diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml index d38cc0e8a17f..51e0a40d46f2 100644 --- a/.github/workflows/post-merge.yml +++ b/.github/workflows/post-merge.yml @@ -29,7 +29,7 @@ jobs: sleep 60 # Get closest bors merge commit - PARENT_COMMIT=`git rev-list --author='bors ' -n1 --first-parent HEAD^1` + PARENT_COMMIT=`git rev-list --author='122020455+rust-bors\[bot\]@users.noreply.github.com' -n1 --first-parent HEAD^1` echo "Parent: ${PARENT_COMMIT}" # Find PR for the current commit diff --git a/Cargo.lock b/Cargo.lock index 2c5053f0c2b7..427e93e56cd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,7 +188,20 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" dependencies = [ - "askama_derive", + "askama_derive 0.14.0", + "itoa", + "percent-encoding", + "serde", + "serde_json", +] + +[[package]] +name = "askama" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7125972258312e79827b60c9eb93938334100245081cf701a2dee981b17427" +dependencies = [ + "askama_macros", "itoa", "percent-encoding", "serde", @@ -201,7 +214,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" dependencies = [ - "askama_parser", + "askama_parser 0.14.0", "basic-toml", "memchr", "proc-macro2", @@ -212,6 +225,32 @@ dependencies = [ "syn 2.0.110", ] +[[package]] +name = "askama_derive" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba5e7259a1580c61571e3116ebaaa01e3c001b2132b17c4cc5c70780ca3e994" +dependencies = [ + "askama_parser 0.15.1", + "basic-toml", + "memchr", + "proc-macro2", + "quote", + "rustc-hash 2.1.1", + "serde", + "serde_derive", + "syn 2.0.110", +] + +[[package]] +name = "askama_macros" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "236ce20b77cb13506eaf5024899f4af6e12e8825f390bd943c4c37fd8f322e46" +dependencies = [ + "askama_derive 0.15.1", +] + [[package]] name = "askama_parser" version = "0.14.0" @@ -224,6 +263,19 @@ dependencies = [ "winnow 0.7.13", ] +[[package]] +name = "askama_parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c63392767bb2df6aa65a6e1e3b80fd89bb7af6d58359b924c0695620f1512e" +dependencies = [ + "rustc-hash 2.1.1", + "serde", + "serde_derive", + "unicode-ident", + "winnow 0.7.13", +] + [[package]] name = "assert_cmd" version = "2.1.1" @@ -393,22 +445,21 @@ dependencies = [ [[package]] name = "capstone" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015ef5d5ca1743e3f94af9509ba6bd2886523cfee46e48d15c2ef5216fd4ac9a" +checksum = "f442ae0f2f3f1b923334b4a5386c95c69c1cfa072bafa23d6fae6d9682eb1dd4" dependencies = [ "capstone-sys", - "libc", + "static_assertions", ] [[package]] name = "capstone-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2267cb8d16a1e4197863ec4284ffd1aec26fe7e57c58af46b02590a0235809a0" +checksum = "a4e8087cab6731295f5a2a2bd82989ba4f41d3a428aab2e7c98d8f4db38aac05" dependencies = [ "cc", - "libc", ] [[package]] @@ -624,7 +675,7 @@ name = "clippy" version = "0.1.94" dependencies = [ "anstream", - "askama", + "askama 0.14.0", "cargo_metadata 0.18.1", "clippy_config", "clippy_lints", @@ -666,6 +717,7 @@ dependencies = [ "indoc", "itertools", "opener", + "rustc-literal-escaper", "walkdir", ] @@ -1514,7 +1566,7 @@ name = "generate-copyright" version = "0.1.0" dependencies = [ "anyhow", - "askama", + "askama 0.15.1", "cargo_metadata 0.21.0", "serde", "serde_json", @@ -2179,9 +2231,9 @@ dependencies = [ [[package]] name = "libffi" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0444124f3ffd67e1b0b0c661a7f81a278a135eb54aaad4078e79fbc8be50c8a5" +checksum = "0498fe5655f857803e156523e644dcdcdc3b3c7edda42ea2afdae2e09b2db87b" dependencies = [ "libc", "libffi-sys", @@ -2189,9 +2241,9 @@ dependencies = [ [[package]] name = "libffi-sys" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d722da8817ea580d0669da6babe2262d7b86a1af1103da24102b8bb9c101ce7" +checksum = "71d4f1d4ce15091955144350b75db16a96d4a63728500122706fb4d29a26afbb" dependencies = [ "cc", ] @@ -3637,8 +3689,6 @@ dependencies = [ "rustc_span", "rustc_symbol_mangling", "rustc_target", - "serde", - "serde_json", "smallvec", "tracing", ] @@ -4145,8 +4195,8 @@ version = "0.0.0" dependencies = [ "expect-test", "memchr", + "unicode-ident", "unicode-properties", - "unicode-xid", ] [[package]] @@ -4573,7 +4623,6 @@ dependencies = [ name = "rustc_resolve" version = "0.0.0" dependencies = [ - "bitflags", "indexmap", "itertools", "pulldown-cmark", @@ -4863,7 +4912,7 @@ name = "rustdoc" version = "0.0.0" dependencies = [ "arrayvec", - "askama", + "askama 0.15.1", "base64", "expect-test", "indexmap", @@ -5357,9 +5406,9 @@ dependencies = [ [[package]] name = "stringdex" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6204af9e1e433f1ef9b6d44475c7089be33c91111d896463b9dfa20464b87f1" +checksum = "07ab85c3f308f022ce6861ab57576b5b6ebc4835f9577e67e0f35f6c351e3f0a" dependencies = [ "stacker", ] @@ -5609,6 +5658,7 @@ dependencies = [ "build_helper", "cargo_metadata 0.21.0", "fluent-syntax", + "globset", "ignore", "miropt-test-tools", "regex", @@ -5982,24 +6032,24 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-normalization" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] name = "unicode-script" @@ -6172,9 +6222,9 @@ dependencies = [ [[package]] name = "wasi-preview1-component-adapter-provider" -version = "38.0.4" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec3ef3783e18f2457796ed91b1e6c2adc46f2905f740d1527ab3053fe8e5682" +checksum = "bb5e2b9858989c3a257de4ca169977f4f79897b64e4f482f188f4fcf8ac557d1" [[package]] name = "wasm-bindgen" @@ -6223,17 +6273,18 @@ dependencies = [ [[package]] name = "wasm-component-ld" -version = "0.5.19" +version = "0.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bfc50dd0b883d841bc1dba5ff7020ca52fa7b2c3bb1266d8bf6a09dd032e115" +checksum = "846d20ed66ae37b7a237e36dfcd2fdc979eae82a46cdb0586f9bba80782fd789" dependencies = [ "anyhow", "clap", + "clap_lex", "lexopt", "libc", "tempfile", "wasi-preview1-component-adapter-provider", - "wasmparser 0.241.2", + "wasmparser 0.243.0", "wat", "windows-sys 0.61.2", "winsplit", @@ -6260,24 +6311,24 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.241.2" +version = "0.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01164c9dda68301e34fdae536c23ed6fe90ce6d97213ccc171eebbd3d02d6b8" +checksum = "c55db9c896d70bd9fa535ce83cd4e1f2ec3726b0edd2142079f594fc3be1cb35" dependencies = [ "leb128fmt", - "wasmparser 0.241.2", + "wasmparser 0.243.0", ] [[package]] name = "wasm-metadata" -version = "0.241.2" +version = "0.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876fe286f2fa416386deedebe8407e6f19e0b5aeaef3d03161e77a15fa80f167" +checksum = "eae05bf9579f45a62e8d0a4e3f52eaa8da518883ac5afa482ec8256c329ecd56" dependencies = [ "anyhow", "indexmap", - "wasm-encoder 0.241.2", - "wasmparser 0.241.2", + "wasm-encoder 0.243.0", + "wasmparser 0.243.0", ] [[package]] @@ -6302,9 +6353,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.241.2" +version = "0.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d90019b1afd4b808c263e428de644f3003691f243387d30d673211ee0cb8e8" +checksum = "f6d8db401b0528ec316dfbe579e6ab4152d61739cfe076706d2009127970159d" dependencies = [ "bitflags", "hashbrown 0.15.5", @@ -6315,22 +6366,22 @@ dependencies = [ [[package]] name = "wast" -version = "241.0.2" +version = "243.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f66e07e2ddf531fef6344dbf94d112df7c2f23ed6ffb10962e711500b8d816" +checksum = "df21d01c2d91e46cb7a221d79e58a2d210ea02020d57c092e79255cc2999ca7f" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width 0.2.2", - "wasm-encoder 0.241.2", + "wasm-encoder 0.243.0", ] [[package]] name = "wat" -version = "1.241.2" +version = "1.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f923705c40830af909c5dec2352ec2821202e4a66008194585e1917458a26d" +checksum = "226a9a91cd80a50449312fef0c75c23478fcecfcc4092bdebe1dc8e760ef521b" dependencies = [ "wast", ] @@ -6726,9 +6777,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.241.2" +version = "0.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0c57df25e7ee612d946d3b7646c1ddb2310f8280aa2c17e543b66e0812241" +checksum = "36f9fc53513e461ce51dcf17a3e331752cb829f1d187069e54af5608fc998fe4" dependencies = [ "anyhow", "bitflags", @@ -6737,17 +6788,17 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.241.2", + "wasm-encoder 0.243.0", "wasm-metadata", - "wasmparser 0.241.2", + "wasmparser 0.243.0", "wit-parser", ] [[package]] name = "wit-parser" -version = "0.241.2" +version = "0.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ef1c6ad67f35c831abd4039c02894de97034100899614d1c44e2268ad01c91" +checksum = "df983a8608e513d8997f435bb74207bf0933d0e49ca97aa9d8a6157164b9b7fc" dependencies = [ "anyhow", "id-arena", @@ -6758,7 +6809,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.241.2", + "wasmparser 0.243.0", ] [[package]] diff --git a/bootstrap.example.toml b/bootstrap.example.toml index 63bf50722ca0..e0cbb0c0e747 100644 --- a/bootstrap.example.toml +++ b/bootstrap.example.toml @@ -106,6 +106,9 @@ # Whether to build LLVM with support for it's gpu offload runtime. #llvm.offload = false +# Absolute path to the directory containing ClangConfig.cmake +#llvm.offload-clang-dir = "" + # When true, link libstdc++ statically into the rustc_llvm. # This is useful if you don't want to use the dynamic version of that # library provided by LLVM. diff --git a/compiler/rustc_abi/src/extern_abi.rs b/compiler/rustc_abi/src/extern_abi.rs index 6a5ea36f2a42..e44dea1ce593 100644 --- a/compiler/rustc_abi/src/extern_abi.rs +++ b/compiler/rustc_abi/src/extern_abi.rs @@ -67,7 +67,6 @@ pub enum ExternAbi { /* gpu */ /// An entry-point function called by the GPU's host - // FIXME: should not be callable from Rust on GPU targets, is for host's use only GpuKernel, /// An entry-point function called by the GPU's host // FIXME: why do we have two of these? diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 7c922417ee29..d4407dbf7be7 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -34,6 +34,7 @@ use rustc_span::source_map::{Spanned, respan}; use rustc_span::{ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, Span, Symbol, kw, sym}; use thin_vec::{ThinVec, thin_vec}; +use crate::attr::data_structures::CfgEntry; pub use crate::format::*; use crate::token::{self, CommentKind, Delimiter}; use crate::tokenstream::{DelimSpan, LazyAttrTokenStream, TokenStream}; @@ -3390,7 +3391,7 @@ impl NormalAttr { item: AttrItem { unsafety: Safety::Default, path: Path::from_ident(ident), - args: AttrArgs::Empty, + args: AttrItemKind::Unparsed(AttrArgs::Empty), tokens: None, }, tokens: None, @@ -3402,11 +3403,53 @@ impl NormalAttr { pub struct AttrItem { pub unsafety: Safety, pub path: Path, - pub args: AttrArgs, + pub args: AttrItemKind, // Tokens for the meta item, e.g. just the `foo` within `#[foo]` or `#![foo]`. pub tokens: Option, } +/// Some attributes are stored in a parsed form, for performance reasons. +/// Their arguments don't have to be reparsed everytime they're used +#[derive(Clone, Encodable, Decodable, Debug, Walkable)] +pub enum AttrItemKind { + Parsed(EarlyParsedAttribute), + Unparsed(AttrArgs), +} + +impl AttrItemKind { + pub fn unparsed(self) -> Option { + match self { + AttrItemKind::Unparsed(args) => Some(args), + AttrItemKind::Parsed(_) => None, + } + } + + pub fn unparsed_ref(&self) -> Option<&AttrArgs> { + match self { + AttrItemKind::Unparsed(args) => Some(args), + AttrItemKind::Parsed(_) => None, + } + } + + pub fn span(&self) -> Option { + match self { + AttrItemKind::Unparsed(args) => args.span(), + AttrItemKind::Parsed(_) => None, + } + } +} + +/// Some attributes are stored in parsed form in the AST. +/// This is done for performance reasons, so the attributes don't need to be reparsed on every use. +/// +/// Currently all early parsed attributes are excluded from pretty printing at rustc_ast_pretty::pprust::state::print_attribute_inline. +/// When adding new early parsed attributes, consider whether they should be pretty printed. +#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +pub enum EarlyParsedAttribute { + CfgTrace(CfgEntry), + CfgAttrTrace, +} + impl AttrItem { pub fn is_valid_for_outer_style(&self) -> bool { self.path == sym::cfg_attr diff --git a/compiler/rustc_ast/src/attr/data_structures.rs b/compiler/rustc_ast/src/attr/data_structures.rs new file mode 100644 index 000000000000..2eab91801cd6 --- /dev/null +++ b/compiler/rustc_ast/src/attr/data_structures.rs @@ -0,0 +1,101 @@ +use std::fmt; + +use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_span::{Span, Symbol}; +use thin_vec::ThinVec; + +use crate::attr::version::RustcVersion; + +#[derive(Encodable, Decodable, Clone, Debug, PartialEq, Eq, Hash, HashStable_Generic)] +pub enum CfgEntry { + All(ThinVec, Span), + Any(ThinVec, Span), + Not(Box, Span), + Bool(bool, Span), + NameValue { name: Symbol, value: Option, span: Span }, + Version(Option, Span), +} + +impl CfgEntry { + pub fn lower_spans(&mut self, lower_span: impl Copy + Fn(Span) -> Span) { + match self { + CfgEntry::All(subs, span) | CfgEntry::Any(subs, span) => { + *span = lower_span(*span); + subs.iter_mut().for_each(|sub| sub.lower_spans(lower_span)); + } + CfgEntry::Not(sub, span) => { + *span = lower_span(*span); + sub.lower_spans(lower_span); + } + CfgEntry::Bool(_, span) + | CfgEntry::NameValue { span, .. } + | CfgEntry::Version(_, span) => { + *span = lower_span(*span); + } + } + } + + pub fn span(&self) -> Span { + let (Self::All(_, span) + | Self::Any(_, span) + | Self::Not(_, span) + | Self::Bool(_, span) + | Self::NameValue { span, .. } + | Self::Version(_, span)) = self; + *span + } + + /// Same as `PartialEq` but doesn't check spans and ignore order of cfgs. + pub fn is_equivalent_to(&self, other: &Self) -> bool { + match (self, other) { + (Self::All(a, _), Self::All(b, _)) | (Self::Any(a, _), Self::Any(b, _)) => { + a.len() == b.len() && a.iter().all(|a| b.iter().any(|b| a.is_equivalent_to(b))) + } + (Self::Not(a, _), Self::Not(b, _)) => a.is_equivalent_to(b), + (Self::Bool(a, _), Self::Bool(b, _)) => a == b, + ( + Self::NameValue { name: name1, value: value1, .. }, + Self::NameValue { name: name2, value: value2, .. }, + ) => name1 == name2 && value1 == value2, + (Self::Version(a, _), Self::Version(b, _)) => a == b, + _ => false, + } + } +} + +impl fmt::Display for CfgEntry { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn write_entries( + name: &str, + entries: &[CfgEntry], + f: &mut fmt::Formatter<'_>, + ) -> fmt::Result { + write!(f, "{name}(")?; + for (nb, entry) in entries.iter().enumerate() { + if nb != 0 { + f.write_str(", ")?; + } + entry.fmt(f)?; + } + f.write_str(")") + } + match self { + Self::All(entries, _) => write_entries("all", entries, f), + Self::Any(entries, _) => write_entries("any", entries, f), + Self::Not(entry, _) => write!(f, "not({entry})"), + Self::Bool(value, _) => write!(f, "{value}"), + Self::NameValue { name, value, .. } => { + match value { + // We use `as_str` and debug display to have characters escaped and `"` + // characters surrounding the string. + Some(value) => write!(f, "{name} = {:?}", value.as_str()), + None => write!(f, "{name}"), + } + } + Self::Version(version, _) => match version { + Some(version) => write!(f, "{version}"), + None => Ok(()), + }, + } + } +} diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index c53188a22aed..6ecba865c815 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -1,5 +1,8 @@ //! Functions dealing with attributes and meta items. +pub mod data_structures; +pub mod version; + use std::fmt::Debug; use std::sync::atomic::{AtomicU32, Ordering}; @@ -8,6 +11,7 @@ use rustc_span::{Ident, Span, Symbol, sym}; use smallvec::{SmallVec, smallvec}; use thin_vec::{ThinVec, thin_vec}; +use crate::AttrItemKind; use crate::ast::{ AttrArgs, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute, DUMMY_NODE_ID, DelimArgs, Expr, ExprKind, LitKind, MetaItem, MetaItemInner, MetaItemKind, MetaItemLit, NormalAttr, Path, @@ -62,6 +66,15 @@ impl Attribute { } } + /// Replaces the arguments of this attribute with new arguments `AttrItemKind`. + /// This is useful for making this attribute into a trace attribute, and should otherwise be avoided. + pub fn replace_args(&mut self, new_args: AttrItemKind) { + match &mut self.kind { + AttrKind::Normal(normal) => normal.item.args = new_args, + AttrKind::DocComment(..) => panic!("unexpected doc comment"), + } + } + pub fn unwrap_normal_item(self) -> AttrItem { match self.kind { AttrKind::Normal(normal) => normal.item, @@ -77,7 +90,7 @@ impl AttributeExt for Attribute { fn value_span(&self) -> Option { match &self.kind { - AttrKind::Normal(normal) => match &normal.item.args { + AttrKind::Normal(normal) => match &normal.item.args.unparsed_ref()? { AttrArgs::Eq { expr, .. } => Some(expr.span), _ => None, }, @@ -96,11 +109,11 @@ impl AttributeExt for Attribute { } /// For a single-segment attribute, returns its name; otherwise, returns `None`. - fn ident(&self) -> Option { + fn name(&self) -> Option { match &self.kind { AttrKind::Normal(normal) => { if let [ident] = &*normal.item.path.segments { - Some(ident.ident) + Some(ident.ident.name) } else { None } @@ -109,9 +122,18 @@ impl AttributeExt for Attribute { } } - fn ident_path(&self) -> Option> { + fn symbol_path(&self) -> Option> { match &self.kind { - AttrKind::Normal(p) => Some(p.item.path.segments.iter().map(|i| i.ident).collect()), + AttrKind::Normal(p) => { + Some(p.item.path.segments.iter().map(|i| i.ident.name).collect()) + } + AttrKind::DocComment(_, _) => None, + } + } + + fn path_span(&self) -> Option { + match &self.kind { + AttrKind::Normal(attr) => Some(attr.item.path.span), AttrKind::DocComment(_, _) => None, } } @@ -138,7 +160,7 @@ impl AttributeExt for Attribute { fn is_word(&self) -> bool { if let AttrKind::Normal(normal) = &self.kind { - matches!(normal.item.args, AttrArgs::Empty) + matches!(normal.item.args, AttrItemKind::Unparsed(AttrArgs::Empty)) } else { false } @@ -294,7 +316,7 @@ impl AttrItem { } pub fn meta_item_list(&self) -> Option> { - match &self.args { + match &self.args.unparsed_ref()? { AttrArgs::Delimited(args) if args.delim == Delimiter::Parenthesis => { MetaItemKind::list_from_tokens(args.tokens.clone()) } @@ -315,7 +337,7 @@ impl AttrItem { /// #[attr("value")] /// ``` fn value_str(&self) -> Option { - match &self.args { + match &self.args.unparsed_ref()? { AttrArgs::Eq { expr, .. } => match expr.kind { ExprKind::Lit(token_lit) => { LitKind::from_token_lit(token_lit).ok().and_then(|lit| lit.str()) @@ -339,7 +361,7 @@ impl AttrItem { /// #[attr("value")] /// ``` fn value_span(&self) -> Option { - match &self.args { + match &self.args.unparsed_ref()? { AttrArgs::Eq { expr, .. } => Some(expr.span), AttrArgs::Delimited(_) | AttrArgs::Empty => None, } @@ -355,7 +377,7 @@ impl AttrItem { } pub fn meta_kind(&self) -> Option { - MetaItemKind::from_attr_args(&self.args) + MetaItemKind::from_attr_args(self.args.unparsed_ref()?) } } @@ -690,7 +712,13 @@ fn mk_attr( args: AttrArgs, span: Span, ) -> Attribute { - mk_attr_from_item(g, AttrItem { unsafety, path, args, tokens: None }, None, style, span) + mk_attr_from_item( + g, + AttrItem { unsafety, path, args: AttrItemKind::Unparsed(args), tokens: None }, + None, + style, + span, + ) } pub fn mk_attr_from_item( @@ -794,9 +822,7 @@ pub trait AttributeExt: Debug { /// For a single-segment attribute (i.e., `#[attr]` and not `#[path::atrr]`), /// return the name of the attribute; otherwise, returns `None`. - fn name(&self) -> Option { - self.ident().map(|ident| ident.name) - } + fn name(&self) -> Option; /// Get the meta item list, `#[attr(meta item list)]` fn meta_item_list(&self) -> Option>; @@ -807,9 +833,6 @@ pub trait AttributeExt: Debug { /// Gets the span of the value literal, as string, when using `#[attr = value]` fn value_span(&self) -> Option; - /// For a single-segment attribute, returns its ident; otherwise, returns `None`. - fn ident(&self) -> Option; - /// Checks whether the path of this attribute matches the name. /// /// Matches one segment of the path to each element in `name` @@ -822,7 +845,7 @@ pub trait AttributeExt: Debug { #[inline] fn has_name(&self, name: Symbol) -> bool { - self.ident().map(|x| x.name == name).unwrap_or(false) + self.name().map(|x| x == name).unwrap_or(false) } #[inline] @@ -836,13 +859,13 @@ pub trait AttributeExt: Debug { fn is_word(&self) -> bool; fn path(&self) -> SmallVec<[Symbol; 1]> { - self.ident_path() - .map(|i| i.into_iter().map(|i| i.name).collect()) - .unwrap_or(smallvec![sym::doc]) + self.symbol_path().unwrap_or(smallvec![sym::doc]) } + fn path_span(&self) -> Option; + /// Returns None for doc comments - fn ident_path(&self) -> Option>; + fn symbol_path(&self) -> Option>; /// Returns the documentation if this is a doc comment or a sugared doc comment. /// * `///doc` returns `Some("doc")`. @@ -903,10 +926,6 @@ impl Attribute { AttributeExt::value_span(self) } - pub fn ident(&self) -> Option { - AttributeExt::ident(self) - } - pub fn path_matches(&self, name: &[Symbol]) -> bool { AttributeExt::path_matches(self, name) } @@ -938,10 +957,6 @@ impl Attribute { AttributeExt::path(self) } - pub fn ident_path(&self) -> Option> { - AttributeExt::ident_path(self) - } - pub fn doc_str(&self) -> Option { AttributeExt::doc_str(self) } diff --git a/compiler/rustc_hir/src/version.rs b/compiler/rustc_ast/src/attr/version.rs similarity index 75% rename from compiler/rustc_hir/src/version.rs rename to compiler/rustc_ast/src/attr/version.rs index 03182088d4c0..59deee40ae28 100644 --- a/compiler/rustc_hir/src/version.rs +++ b/compiler/rustc_ast/src/attr/version.rs @@ -1,16 +1,10 @@ -use std::borrow::Cow; use std::fmt::{self, Display}; use std::sync::OnceLock; -use rustc_error_messages::{DiagArgValue, IntoDiagArg}; -use rustc_macros::{ - BlobDecodable, Encodable, HashStable_Generic, PrintAttribute, current_rustc_version, -}; - -use crate::attrs::PrintAttribute; +use rustc_macros::{BlobDecodable, Encodable, HashStable_Generic, current_rustc_version}; #[derive(Encodable, BlobDecodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable_Generic)] pub struct RustcVersion { pub major: u16, pub minor: u16, @@ -47,9 +41,3 @@ impl Display for RustcVersion { write!(formatter, "{}.{}.{}", self.major, self.minor, self.patch) } } - -impl IntoDiagArg for RustcVersion { - fn into_diag_arg(self, _: &mut Option) -> DiagArgValue { - DiagArgValue::Str(Cow::Owned(self.to_string())) - } -} diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index d122adfdf966..83b751fbde90 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -366,6 +366,7 @@ macro_rules! common_visitor_and_walkers { crate::token::LitKind, crate::tokenstream::LazyAttrTokenStream, crate::tokenstream::TokenStream, + EarlyParsedAttribute, Movability, Mutability, Pinnedness, @@ -457,6 +458,7 @@ macro_rules! common_visitor_and_walkers { ModSpans, MutTy, NormalAttr, + AttrItemKind, Parens, ParenthesizedArgs, PatFieldsRest, diff --git a/compiler/rustc_ast_lowering/messages.ftl b/compiler/rustc_ast_lowering/messages.ftl index e1fccead4d21..0cd5c4f303de 100644 --- a/compiler/rustc_ast_lowering/messages.ftl +++ b/compiler/rustc_ast_lowering/messages.ftl @@ -6,6 +6,7 @@ ast_lowering_abi_specified_multiple_times = ast_lowering_arbitrary_expression_in_pattern = arbitrary expressions aren't allowed in patterns .pattern_from_macro_note = the `expr` fragment specifier forces the metavariable's content to be an expression + .const_block_in_pattern_help = use a named `const`-item or an `if`-guard (`x if x == const {"{ ... }"}`) instead ast_lowering_argument = argument diff --git a/compiler/rustc_ast_lowering/src/asm.rs b/compiler/rustc_ast_lowering/src/asm.rs index d44faad017ee..04e5f0523101 100644 --- a/compiler/rustc_ast_lowering/src/asm.rs +++ b/compiler/rustc_ast_lowering/src/asm.rs @@ -52,7 +52,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { | asm::InlineAsmArch::LoongArch64 | asm::InlineAsmArch::S390x ); - if !is_stable && !self.tcx.features().asm_experimental_arch() { + if !is_stable + && !self.tcx.features().asm_experimental_arch() + && sp + .ctxt() + .outer_expn_data() + .allow_internal_unstable + .filter(|features| features.contains(&sym::asm_experimental_arch)) + .is_none() + { feature_err( &self.tcx.sess, sym::asm_experimental_arch, diff --git a/compiler/rustc_ast_lowering/src/block.rs b/compiler/rustc_ast_lowering/src/block.rs index 5bfe63008516..cf3f331a701b 100644 --- a/compiler/rustc_ast_lowering/src/block.rs +++ b/compiler/rustc_ast_lowering/src/block.rs @@ -98,7 +98,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // Let statements are allowed to have impl trait in bindings. let super_ = l.super_.map(|span| self.lower_span(span)); let ty = l.ty.as_ref().map(|t| { - self.lower_ty(t, self.impl_trait_in_bindings_ctxt(ImplTraitPosition::Variable)) + self.lower_ty_alloc(t, self.impl_trait_in_bindings_ctxt(ImplTraitPosition::Variable)) }); let init = l.kind.init().map(|init| self.lower_expr(init)); let hir_id = self.lower_node_id(l.id); diff --git a/compiler/rustc_ast_lowering/src/delegation.rs b/compiler/rustc_ast_lowering/src/delegation.rs index 532a0ce520cd..5d2531e50393 100644 --- a/compiler/rustc_ast_lowering/src/delegation.rs +++ b/compiler/rustc_ast_lowering/src/delegation.rs @@ -48,11 +48,12 @@ use rustc_data_structures::fx::FxHashSet; use rustc_errors::ErrorGuaranteed; use rustc_hir::Target; use rustc_hir::attrs::{AttributeKind, InlineAttr}; -use rustc_hir::def_id::DefId; +use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::span_bug; -use rustc_middle::ty::{Asyncness, DelegationFnSigAttrs, ResolverAstLowering}; +use rustc_middle::ty::{Asyncness, DelegationAttrs, DelegationFnSigAttrs, ResolverAstLowering}; use rustc_span::symbol::kw; use rustc_span::{DUMMY_SP, Ident, Span, Symbol}; +use smallvec::SmallVec; use {rustc_ast as ast, rustc_hir as hir}; use super::{GenericArgsMode, ImplTraitContext, LoweringContext, ParamMode}; @@ -66,24 +67,24 @@ pub(crate) struct DelegationResults<'hir> { pub generics: &'hir hir::Generics<'hir>, } -struct AttributeAdditionInfo { +struct AttrAdditionInfo { pub equals: fn(&hir::Attribute) -> bool, - pub kind: AttributeAdditionKind, + pub kind: AttrAdditionKind, } -enum AttributeAdditionKind { +enum AttrAdditionKind { Default { factory: fn(Span) -> hir::Attribute }, Inherit { flag: DelegationFnSigAttrs, factory: fn(Span, &hir::Attribute) -> hir::Attribute }, } const PARENT_ID: hir::ItemLocalId = hir::ItemLocalId::ZERO; -static ATTRIBUTES_ADDITIONS: &[AttributeAdditionInfo] = &[ - AttributeAdditionInfo { +static ATTRS_ADDITIONS: &[AttrAdditionInfo] = &[ + AttrAdditionInfo { equals: |a| matches!(a, hir::Attribute::Parsed(AttributeKind::MustUse { .. })), - kind: AttributeAdditionKind::Inherit { - factory: |span, original_attribute| { - let reason = match original_attribute { + kind: AttrAdditionKind::Inherit { + factory: |span, original_attr| { + let reason = match original_attr { hir::Attribute::Parsed(AttributeKind::MustUse { reason, .. }) => *reason, _ => None, }; @@ -93,14 +94,41 @@ static ATTRIBUTES_ADDITIONS: &[AttributeAdditionInfo] = &[ flag: DelegationFnSigAttrs::MUST_USE, }, }, - AttributeAdditionInfo { + AttrAdditionInfo { equals: |a| matches!(a, hir::Attribute::Parsed(AttributeKind::Inline(..))), - kind: AttributeAdditionKind::Default { + kind: AttrAdditionKind::Default { factory: |span| hir::Attribute::Parsed(AttributeKind::Inline(InlineAttr::Hint, span)), }, }, ]; +type DelegationIdsVec = SmallVec<[DefId; 1]>; + +// As delegations can now refer to another delegation, we have a delegation path +// of the following type: reuse (current delegation) <- reuse (delegee_id) <- ... <- reuse <- function (root_function_id). +// In its most basic and widely used form: reuse (current delegation) <- function (delegee_id, root_function_id) +struct DelegationIds { + path: DelegationIdsVec, +} + +impl DelegationIds { + fn new(path: DelegationIdsVec) -> Self { + assert!(!path.is_empty()); + Self { path } + } + + // Id of the first function in (non)local crate that is being reused + fn root_function_id(&self) -> DefId { + *self.path.last().expect("Ids vector can't be empty") + } + + // Id of the first definition which is being reused, + // can be either function, in this case `root_id == delegee_id`, or other delegation + fn delegee_id(&self) -> DefId { + *self.path.first().expect("Ids vector can't be empty") + } +} + impl<'hir> LoweringContext<'_, 'hir> { fn is_method(&self, def_id: DefId, span: Span) -> bool { match self.tcx.def_kind(def_id) { @@ -124,19 +152,36 @@ impl<'hir> LoweringContext<'_, 'hir> { ) -> DelegationResults<'hir> { let span = self.lower_span(delegation.path.segments.last().unwrap().ident.span); - let sig_id = self.get_delegation_sig_id( - self.resolver.delegation_sig_resolution_nodes[&self.local_def_id(item_id)], + let ids = self.get_delegation_ids( + self.resolver.delegation_infos[&self.local_def_id(item_id)].resolution_node, span, ); - match sig_id { - Ok(sig_id) => { - self.add_attributes_if_needed(span, sig_id); + match ids { + Ok(ids) => { + self.add_attrs_if_needed(span, &ids); + + let delegee_id = ids.delegee_id(); + let root_function_id = ids.root_function_id(); + + // `is_method` is used to choose the name of the first parameter (`self` or `arg0`), + // if the original function is not a method (without `self`), then it can not be added + // during chain of reuses, so we use `root_function_id` here + let is_method = self.is_method(root_function_id, span); + + // Here we use `root_function_id` as we can not get params information out of potential delegation reuse, + // we need a function to extract this information + let (param_count, c_variadic) = self.param_count(root_function_id); + + // Here we use `delegee_id`, as this id will then be used to calculate parent for generics + // inheritance, and we want this id to point on a delegee, not on the original + // function (see https://github.com/rust-lang/rust/issues/150152#issuecomment-3674834654) + let decl = self.lower_delegation_decl(delegee_id, param_count, c_variadic, span); + + // Here we pass `root_function_id` as we want to inherit signature (including consts, async) + // from the root function that started delegation + let sig = self.lower_delegation_sig(root_function_id, decl, span); - let is_method = self.is_method(sig_id, span); - let (param_count, c_variadic) = self.param_count(sig_id); - let decl = self.lower_delegation_decl(sig_id, param_count, c_variadic, span); - let sig = self.lower_delegation_sig(sig_id, decl, span); let body_id = self.lower_delegation_body(delegation, is_method, param_count, span); let ident = self.lower_ident(delegation.ident); let generics = self.lower_delegation_generics(span); @@ -146,36 +191,36 @@ impl<'hir> LoweringContext<'_, 'hir> { } } - fn add_attributes_if_needed(&mut self, span: Span, sig_id: DefId) { - let new_attributes = self.create_new_attributes( - ATTRIBUTES_ADDITIONS, - span, - sig_id, - self.attrs.get(&PARENT_ID), - ); + fn add_attrs_if_needed(&mut self, span: Span, ids: &DelegationIds) { + let new_attrs = + self.create_new_attrs(ATTRS_ADDITIONS, span, ids, self.attrs.get(&PARENT_ID)); - if new_attributes.is_empty() { + if new_attrs.is_empty() { return; } - let new_arena_allocated_attributes = match self.attrs.get(&PARENT_ID) { + let new_arena_allocated_attrs = match self.attrs.get(&PARENT_ID) { Some(existing_attrs) => self.arena.alloc_from_iter( - existing_attrs.iter().map(|a| a.clone()).chain(new_attributes.into_iter()), + existing_attrs.iter().map(|a| a.clone()).chain(new_attrs.into_iter()), ), - None => self.arena.alloc_from_iter(new_attributes.into_iter()), + None => self.arena.alloc_from_iter(new_attrs.into_iter()), }; - self.attrs.insert(PARENT_ID, new_arena_allocated_attributes); + self.attrs.insert(PARENT_ID, new_arena_allocated_attrs); } - fn create_new_attributes( + fn create_new_attrs( &self, - candidate_additions: &[AttributeAdditionInfo], + candidate_additions: &[AttrAdditionInfo], span: Span, - sig_id: DefId, + ids: &DelegationIds, existing_attrs: Option<&&[hir::Attribute]>, ) -> Vec { - let local_original_attributes = self.parse_local_original_attributes(sig_id); + let defs_orig_attrs = ids + .path + .iter() + .map(|def_id| (*def_id, self.parse_local_original_attrs(*def_id))) + .collect::>(); candidate_additions .iter() @@ -189,65 +234,81 @@ impl<'hir> LoweringContext<'_, 'hir> { } match addition_info.kind { - AttributeAdditionKind::Default { factory } => Some(factory(span)), - AttributeAdditionKind::Inherit { flag, factory } => { - let original_attribute = match sig_id.as_local() { - Some(local_id) => self - .resolver - .delegation_fn_sigs - .get(&local_id) - .is_some_and(|sig| sig.attrs_flags.contains(flag)) - .then(|| { - local_original_attributes - .as_ref() - .map(|attrs| { - attrs - .iter() - .find(|base_attr| (addition_info.equals)(base_attr)) - }) - .flatten() - }) - .flatten(), - None => self - .tcx - .get_all_attrs(sig_id) - .iter() - .find(|base_attr| (addition_info.equals)(base_attr)), - }; + AttrAdditionKind::Default { factory } => Some(factory(span)), + AttrAdditionKind::Inherit { flag, factory } => { + for (def_id, orig_attrs) in &defs_orig_attrs { + let original_attr = match def_id.as_local() { + Some(local_id) => self + .get_attrs(local_id) + .flags + .contains(flag) + .then(|| { + orig_attrs + .as_ref() + .map(|attrs| { + attrs.iter().find(|base_attr| { + (addition_info.equals)(base_attr) + }) + }) + .flatten() + }) + .flatten(), + None => self + .tcx + .get_all_attrs(*def_id) + .iter() + .find(|base_attr| (addition_info.equals)(base_attr)), + }; - original_attribute.map(|a| factory(span, a)) + if let Some(original_attr) = original_attr { + return Some(factory(span, original_attr)); + } + } + + None } } }) .collect::>() } - fn parse_local_original_attributes(&self, sig_id: DefId) -> Option> { - if let Some(local_id) = sig_id.as_local() - && let Some(info) = self.resolver.delegation_fn_sigs.get(&local_id) - && !info.to_inherit_attrs.is_empty() - { - Some(AttributeParser::parse_limited_all( - self.tcx.sess, - info.to_inherit_attrs.as_slice(), - None, - Target::Fn, - DUMMY_SP, - DUMMY_NODE_ID, - Some(self.tcx.features()), - ShouldEmit::Nothing, - )) + fn parse_local_original_attrs(&self, def_id: DefId) -> Option> { + if let Some(local_id) = def_id.as_local() { + let attrs = &self.get_attrs(local_id).to_inherit; + + if !attrs.is_empty() { + return Some(AttributeParser::parse_limited_all( + self.tcx.sess, + attrs, + None, + Target::Fn, + DUMMY_SP, + DUMMY_NODE_ID, + Some(self.tcx.features()), + ShouldEmit::Nothing, + )); + } + } + + None + } + + fn get_attrs(&self, local_id: LocalDefId) -> &DelegationAttrs { + // local_id can correspond either to a function or other delegation + if let Some(fn_sig) = self.resolver.delegation_fn_sigs.get(&local_id) { + &fn_sig.attrs } else { - None + &self.resolver.delegation_infos[&local_id].attrs } } - fn get_delegation_sig_id( + fn get_delegation_ids( &self, mut node_id: NodeId, span: Span, - ) -> Result { + ) -> Result { let mut visited: FxHashSet = Default::default(); + let mut path: DelegationIdsVec = Default::default(); loop { visited.insert(node_id); @@ -262,14 +323,15 @@ impl<'hir> LoweringContext<'_, 'hir> { )); }; + path.push(def_id); + // If def_id is in local crate and it corresponds to another delegation // it means that we refer to another delegation as a callee, so in order to obtain // a signature DefId we obtain NodeId of the callee delegation and try to get signature from it. if let Some(local_id) = def_id.as_local() - && let Some(next_node_id) = - self.resolver.delegation_sig_resolution_nodes.get(&local_id) + && let Some(delegation_info) = self.resolver.delegation_infos.get(&local_id) { - node_id = *next_node_id; + node_id = delegation_info.resolution_node; if visited.contains(&node_id) { // We encountered a cycle in the resolution, or delegation callee refers to non-existent // entity, in this case emit an error. @@ -279,7 +341,7 @@ impl<'hir> LoweringContext<'_, 'hir> { }); } } else { - return Ok(def_id); + return Ok(DelegationIds::new(path)); } } } @@ -299,14 +361,14 @@ impl<'hir> LoweringContext<'_, 'hir> { } // Function parameter count, including C variadic `...` if present. - fn param_count(&self, sig_id: DefId) -> (usize, bool /*c_variadic*/) { - if let Some(local_sig_id) = sig_id.as_local() { + fn param_count(&self, def_id: DefId) -> (usize, bool /*c_variadic*/) { + if let Some(local_sig_id) = def_id.as_local() { match self.resolver.delegation_fn_sigs.get(&local_sig_id) { Some(sig) => (sig.param_count, sig.c_variadic), None => (0, false), } } else { - let sig = self.tcx.fn_sig(sig_id).skip_binder().skip_binder(); + let sig = self.tcx.fn_sig(def_id).skip_binder().skip_binder(); (sig.inputs().len() + usize::from(sig.c_variadic), sig.c_variadic) } } @@ -356,7 +418,7 @@ impl<'hir> LoweringContext<'_, 'hir> { // We are not forwarding the attributes, as the delegation fn sigs are collected on the ast, // and here we need the hir attributes. let default_safety = - if sig.attrs_flags.contains(DelegationFnSigAttrs::TARGET_FEATURE) + if sig.attrs.flags.contains(DelegationFnSigAttrs::TARGET_FEATURE) || self.tcx.def_kind(parent) == DefKind::ForeignMod { hir::Safety::Unsafe diff --git a/compiler/rustc_ast_lowering/src/errors.rs b/compiler/rustc_ast_lowering/src/errors.rs index 35c37fe91d49..88e69e67d8a5 100644 --- a/compiler/rustc_ast_lowering/src/errors.rs +++ b/compiler/rustc_ast_lowering/src/errors.rs @@ -357,6 +357,8 @@ pub(crate) struct ArbitraryExpressionInPattern { pub span: Span, #[note(ast_lowering_pattern_from_macro_note)] pub pattern_from_macro_note: bool, + #[help(ast_lowering_const_block_in_pattern_help)] + pub const_block_in_pattern_help: bool, } #[derive(Diagnostic)] diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 0502fd2873e9..9fbfeb7a11e6 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -158,14 +158,14 @@ impl<'hir> LoweringContext<'_, 'hir> { } ExprKind::Cast(expr, ty) => { let expr = self.lower_expr(expr); - let ty = - self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast)); + let ty = self + .lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast)); hir::ExprKind::Cast(expr, ty) } ExprKind::Type(expr, ty) => { let expr = self.lower_expr(expr); - let ty = - self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast)); + let ty = self + .lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast)); hir::ExprKind::Type(expr, ty) } ExprKind::AddrOf(k, m, ohs) => { @@ -335,7 +335,7 @@ impl<'hir> LoweringContext<'_, 'hir> { } ExprKind::FormatArgs(fmt) => self.lower_format_args(e.span, fmt), ExprKind::OffsetOf(container, fields) => hir::ExprKind::OffsetOf( - self.lower_ty( + self.lower_ty_alloc( container, ImplTraitContext::Disallowed(ImplTraitPosition::OffsetOf), ), @@ -371,7 +371,10 @@ impl<'hir> LoweringContext<'_, 'hir> { *kind, self.lower_expr(expr), ty.as_ref().map(|ty| { - self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Cast)) + self.lower_ty_alloc( + ty, + ImplTraitContext::Disallowed(ImplTraitPosition::Cast), + ) }), ), @@ -617,7 +620,7 @@ impl<'hir> LoweringContext<'_, 'hir> { }); if let Some(ty) = opt_ty { - let ty = self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Path)); + let ty = self.lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Path)); let block_expr = self.arena.alloc(self.expr_block(whole_block)); hir::ExprKind::Type(block_expr, ty) } else { diff --git a/compiler/rustc_ast_lowering/src/index.rs b/compiler/rustc_ast_lowering/src/index.rs index f6edcaa64dfe..be0a1d490da6 100644 --- a/compiler/rustc_ast_lowering/src/index.rs +++ b/compiler/rustc_ast_lowering/src/index.rs @@ -312,7 +312,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> { fn visit_const_arg(&mut self, const_arg: &'hir ConstArg<'hir, AmbigArg>) { self.insert( - const_arg.as_unambig_ct().span(), + const_arg.as_unambig_ct().span, const_arg.hir_id, Node::ConstArg(const_arg.as_unambig_ct()), ); diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index bfce7c25b75d..f8b98a5ece40 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -264,8 +264,8 @@ impl<'hir> LoweringContext<'_, 'hir> { define_opaque, }) => { let ident = self.lower_ident(*ident); - let ty = - self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy)); + let ty = self + .lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy)); let body_id = self.lower_const_body(span, e.as_deref()); self.lower_define_opaque(hir_id, define_opaque); hir::ItemKind::Static(*m, ident, ty, body_id) @@ -279,8 +279,10 @@ impl<'hir> LoweringContext<'_, 'hir> { id, ImplTraitContext::Disallowed(ImplTraitPosition::Generic), |this| { - let ty = this - .lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy)); + let ty = this.lower_ty_alloc( + ty, + ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy), + ); let rhs = this.lower_const_item_rhs(attrs, rhs.as_ref(), span); (ty, rhs) }, @@ -379,7 +381,7 @@ impl<'hir> LoweringContext<'_, 'hir> { ); this.arena.alloc(this.ty(span, hir::TyKind::Err(guar))) } - Some(ty) => this.lower_ty( + Some(ty) => this.lower_ty_alloc( ty, ImplTraitContext::OpaqueTy { origin: hir::OpaqueTyOrigin::TyAlias { @@ -453,7 +455,7 @@ impl<'hir> LoweringContext<'_, 'hir> { .as_deref() .map(|of_trait| this.lower_trait_impl_header(of_trait)); - let lowered_ty = this.lower_ty( + let lowered_ty = this.lower_ty_alloc( ty, ImplTraitContext::Disallowed(ImplTraitPosition::ImplSelf), ); @@ -758,8 +760,8 @@ impl<'hir> LoweringContext<'_, 'hir> { safety, define_opaque, }) => { - let ty = - self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy)); + let ty = self + .lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy)); let safety = self.lower_safety(*safety, hir::Safety::Unsafe); if define_opaque.is_some() { self.dcx().span_err(i.span, "foreign statics cannot define opaque types"); @@ -870,7 +872,8 @@ impl<'hir> LoweringContext<'_, 'hir> { &mut self, (index, f): (usize, &FieldDef), ) -> hir::FieldDef<'hir> { - let ty = self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy)); + let ty = + self.lower_ty_alloc(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy)); let hir_id = self.lower_node_id(f.id); self.lower_attrs(hir_id, &f.attrs, f.span, Target::Field); hir::FieldDef { @@ -908,8 +911,10 @@ impl<'hir> LoweringContext<'_, 'hir> { i.id, ImplTraitContext::Disallowed(ImplTraitPosition::Generic), |this| { - let ty = this - .lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy)); + let ty = this.lower_ty_alloc( + ty, + ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy), + ); let rhs = rhs .as_ref() .map(|rhs| this.lower_const_item_rhs(attrs, Some(rhs), i.span)); @@ -1008,7 +1013,7 @@ impl<'hir> LoweringContext<'_, 'hir> { ImplTraitContext::Disallowed(ImplTraitPosition::Generic), |this| { let ty = ty.as_ref().map(|x| { - this.lower_ty( + this.lower_ty_alloc( x, ImplTraitContext::Disallowed(ImplTraitPosition::AssocTy), ) @@ -1120,8 +1125,10 @@ impl<'hir> LoweringContext<'_, 'hir> { i.id, ImplTraitContext::Disallowed(ImplTraitPosition::Generic), |this| { - let ty = this - .lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy)); + let ty = this.lower_ty_alloc( + ty, + ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy), + ); this.lower_define_opaque(hir_id, &define_opaque); let rhs = this.lower_const_item_rhs(attrs, rhs.as_ref(), i.span); hir::ImplItemKind::Const(ty, rhs) @@ -1180,7 +1187,7 @@ impl<'hir> LoweringContext<'_, 'hir> { hir::ImplItemKind::Type(ty) } Some(ty) => { - let ty = this.lower_ty( + let ty = this.lower_ty_alloc( ty, ImplTraitContext::OpaqueTy { origin: hir::OpaqueTyOrigin::TyAlias { @@ -1916,7 +1923,7 @@ impl<'hir> LoweringContext<'_, 'hir> { bound_generic_params, hir::GenericParamSource::Binder, ), - bounded_ty: self.lower_ty( + bounded_ty: self.lower_ty_alloc( bounded_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Bound), ), @@ -1945,10 +1952,14 @@ impl<'hir> LoweringContext<'_, 'hir> { } WherePredicateKind::EqPredicate(WhereEqPredicate { lhs_ty, rhs_ty }) => { hir::WherePredicateKind::EqPredicate(hir::WhereEqPredicate { - lhs_ty: self - .lower_ty(lhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Bound)), - rhs_ty: self - .lower_ty(rhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Bound)), + lhs_ty: self.lower_ty_alloc( + lhs_ty, + ImplTraitContext::Disallowed(ImplTraitPosition::Bound), + ), + rhs_ty: self.lower_ty_alloc( + rhs_ty, + ImplTraitContext::Disallowed(ImplTraitPosition::Bound), + ), }) } }); diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 416fef8e3af3..a81d2297ef85 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1125,8 +1125,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let kind = match &constraint.kind { AssocItemConstraintKind::Equality { term } => { let term = match term { - Term::Ty(ty) => self.lower_ty(ty, itctx).into(), - Term::Const(c) => self.lower_anon_const_to_const_arg(c).into(), + Term::Ty(ty) => self.lower_ty_alloc(ty, itctx).into(), + Term::Const(c) => self.lower_anon_const_to_const_arg_and_alloc(c).into(), }; hir::AssocItemConstraintKind::Equality { term } } @@ -1250,17 +1250,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } _ => {} } - GenericArg::Type(self.lower_ty(ty, itctx).try_as_ambig_ty().unwrap()) - } - ast::GenericArg::Const(ct) => { - GenericArg::Const(self.lower_anon_const_to_const_arg(ct).try_as_ambig_ct().unwrap()) + GenericArg::Type(self.lower_ty_alloc(ty, itctx).try_as_ambig_ty().unwrap()) } + ast::GenericArg::Const(ct) => GenericArg::Const( + self.lower_anon_const_to_const_arg_and_alloc(ct).try_as_ambig_ct().unwrap(), + ), } } #[instrument(level = "debug", skip(self))] - fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext) -> &'hir hir::Ty<'hir> { - self.arena.alloc(self.lower_ty_direct(t, itctx)) + fn lower_ty_alloc(&mut self, t: &Ty, itctx: ImplTraitContext) -> &'hir hir::Ty<'hir> { + self.arena.alloc(self.lower_ty(t, itctx)) } fn lower_path_ty( @@ -1324,11 +1324,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { self.ty(span, hir::TyKind::Tup(tys)) } - fn lower_ty_direct(&mut self, t: &Ty, itctx: ImplTraitContext) -> hir::Ty<'hir> { + fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext) -> hir::Ty<'hir> { let kind = match &t.kind { TyKind::Infer => hir::TyKind::Infer(()), TyKind::Err(guar) => hir::TyKind::Err(*guar), - TyKind::Slice(ty) => hir::TyKind::Slice(self.lower_ty(ty, itctx)), + TyKind::Slice(ty) => hir::TyKind::Slice(self.lower_ty_alloc(ty, itctx)), TyKind::Ptr(mt) => hir::TyKind::Ptr(self.lower_mt(mt, itctx)), TyKind::Ref(region, mt) => { let lifetime = self.lower_ty_direct_lifetime(t, *region); @@ -1362,15 +1362,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let generic_params = self.lower_lifetime_binder(t.id, &f.generic_params); hir::TyKind::UnsafeBinder(self.arena.alloc(hir::UnsafeBinderTy { generic_params, - inner_ty: self.lower_ty(&f.inner_ty, itctx), + inner_ty: self.lower_ty_alloc(&f.inner_ty, itctx), })) } TyKind::Never => hir::TyKind::Never, TyKind::Tup(tys) => hir::TyKind::Tup( - self.arena.alloc_from_iter(tys.iter().map(|ty| self.lower_ty_direct(ty, itctx))), + self.arena.alloc_from_iter(tys.iter().map(|ty| self.lower_ty(ty, itctx))), ), TyKind::Paren(ty) => { - return self.lower_ty_direct(ty, itctx); + return self.lower_ty(ty, itctx); } TyKind::Path(qself, path) => { return self.lower_path_ty(t, qself, path, ParamMode::Explicit, itctx); @@ -1393,7 +1393,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { )) } TyKind::Array(ty, length) => hir::TyKind::Array( - self.lower_ty(ty, itctx), + self.lower_ty_alloc(ty, itctx), self.lower_array_length_to_const_arg(length), ), TyKind::TraitObject(bounds, kind) => { @@ -1493,7 +1493,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } } TyKind::Pat(ty, pat) => { - hir::TyKind::Pat(self.lower_ty(ty, itctx), self.lower_ty_pat(pat, ty.span)) + hir::TyKind::Pat(self.lower_ty_alloc(ty, itctx), self.lower_ty_pat(pat, ty.span)) } TyKind::MacCall(_) => { span_bug!(t.span, "`TyKind::MacCall` should have been expanded by now") @@ -1693,7 +1693,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { ImplTraitContext::Disallowed(ImplTraitPosition::PointerParam) } }; - self.lower_ty_direct(¶m.ty, itctx) + self.lower_ty(¶m.ty, itctx) })); let output = match coro { @@ -1732,7 +1732,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { ImplTraitContext::Disallowed(ImplTraitPosition::PointerReturn) } }; - hir::FnRetTy::Return(self.lower_ty(ty, itctx)) + hir::FnRetTy::Return(self.lower_ty_alloc(ty, itctx)) } FnRetTy::Default(span) => hir::FnRetTy::DefaultReturn(self.lower_span(*span)), }, @@ -1843,7 +1843,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // Not `OpaqueTyOrigin::AsyncFn`: that's only used for the // `impl Future` opaque type that `async fn` implicitly // generates. - self.lower_ty(ty, itctx) + self.lower_ty_alloc(ty, itctx) } FnRetTy::Default(ret_ty_span) => self.arena.alloc(self.ty_tup(*ret_ty_span, &[])), }; @@ -2036,7 +2036,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } }) .map(|def| { - self.lower_ty( + self.lower_ty_alloc( def, ImplTraitContext::Disallowed(ImplTraitPosition::GenericDefault), ) @@ -2047,8 +2047,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { (hir::ParamName::Plain(self.lower_ident(param.ident)), kind) } GenericParamKind::Const { ty, span: _, default } => { - let ty = self - .lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::GenericDefault)); + let ty = self.lower_ty_alloc( + ty, + ImplTraitContext::Disallowed(ImplTraitPosition::GenericDefault), + ); // Not only do we deny const param defaults in binders but we also map them to `None` // since later compiler stages cannot handle them (and shouldn't need to be able to). @@ -2064,7 +2066,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { false } }) - .map(|def| self.lower_anon_const_to_const_arg(def)); + .map(|def| self.lower_anon_const_to_const_arg_and_alloc(def)); ( hir::ParamName::Plain(self.lower_ident(param.ident)), @@ -2198,7 +2200,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } fn lower_mt(&mut self, mt: &MutTy, itctx: ImplTraitContext) -> hir::MutTy<'hir> { - hir::MutTy { ty: self.lower_ty(&mt.ty, itctx), mutbl: mt.mutbl } + hir::MutTy { ty: self.lower_ty_alloc(&mt.ty, itctx), mutbl: mt.mutbl } } #[instrument(level = "debug", skip(self), ret)] @@ -2283,10 +2285,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // `ExprKind::Paren(ExprKind::Underscore)` and should also be lowered to `GenericArg::Infer` match c.value.peel_parens().kind { ExprKind::Underscore => { - let ct_kind = hir::ConstArgKind::Infer(self.lower_span(c.value.span), ()); - self.arena.alloc(hir::ConstArg { hir_id: self.lower_node_id(c.id), kind: ct_kind }) + let ct_kind = hir::ConstArgKind::Infer(()); + self.arena.alloc(hir::ConstArg { + hir_id: self.lower_node_id(c.id), + kind: ct_kind, + span: self.lower_span(c.value.span), + }) } - _ => self.lower_anon_const_to_const_arg(c), + _ => self.lower_anon_const_to_const_arg_and_alloc(c), } } @@ -2354,7 +2360,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { hir::ConstArgKind::Anon(ct) }; - self.arena.alloc(hir::ConstArg { hir_id: self.next_id(), kind: ct_kind }) + self.arena.alloc(hir::ConstArg { + hir_id: self.next_id(), + kind: ct_kind, + span: self.lower_span(span), + }) } fn lower_const_item_rhs( @@ -2365,15 +2375,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { ) -> hir::ConstItemRhs<'hir> { match rhs { Some(ConstItemRhs::TypeConst(anon)) => { - hir::ConstItemRhs::TypeConst(self.lower_anon_const_to_const_arg(anon)) + hir::ConstItemRhs::TypeConst(self.lower_anon_const_to_const_arg_and_alloc(anon)) } None if attr::contains_name(attrs, sym::type_const) => { let const_arg = ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Error( - DUMMY_SP, self.dcx().span_delayed_bug(DUMMY_SP, "no block"), ), + span: DUMMY_SP, }; hir::ConstItemRhs::TypeConst(self.arena.alloc(const_arg)) } @@ -2386,16 +2396,65 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { #[instrument(level = "debug", skip(self), ret)] fn lower_expr_to_const_arg_direct(&mut self, expr: &Expr) -> hir::ConstArg<'hir> { + let span = self.lower_span(expr.span); + let overly_complex_const = |this: &mut Self| { let e = this.dcx().struct_span_err( expr.span, "complex const arguments must be placed inside of a `const` block", ); - ConstArg { hir_id: this.next_id(), kind: hir::ConstArgKind::Error(expr.span, e.emit()) } + ConstArg { hir_id: this.next_id(), kind: hir::ConstArgKind::Error(e.emit()), span } }; match &expr.kind { + ExprKind::Call(func, args) if let ExprKind::Path(qself, path) = &func.kind => { + let qpath = self.lower_qpath( + func.id, + qself, + path, + ParamMode::Explicit, + AllowReturnTypeNotation::No, + ImplTraitContext::Disallowed(ImplTraitPosition::Path), + None, + ); + + let lowered_args = self.arena.alloc_from_iter(args.iter().map(|arg| { + let const_arg = if let ExprKind::ConstBlock(anon_const) = &arg.kind { + let def_id = self.local_def_id(anon_const.id); + let def_kind = self.tcx.def_kind(def_id); + assert_eq!(DefKind::AnonConst, def_kind); + self.lower_anon_const_to_const_arg(anon_const) + } else { + self.lower_expr_to_const_arg_direct(arg) + }; + + &*self.arena.alloc(const_arg) + })); + + ConstArg { + hir_id: self.next_id(), + kind: hir::ConstArgKind::TupleCall(qpath, lowered_args), + span, + } + } + ExprKind::Tup(exprs) => { + let exprs = self.arena.alloc_from_iter(exprs.iter().map(|expr| { + let expr = if let ExprKind::ConstBlock(anon_const) = &expr.kind { + let def_id = self.local_def_id(anon_const.id); + let def_kind = self.tcx.def_kind(def_id); + assert_eq!(DefKind::AnonConst, def_kind); + + self.lower_anon_const_to_const_arg(anon_const) + } else { + self.lower_expr_to_const_arg_direct(&expr) + }; + + &*self.arena.alloc(expr) + })); + + ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Tup(exprs), span } + } ExprKind::Path(qself, path) => { let qpath = self.lower_qpath( expr.id, @@ -2408,7 +2467,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { None, ); - ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Path(qpath) } + ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Path(qpath), span } } ExprKind::Struct(se) => { let path = self.lower_qpath( @@ -2436,7 +2495,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let def_kind = self.tcx.def_kind(def_id); assert_eq!(DefKind::AnonConst, def_kind); - self.lower_anon_const_to_const_arg_direct(anon_const) + self.lower_anon_const_to_const_arg(anon_const) } else { self.lower_expr_to_const_arg_direct(&f.expr) }; @@ -2449,18 +2508,27 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { }) })); - ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Struct(path, fields) } + ConstArg { + hir_id: self.next_id(), + kind: hir::ConstArgKind::Struct(path, fields), + span, + } } ExprKind::Underscore => ConstArg { hir_id: self.lower_node_id(expr.id), - kind: hir::ConstArgKind::Infer(expr.span, ()), + kind: hir::ConstArgKind::Infer(()), + span, }, ExprKind::Block(block, _) => { if let [stmt] = block.stmts.as_slice() && let StmtKind::Expr(expr) = &stmt.kind && matches!( expr.kind, - ExprKind::Block(..) | ExprKind::Path(..) | ExprKind::Struct(..) + ExprKind::Block(..) + | ExprKind::Path(..) + | ExprKind::Struct(..) + | ExprKind::Call(..) + | ExprKind::Tup(..) ) { return self.lower_expr_to_const_arg_direct(expr); @@ -2474,12 +2542,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { /// See [`hir::ConstArg`] for when to use this function vs /// [`Self::lower_anon_const_to_anon_const`]. - fn lower_anon_const_to_const_arg(&mut self, anon: &AnonConst) -> &'hir hir::ConstArg<'hir> { - self.arena.alloc(self.lower_anon_const_to_const_arg_direct(anon)) + fn lower_anon_const_to_const_arg_and_alloc( + &mut self, + anon: &AnonConst, + ) -> &'hir hir::ConstArg<'hir> { + self.arena.alloc(self.lower_anon_const_to_const_arg(anon)) } #[instrument(level = "debug", skip(self))] - fn lower_anon_const_to_const_arg_direct(&mut self, anon: &AnonConst) -> hir::ConstArg<'hir> { + fn lower_anon_const_to_const_arg(&mut self, anon: &AnonConst) -> hir::ConstArg<'hir> { let tcx = self.tcx; // We cannot change parsing depending on feature gates available, @@ -2491,7 +2562,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { return match anon.mgca_disambiguation { MgcaDisambiguation::AnonConst => { let lowered_anon = self.lower_anon_const_to_anon_const(anon); - ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Anon(lowered_anon) } + ConstArg { + hir_id: self.next_id(), + kind: hir::ConstArgKind::Anon(lowered_anon), + span: lowered_anon.span, + } } MgcaDisambiguation::Direct => self.lower_expr_to_const_arg_direct(&anon.value), }; @@ -2528,11 +2603,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { return ConstArg { hir_id: self.lower_node_id(anon.id), kind: hir::ConstArgKind::Path(qpath), + span: self.lower_span(expr.span), }; } let lowered_anon = self.lower_anon_const_to_anon_const(anon); - ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Anon(lowered_anon) } + ConstArg { + hir_id: self.next_id(), + kind: hir::ConstArgKind::Anon(lowered_anon), + span: self.lower_span(expr.span), + } } /// See [`hir::ConstArg`] for when to use this function vs diff --git a/compiler/rustc_ast_lowering/src/pat.rs b/compiler/rustc_ast_lowering/src/pat.rs index 3571fd652397..e066bce95158 100644 --- a/compiler/rustc_ast_lowering/src/pat.rs +++ b/compiler/rustc_ast_lowering/src/pat.rs @@ -399,7 +399,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { ExprKind::Lit(lit) => { hir::PatExprKind::Lit { lit: self.lower_lit(lit, span), negated: false } } - ExprKind::ConstBlock(c) => hir::PatExprKind::ConstBlock(self.lower_const_block(c)), ExprKind::IncludedBytes(byte_sym) => hir::PatExprKind::Lit { lit: respan(span, LitKind::ByteStr(*byte_sym, StrStyle::Cooked)), negated: false, @@ -419,10 +418,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { hir::PatExprKind::Lit { lit: self.lower_lit(lit, span), negated: true } } _ => { + let is_const_block = matches!(expr.kind, ExprKind::ConstBlock(_)); let pattern_from_macro = expr.is_approximately_pattern(); let guar = self.dcx().emit_err(ArbitraryExpressionInPattern { span, pattern_from_macro_note: pattern_from_macro, + const_block_in_pattern_help: is_const_block, }); err(guar) } @@ -443,16 +444,18 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let pat_hir_id = self.lower_node_id(pattern.id); let node = match &pattern.kind { TyPatKind::Range(e1, e2, Spanned { node: end, span }) => hir::TyPatKind::Range( - e1.as_deref().map(|e| self.lower_anon_const_to_const_arg(e)).unwrap_or_else(|| { - self.lower_ty_pat_range_end( - hir::LangItem::RangeMin, - span.shrink_to_lo(), - base_type, - ) - }), + e1.as_deref() + .map(|e| self.lower_anon_const_to_const_arg_and_alloc(e)) + .unwrap_or_else(|| { + self.lower_ty_pat_range_end( + hir::LangItem::RangeMin, + span.shrink_to_lo(), + base_type, + ) + }), e2.as_deref() .map(|e| match end { - RangeEnd::Included(..) => self.lower_anon_const_to_const_arg(e), + RangeEnd::Included(..) => self.lower_anon_const_to_const_arg_and_alloc(e), RangeEnd::Excluded => self.lower_excluded_range_end(e), }) .unwrap_or_else(|| { @@ -510,6 +513,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { self.arena.alloc(hir::ConstArg { hir_id: self.next_id(), kind: hir::ConstArgKind::Anon(self.arena.alloc(anon_const)), + span, }) } @@ -554,6 +558,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { }) }); let hir_id = self.next_id(); - self.arena.alloc(hir::ConstArg { kind: hir::ConstArgKind::Anon(ct), hir_id }) + self.arena.alloc(hir::ConstArg { kind: hir::ConstArgKind::Anon(ct), hir_id, span }) } } diff --git a/compiler/rustc_ast_lowering/src/path.rs b/compiler/rustc_ast_lowering/src/path.rs index 3322e0fb66b4..bfb42efb684f 100644 --- a/compiler/rustc_ast_lowering/src/path.rs +++ b/compiler/rustc_ast_lowering/src/path.rs @@ -36,7 +36,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let qself = qself .as_ref() // Reject cases like `::Assoc` and `::Assoc`. - .map(|q| self.lower_ty(&q.ty, ImplTraitContext::Disallowed(ImplTraitPosition::Path))); + .map(|q| { + self.lower_ty_alloc(&q.ty, ImplTraitContext::Disallowed(ImplTraitPosition::Path)) + }); let partial_res = self.resolver.get_partial_res(id).unwrap_or_else(|| PartialRes::new(Res::Err)); @@ -510,7 +512,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // we generally don't permit such things (see #51008). let ParenthesizedArgs { span, inputs, inputs_span, output } = data; let inputs = self.arena.alloc_from_iter(inputs.iter().map(|ty| { - self.lower_ty_direct(ty, ImplTraitContext::Disallowed(ImplTraitPosition::FnTraitParam)) + self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::FnTraitParam)) })); let output_ty = match output { // Only allow `impl Trait` in return position. i.e.: @@ -520,9 +522,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // ``` FnRetTy::Ty(ty) if matches!(itctx, ImplTraitContext::OpaqueTy { .. }) => { if self.tcx.features().impl_trait_in_fn_trait_return() { - self.lower_ty(ty, itctx) + self.lower_ty_alloc(ty, itctx) } else { - self.lower_ty( + self.lower_ty_alloc( ty, ImplTraitContext::FeatureGated( ImplTraitPosition::FnTraitReturn, @@ -531,9 +533,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { ) } } - FnRetTy::Ty(ty) => { - self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::FnTraitReturn)) - } + FnRetTy::Ty(ty) => self + .lower_ty_alloc(ty, ImplTraitContext::Disallowed(ImplTraitPosition::FnTraitReturn)), FnRetTy::Default(_) => self.arena.alloc(self.ty_tup(*span, &[])), }; let args = smallvec![GenericArg::Type( diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index a083ca7d133e..eddcf12fca29 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -401,9 +401,16 @@ impl<'a> AstValidator<'a> { | CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::Arm(_) - | CanonAbi::GpuKernel | CanonAbi::X86(_) => { /* nothing to check */ } + CanonAbi::GpuKernel => { + // An `extern "gpu-kernel"` function cannot be `async` and/or `gen`. + self.reject_coroutine(abi, sig); + + // An `extern "gpu-kernel"` function cannot return a value. + self.reject_return(abi, sig); + } + CanonAbi::Custom => { // An `extern "custom"` function must be unsafe. self.reject_safe_fn(abi, ctxt, sig); @@ -433,18 +440,7 @@ impl<'a> AstValidator<'a> { self.dcx().emit_err(errors::AbiX86Interrupt { spans, param_count }); } - if let FnRetTy::Ty(ref ret_ty) = sig.decl.output - && match &ret_ty.kind { - TyKind::Never => false, - TyKind::Tup(tup) if tup.is_empty() => false, - _ => true, - } - { - self.dcx().emit_err(errors::AbiMustNotHaveReturnType { - span: ret_ty.span, - abi, - }); - } + self.reject_return(abi, sig); } else { // An `extern "interrupt"` function must have type `fn()`. self.reject_params_or_return(abi, ident, sig); @@ -496,6 +492,18 @@ impl<'a> AstValidator<'a> { } } + fn reject_return(&self, abi: ExternAbi, sig: &FnSig) { + if let FnRetTy::Ty(ref ret_ty) = sig.decl.output + && match &ret_ty.kind { + TyKind::Never => false, + TyKind::Tup(tup) if tup.is_empty() => false, + _ => true, + } + { + self.dcx().emit_err(errors::AbiMustNotHaveReturnType { span: ret_ty.span, abi }); + } + } + fn reject_params_or_return(&self, abi: ExternAbi, ident: &Ident, sig: &FnSig) { let mut spans: Vec<_> = sig.decl.inputs.iter().map(|p| p.span).collect(); if let FnRetTy::Ty(ref ret_ty) = sig.decl.output diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index dbbd3906b525..028a5048d543 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -160,7 +160,7 @@ impl<'a> PostExpansionVisitor<'a> { impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { fn visit_attribute(&mut self, attr: &ast::Attribute) { - let attr_info = attr.ident().and_then(|ident| BUILTIN_ATTRIBUTE_MAP.get(&ident.name)); + let attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name)); // Check feature gates for built-in attributes. if let Some(BuiltinAttribute { gate: AttributeGate::Gated { feature, message, check, notes, .. }, @@ -505,7 +505,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { half_open_range_patterns_in_slices, "half-open range patterns in slices are unstable" ); - gate_all!(associated_const_equality, "associated const equality is incomplete"); gate_all!(yeet_expr, "`do yeet` expression is experimental"); gate_all!(const_closures, "const closures are experimental"); gate_all!(builtin_syntax, "`builtin #` syntax is unstable"); @@ -518,6 +517,23 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { gate_all!(postfix_match, "postfix match is experimental"); gate_all!(mut_ref, "mutable by-reference bindings are experimental"); gate_all!(min_generic_const_args, "unbraced const blocks as const args are experimental"); + // associated_const_equality is stabilized as part of min_generic_const_args + if let Some(spans) = spans.get(&sym::associated_const_equality) { + for span in spans { + if !visitor.features.min_generic_const_args() + && !span.allows_unstable(sym::min_generic_const_args) + { + #[allow(rustc::untranslatable_diagnostic)] + feature_err( + &visitor.sess, + sym::min_generic_const_args, + *span, + "associated const equality is incomplete", + ) + .emit(); + } + } + } gate_all!(global_registration, "global registration is experimental"); gate_all!(return_type_notation, "return type notation is experimental"); gate_all!(pin_ergonomics, "pinned reference syntax is experimental"); diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 1aa08dfd3d5e..0cf0eae821e9 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -694,7 +694,7 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::Dere } ast::Safety::Default | ast::Safety::Safe(_) => {} } - match &item.args { + match &item.args.unparsed_ref().expect("Parsed attributes are never printed") { AttrArgs::Delimited(DelimArgs { dspan: _, delim, tokens }) => self.print_mac_common( Some(MacHeader::Path(&item.path)), false, diff --git a/compiler/rustc_attr_parsing/messages.ftl b/compiler/rustc_attr_parsing/messages.ftl index 5caa98b05357..36213e68a52b 100644 --- a/compiler/rustc_attr_parsing/messages.ftl +++ b/compiler/rustc_attr_parsing/messages.ftl @@ -229,6 +229,8 @@ attr_parsing_unstable_cfg_target_compact = attr_parsing_unstable_feature_bound_incompatible_stability = item annotated with `#[unstable_feature_bound]` should not be stable .help = If this item is meant to be stable, do not use any functions annotated with `#[unstable_feature_bound]`. Otherwise, mark this item as unstable with `#[unstable]` +attr_parsing_unsupported_instruction_set = target `{$current_target}` does not support `#[instruction_set({$instruction_set}::*)]` + attr_parsing_unsupported_literal_suggestion = consider removing the prefix diff --git a/compiler/rustc_attr_parsing/src/attributes/cfg.rs b/compiler/rustc_attr_parsing/src/attributes/cfg.rs index 798cc1076541..ccf0a394afd0 100644 --- a/compiler/rustc_attr_parsing/src/attributes/cfg.rs +++ b/compiler/rustc_attr_parsing/src/attributes/cfg.rs @@ -294,11 +294,9 @@ pub fn parse_cfg_attr( sess: &Session, features: Option<&Features>, ) -> Option<(CfgEntry, Vec<(AttrItem, Span)>)> { - match cfg_attr.get_normal_item().args { - ast::AttrArgs::Delimited(ast::DelimArgs { dspan, delim, ref tokens }) - if !tokens.is_empty() => - { - check_cfg_attr_bad_delim(&sess.psess, dspan, delim); + match cfg_attr.get_normal_item().args.unparsed_ref().unwrap() { + ast::AttrArgs::Delimited(ast::DelimArgs { dspan, delim, tokens }) if !tokens.is_empty() => { + check_cfg_attr_bad_delim(&sess.psess, *dspan, *delim); match parse_in(&sess.psess, tokens.clone(), "`cfg_attr` input", |p| { parse_cfg_attr_internal(p, sess, features, cfg_attr) }) { @@ -322,7 +320,7 @@ pub fn parse_cfg_attr( } _ => { let (span, reason) = if let ast::AttrArgs::Delimited(ast::DelimArgs { dspan, .. }) = - cfg_attr.get_normal_item().args + cfg_attr.get_normal_item().args.unparsed_ref()? { (dspan.entire(), AttributeParseErrorReason::ExpectedAtLeastOneArgument) } else { @@ -371,13 +369,7 @@ fn parse_cfg_attr_internal<'a>( attribute.span, attribute.get_normal_item().span(), attribute.style, - AttrPath { - segments: attribute - .ident_path() - .expect("cfg_attr is not a doc comment") - .into_boxed_slice(), - span: attribute.span, - }, + AttrPath { segments: attribute.path().into_boxed_slice(), span: attribute.span }, Some(attribute.get_normal_item().unsafety), ParsedDescription::Attribute, pred_span, diff --git a/compiler/rustc_attr_parsing/src/attributes/cfg_select.rs b/compiler/rustc_attr_parsing/src/attributes/cfg_select.rs index 00a2d12106e7..24b989e22a2b 100644 --- a/compiler/rustc_attr_parsing/src/attributes/cfg_select.rs +++ b/compiler/rustc_attr_parsing/src/attributes/cfg_select.rs @@ -7,7 +7,7 @@ use rustc_hir::attrs::CfgEntry; use rustc_parse::exp; use rustc_parse::parser::Parser; use rustc_session::Session; -use rustc_span::{ErrorGuaranteed, Ident, Span}; +use rustc_span::{ErrorGuaranteed, Span, sym}; use crate::parser::MetaItemOrLitParser; use crate::{AttributeParser, ParsedDescription, ShouldEmit, parse_cfg_entry}; @@ -86,10 +86,7 @@ pub fn parse_cfg_select( cfg_span, cfg_span, AttrStyle::Inner, - AttrPath { - segments: vec![Ident::from_str("cfg_select")].into_boxed_slice(), - span: cfg_span, - }, + AttrPath { segments: vec![sym::cfg_select].into_boxed_slice(), span: cfg_span }, None, ParsedDescription::Macro, cfg_span, diff --git a/compiler/rustc_attr_parsing/src/attributes/instruction_set.rs b/compiler/rustc_attr_parsing/src/attributes/instruction_set.rs new file mode 100644 index 000000000000..3be9b9ded9c1 --- /dev/null +++ b/compiler/rustc_attr_parsing/src/attributes/instruction_set.rs @@ -0,0 +1,73 @@ +use rustc_hir::attrs::InstructionSetAttr; + +use super::prelude::*; +use crate::session_diagnostics; + +pub(crate) struct InstructionSetParser; + +impl SingleAttributeParser for InstructionSetParser { + const PATH: &[Symbol] = &[sym::instruction_set]; + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowListWarnRest(&[ + Allow(Target::Fn), + Allow(Target::Closure), + Allow(Target::Method(MethodKind::Inherent)), + Allow(Target::Method(MethodKind::TraitImpl)), + Allow(Target::Method(MethodKind::Trait { body: true })), + ]); + const TEMPLATE: AttributeTemplate = template!(List: &["set"], "https://doc.rust-lang.org/reference/attributes/codegen.html#the-instruction_set-attribute"); + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; + const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; + + fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { + const POSSIBLE_SYMBOLS: &[Symbol] = &[sym::arm_a32, sym::arm_t32]; + const POSSIBLE_ARM_SYMBOLS: &[Symbol] = &[sym::a32, sym::t32]; + let Some(maybe_meta_item) = args.list().and_then(MetaItemListParser::single) else { + cx.expected_specific_argument(cx.attr_span, POSSIBLE_SYMBOLS); + return None; + }; + + let Some(meta_item) = maybe_meta_item.meta_item() else { + cx.expected_specific_argument(maybe_meta_item.span(), POSSIBLE_SYMBOLS); + return None; + }; + + let mut segments = meta_item.path().segments(); + + let Some(architecture) = segments.next() else { + cx.expected_specific_argument(meta_item.span(), POSSIBLE_SYMBOLS); + return None; + }; + + let Some(instruction_set) = segments.next() else { + cx.expected_specific_argument(architecture.span, POSSIBLE_SYMBOLS); + return None; + }; + + let instruction_set = match architecture.name { + sym::arm => { + if !cx.sess.target.has_thumb_interworking { + cx.dcx().emit_err(session_diagnostics::UnsupportedInstructionSet { + span: cx.attr_span, + instruction_set: sym::arm, + current_target: &cx.sess.opts.target_triple, + }); + return None; + } + match instruction_set.name { + sym::a32 => InstructionSetAttr::ArmA32, + sym::t32 => InstructionSetAttr::ArmT32, + _ => { + cx.expected_specific_argument(instruction_set.span, POSSIBLE_ARM_SYMBOLS); + return None; + } + } + } + _ => { + cx.expected_specific_argument(architecture.span, POSSIBLE_SYMBOLS); + return None; + } + }; + + Some(AttributeKind::InstructionSet(instruction_set)) + } +} diff --git a/compiler/rustc_attr_parsing/src/attributes/mod.rs b/compiler/rustc_attr_parsing/src/attributes/mod.rs index c39c60ea7e39..fafac7ea909d 100644 --- a/compiler/rustc_attr_parsing/src/attributes/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/mod.rs @@ -42,6 +42,7 @@ pub(crate) mod deprecation; pub(crate) mod doc; pub(crate) mod dummy; pub(crate) mod inline; +pub(crate) mod instruction_set; pub(crate) mod link_attrs; pub(crate) mod lint_helpers; pub(crate) mod loop_match; diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs index be4e2210c5ee..922a5bd297ac 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs @@ -1,4 +1,5 @@ use rustc_ast::{LitIntType, LitKind, MetaItemLit}; +use rustc_session::errors; use super::prelude::*; use super::util::parse_single_integer; @@ -13,6 +14,52 @@ impl NoArgsAttributeParser for RustcMainParser { const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcMain; } +pub(crate) struct RustcMustImplementOneOfParser; + +impl SingleAttributeParser for RustcMustImplementOneOfParser { + const PATH: &[Symbol] = &[sym::rustc_must_implement_one_of]; + const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; + const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); + const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; + const TEMPLATE: AttributeTemplate = template!(List: &["function1, function2, ..."]); + fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { + let Some(list) = args.list() else { + cx.expected_list(cx.attr_span, args); + return None; + }; + + let mut fn_names = ThinVec::new(); + + let inputs: Vec<_> = list.mixed().collect(); + + if inputs.len() < 2 { + cx.expected_list_with_num_args_or_more(2, list.span); + return None; + } + + let mut errored = false; + for argument in inputs { + let Some(meta) = argument.meta_item() else { + cx.expected_identifier(argument.span()); + return None; + }; + + let Some(ident) = meta.ident() else { + cx.dcx().emit_err(errors::MustBeNameOfAssociatedFunction { span: meta.span() }); + errored = true; + continue; + }; + + fn_names.push(ident); + } + if errored { + return None; + } + + Some(AttributeKind::RustcMustImplementOneOf { attr_span: cx.attr_span, fn_names }) + } +} + pub(crate) struct RustcNeverReturnsNullPointerParser; impl NoArgsAttributeParser for RustcNeverReturnsNullPointerParser { diff --git a/compiler/rustc_attr_parsing/src/attributes/util.rs b/compiler/rustc_attr_parsing/src/attributes/util.rs index 431ba539b2ba..ebec8e8443fc 100644 --- a/compiler/rustc_attr_parsing/src/attributes/util.rs +++ b/compiler/rustc_attr_parsing/src/attributes/util.rs @@ -28,8 +28,7 @@ pub fn parse_version(s: Symbol) -> Option { } pub fn is_builtin_attr(attr: &impl AttributeExt) -> bool { - attr.is_doc_comment().is_some() - || attr.ident().is_some_and(|ident| is_builtin_attr_name(ident.name)) + attr.is_doc_comment().is_some() || attr.name().is_some_and(|name| is_builtin_attr_name(name)) } /// Parse a single integer. diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 9a443dfbb842..b85bb6c6c89d 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -37,6 +37,7 @@ use crate::attributes::deprecation::DeprecationParser; use crate::attributes::doc::DocParser; use crate::attributes::dummy::DummyParser; use crate::attributes::inline::{InlineParser, RustcForceInlineParser}; +use crate::attributes::instruction_set::InstructionSetParser; use crate::attributes::link_attrs::{ ExportStableParser, FfiConstParser, FfiPureParser, LinkNameParser, LinkOrdinalParser, LinkParser, LinkSectionParser, LinkageParser, StdInternalSymbolParser, @@ -64,8 +65,9 @@ use crate::attributes::rustc_internal::{ RustcLayoutScalarValidRangeEndParser, RustcLayoutScalarValidRangeStartParser, RustcLegacyConstGenericsParser, RustcLintDiagnosticsParser, RustcLintOptDenyFieldAccessParser, RustcLintOptTyParser, RustcLintQueryInstabilityParser, - RustcLintUntrackedQueryInformationParser, RustcMainParser, RustcNeverReturnsNullPointerParser, - RustcNoImplicitAutorefsParser, RustcObjectLifetimeDefaultParser, RustcScalableVectorParser, + RustcLintUntrackedQueryInformationParser, RustcMainParser, RustcMustImplementOneOfParser, + RustcNeverReturnsNullPointerParser, RustcNoImplicitAutorefsParser, + RustcObjectLifetimeDefaultParser, RustcScalableVectorParser, RustcSimdMonomorphizeLaneLimitParser, }; use crate::attributes::semantics::MayDangleParser; @@ -197,6 +199,7 @@ attribute_parsers!( Single, Single, Single, + Single, Single, Single, Single, @@ -217,6 +220,7 @@ attribute_parsers!( Single, Single, Single, + Single, Single, Single, Single, @@ -492,6 +496,17 @@ impl<'f, 'sess: 'f, S: Stage> AcceptContext<'f, 'sess, S> { self.emit_parse_error(span, AttributeParseErrorReason::ExpectedList) } + pub(crate) fn expected_list_with_num_args_or_more( + &self, + args: usize, + span: Span, + ) -> ErrorGuaranteed { + self.emit_parse_error( + span, + AttributeParseErrorReason::ExpectedListWithNumArgsOrMore { args }, + ) + } + pub(crate) fn expected_list_or_no_args(&self, span: Span) -> ErrorGuaranteed { self.emit_parse_error(span, AttributeParseErrorReason::ExpectedListOrNoArgs) } diff --git a/compiler/rustc_attr_parsing/src/early_parsed.rs b/compiler/rustc_attr_parsing/src/early_parsed.rs new file mode 100644 index 000000000000..6a33cb38edf9 --- /dev/null +++ b/compiler/rustc_attr_parsing/src/early_parsed.rs @@ -0,0 +1,53 @@ +use rustc_ast::EarlyParsedAttribute; +use rustc_ast::attr::data_structures::CfgEntry; +use rustc_hir::Attribute; +use rustc_hir::attrs::AttributeKind; +use rustc_span::{Span, Symbol, sym}; +use thin_vec::ThinVec; + +pub(crate) const EARLY_PARSED_ATTRIBUTES: &[&[Symbol]] = + &[&[sym::cfg_trace], &[sym::cfg_attr_trace]]; + +/// This struct contains the state necessary to convert early parsed attributes to hir attributes +/// The only conversion that really happens here is that multiple early parsed attributes are +/// merged into a single hir attribute, representing their combined state. +/// FIXME: We should make this a nice and extendable system if this is going to be used more often +#[derive(Default)] +pub(crate) struct EarlyParsedState { + /// Attribute state for `#[cfg]` trace attributes + cfg_trace: ThinVec<(CfgEntry, Span)>, + + /// Attribute state for `#[cfg_attr]` trace attributes + /// The arguments of these attributes is no longer relevant for any later passes, only their presence. + /// So we discard the arguments here. + cfg_attr_trace: bool, +} + +impl EarlyParsedState { + pub(crate) fn accept_early_parsed_attribute( + &mut self, + attr_span: Span, + lower_span: impl Copy + Fn(Span) -> Span, + parsed: &EarlyParsedAttribute, + ) { + match parsed { + EarlyParsedAttribute::CfgTrace(cfg) => { + let mut cfg = cfg.clone(); + cfg.lower_spans(lower_span); + self.cfg_trace.push((cfg, attr_span)); + } + EarlyParsedAttribute::CfgAttrTrace => { + self.cfg_attr_trace = true; + } + } + } + + pub(crate) fn finalize_early_parsed_attributes(self, attributes: &mut Vec) { + if !self.cfg_trace.is_empty() { + attributes.push(Attribute::Parsed(AttributeKind::CfgTrace(self.cfg_trace))); + } + if self.cfg_attr_trace { + attributes.push(Attribute::Parsed(AttributeKind::CfgAttrTrace)); + } + } +} diff --git a/compiler/rustc_attr_parsing/src/interface.rs b/compiler/rustc_attr_parsing/src/interface.rs index 91596ff0de60..e38fffa6587c 100644 --- a/compiler/rustc_attr_parsing/src/interface.rs +++ b/compiler/rustc_attr_parsing/src/interface.rs @@ -2,7 +2,7 @@ use std::convert::identity; use rustc_ast as ast; use rustc_ast::token::DocFragmentKind; -use rustc_ast::{AttrStyle, NodeId, Safety}; +use rustc_ast::{AttrItemKind, AttrStyle, NodeId, Safety}; use rustc_errors::DiagCtxtHandle; use rustc_feature::{AttributeTemplate, Features}; use rustc_hir::attrs::AttributeKind; @@ -13,6 +13,7 @@ use rustc_session::lint::BuiltinLintDiag; use rustc_span::{DUMMY_SP, Span, Symbol, sym}; use crate::context::{AcceptContext, FinalizeContext, SharedContext, Stage}; +use crate::early_parsed::{EARLY_PARSED_ATTRIBUTES, EarlyParsedState}; use crate::parser::{ArgParser, PathParser, RefPathParser}; use crate::session_diagnostics::ParsedDescription; use crate::{Early, Late, OmitDoc, ShouldEmit}; @@ -146,8 +147,12 @@ impl<'sess> AttributeParser<'sess, Early> { normal_attr.item.path.segments.iter().map(|seg| seg.ident.name).collect::>(); let path = AttrPath::from_ast(&normal_attr.item.path, identity); - let args = - ArgParser::from_attr_args(&normal_attr.item.args, &parts, &sess.psess, emit_errors)?; + let args = ArgParser::from_attr_args( + &normal_attr.item.args.unparsed_ref().unwrap(), + &parts, + &sess.psess, + emit_errors, + )?; Self::parse_single_args( sess, attr.span, @@ -263,12 +268,12 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { target_id: S::Id, target: Target, omit_doc: OmitDoc, - lower_span: impl Copy + Fn(Span) -> Span, mut emit_lint: impl FnMut(AttributeLint), ) -> Vec { let mut attributes = Vec::new(); let mut attr_paths: Vec> = Vec::new(); + let mut early_parsed_state = EarlyParsedState::default(); for attr in attrs { // If we're only looking for a single attribute, skip all the ones we don't care about. @@ -288,6 +293,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { continue; } + let attr_span = lower_span(attr.span); match &attr.kind { ast::AttrKind::DocComment(comment_kind, symbol) => { if omit_doc == OmitDoc::Skip { @@ -297,7 +303,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { attributes.push(Attribute::Parsed(AttributeKind::DocComment { style: attr.style, kind: DocFragmentKind::Sugared(*comment_kind), - span: lower_span(attr.span), + span: attr_span, comment: *symbol, })) } @@ -305,6 +311,15 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { attr_paths.push(PathParser(&n.item.path)); let attr_path = AttrPath::from_ast(&n.item.path, lower_span); + let args = match &n.item.args { + AttrItemKind::Unparsed(args) => args, + AttrItemKind::Parsed(parsed) => { + early_parsed_state + .accept_early_parsed_attribute(attr_span, lower_span, parsed); + continue; + } + }; + self.check_attribute_safety( &attr_path, lower_span(n.item.span()), @@ -318,7 +333,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { if let Some(accepts) = S::parsers().accepters.get(parts.as_slice()) { let Some(args) = ArgParser::from_attr_args( - &n.item.args, + args, &parts, &self.sess.psess, self.stage.should_emit(), @@ -351,7 +366,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { attributes.push(Attribute::Parsed(AttributeKind::DocComment { style: attr.style, kind: DocFragmentKind::Raw(nv.value_span), - span: attr.span, + span: attr_span, comment, })); continue; @@ -365,7 +380,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { target_id, emit_lint: &mut emit_lint, }, - attr_span: lower_span(attr.span), + attr_span, inner_span: lower_span(n.item.span()), attr_style: attr.style, parsed_description: ParsedDescription::Attribute, @@ -396,17 +411,18 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { attributes.push(Attribute::Unparsed(Box::new(AttrItem { path: attr_path.clone(), - args: self.lower_attr_args(&n.item.args, lower_span), + args: self + .lower_attr_args(n.item.args.unparsed_ref().unwrap(), lower_span), id: HashIgnoredAttrId { attr_id: attr.id }, style: attr.style, - span: lower_span(attr.span), + span: attr_span, }))); } } } } - let mut parsed_attributes = Vec::new(); + early_parsed_state.finalize_early_parsed_attributes(&mut attributes); for f in &S::parsers().finalizers { if let Some(attr) = f(&mut FinalizeContext { shared: SharedContext { @@ -417,18 +433,16 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { }, all_attrs: &attr_paths, }) { - parsed_attributes.push(Attribute::Parsed(attr)); + attributes.push(Attribute::Parsed(attr)); } } - attributes.extend(parsed_attributes); - attributes } /// Returns whether there is a parser for an attribute with this name pub fn is_parsed_attribute(path: &[Symbol]) -> bool { - Late::parsers().accepters.contains_key(path) + Late::parsers().accepters.contains_key(path) || EARLY_PARSED_ATTRIBUTES.contains(&path) } fn lower_attr_args(&self, args: &ast::AttrArgs, lower_span: impl Fn(Span) -> Span) -> AttrArgs { diff --git a/compiler/rustc_attr_parsing/src/lib.rs b/compiler/rustc_attr_parsing/src/lib.rs index 411b4dd75e66..349e6c234520 100644 --- a/compiler/rustc_attr_parsing/src/lib.rs +++ b/compiler/rustc_attr_parsing/src/lib.rs @@ -99,6 +99,7 @@ mod interface; /// like lists or name-value pairs. pub mod parser; +mod early_parsed; mod safety; mod session_diagnostics; mod target_checking; diff --git a/compiler/rustc_attr_parsing/src/parser.rs b/compiler/rustc_attr_parsing/src/parser.rs index 9551744d5ec5..d79579fdf0b7 100644 --- a/compiler/rustc_attr_parsing/src/parser.rs +++ b/compiler/rustc_attr_parsing/src/parser.rs @@ -8,7 +8,9 @@ use std::fmt::{Debug, Display}; use rustc_ast::token::{self, Delimiter, MetaVarKind}; use rustc_ast::tokenstream::TokenStream; -use rustc_ast::{AttrArgs, Expr, ExprKind, LitKind, MetaItemLit, Path, StmtKind, UnOp}; +use rustc_ast::{ + AttrArgs, Expr, ExprKind, LitKind, MetaItemLit, Path, PathSegment, StmtKind, UnOp, +}; use rustc_ast_pretty::pprust; use rustc_errors::{Diag, PResult}; use rustc_hir::{self as hir, AttrPath}; @@ -34,7 +36,7 @@ pub type RefPathParser<'p> = PathParser<&'p Path>; impl> PathParser

{ pub fn get_attribute_path(&self) -> hir::AttrPath { AttrPath { - segments: self.segments().copied().collect::>().into_boxed_slice(), + segments: self.segments().map(|s| s.name).collect::>().into_boxed_slice(), span: self.span(), } } @@ -120,10 +122,10 @@ impl ArgParser { } if args.delim != Delimiter::Parenthesis { - psess.dcx().emit_err(MetaBadDelim { + should_emit.emit_err(psess.dcx().create_err(MetaBadDelim { span: args.dspan.entire(), sugg: MetaBadDelimSugg { open: args.dspan.open, close: args.dspan.close }, - }); + })); return None; } @@ -256,6 +258,11 @@ impl Debug for MetaItemParser { } impl MetaItemParser { + /// For a single-segment meta item, returns its name; otherwise, returns `None`. + pub fn ident(&self) -> Option { + if let [PathSegment { ident, .. }] = self.path.0.segments[..] { Some(ident) } else { None } + } + pub fn span(&self) -> Span { if let Some(other) = self.args.span() { self.path.borrow().span().with_hi(other.hi()) diff --git a/compiler/rustc_attr_parsing/src/safety.rs b/compiler/rustc_attr_parsing/src/safety.rs index 817785108a1e..9fca57f88025 100644 --- a/compiler/rustc_attr_parsing/src/safety.rs +++ b/compiler/rustc_attr_parsing/src/safety.rs @@ -4,7 +4,7 @@ use rustc_hir::AttrPath; use rustc_hir::lints::{AttributeLint, AttributeLintKind}; use rustc_session::lint::LintId; use rustc_session::lint::builtin::UNSAFE_ATTR_OUTSIDE_UNSAFE; -use rustc_span::{Span, sym}; +use rustc_span::Span; use crate::context::Stage; use crate::{AttributeParser, ShouldEmit}; @@ -22,12 +22,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { return; } - let name = (attr_path.segments.len() == 1).then_some(attr_path.segments[0].name); - if let Some(name) = name - && [sym::cfg_trace, sym::cfg_attr_trace].contains(&name) - { - return; - } + let name = (attr_path.segments.len() == 1).then_some(attr_path.segments[0]); // FIXME: We should retrieve this information from the attribute parsers instead of from `BUILTIN_ATTRIBUTE_MAP` let builtin_attr_info = name.and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name)); diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs index d9998a15f233..20d00a82cadb 100644 --- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs +++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs @@ -9,6 +9,7 @@ use rustc_feature::AttributeTemplate; use rustc_hir::AttrPath; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_span::{Span, Symbol}; +use rustc_target::spec::TargetTuple; use crate::fluent_generated as fluent; @@ -520,6 +521,9 @@ pub(crate) enum AttributeParseErrorReason<'a> { ExpectedSingleArgument, ExpectedList, ExpectedListOrNoArgs, + ExpectedListWithNumArgsOrMore { + args: usize, + }, ExpectedNameValueOrNoArgs, ExpectedNonEmptyStringLiteral, UnexpectedLiteral, @@ -597,6 +601,9 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> { AttributeParseErrorReason::ExpectedListOrNoArgs => { diag.span_label(self.span, "expected a list or no arguments here"); } + AttributeParseErrorReason::ExpectedListWithNumArgsOrMore { args } => { + diag.span_label(self.span, format!("expected {args} or more items")); + } AttributeParseErrorReason::ExpectedNameValueOrNoArgs => { diag.span_label(self.span, "didn't expect a list here"); } @@ -930,3 +937,12 @@ pub(crate) struct DocAliasMalformed { #[primary_span] pub span: Span, } + +#[derive(Diagnostic)] +#[diag(attr_parsing_unsupported_instruction_set)] +pub(crate) struct UnsupportedInstructionSet<'a> { + #[primary_span] + pub span: Span, + pub instruction_set: Symbol, + pub current_target: &'a TargetTuple, +} diff --git a/compiler/rustc_attr_parsing/src/target_checking.rs b/compiler/rustc_attr_parsing/src/target_checking.rs index 88efb910c160..e86ecb451fc2 100644 --- a/compiler/rustc_attr_parsing/src/target_checking.rs +++ b/compiler/rustc_attr_parsing/src/target_checking.rs @@ -104,7 +104,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> { let (applied, only) = allowed_targets_applied(allowed_targets, target, cx.features); let name = cx.attr_path.clone(); - let lint = if name.segments[0].name == sym::deprecated + let lint = if name.segments[0] == sym::deprecated && ![ Target::Closure, Target::Expression, diff --git a/compiler/rustc_attr_parsing/src/validate_attr.rs b/compiler/rustc_attr_parsing/src/validate_attr.rs index e69ed0eea6b0..f56e85b11061 100644 --- a/compiler/rustc_attr_parsing/src/validate_attr.rs +++ b/compiler/rustc_attr_parsing/src/validate_attr.rs @@ -27,7 +27,7 @@ pub fn check_attr(psess: &ParseSess, attr: &Attribute) { return; } - let builtin_attr_info = attr.ident().and_then(|ident| BUILTIN_ATTRIBUTE_MAP.get(&ident.name)); + let builtin_attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name)); // Check input tokens for built-in and key-value attributes. match builtin_attr_info { @@ -48,7 +48,7 @@ pub fn check_attr(psess: &ParseSess, attr: &Attribute) { } _ => { let attr_item = attr.get_normal_item(); - if let AttrArgs::Eq { .. } = attr_item.args { + if let AttrArgs::Eq { .. } = attr_item.args.unparsed_ref().unwrap() { // All key-value attributes are restricted to meta-item syntax. match parse_meta(psess, attr) { Ok(_) => {} @@ -67,7 +67,7 @@ pub fn parse_meta<'a>(psess: &'a ParseSess, attr: &Attribute) -> PResult<'a, Met unsafety: item.unsafety, span: attr.span, path: item.path.clone(), - kind: match &item.args { + kind: match &item.args.unparsed_ref().unwrap() { AttrArgs::Empty => MetaItemKind::Word, AttrArgs::Delimited(DelimArgs { dspan, delim, tokens }) => { check_meta_bad_delim(psess, *dspan, *delim); diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 097416b4f280..e5aad4cdbd06 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -1581,12 +1581,18 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { .unwrap(); } (None, None) => { + // `struct_tail` returns regions which haven't been mapped + // to nll vars yet so we do it here as `outlives_constraints` + // expects nll vars. + let src_lt = self.universal_regions.to_region_vid(src_lt); + let dst_lt = self.universal_regions.to_region_vid(dst_lt); + // The principalless (no non-auto traits) case: // You can only cast `dyn Send + 'long` to `dyn Send + 'short`. self.constraints.outlives_constraints.push( OutlivesConstraint { - sup: src_lt.as_var(), - sub: dst_lt.as_var(), + sup: src_lt, + sub: dst_lt, locations: location.to_locations(), span: location.to_locations().span(self.body), category: ConstraintCategory::Cast { diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs index a0d5e1ce780d..fda4719fc3f5 100644 --- a/compiler/rustc_borrowck/src/universal_regions.rs +++ b/compiler/rustc_borrowck/src/universal_regions.rs @@ -543,38 +543,9 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> { &indices, ); - let (unnormalized_output_ty, mut unnormalized_input_tys) = + let (unnormalized_output_ty, unnormalized_input_tys) = inputs_and_output.split_last().unwrap(); - // C-variadic fns also have a `VaList` input that's not listed in the signature - // (as it's created inside the body itself, not passed in from outside). - if let DefiningTy::FnDef(def_id, _) = defining_ty { - if self.infcx.tcx.fn_sig(def_id).skip_binder().c_variadic() { - let va_list_did = self - .infcx - .tcx - .require_lang_item(LangItem::VaList, self.infcx.tcx.def_span(self.mir_def)); - - let reg_vid = self - .infcx - .next_nll_region_var(NllRegionVariableOrigin::FreeRegion, || { - RegionCtxt::Free(sym::c_dash_variadic) - }) - .as_var(); - - let region = ty::Region::new_var(self.infcx.tcx, reg_vid); - let va_list_ty = self - .infcx - .tcx - .type_of(va_list_did) - .instantiate(self.infcx.tcx, &[region.into()]); - - unnormalized_input_tys = self.infcx.tcx.mk_type_list_from_iter( - unnormalized_input_tys.iter().copied().chain(iter::once(va_list_ty)), - ); - } - } - let fr_fn_body = self .infcx .next_nll_region_var(NllRegionVariableOrigin::FreeRegion, || { @@ -816,7 +787,40 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> { DefiningTy::FnDef(def_id, _) => { let sig = tcx.fn_sig(def_id).instantiate_identity(); let sig = indices.fold_to_region_vids(tcx, sig); - sig.inputs_and_output() + let inputs_and_output = sig.inputs_and_output(); + + // C-variadic fns also have a `VaList` input that's not listed in the signature + // (as it's created inside the body itself, not passed in from outside). + if self.infcx.tcx.fn_sig(def_id).skip_binder().c_variadic() { + let va_list_did = self + .infcx + .tcx + .require_lang_item(LangItem::VaList, self.infcx.tcx.def_span(self.mir_def)); + + let reg_vid = self + .infcx + .next_nll_region_var(NllRegionVariableOrigin::FreeRegion, || { + RegionCtxt::Free(sym::c_dash_variadic) + }) + .as_var(); + + let region = ty::Region::new_var(self.infcx.tcx, reg_vid); + let va_list_ty = self + .infcx + .tcx + .type_of(va_list_did) + .instantiate(self.infcx.tcx, &[region.into()]); + + // The signature needs to follow the order [input_tys, va_list_ty, output_ty] + return inputs_and_output.map_bound(|tys| { + let (output_ty, input_tys) = tys.split_last().unwrap(); + tcx.mk_type_list_from_iter( + input_tys.iter().copied().chain([va_list_ty, *output_ty]), + ) + }); + } + + inputs_and_output } DefiningTy::Const(def_id, _) => { diff --git a/compiler/rustc_builtin_macros/src/autodiff.rs b/compiler/rustc_builtin_macros/src/autodiff.rs index 39abb66df30c..95191b82ff3f 100644 --- a/compiler/rustc_builtin_macros/src/autodiff.rs +++ b/compiler/rustc_builtin_macros/src/autodiff.rs @@ -358,7 +358,7 @@ mod llvm_enzyme { let inline_item = ast::AttrItem { unsafety: ast::Safety::Default, path: ast::Path::from_ident(Ident::with_dummy_span(sym::inline)), - args: ast::AttrArgs::Delimited(never_arg), + args: rustc_ast::ast::AttrItemKind::Unparsed(ast::AttrArgs::Delimited(never_arg)), tokens: None, }; let inline_never_attr = Box::new(ast::NormalAttr { item: inline_item, tokens: None }); @@ -421,11 +421,13 @@ mod llvm_enzyme { } }; // Now update for d_fn - rustc_ad_attr.item.args = rustc_ast::AttrArgs::Delimited(rustc_ast::DelimArgs { - dspan: DelimSpan::dummy(), - delim: rustc_ast::token::Delimiter::Parenthesis, - tokens: ts, - }); + rustc_ad_attr.item.args = rustc_ast::ast::AttrItemKind::Unparsed( + rustc_ast::AttrArgs::Delimited(rustc_ast::DelimArgs { + dspan: DelimSpan::dummy(), + delim: rustc_ast::token::Delimiter::Parenthesis, + tokens: ts, + }), + ); let new_id = ecx.sess.psess.attr_id_generator.mk_attr_id(); let d_attr = outer_normal_attr(&rustc_ad_attr, new_id, span); diff --git a/compiler/rustc_builtin_macros/src/cfg.rs b/compiler/rustc_builtin_macros/src/cfg.rs index 7bc9080ba022..557daa94b98e 100644 --- a/compiler/rustc_builtin_macros/src/cfg.rs +++ b/compiler/rustc_builtin_macros/src/cfg.rs @@ -13,7 +13,7 @@ use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpa use rustc_hir::AttrPath; use rustc_hir::attrs::CfgEntry; use rustc_parse::exp; -use rustc_span::{ErrorGuaranteed, Ident, Span}; +use rustc_span::{ErrorGuaranteed, Span, sym}; use crate::errors; @@ -47,7 +47,7 @@ fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result bool { impl<'ast> visit::Visitor<'ast> for CfgFinder { type Result = ControlFlow<()>; fn visit_attribute(&mut self, attr: &'ast Attribute) -> ControlFlow<()> { - if attr - .ident() - .is_some_and(|ident| ident.name == sym::cfg || ident.name == sym::cfg_attr) - { + if attr.name().is_some_and(|name| name == sym::cfg || name == sym::cfg_attr) { ControlFlow::Break(()) } else { ControlFlow::Continue(()) diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs index bb6557802ece..7c84530abbee 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs @@ -807,24 +807,29 @@ impl<'a> TraitDef<'a> { rustc_ast::AttrItem { unsafety: Safety::Default, path: rustc_const_unstable, - args: AttrArgs::Delimited(DelimArgs { - dspan: DelimSpan::from_single(self.span), - delim: rustc_ast::token::Delimiter::Parenthesis, - tokens: [ - TokenKind::Ident(sym::feature, IdentIsRaw::No), - TokenKind::Eq, - TokenKind::lit(LitKind::Str, sym::derive_const, None), - TokenKind::Comma, - TokenKind::Ident(sym::issue, IdentIsRaw::No), - TokenKind::Eq, - TokenKind::lit(LitKind::Str, sym::derive_const_issue, None), - ] - .into_iter() - .map(|kind| { - TokenTree::Token(Token { kind, span: self.span }, Spacing::Alone) - }) - .collect(), - }), + args: rustc_ast::ast::AttrItemKind::Unparsed(AttrArgs::Delimited( + DelimArgs { + dspan: DelimSpan::from_single(self.span), + delim: rustc_ast::token::Delimiter::Parenthesis, + tokens: [ + TokenKind::Ident(sym::feature, IdentIsRaw::No), + TokenKind::Eq, + TokenKind::lit(LitKind::Str, sym::derive_const, None), + TokenKind::Comma, + TokenKind::Ident(sym::issue, IdentIsRaw::No), + TokenKind::Eq, + TokenKind::lit(LitKind::Str, sym::derive_const_issue, None), + ] + .into_iter() + .map(|kind| { + TokenTree::Token( + Token { kind, span: self.span }, + Spacing::Alone, + ) + }) + .collect(), + }, + )), tokens: None, }, self.span, diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs index 79228c20d292..3def9a5c015c 100644 --- a/compiler/rustc_codegen_gcc/src/builder.rs +++ b/compiler/rustc_codegen_gcc/src/builder.rs @@ -314,14 +314,12 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { self.block.get_function() } - fn function_call( + pub fn function_call( &mut self, - func: RValue<'gcc>, + func: Function<'gcc>, args: &[RValue<'gcc>], _funclet: Option<&Funclet>, ) -> RValue<'gcc> { - // TODO(antoyo): remove when the API supports a different type for functions. - let func: Function<'gcc> = self.cx.rvalue_as_function(func); let args = self.check_call("call", func, args); // gccjit requires to use the result of functions, even when it's not used. @@ -514,6 +512,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { type CodegenCx = CodegenCx<'gcc, 'tcx>; fn build(cx: &'a CodegenCx<'gcc, 'tcx>, block: Block<'gcc>) -> Builder<'a, 'gcc, 'tcx> { + *cx.current_func.borrow_mut() = Some(block.get_function()); Builder::with_cx(cx, block) } @@ -1765,6 +1764,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { // FIXME(antoyo): remove when having a proper API. let gcc_func = unsafe { std::mem::transmute::, Function<'gcc>>(func) }; let call = if self.functions.borrow().values().any(|value| *value == gcc_func) { + // TODO(antoyo): remove when the API supports a different type for functions. + let func: Function<'gcc> = self.cx.rvalue_as_function(func); self.function_call(func, args, funclet) } else { // If it's a not function that was defined, it's a function pointer. diff --git a/compiler/rustc_codegen_gcc/src/context.rs b/compiler/rustc_codegen_gcc/src/context.rs index dbb89a4ff7db..d200d5319a93 100644 --- a/compiler/rustc_codegen_gcc/src/context.rs +++ b/compiler/rustc_codegen_gcc/src/context.rs @@ -92,6 +92,8 @@ pub struct CodegenCx<'gcc, 'tcx> { pub instances: RefCell, LValue<'gcc>>>, /// Cache function instances of monomorphic and polymorphic items pub function_instances: RefCell, Function<'gcc>>>, + /// Cache function instances of intrinsics + pub intrinsic_instances: RefCell, Function<'gcc>>>, /// Cache generated vtables pub vtables: RefCell, Option>), RValue<'gcc>>>, @@ -280,6 +282,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> { linkage: Cell::new(FunctionType::Internal), instances: Default::default(), function_instances: Default::default(), + intrinsic_instances: Default::default(), on_stack_params: Default::default(), on_stack_function_params: Default::default(), vtables: Default::default(), @@ -391,17 +394,13 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> { } fn get_fn(&self, instance: Instance<'tcx>) -> Function<'gcc> { - let func = get_fn(self, instance); - *self.current_func.borrow_mut() = Some(func); - func + get_fn(self, instance) } fn get_fn_addr(&self, instance: Instance<'tcx>) -> RValue<'gcc> { let func_name = self.tcx.symbol_name(instance).name; - let func = if self.intrinsics.borrow().contains_key(func_name) { - self.intrinsics.borrow()[func_name] - } else if let Some(variable) = self.get_declared_value(func_name) { + let func = if let Some(variable) = self.get_declared_value(func_name) { return variable; } else { get_fn(self, instance) diff --git a/compiler/rustc_codegen_gcc/src/declare.rs b/compiler/rustc_codegen_gcc/src/declare.rs index 42d6fb17a88b..e4130b221ee3 100644 --- a/compiler/rustc_codegen_gcc/src/declare.rs +++ b/compiler/rustc_codegen_gcc/src/declare.rs @@ -8,7 +8,6 @@ use rustc_target::callconv::FnAbi; use crate::abi::{FnAbiGcc, FnAbiGccExt}; use crate::context::CodegenCx; -use crate::intrinsic::llvm; impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> { pub fn get_or_insert_global( @@ -100,18 +99,14 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> { let return_type = self.type_i32(); let variadic = false; self.linkage.set(FunctionType::Exported); - let func = declare_raw_fn( + declare_raw_fn( self, name, callconv, return_type, &[self.type_i32(), const_string], variadic, - ); - // NOTE: it is needed to set the current_func here as well, because get_fn() is not called - // for the main function. - *self.current_func.borrow_mut() = Some(func); - func + ) } pub fn declare_fn(&self, name: &str, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> Function<'gcc> { @@ -166,19 +161,6 @@ fn declare_raw_fn<'gcc>( param_types: &[Type<'gcc>], variadic: bool, ) -> Function<'gcc> { - if name.starts_with("llvm.") { - let intrinsic = match name { - "llvm.fma.f16" => { - // fma is not a target builtin, but a normal builtin, so we handle it differently - // here. - cx.context.get_builtin_function("fma") - } - _ => llvm::intrinsic(name, cx), - }; - - cx.intrinsics.borrow_mut().insert(name.to_string(), intrinsic); - return intrinsic; - } let func = if cx.functions.borrow().contains_key(name) { cx.functions.borrow()[name] } else { diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs index d2714ba7914f..36ea76cbc51a 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs @@ -9,7 +9,7 @@ use gccjit::Type; use gccjit::{ComparisonOp, Function, FunctionType, RValue, ToRValue, UnaryOp}; #[cfg(feature = "master")] use rustc_abi::ExternAbi; -use rustc_abi::{BackendRepr, HasDataLayout}; +use rustc_abi::{BackendRepr, HasDataLayout, WrappingRange}; use rustc_codegen_ssa::MemFlags; use rustc_codegen_ssa::base::wants_msvc_seh; use rustc_codegen_ssa::common::IntPredicate; @@ -20,19 +20,15 @@ use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue}; use rustc_codegen_ssa::traits::MiscCodegenMethods; use rustc_codegen_ssa::traits::{ ArgAbiBuilderMethods, BaseTypeCodegenMethods, BuilderMethods, ConstCodegenMethods, - IntrinsicCallBuilderMethods, + IntrinsicCallBuilderMethods, LayoutTypeCodegenMethods, }; use rustc_middle::bug; -#[cfg(feature = "master")] -use rustc_middle::ty::layout::FnAbiOf; -use rustc_middle::ty::layout::LayoutOf; +use rustc_middle::ty::layout::{FnAbiOf, LayoutOf}; use rustc_middle::ty::{self, Instance, Ty}; use rustc_span::{Span, Symbol, sym}; use rustc_target::callconv::{ArgAbi, PassMode}; -#[cfg(feature = "master")] -use crate::abi::FnAbiGccExt; -use crate::abi::GccType; +use crate::abi::{FnAbiGccExt, GccType}; use crate::builder::Builder; use crate::common::{SignType, TypeReflection}; use crate::context::CodegenCx; @@ -609,6 +605,94 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc Ok(()) } + fn codegen_llvm_intrinsic_call( + &mut self, + instance: ty::Instance<'tcx>, + args: &[OperandRef<'tcx, Self::Value>], + is_cleanup: bool, + ) -> Self::Value { + let func = if let Some(&func) = self.intrinsic_instances.borrow().get(&instance) { + func + } else { + let sym = self.tcx.symbol_name(instance).name; + + let func = if let Some(func) = self.intrinsics.borrow().get(sym) { + *func + } else { + self.linkage.set(FunctionType::Extern); + let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty()); + let fn_ty = fn_abi.gcc_type(self); + + let func = match sym { + "llvm.fma.f16" => { + // fma is not a target builtin, but a normal builtin, so we handle it differently + // here. + self.context.get_builtin_function("fma") + } + _ => llvm::intrinsic(sym, self), + }; + + self.intrinsics.borrow_mut().insert(sym.to_string(), func); + + self.on_stack_function_params + .borrow_mut() + .insert(func, fn_ty.on_stack_param_indices); + #[cfg(feature = "master")] + for fn_attr in fn_ty.fn_attributes { + func.add_attribute(fn_attr); + } + + crate::attributes::from_fn_attrs(self, func, instance); + + func + }; + + self.intrinsic_instances.borrow_mut().insert(instance, func); + + func + }; + let fn_ptr = func.get_address(None); + let fn_ty = fn_ptr.get_type(); + + let mut llargs = vec![]; + + for arg in args { + match arg.val { + OperandValue::ZeroSized => {} + OperandValue::Immediate(_) => llargs.push(arg.immediate()), + OperandValue::Pair(a, b) => { + llargs.push(a); + llargs.push(b); + } + OperandValue::Ref(op_place_val) => { + let mut llval = op_place_val.llval; + // We can't use `PlaceRef::load` here because the argument + // may have a type we don't treat as immediate, but the ABI + // used for this call is passing it by-value. In that case, + // the load would just produce `OperandValue::Ref` instead + // of the `OperandValue::Immediate` we need for the call. + llval = self.load(self.backend_type(arg.layout), llval, op_place_val.align); + if let BackendRepr::Scalar(scalar) = arg.layout.backend_repr { + if scalar.is_bool() { + self.range_metadata(llval, WrappingRange { start: 0, end: 1 }); + } + // We store bools as `i8` so we need to truncate to `i1`. + llval = self.to_immediate_scalar(llval, scalar); + } + llargs.push(llval); + } + } + } + + // FIXME directly use the llvm intrinsic adjustment functions here + let llret = self.call(fn_ty, None, None, fn_ptr, &llargs, None, None); + if is_cleanup { + self.apply_attrs_to_cleanup_callsite(llret); + } + + llret + } + fn abort(&mut self) { let func = self.context.get_builtin_function("abort"); let func: RValue<'gcc> = unsafe { std::mem::transmute(func) }; diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index b40962b759d8..9741436aacb7 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -38,8 +38,6 @@ rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } rustc_symbol_mangling = { path = "../rustc_symbol_mangling" } rustc_target = { path = "../rustc_target" } -serde = { version = "1", features = ["derive"] } -serde_json = "1" smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } tracing = "0.1" # tidy-alphabetical-end diff --git a/compiler/rustc_codegen_llvm/messages.ftl b/compiler/rustc_codegen_llvm/messages.ftl index a637ae8184b4..85cb7499cca4 100644 --- a/compiler/rustc_codegen_llvm/messages.ftl +++ b/compiler/rustc_codegen_llvm/messages.ftl @@ -1,4 +1,7 @@ -codegen_llvm_autodiff_component_unavailable = failed to load our autodiff backend. Did you install it via rustup? +codegen_llvm_autodiff_component_missing = autodiff backend not found in the sysroot: {$err} + .note = it will be distributed via rustup in the future + +codegen_llvm_autodiff_component_unavailable = failed to load our autodiff backend: {$err} codegen_llvm_autodiff_without_enable = using the autodiff feature requires -Z autodiff=Enable codegen_llvm_autodiff_without_lto = using the autodiff feature requires setting `lto="fat"` in your Cargo.toml diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index d87de8b38467..bcadb6f0de92 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -250,7 +250,7 @@ pub(crate) fn target_machine_factory( let use_emulated_tls = matches!(sess.tls_model(), TlsModel::Emulated); - let debuginfo_compression = match sess.opts.debuginfo_compression { + let debuginfo_compression = match sess.opts.unstable_opts.debuginfo_compression { config::DebugInfoCompression::None => llvm::CompressionKind::None, config::DebugInfoCompression::Zlib => { if llvm::LLVMRustLLVMHasZlibCompression() { @@ -1136,7 +1136,7 @@ pub(crate) fn codegen( EmitObj::None => {} } - record_llvm_cgu_instructions_stats(&cgcx.prof, llmod); + record_llvm_cgu_instructions_stats(&cgcx.prof, &module.name, llmod); } // `.dwo` files are only emitted if: @@ -1343,22 +1343,11 @@ fn record_artifact_size( } } -fn record_llvm_cgu_instructions_stats(prof: &SelfProfilerRef, llmod: &llvm::Module) { +fn record_llvm_cgu_instructions_stats(prof: &SelfProfilerRef, name: &str, llmod: &llvm::Module) { if !prof.enabled() { return; } - let raw_stats = - llvm::build_string(|s| unsafe { llvm::LLVMRustModuleInstructionStats(llmod, s) }) - .expect("cannot get module instruction stats"); - - #[derive(serde::Deserialize)] - struct InstructionsStats { - module: String, - total: u64, - } - - let InstructionsStats { module, total } = - serde_json::from_str(&raw_stats).expect("cannot parse llvm cgu instructions stats"); - prof.artifact_size("cgu_instructions", module, total); + let total = unsafe { llvm::LLVMRustModuleInstructionStats(llmod) }; + prof.artifact_size("cgu_instructions", name, total); } diff --git a/compiler/rustc_codegen_llvm/src/base.rs b/compiler/rustc_codegen_llvm/src/base.rs index 388118f9b4f1..d00e70638b45 100644 --- a/compiler/rustc_codegen_llvm/src/base.rs +++ b/compiler/rustc_codegen_llvm/src/base.rs @@ -93,8 +93,13 @@ pub(crate) fn compile_codegen_unit( // They are necessary for correct offload execution. We do this here to simplify the // `offload` intrinsic, avoiding the need for tracking whether it's the first // intrinsic call or not. - let has_host_offload = - cx.sess().opts.unstable_opts.offload.iter().any(|o| matches!(o, Offload::Host(_))); + let has_host_offload = cx + .sess() + .opts + .unstable_opts + .offload + .iter() + .any(|o| matches!(o, Offload::Host(_) | Offload::Test)); if has_host_offload && !cx.sess().target.is_like_gpu { cx.offload_globals.replace(Some(OffloadGlobals::declare(&cx))); } diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 9a9e4dcdbb3c..7a49ba64029e 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -1705,7 +1705,7 @@ impl<'a, 'll, CX: Borrow>> GenericBuilder<'a, 'll, CX> { ret.expect("LLVM does not have support for catchret") } - fn check_call<'b>( + pub(crate) fn check_call<'b>( &mut self, typ: &str, fn_ty: &'ll Type, diff --git a/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs b/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs index 046501d08c48..b8eb4f038216 100644 --- a/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs +++ b/compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs @@ -2,7 +2,9 @@ use std::ffi::CString; use llvm::Linkage::*; use rustc_abi::Align; +use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, BuilderMethods}; +use rustc_middle::bug; use rustc_middle::ty::offload_meta::OffloadMetadata; use crate::builder::Builder; @@ -47,8 +49,9 @@ impl<'ll> OffloadGlobals<'ll> { let bin_desc = cx.type_named_struct("struct.__tgt_bin_desc"); cx.set_struct_body(bin_desc, &tgt_bin_desc_ty, false); - let register_lib = declare_offload_fn(&cx, "__tgt_register_lib", mapper_fn_ty); - let unregister_lib = declare_offload_fn(&cx, "__tgt_unregister_lib", mapper_fn_ty); + let reg_lib_decl = cx.type_func(&[cx.type_ptr()], cx.type_void()); + let register_lib = declare_offload_fn(&cx, "__tgt_register_lib", reg_lib_decl); + let unregister_lib = declare_offload_fn(&cx, "__tgt_unregister_lib", reg_lib_decl); let init_ty = cx.type_func(&[], cx.type_void()); let init_rtls = declare_offload_fn(cx, "__tgt_init_all_rtls", init_ty); @@ -69,6 +72,57 @@ impl<'ll> OffloadGlobals<'ll> { } } +pub(crate) struct OffloadKernelDims<'ll> { + num_workgroups: &'ll Value, + threads_per_block: &'ll Value, + workgroup_dims: &'ll Value, + thread_dims: &'ll Value, +} + +impl<'ll> OffloadKernelDims<'ll> { + pub(crate) fn from_operands<'tcx>( + builder: &mut Builder<'_, 'll, 'tcx>, + workgroup_op: &OperandRef<'tcx, &'ll llvm::Value>, + thread_op: &OperandRef<'tcx, &'ll llvm::Value>, + ) -> Self { + let cx = builder.cx; + let arr_ty = cx.type_array(cx.type_i32(), 3); + let four = Align::from_bytes(4).unwrap(); + + let OperandValue::Ref(place) = workgroup_op.val else { + bug!("expected array operand by reference"); + }; + let workgroup_val = builder.load(arr_ty, place.llval, four); + + let OperandValue::Ref(place) = thread_op.val else { + bug!("expected array operand by reference"); + }; + let thread_val = builder.load(arr_ty, place.llval, four); + + fn mul_dim3<'ll, 'tcx>( + builder: &mut Builder<'_, 'll, 'tcx>, + arr: &'ll Value, + ) -> &'ll Value { + let x = builder.extract_value(arr, 0); + let y = builder.extract_value(arr, 1); + let z = builder.extract_value(arr, 2); + + let xy = builder.mul(x, y); + builder.mul(xy, z) + } + + let num_workgroups = mul_dim3(builder, workgroup_val); + let threads_per_block = mul_dim3(builder, thread_val); + + OffloadKernelDims { + workgroup_dims: workgroup_val, + thread_dims: thread_val, + num_workgroups, + threads_per_block, + } + } +} + // ; Function Attrs: nounwind // declare i32 @__tgt_target_kernel(ptr, i64, i32, i32, ptr, ptr) #2 fn generate_launcher<'ll>(cx: &CodegenCx<'ll, '_>) -> (&'ll llvm::Value, &'ll llvm::Type) { @@ -204,12 +258,12 @@ impl KernelArgsTy { num_args: u64, memtransfer_types: &'ll Value, geps: [&'ll Value; 3], + workgroup_dims: &'ll Value, + thread_dims: &'ll Value, ) -> [(Align, &'ll Value); 13] { let four = Align::from_bytes(4).expect("4 Byte alignment should work"); let eight = Align::EIGHT; - let ti32 = cx.type_i32(); - let ci32_0 = cx.get_const_i32(0); [ (four, cx.get_const_i32(KernelArgsTy::OFFLOAD_VERSION)), (four, cx.get_const_i32(num_args)), @@ -222,8 +276,8 @@ impl KernelArgsTy { (eight, cx.const_null(cx.type_ptr())), // dbg (eight, cx.get_const_i64(KernelArgsTy::TRIPCOUNT)), (eight, cx.get_const_i64(KernelArgsTy::FLAGS)), - (four, cx.const_array(ti32, &[cx.get_const_i32(2097152), ci32_0, ci32_0])), - (four, cx.const_array(ti32, &[cx.get_const_i32(256), ci32_0, ci32_0])), + (four, workgroup_dims), + (four, thread_dims), (four, cx.get_const_i32(0)), ] } @@ -413,10 +467,13 @@ pub(crate) fn gen_call_handling<'ll, 'tcx>( types: &[&Type], metadata: &[OffloadMetadata], offload_globals: &OffloadGlobals<'ll>, + offload_dims: &OffloadKernelDims<'ll>, ) { let cx = builder.cx; let OffloadKernelGlobals { offload_sizes, offload_entry, memtransfer_types, region_id } = offload_data; + let OffloadKernelDims { num_workgroups, threads_per_block, workgroup_dims, thread_dims } = + offload_dims; let tgt_decl = offload_globals.launcher_fn; let tgt_target_kernel_ty = offload_globals.launcher_ty; @@ -430,7 +487,7 @@ pub(crate) fn gen_call_handling<'ll, 'tcx>( let fn_ty = offload_globals.mapper_fn_ty; let num_args = types.len() as u64; - let ip = unsafe { llvm::LLVMRustGetInsertPoint(&builder.llbuilder) }; + let bb = builder.llbb(); // FIXME(Sa4dUs): dummy loads are a temp workaround, we should find a proper way to prevent these // variables from being optimized away @@ -468,7 +525,7 @@ pub(crate) fn gen_call_handling<'ll, 'tcx>( // Step 1) unsafe { - llvm::LLVMRustRestoreInsertPoint(&builder.llbuilder, ip); + llvm::LLVMPositionBuilderAtEnd(&builder.llbuilder, bb); } builder.memset(tgt_bin_desc_alloca, cx.get_const_i8(0), cx.get_const_i64(32), Align::EIGHT); @@ -554,7 +611,8 @@ pub(crate) fn gen_call_handling<'ll, 'tcx>( num_args, s_ident_t, ); - let values = KernelArgsTy::new(&cx, num_args, memtransfer_types, geps); + let values = + KernelArgsTy::new(&cx, num_args, memtransfer_types, geps, workgroup_dims, thread_dims); // Step 3) // Here we fill the KernelArgsTy, see the documentation above @@ -567,9 +625,8 @@ pub(crate) fn gen_call_handling<'ll, 'tcx>( s_ident_t, // FIXME(offload) give users a way to select which GPU to use. cx.get_const_i64(u64::MAX), // MAX == -1. - // FIXME(offload): Don't hardcode the numbers of threads in the future. - cx.get_const_i32(2097152), - cx.get_const_i32(256), + num_workgroups, + threads_per_block, region_id, a5, ]; diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 03da70d48f7d..4b2544b7efdf 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -101,6 +101,8 @@ pub(crate) struct FullCx<'ll, 'tcx> { /// Cache instances of monomorphic and polymorphic items pub instances: RefCell, &'ll Value>>, + /// Cache instances of intrinsics + pub intrinsic_instances: RefCell, &'ll Value>>, /// Cache generated vtables pub vtables: RefCell, Option>), &'ll Value>>, /// Cache of constant strings, @@ -209,6 +211,10 @@ pub(crate) unsafe fn create_module<'ll>( // LLVM 22 updated the NVPTX layout to indicate 256-bit vector load/store: https://github.com/llvm/llvm-project/pull/155198 target_data_layout = target_data_layout.replace("-i256:256", ""); } + if sess.target.arch == Arch::PowerPC64 { + // LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673 + target_data_layout = target_data_layout.replace("-f64:32:64", ""); + } } // Ensure the data-layout values hardcoded remain the defaults. @@ -627,6 +633,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { tls_model, codegen_unit, instances: Default::default(), + intrinsic_instances: Default::default(), vtables: Default::default(), const_str_cache: Default::default(), const_globals: Default::default(), diff --git a/compiler/rustc_codegen_llvm/src/errors.rs b/compiler/rustc_codegen_llvm/src/errors.rs index c73140e041b6..bd42cf556966 100644 --- a/compiler/rustc_codegen_llvm/src/errors.rs +++ b/compiler/rustc_codegen_llvm/src/errors.rs @@ -34,7 +34,16 @@ impl Diagnostic<'_, G> for ParseTargetMachineConfig<'_> { #[derive(Diagnostic)] #[diag(codegen_llvm_autodiff_component_unavailable)] -pub(crate) struct AutoDiffComponentUnavailable; +pub(crate) struct AutoDiffComponentUnavailable { + pub err: String, +} + +#[derive(Diagnostic)] +#[diag(codegen_llvm_autodiff_component_missing)] +#[note] +pub(crate) struct AutoDiffComponentMissing { + pub err: String, +} #[derive(Diagnostic)] #[diag(codegen_llvm_autodiff_without_lto)] diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index 5503f7689304..481f75f337d6 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -1,7 +1,11 @@ use std::assert_matches::assert_matches; use std::cmp::Ordering; +use std::ffi::c_uint; +use std::ptr; -use rustc_abi::{Align, BackendRepr, ExternAbi, Float, HasDataLayout, Primitive, Size}; +use rustc_abi::{ + Align, BackendRepr, ExternAbi, Float, HasDataLayout, Primitive, Size, WrappingRange, +}; use rustc_codegen_ssa::base::{compare_simd_types, wants_msvc_seh, wants_wasm_eh}; use rustc_codegen_ssa::codegen_attrs::autodiff_attrs; use rustc_codegen_ssa::common::{IntPredicate, TypeKind}; @@ -26,8 +30,9 @@ use tracing::debug; use crate::abi::FnAbiLlvmExt; use crate::builder::Builder; use crate::builder::autodiff::{adjust_activity_to_abi, generate_enzyme_call}; -use crate::builder::gpu_offload::{gen_call_handling, gen_define_handling}; +use crate::builder::gpu_offload::{OffloadKernelDims, gen_call_handling, gen_define_handling}; use crate::context::CodegenCx; +use crate::declare::declare_raw_fn; use crate::errors::{ AutoDiffWithoutEnable, AutoDiffWithoutLto, OffloadWithoutEnable, OffloadWithoutFatLTO, }; @@ -633,6 +638,99 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { Ok(()) } + fn codegen_llvm_intrinsic_call( + &mut self, + instance: ty::Instance<'tcx>, + args: &[OperandRef<'tcx, Self::Value>], + is_cleanup: bool, + ) -> Self::Value { + let tcx = self.tcx(); + + // FIXME remove usage of fn_abi + let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty()); + assert!(!fn_abi.ret.is_indirect()); + let fn_ty = fn_abi.llvm_type(self); + + let fn_ptr = if let Some(&llfn) = self.intrinsic_instances.borrow().get(&instance) { + llfn + } else { + let sym = tcx.symbol_name(instance).name; + + // FIXME use get_intrinsic + let llfn = if let Some(llfn) = self.get_declared_value(sym) { + llfn + } else { + // Function addresses in Rust are never significant, allowing functions to + // be merged. + let llfn = declare_raw_fn( + self, + sym, + fn_abi.llvm_cconv(self), + llvm::UnnamedAddr::Global, + llvm::Visibility::Default, + fn_ty, + ); + fn_abi.apply_attrs_llfn(self, llfn, Some(instance)); + + llfn + }; + + self.intrinsic_instances.borrow_mut().insert(instance, llfn); + + llfn + }; + + let mut llargs = vec![]; + + for arg in args { + match arg.val { + OperandValue::ZeroSized => {} + OperandValue::Immediate(_) => llargs.push(arg.immediate()), + OperandValue::Pair(a, b) => { + llargs.push(a); + llargs.push(b); + } + OperandValue::Ref(op_place_val) => { + let mut llval = op_place_val.llval; + // We can't use `PlaceRef::load` here because the argument + // may have a type we don't treat as immediate, but the ABI + // used for this call is passing it by-value. In that case, + // the load would just produce `OperandValue::Ref` instead + // of the `OperandValue::Immediate` we need for the call. + llval = self.load(self.backend_type(arg.layout), llval, op_place_val.align); + if let BackendRepr::Scalar(scalar) = arg.layout.backend_repr { + if scalar.is_bool() { + self.range_metadata(llval, WrappingRange { start: 0, end: 1 }); + } + // We store bools as `i8` so we need to truncate to `i1`. + llval = self.to_immediate_scalar(llval, scalar); + } + llargs.push(llval); + } + } + } + + debug!("call intrinsic {:?} with args ({:?})", instance, llargs); + let args = self.check_call("call", fn_ty, fn_ptr, &llargs); + let llret = unsafe { + llvm::LLVMBuildCallWithOperandBundles( + self.llbuilder, + fn_ty, + fn_ptr, + args.as_ptr() as *const &llvm::Value, + args.len() as c_uint, + ptr::dangling(), + 0, + c"".as_ptr(), + ) + }; + if is_cleanup { + self.apply_attrs_to_cleanup_callsite(llret); + } + + llret + } + fn abort(&mut self) { self.call_intrinsic("llvm.trap", &[], &[]); } @@ -1286,7 +1384,8 @@ fn codegen_offload<'ll, 'tcx>( } }; - let args = get_args_from_tuple(bx, args[1], fn_target); + let offload_dims = OffloadKernelDims::from_operands(bx, &args[1], &args[2]); + let args = get_args_from_tuple(bx, args[3], fn_target); let target_symbol = symbol_name_for_instance_in_crate(tcx, fn_target, LOCAL_CRATE); let sig = tcx.fn_sig(fn_target.def_id()).skip_binder().skip_binder(); @@ -1305,7 +1404,7 @@ fn codegen_offload<'ll, 'tcx>( } }; let offload_data = gen_define_handling(&cx, &metadata, &types, target_symbol, offload_globals); - gen_call_handling(bx, &offload_data, &args, &types, &metadata, offload_globals); + gen_call_handling(bx, &offload_data, &args, &types, &metadata, offload_globals, &offload_dims); } fn get_args_from_tuple<'ll, 'tcx>( diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 095274744993..438a74e0a091 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -249,8 +249,14 @@ impl CodegenBackend for LlvmCodegenBackend { use crate::back::lto::enable_autodiff_settings; if sess.opts.unstable_opts.autodiff.contains(&AutoDiff::Enable) { - if let Err(_) = llvm::EnzymeWrapper::get_or_init(&sess.opts.sysroot) { - sess.dcx().emit_fatal(crate::errors::AutoDiffComponentUnavailable); + match llvm::EnzymeWrapper::get_or_init(&sess.opts.sysroot) { + Ok(_) => {} + Err(llvm::EnzymeLibraryError::NotFound { err }) => { + sess.dcx().emit_fatal(crate::errors::AutoDiffComponentMissing { err }); + } + Err(llvm::EnzymeLibraryError::LoadFailed { err }) => { + sess.dcx().emit_fatal(crate::errors::AutoDiffComponentUnavailable { err }); + } } enable_autodiff_settings(&sess.opts.unstable_opts.autodiff); } diff --git a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs index b11310b970d0..67fbc0f53adc 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs @@ -153,7 +153,7 @@ pub(crate) mod Enzyme_AD { fn load_ptr_by_symbol_mut_void( lib: &libloading::Library, bytes: &[u8], - ) -> Result<*mut c_void, Box> { + ) -> Result<*mut c_void, libloading::Error> { unsafe { let s: libloading::Symbol<'_, *mut c_void> = lib.get(bytes)?; // libloading = 0.9.0: try_as_raw_ptr always succeeds and returns Some @@ -192,15 +192,27 @@ pub(crate) mod Enzyme_AD { static ENZYME_INSTANCE: OnceLock> = OnceLock::new(); + #[derive(Debug)] + pub(crate) enum EnzymeLibraryError { + NotFound { err: String }, + LoadFailed { err: String }, + } + + impl From for EnzymeLibraryError { + fn from(err: libloading::Error) -> Self { + Self::LoadFailed { err: format!("{err:?}") } + } + } + impl EnzymeWrapper { /// Initialize EnzymeWrapper with the given sysroot if not already initialized. /// Safe to call multiple times - subsequent calls are no-ops due to OnceLock. pub(crate) fn get_or_init( sysroot: &rustc_session::config::Sysroot, - ) -> Result, Box> { + ) -> Result, EnzymeLibraryError> { let mtx: &'static Mutex = ENZYME_INSTANCE.get_or_try_init(|| { let w = Self::call_dynamic(sysroot)?; - Ok::<_, Box>(Mutex::new(w)) + Ok::<_, EnzymeLibraryError>(Mutex::new(w)) })?; Ok(mtx.lock().unwrap()) @@ -351,7 +363,7 @@ pub(crate) mod Enzyme_AD { #[allow(non_snake_case)] fn call_dynamic( sysroot: &rustc_session::config::Sysroot, - ) -> Result> { + ) -> Result { let enzyme_path = Self::get_enzyme_path(sysroot)?; let lib = unsafe { libloading::Library::new(enzyme_path)? }; @@ -416,7 +428,7 @@ pub(crate) mod Enzyme_AD { }) } - fn get_enzyme_path(sysroot: &Sysroot) -> Result { + fn get_enzyme_path(sysroot: &Sysroot) -> Result { let llvm_version_major = unsafe { LLVMRustVersionMajor() }; let path_buf = sysroot @@ -434,15 +446,19 @@ pub(crate) mod Enzyme_AD { .map(|p| p.join("lib").display().to_string()) .collect::>() .join("\n* "); - format!( - "failed to find a `libEnzyme-{llvm_version_major}` folder \ + EnzymeLibraryError::NotFound { + err: format!( + "failed to find a `libEnzyme-{llvm_version_major}` folder \ in the sysroot candidates:\n* {candidates}" - ) + ), + } })?; Ok(path_buf .to_str() - .ok_or_else(|| format!("invalid UTF-8 in path: {}", path_buf.display()))? + .ok_or_else(|| EnzymeLibraryError::LoadFailed { + err: format!("invalid UTF-8 in path: {}", path_buf.display()), + })? .to_string()) } } diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 75b3e5955b78..a90013801c8c 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -2443,8 +2443,6 @@ unsafe extern "C" { pub(crate) fn LLVMRustPositionBuilderPastAllocas<'a>(B: &Builder<'a>, Fn: &'a Value); pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock); - pub(crate) fn LLVMRustGetInsertPoint<'a>(B: &Builder<'a>) -> &'a Value; - pub(crate) fn LLVMRustRestoreInsertPoint<'a>(B: &Builder<'a>, IP: &'a Value); pub(crate) fn LLVMRustSetModulePICLevel(M: &Module); pub(crate) fn LLVMRustSetModulePIELevel(M: &Module); @@ -2454,7 +2452,7 @@ unsafe extern "C" { pub(crate) fn LLVMRustModuleBufferLen(p: &ModuleBuffer) -> usize; pub(crate) fn LLVMRustModuleBufferFree(p: &'static mut ModuleBuffer); pub(crate) fn LLVMRustModuleCost(M: &Module) -> u64; - pub(crate) fn LLVMRustModuleInstructionStats(M: &Module, Str: &RustString); + pub(crate) fn LLVMRustModuleInstructionStats(M: &Module) -> u64; pub(crate) fn LLVMRustThinLTOBufferCreate( M: &Module, diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index 01181ce26184..9b08f4e9869c 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -262,6 +262,11 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option Some(LLVMFeature::new("crypto")), s => Some(LLVMFeature::new(s)), }, + Arch::RiscV32 | Arch::RiscV64 => match s { + // Filter out Rust-specific *virtual* target feature + "zkne_or_zknd" => None, + s => Some(LLVMFeature::new(s)), + }, Arch::Sparc | Arch::Sparc64 => match s { "leoncasa" => Some(LLVMFeature::new("hasleoncasa")), s => Some(LLVMFeature::new(s)), diff --git a/compiler/rustc_codegen_ssa/messages.ftl b/compiler/rustc_codegen_ssa/messages.ftl index ff78bea5b67c..1d87dc5da8d2 100644 --- a/compiler/rustc_codegen_ssa/messages.ftl +++ b/compiler/rustc_codegen_ssa/messages.ftl @@ -8,8 +8,6 @@ codegen_ssa_aix_strip_not_used = using host's `strip` binary to cross-compile to codegen_ssa_archive_build_failure = failed to build archive at `{$path}`: {$error} -codegen_ssa_bare_instruction_set = `#[instruction_set]` requires an argument - codegen_ssa_binary_output_to_tty = option `-o` or `--emit` is used to write binary output type `{$shorthand}` to stdout, but stdout is a tty codegen_ssa_cgu_not_recorded = @@ -90,8 +88,6 @@ codegen_ssa_incorrect_cgu_reuse_type = codegen_ssa_insufficient_vs_code_product = VS Code is a different product, and is not sufficient. -codegen_ssa_invalid_instruction_set = invalid instruction set specified - codegen_ssa_invalid_literal_value = invalid literal value .label = value must be an integer between `0` and `255` @@ -215,8 +211,6 @@ codegen_ssa_msvc_missing_linker = the msvc targets depend on the msvc linker but codegen_ssa_multiple_external_func_decl = multiple declarations of external function `{$function}` from library `{$library_name}` have different calling conventions -codegen_ssa_multiple_instruction_set = cannot specify more than one instruction set - codegen_ssa_multiple_main_functions = entry symbol `main` declared multiple times .help = did you use `#[no_mangle]` on `fn main`? Use `#![no_main]` to suppress the usual Rust-generated entry point @@ -383,8 +377,6 @@ codegen_ssa_unstable_ctarget_feature = unstable feature specified for `-Ctarget-feature`: `{$feature}` .note = this feature is not stably supported; its behavior can change in the future -codegen_ssa_unsupported_instruction_set = target does not support `#[instruction_set]` - codegen_ssa_unsupported_link_self_contained = option `-C link-self-contained` is not supported on this target codegen_ssa_use_cargo_directive = use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 6dff79374f20..8a2a6823fdf4 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -330,14 +330,12 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 { let mut e_flags: u32 = 0x0; // Check if compression is enabled - // `unstable_target_features` is used here because "zca" is gated behind riscv_target_feature. - if sess.unstable_target_features.contains(&sym::zca) { + if sess.target_features.contains(&sym::zca) { e_flags |= elf::EF_RISCV_RVC; } // Check if RVTSO is enabled - // `unstable_target_features` is used here because "ztso" is gated behind riscv_target_feature. - if sess.unstable_target_features.contains(&sym::ztso) { + if sess.target_features.contains(&sym::ztso) { e_flags |= elf::EF_RISCV_TSO; } diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 8ab0b367f08a..c8aa7c04585c 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -6,7 +6,8 @@ use std::time::{Duration, Instant}; use itertools::Itertools; use rustc_abi::FIRST_VARIANT; use rustc_ast::expand::allocator::{ - ALLOC_ERROR_HANDLER, ALLOCATOR_METHODS, AllocatorKind, AllocatorMethod, AllocatorTy, + ALLOC_ERROR_HANDLER, ALLOCATOR_METHODS, AllocatorKind, AllocatorMethod, AllocatorMethodInput, + AllocatorTy, }; use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry}; @@ -671,7 +672,7 @@ pub fn allocator_shim_contents(tcx: TyCtxt<'_>, kind: AllocatorKind) -> Vec( } } -// FIXME(jdonszelmann): remove when instruction_set becomes a parsed attr -fn parse_instruction_set_attr(tcx: TyCtxt<'_>, attr: &Attribute) -> Option { - let list = attr.meta_item_list()?; - - match &list[..] { - [MetaItemInner::MetaItem(set)] => { - let segments = set.path.segments.iter().map(|x| x.ident.name).collect::>(); - match segments.as_slice() { - [sym::arm, sym::a32 | sym::t32] if !tcx.sess.target.has_thumb_interworking => { - tcx.dcx().emit_err(errors::UnsupportedInstructionSet { span: attr.span() }); - None - } - [sym::arm, sym::a32] => Some(InstructionSetAttr::ArmA32), - [sym::arm, sym::t32] => Some(InstructionSetAttr::ArmT32), - _ => { - tcx.dcx().emit_err(errors::InvalidInstructionSet { span: attr.span() }); - None - } - } - } - [] => { - tcx.dcx().emit_err(errors::BareInstructionSet { span: attr.span() }); - None - } - _ => { - tcx.dcx().emit_err(errors::MultipleInstructionSet { span: attr.span() }); - None - } - } -} - // FIXME(jdonszelmann): remove when patchable_function_entry becomes a parsed attr fn parse_patchable_function_entry( tcx: TyCtxt<'_>, @@ -353,11 +320,14 @@ fn process_builtin_attrs( AttributeKind::ThreadLocal => { codegen_fn_attrs.flags |= CodegenFnAttrFlags::THREAD_LOCAL } + AttributeKind::InstructionSet(instruction_set) => { + codegen_fn_attrs.instruction_set = Some(*instruction_set) + } _ => {} } } - let Some(Ident { name, .. }) = attr.ident() else { + let Some(name) = attr.name() else { continue; }; @@ -369,9 +339,6 @@ fn process_builtin_attrs( sym::rustc_allocator_zeroed => { codegen_fn_attrs.flags |= CodegenFnAttrFlags::ALLOCATOR_ZEROED } - sym::instruction_set => { - codegen_fn_attrs.instruction_set = parse_instruction_set_attr(tcx, attr) - } sym::patchable_function_entry => { codegen_fn_attrs.patchable_function_entry = parse_patchable_function_entry(tcx, attr); diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index 18279a4d05fe..02476a332252 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -260,7 +260,7 @@ fn push_debuginfo_type_name<'tcx>( .map(|bound| { let ExistentialProjection { def_id: item_def_id, term, .. } = tcx.instantiate_bound_regions_with_erased(bound); - // FIXME(associated_const_equality): allow for consts here + // FIXME(mgca): allow for consts here (item_def_id, term.expect_type()) }) .collect(); diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index c3d63e332989..95306c140895 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -136,34 +136,6 @@ pub(crate) struct RequiresRustAbi { pub span: Span, } -#[derive(Diagnostic)] -#[diag(codegen_ssa_unsupported_instruction_set, code = E0779)] -pub(crate) struct UnsupportedInstructionSet { - #[primary_span] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag(codegen_ssa_invalid_instruction_set, code = E0779)] -pub(crate) struct InvalidInstructionSet { - #[primary_span] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag(codegen_ssa_bare_instruction_set, code = E0778)] -pub(crate) struct BareInstructionSet { - #[primary_span] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag(codegen_ssa_multiple_instruction_set, code = E0779)] -pub(crate) struct MultipleInstructionSet { - #[primary_span] - pub span: Span, -} - #[derive(Diagnostic)] #[diag(codegen_ssa_expected_name_value_pair)] pub(crate) struct ExpectedNameValuePair { diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index cce33107e2c2..d22546dee565 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -9,12 +9,12 @@ use rustc_lint_defs::builtin::TAIL_CALL_TRACK_CALLER; use rustc_middle::mir::{self, AssertKind, InlineAsmMacro, SwitchTargets, UnwindTerminateReason}; use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, ValidityRequirement}; use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths}; -use rustc_middle::ty::{self, Instance, Ty}; +use rustc_middle::ty::{self, Instance, Ty, TypeVisitableExt}; use rustc_middle::{bug, span_bug}; use rustc_session::config::OptLevel; use rustc_span::Span; use rustc_span::source_map::Spanned; -use rustc_target::callconv::{ArgAbi, CastTarget, FnAbi, PassMode}; +use rustc_target::callconv::{ArgAbi, ArgAttributes, CastTarget, FnAbi, PassMode}; use tracing::{debug, info}; use super::operand::OperandRef; @@ -1036,6 +1036,59 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { _ => bug!("{} is not callable", callee.layout.ty), }; + if let Some(instance) = instance + && let Some(name) = bx.tcx().codegen_fn_attrs(instance.def_id()).symbol_name + && name.as_str().starts_with("llvm.") + // This is the only LLVM intrinsic we use that unwinds + // FIXME either add unwind support to codegen_llvm_intrinsic_call or replace usage of + // this intrinsic with something else + && name.as_str() != "llvm.wasm.throw" + { + assert!(!instance.args.has_infer()); + assert!(!instance.args.has_escaping_bound_vars()); + + let result_layout = + self.cx.layout_of(self.monomorphized_place_ty(destination.as_ref())); + + let return_dest = if result_layout.is_zst() { + ReturnDest::Nothing + } else if let Some(index) = destination.as_local() { + match self.locals[index] { + LocalRef::Place(dest) => ReturnDest::Store(dest), + LocalRef::UnsizedPlace(_) => bug!("return type must be sized"), + LocalRef::PendingOperand => { + // Handle temporary places, specifically `Operand` ones, as + // they don't have `alloca`s. + ReturnDest::DirectOperand(index) + } + LocalRef::Operand(_) => bug!("place local already assigned to"), + } + } else { + ReturnDest::Store(self.codegen_place(bx, destination.as_ref())) + }; + + let args = + args.into_iter().map(|arg| self.codegen_operand(bx, &arg.node)).collect::>(); + + self.set_debug_loc(bx, source_info); + + let llret = + bx.codegen_llvm_intrinsic_call(instance, &args, self.mir[helper.bb].is_cleanup); + + if let Some(target) = target { + self.store_return( + bx, + return_dest, + &ArgAbi { layout: result_layout, mode: PassMode::Direct(ArgAttributes::new()) }, + llret, + ); + return helper.funclet_br(self, bx, target, mergeable_succ); + } else { + bx.unreachable(); + return MergingSucc::False; + } + } + // FIXME(eddyb) avoid computing this if possible, when `instance` is // available - right now `sig` is only needed for getting the `abi` // and figuring out how many extra args were passed to a C-variadic `fn`. diff --git a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs index f068a51f7d4a..2f93f688c316 100644 --- a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs +++ b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs @@ -2,7 +2,7 @@ use std::collections::hash_map::Entry; use std::marker::PhantomData; use std::ops::Range; -use rustc_abi::{BackendRepr, FieldIdx, FieldsShape, ScalableElt, Size, VariantIdx}; +use rustc_abi::{BackendRepr, FieldIdx, FieldsShape, Size, VariantIdx}; use rustc_data_structures::fx::FxHashMap; use rustc_index::IndexVec; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; @@ -431,22 +431,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // Internally, with an intrinsic operating on a `svint32_t`/`` // (for example), the intrinsic takes the `svbool_t`/`` predicate // and casts it to a `svbool4_t`/``. Therefore, it's important that - // the `` never spills because that'll cause errors during + // the `` never spills because that'll cause errors during // instruction selection. Spilling to the stack to create debuginfo for these - // intermediate values must be avoided and won't degrade the debugging experience - // anyway. + // intermediate values must be avoided and doing so won't affect the + // debugging experience anyway. if operand.layout.ty.is_scalable_vector() && bx.sess().target.arch == rustc_target::spec::Arch::AArch64 - && let ty::Adt(adt, args) = &operand.layout.ty.kind() - && let Some(marker_type_field) = - adt.non_enum_variant().fields.get(FieldIdx::from_u32(0)) { - let marker_type = marker_type_field.ty(bx.tcx(), args); + let (count, element_ty) = + operand.layout.ty.scalable_vector_element_count_and_type(bx.tcx()); // i.e. `` when `N != 16` - if let ty::Slice(element_ty) = marker_type.kind() - && element_ty.is_bool() - && adt.repr().scalable != Some(ScalableElt::ElementCount(16)) - { + if element_ty.is_bool() && count != 16 { return; } } diff --git a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs index 4a47799b2bdc..4bbb7470debe 100644 --- a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs +++ b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs @@ -181,7 +181,8 @@ fn prefix_and_suffix<'tcx>( } } Linkage::Internal => { - // write nothing + // LTO can fail when internal linkage is used. + emit_fatal("naked functions may not have internal linkage") } Linkage::Common => emit_fatal("Functions may not have common linkage"), Linkage::AvailableExternally => { diff --git a/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs b/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs index 187e4b90656a..04183c2801e7 100644 --- a/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs +++ b/compiler/rustc_codegen_ssa/src/traits/intrinsic.rs @@ -25,6 +25,13 @@ pub trait IntrinsicCallBuilderMethods<'tcx>: BackendTypes { span: Span, ) -> Result<(), ty::Instance<'tcx>>; + fn codegen_llvm_intrinsic_call( + &mut self, + instance: ty::Instance<'tcx>, + args: &[OperandRef<'tcx, Self::Value>], + is_cleanup: bool, + ) -> Self::Value; + fn abort(&mut self); fn assume(&mut self, val: Self::Value); fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value; diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs index ed2c0bd6f98e..b06b407a6085 100644 --- a/compiler/rustc_const_eval/src/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/check_consts/check.rs @@ -251,7 +251,7 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> { let mut transient = DenseBitSet::new_filled(ccx.body.local_decls.len()); // Make sure to only visit reachable blocks, the dataflow engine can ICE otherwise. for (bb, data) in traversal::reachable(&ccx.body) { - if matches!(data.terminator().kind, TerminatorKind::Return) { + if data.terminator().kind == TerminatorKind::Return { let location = ccx.body.terminator_loc(bb); maybe_storage_live.seek_after_primary_effect(location); // If a local may be live here, it is definitely not transient. diff --git a/compiler/rustc_const_eval/src/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/check_consts/qualifs.rs index 42943648ffdd..113e0d66c48a 100644 --- a/compiler/rustc_const_eval/src/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/check_consts/qualifs.rs @@ -312,7 +312,7 @@ where // i.e., we treat all qualifs as non-structural for deref projections. Generally, // we can say very little about `*ptr` even if we know that `ptr` satisfies all // sorts of properties. - if matches!(elem, ProjectionElem::Deref) { + if elem == ProjectionElem::Deref { // We have to assume that this qualifies. return true; } diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs index 312ebe7ddd09..94c6fd1b3238 100644 --- a/compiler/rustc_const_eval/src/interpret/call.rs +++ b/compiler/rustc_const_eval/src/interpret/call.rs @@ -283,7 +283,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { 'tcx: 'y, { assert_eq!(callee_ty, callee_abi.layout.ty); - if matches!(callee_abi.mode, PassMode::Ignore) { + if callee_abi.mode == PassMode::Ignore { // This one is skipped. Still must be made live though! if !already_live { self.storage_live(callee_arg.as_local().unwrap())?; diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs index 44c817b33184..d70d157d8808 100644 --- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs +++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs @@ -861,7 +861,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { } } else { // unsigned - if matches!(mir_op, BinOp::Add) { + if mir_op == BinOp::Add { // max unsigned Scalar::from_uint(size.unsigned_int_max(), size) } else { diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index bac3a9da48d9..862fe4779080 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -327,7 +327,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { return Err(ConstEvalErrKind::ConstMakeGlobalWithOffset(ptr)).into(); } - if matches!(self.tcx.try_get_global_alloc(alloc_id), Some(_)) { + if self.tcx.try_get_global_alloc(alloc_id).is_some() { // This points to something outside the current interpreter. return Err(ConstEvalErrKind::ConstMakeGlobalPtrIsNonHeap(ptr)).into(); } @@ -981,7 +981,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { msg: CheckInAllocMsg, ) -> InterpResult<'tcx, (Size, Align)> { let info = self.get_alloc_info(id); - if matches!(info.kind, AllocKind::Dead) { + if info.kind == AllocKind::Dead { throw_ub!(PointerUseAfterFree(id, msg)) } interp_ok((info.size, info.align)) @@ -1072,7 +1072,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { // Recurse, if there is data here. // Do this *before* invoking the callback, as the callback might mutate the // allocation and e.g. replace all provenance by wildcards! - if matches!(info.kind, AllocKind::LiveData) { + if info.kind == AllocKind::LiveData { let alloc = self.get_alloc_raw(id)?; for prov in alloc.provenance().provenances() { if let Some(id) = prov.get_alloc_id() { @@ -1605,7 +1605,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { match self.ptr_try_get_alloc_id(ptr, 0) { Ok((alloc_id, offset, _)) => { let info = self.get_alloc_info(alloc_id); - if matches!(info.kind, AllocKind::TypeId) { + if info.kind == AllocKind::TypeId { // We *could* actually precisely answer this question since here, // the offset *is* the integer value. But the entire point of making // this a pointer is not to leak the integer value, so we say everything diff --git a/compiler/rustc_error_codes/src/error_codes/E0778.md b/compiler/rustc_error_codes/src/error_codes/E0778.md index 467362dca58f..4bdf85451c9b 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0778.md +++ b/compiler/rustc_error_codes/src/error_codes/E0778.md @@ -1,8 +1,9 @@ +#### Note: this error code is no longer emitted by the compiler The `instruction_set` attribute was malformed. Erroneous code example: -```compile_fail,E0778 +```compile_fail #![feature(isa_attribute)] #[instruction_set()] // error: expected one argument diff --git a/compiler/rustc_error_codes/src/error_codes/E0779.md b/compiler/rustc_error_codes/src/error_codes/E0779.md index 146e20c26265..036931379a06 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0779.md +++ b/compiler/rustc_error_codes/src/error_codes/E0779.md @@ -1,8 +1,9 @@ +#### Note: this error code is no longer emitted by the compiler An unknown argument was given to the `instruction_set` attribute. Erroneous code example: -```compile_fail,E0779 +```compile_fail #![feature(isa_attribute)] #[instruction_set(intel::x64)] // error: invalid argument diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 492c845df171..28f711f362bd 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -7,8 +7,8 @@ use rustc_ast::tokenstream::{ AttrTokenStream, AttrTokenTree, LazyAttrTokenStream, Spacing, TokenTree, }; use rustc_ast::{ - self as ast, AttrKind, AttrStyle, Attribute, HasAttrs, HasTokens, MetaItem, MetaItemInner, - NodeId, NormalAttr, + self as ast, AttrItemKind, AttrKind, AttrStyle, Attribute, EarlyParsedAttribute, HasAttrs, + HasTokens, MetaItem, MetaItemInner, NodeId, NormalAttr, }; use rustc_attr_parsing as attr; use rustc_attr_parsing::{ @@ -288,7 +288,9 @@ impl<'a> StripUnconfigured<'a> { pub(crate) fn expand_cfg_attr(&self, cfg_attr: &Attribute, recursive: bool) -> Vec { // A trace attribute left in AST in place of the original `cfg_attr` attribute. // It can later be used by lints or other diagnostics. - let trace_attr = attr_into_trace(cfg_attr.clone(), sym::cfg_attr_trace); + let mut trace_attr = cfg_attr.clone(); + trace_attr.replace_args(AttrItemKind::Parsed(EarlyParsedAttribute::CfgAttrTrace)); + let trace_attr = attr_into_trace(trace_attr, sym::cfg_attr_trace); let Some((cfg_predicate, expanded_attrs)) = rustc_attr_parsing::parse_cfg_attr(cfg_attr, &self.sess, self.features) diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index 6422779e13c9..c130d9f59940 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -7,12 +7,16 @@ use rustc_ast::mut_visit::*; use rustc_ast::tokenstream::TokenStream; use rustc_ast::visit::{self, AssocCtxt, Visitor, VisitorResult, try_visit, walk_list}; use rustc_ast::{ - self as ast, AssocItemKind, AstNodeWrapper, AttrArgs, AttrStyle, AttrVec, DUMMY_NODE_ID, - ExprKind, ForeignItemKind, HasAttrs, HasNodeId, Inline, ItemKind, MacStmtStyle, MetaItemInner, - MetaItemKind, ModKind, NodeId, PatKind, StmtKind, TyKind, token, + self as ast, AssocItemKind, AstNodeWrapper, AttrArgs, AttrItemKind, AttrStyle, AttrVec, + DUMMY_NODE_ID, EarlyParsedAttribute, ExprKind, ForeignItemKind, HasAttrs, HasNodeId, Inline, + ItemKind, MacStmtStyle, MetaItemInner, MetaItemKind, ModKind, NodeId, PatKind, StmtKind, + TyKind, token, }; use rustc_ast_pretty::pprust; -use rustc_attr_parsing::{AttributeParser, Early, EvalConfigResult, ShouldEmit, validate_attr}; +use rustc_attr_parsing::{ + AttributeParser, CFG_TEMPLATE, Early, EvalConfigResult, ShouldEmit, eval_config_entry, + parse_cfg, validate_attr, +}; use rustc_data_structures::flat_map_in_place::FlatMapInPlace; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_errors::PResult; @@ -813,10 +817,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> { }; let attr_item = attr.get_normal_item(); let safety = attr_item.unsafety; - if let AttrArgs::Eq { .. } = attr_item.args { + if let AttrArgs::Eq { .. } = attr_item.args.unparsed_ref().unwrap() { self.cx.dcx().emit_err(UnsupportedKeyValue { span }); } - let inner_tokens = attr_item.args.inner_tokens(); + let inner_tokens = attr_item.args.unparsed_ref().unwrap().inner_tokens(); match expander.expand_with_safety(self.cx, safety, span, inner_tokens, tokens) { Ok(tok_result) => { let fragment = self.parse_ast_fragment( @@ -2110,7 +2114,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { let mut attr_pos = None; for (pos, attr) in item.attrs().iter().enumerate() { if !attr.is_doc_comment() && !self.cx.expanded_inert_attrs.is_marked(attr) { - let name = attr.ident().map(|ident| ident.name); + let name = attr.name(); if name == Some(sym::cfg) || name == Some(sym::cfg_attr) { cfg_pos = Some(pos); // a cfg attr found, no need to search anymore break; @@ -2187,22 +2191,18 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { } else if rustc_attr_parsing::is_builtin_attr(attr) && !AttributeParser::::is_parsed_attribute(&attr.path()) { - let attr_name = attr.ident().unwrap().name; - // `#[cfg]` and `#[cfg_attr]` are special - they are - // eagerly evaluated. - if attr_name != sym::cfg_trace && attr_name != sym::cfg_attr_trace { - self.cx.sess.psess.buffer_lint( - UNUSED_ATTRIBUTES, - attr.span, - self.cx.current_expansion.lint_node_id, - crate::errors::UnusedBuiltinAttribute { - attr_name, - macro_name: pprust::path_to_string(&call.path), - invoc_span: call.path.span, - attr_span: attr.span, - }, - ); - } + let attr_name = attr.name().unwrap(); + self.cx.sess.psess.buffer_lint( + UNUSED_ATTRIBUTES, + attr.span, + self.cx.current_expansion.lint_node_id, + crate::errors::UnusedBuiltinAttribute { + attr_name, + macro_name: pprust::path_to_string(&call.path), + invoc_span: call.path.span, + attr_span: attr.span, + }, + ); } } } @@ -2213,11 +2213,26 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { attr: ast::Attribute, pos: usize, ) -> EvalConfigResult { - let res = self.cfg().cfg_true(&attr, ShouldEmit::ErrorsAndLints); + let Some(cfg) = AttributeParser::parse_single( + self.cfg().sess, + &attr, + attr.span, + self.cfg().lint_node_id, + self.cfg().features, + ShouldEmit::ErrorsAndLints, + parse_cfg, + &CFG_TEMPLATE, + ) else { + // Cfg attribute was not parsable, give up + return EvalConfigResult::True; + }; + + let res = eval_config_entry(self.cfg().sess, &cfg); if res.as_bool() { // A trace attribute left in AST in place of the original `cfg` attribute. // It can later be used by lints or other diagnostics. - let trace_attr = attr_into_trace(attr, sym::cfg_trace); + let mut trace_attr = attr_into_trace(attr, sym::cfg_trace); + trace_attr.replace_args(AttrItemKind::Parsed(EarlyParsedAttribute::CfgTrace(cfg))); node.visit_attrs(|attrs| attrs.insert(pos, trace_attr)); } diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index dddd62a4945a..d53d180a4ab9 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -558,25 +558,20 @@ fn metavar_expr_concat<'tx>( MetaVarExprConcatElem::Ident(elem) => elem.name, MetaVarExprConcatElem::Literal(elem) => *elem, MetaVarExprConcatElem::Var(ident) => { - match matched_from_ident(dcx, *ident, tscx.interp)? { - NamedMatch::MatchedSeq(named_matches) => { - let Some((curr_idx, _)) = tscx.repeats.last() else { - return Err(dcx.struct_span_err(dspan.entire(), "invalid syntax")); - }; - match &named_matches[*curr_idx] { - // FIXME(c410-f3r) Nested repetitions are unimplemented - MatchedSeq(_) => { - return Err(dcx.struct_span_err( - ident.span, - "nested repetitions with `${concat(...)}` metavariable expressions are not yet supported", - )); - } - MatchedSingle(pnr) => extract_symbol_from_pnr(dcx, pnr, ident.span)?, - } - } - NamedMatch::MatchedSingle(pnr) => { + let key = MacroRulesNormalizedIdent::new(*ident); + match lookup_cur_matched(key, tscx.interp, &tscx.repeats) { + Some(NamedMatch::MatchedSingle(pnr)) => { extract_symbol_from_pnr(dcx, pnr, ident.span)? } + Some(NamedMatch::MatchedSeq(..)) => { + return Err(dcx.struct_span_err( + ident.span, + "`${concat(...)}` variable is still repeating at this depth", + )); + } + None => { + return Err(dcx.create_err(MveUnrecognizedVar { span: ident.span, key })); + } } } }; diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index e5d66364c2a6..6aaf4542260c 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -60,6 +60,9 @@ declare_features! ( (removed, allocator, "1.0.0", None, None), /// Allows a test to fail without failing the whole suite. (removed, allow_fail, "1.60.0", Some(46488), Some("removed due to no clear use cases"), 93416), + /// Allows users to enforce equality of associated constants `TraitImpl`. + (removed, associated_const_equality, "CURRENT_RUSTC_VERSION", Some(92827), + Some("merged into `min_generic_const_args`")), (removed, await_macro, "1.38.0", Some(50547), Some("subsumed by `.await` syntax"), 62293), /// Allows using the `box $expr` syntax. @@ -271,6 +274,8 @@ declare_features! ( /// Allows `#[link(kind = "static-nobundle", ...)]`. (removed, static_nobundle, "1.63.0", Some(37403), Some(r#"subsumed by `#[link(kind = "static", modifiers = "-bundle", ...)]`"#), 95818), + /// Allows string patterns to dereference values to match them. + (removed, string_deref_patterns, "CURRENT_RUSTC_VERSION", Some(87121), Some("superseded by `deref_patterns`"), 150530), (removed, struct_inherit, "1.0.0", None, None), (removed, test_removed_feature, "1.0.0", None, None), /// Allows using items which are missing stability attributes diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 692cba8035c4..387a01967ae5 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -239,22 +239,16 @@ declare_features! ( (internal, negative_bounds, "1.71.0", None), /// Set the maximum pattern complexity allowed (not limited by default). (internal, pattern_complexity_limit, "1.78.0", None), - /// Allows using pattern types. - (internal, pattern_types, "1.79.0", Some(123646)), /// Allows using `#[prelude_import]` on glob `use` items. (internal, prelude_import, "1.2.0", None), /// Used to identify crates that contain the profiler runtime. (internal, profiler_runtime, "1.18.0", None), /// Allows using `rustc_*` attributes (RFC 572). (internal, rustc_attrs, "1.0.0", None), - /// Introduces a hierarchy of `Sized` traits (RFC 3729). - (unstable, sized_hierarchy, "1.89.0", None), /// Allows using the `#[stable]` and `#[unstable]` attributes. (internal, staged_api, "1.0.0", None), /// Added for testing unstable lints; perma-unstable. (internal, test_unstable_lint, "1.60.0", None), - /// Helps with formatting for `group_imports = "StdExternalCrate"`. - (unstable, unqualified_local_imports, "1.83.0", Some(138299)), /// Use for stable + negative coherence and strict coherence depending on trait's /// rustc_strict_coherence value. (unstable, with_negative_coherence, "1.60.0", None), @@ -295,6 +289,8 @@ declare_features! ( (internal, needs_panic_runtime, "1.10.0", Some(32837)), /// Allows using the `#![panic_runtime]` attribute. (internal, panic_runtime, "1.10.0", Some(32837)), + /// Allows using pattern types. + (internal, pattern_types, "1.79.0", Some(123646)), /// Allows using `#[rustc_allow_const_fn_unstable]`. /// This is an attribute on `const fn` for the same /// purpose as `#[allow_internal_unstable]`. @@ -305,12 +301,16 @@ declare_features! ( (internal, rustdoc_internals, "1.58.0", Some(90418)), /// Allows using the `rustdoc::missing_doc_code_examples` lint (unstable, rustdoc_missing_doc_code_examples, "1.31.0", Some(101730)), + /// Introduces a hierarchy of `Sized` traits (RFC 3729). + (unstable, sized_hierarchy, "1.89.0", Some(144404)), /// Allows using `#[structural_match]` which indicates that a type is structurally matchable. /// FIXME: Subsumed by trait `StructuralPartialEq`, cannot move to removed until a library /// feature with the same name exists. (unstable, structural_match, "1.8.0", Some(31434)), /// Allows using the `rust-call` ABI. (unstable, unboxed_closures, "1.0.0", Some(29625)), + /// Helps with formatting for `group_imports = "StdExternalCrate"`. + (unstable, unqualified_local_imports, "1.83.0", Some(138299)), // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! // Features are listed in alphabetical order. Tidy will fail if you don't keep it this way. // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! @@ -319,47 +319,14 @@ declare_features! ( // feature-group-end: internal feature gates // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // feature-group-start: actual feature gates (target features) - // ------------------------------------------------------------------------- - - // FIXME: Document these and merge with the list below. - - // Unstable `#[target_feature]` directives. - (unstable, aarch64_unstable_target_feature, "1.82.0", Some(44839)), - (unstable, aarch64_ver_target_feature, "1.27.0", Some(44839)), - (unstable, apx_target_feature, "1.88.0", Some(139284)), - (unstable, arm_target_feature, "1.27.0", Some(44839)), - (unstable, bpf_target_feature, "1.54.0", Some(44839)), - (unstable, csky_target_feature, "1.73.0", Some(44839)), - (unstable, ermsb_target_feature, "1.49.0", Some(44839)), - (unstable, hexagon_target_feature, "1.27.0", Some(44839)), - (unstable, lahfsahf_target_feature, "1.78.0", Some(44839)), - (unstable, loongarch_target_feature, "1.73.0", Some(44839)), - (unstable, m68k_target_feature, "1.85.0", Some(134328)), - (unstable, mips_target_feature, "1.27.0", Some(44839)), - (unstable, movrs_target_feature, "1.88.0", Some(137976)), - (unstable, nvptx_target_feature, "1.91.0", Some(44839)), - (unstable, powerpc_target_feature, "1.27.0", Some(44839)), - (unstable, prfchw_target_feature, "1.78.0", Some(44839)), - (unstable, riscv_target_feature, "1.45.0", Some(44839)), - (unstable, rtm_target_feature, "1.35.0", Some(44839)), - (unstable, s390x_target_feature, "1.82.0", Some(44839)), - (unstable, sparc_target_feature, "1.84.0", Some(132783)), - (unstable, wasm_target_feature, "1.30.0", Some(44839)), - (unstable, x87_target_feature, "1.85.0", Some(44839)), - // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! - // Features are listed in alphabetical order. Tidy will fail if you don't keep it this way. - // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! - - // ------------------------------------------------------------------------- - // feature-group-end: actual feature gates (target features) - // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- // feature-group-start: actual feature gates // ------------------------------------------------------------------------- + /// The remaining unstable target features on aarch64. + (unstable, aarch64_unstable_target_feature, "1.82.0", Some(150244)), + /// Instruction set "version" target features on aarch64. + (unstable, aarch64_ver_target_feature, "1.27.0", Some(150245)), /// Allows `extern "avr-interrupt" fn()` and `extern "avr-non-blocking-interrupt" fn()`. (unstable, abi_avr_interrupt, "1.45.0", Some(69664)), /// Allows `extern "cmse-nonsecure-call" fn()`. @@ -380,10 +347,14 @@ declare_features! ( (unstable, adt_const_params, "1.56.0", Some(95174)), /// Allows defining an `#[alloc_error_handler]`. (unstable, alloc_error_handler, "1.29.0", Some(51540)), + /// The `apxf` target feature on x86 + (unstable, apx_target_feature, "1.88.0", Some(139284)), /// Allows inherent and trait methods with arbitrary self types. (unstable, arbitrary_self_types, "1.23.0", Some(44874)), /// Allows inherent and trait methods with arbitrary self types that are raw pointers. (unstable, arbitrary_self_types_pointers, "1.83.0", Some(44874)), + /// Target features on arm. + (unstable, arm_target_feature, "1.27.0", Some(150246)), /// Enables experimental inline assembly support for additional architectures. (unstable, asm_experimental_arch, "1.58.0", Some(93335)), /// Enables experimental register support in inline assembly. @@ -392,8 +363,6 @@ declare_features! ( (unstable, asm_goto_with_outputs, "1.85.0", Some(119364)), /// Allows the `may_unwind` option in inline assembly. (unstable, asm_unwind, "1.58.0", Some(93334)), - /// Allows users to enforce equality of associated constants `TraitImpl`. - (unstable, associated_const_equality, "1.58.0", Some(92827)), /// Allows associated type defaults. (unstable, associated_type_defaults, "1.2.0", Some(29661)), /// Allows implementing `AsyncDrop`. @@ -408,6 +377,8 @@ declare_features! ( (unstable, async_trait_bounds, "1.85.0", Some(62290)), /// Allows using Intel AVX10 target features and intrinsics (unstable, avx10_target_feature, "1.88.0", Some(138843)), + /// Target features on bpf. + (unstable, bpf_target_feature, "1.54.0", Some(150247)), /// Allows using C-variadics. (unstable, c_variadic, "1.34.0", Some(44930)), /// Allows defining c-variadic naked functions with any extern ABI that is allowed @@ -468,6 +439,8 @@ declare_features! ( /// Allows function attribute `#[coverage(on/off)]`, to control coverage /// instrumentation of that function. (unstable, coverage_attribute, "1.74.0", Some(84605)), + /// Target features on csky. + (unstable, csky_target_feature, "1.73.0", Some(150248)), /// Allows non-builtin attributes in inner attribute position. (unstable, custom_inner_attributes, "1.30.0", Some(54726)), /// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`. @@ -495,6 +468,8 @@ declare_features! ( (incomplete, effective_target_features, "1.91.0", Some(143352)), /// Allows the .use postfix syntax `x.use` and use closures `use |x| { ... }` (incomplete, ergonomic_clones, "1.87.0", Some(132290)), + /// ermsb target feature on x86. + (unstable, ermsb_target_feature, "1.49.0", Some(150249)), /// Allows exhaustive pattern matching on types that contain uninhabited types. (unstable, exhaustive_patterns, "1.13.0", Some(51085)), /// Disallows `extern` without an explicit ABI. @@ -541,6 +516,8 @@ declare_features! ( (incomplete, guard_patterns, "1.85.0", Some(129967)), /// Allows using `..=X` as a patterns in slices. (unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)), + /// Target features on hexagon. + (unstable, hexagon_target_feature, "1.27.0", Some(150250)), /// Allows `if let` guard in match arms. (unstable, if_let_guard, "1.47.0", Some(51114)), /// Allows `impl Trait` to be used inside associated types (RFC 2515). @@ -555,6 +532,8 @@ declare_features! ( (incomplete, inherent_associated_types, "1.52.0", Some(8995)), /// Allows using `pointer` and `reference` in intra-doc links (unstable, intra_doc_pointers, "1.51.0", Some(80896)), + /// lahfsahf target feature on x86. + (unstable, lahfsahf_target_feature, "1.78.0", Some(150251)), /// Allows setting the threshold for the `large_assignments` lint. (unstable, large_assignments, "1.52.0", Some(83518)), /// Allow to have type alias types for inter-crate use. @@ -562,8 +541,12 @@ declare_features! ( /// Allows using `#[link(kind = "link-arg", name = "...")]` /// to pass custom arguments to the linker. (unstable, link_arg_attribute, "1.76.0", Some(99427)), + /// Target features on loongarch. + (unstable, loongarch_target_feature, "1.73.0", Some(150252)), /// Allows fused `loop`/`match` for direct intraprocedural jumps. (incomplete, loop_match, "1.90.0", Some(132306)), + /// Target features on m68k. + (unstable, m68k_target_feature, "1.85.0", Some(134328)), /// Allow `macro_rules!` attribute rules (unstable, macro_attr, "1.91.0", Some(143547)), /// Allow `macro_rules!` derive rules @@ -580,8 +563,12 @@ declare_features! ( /// standard library until the soundness issues with specialization /// are fixed. (unstable, min_specialization, "1.7.0", Some(31844)), + /// Target features on mips. + (unstable, mips_target_feature, "1.27.0", Some(150253)), /// Allows qualified paths in struct expressions, struct patterns and tuple struct patterns. (unstable, more_qualified_paths, "1.54.0", Some(86935)), + /// The `movrs` target feature on x86. + (unstable, movrs_target_feature, "1.88.0", Some(137976)), /// Allows the `#[must_not_suspend]` attribute. (unstable, must_not_suspend, "1.57.0", Some(83310)), /// Allows `mut ref` and `mut ref mut` identifier patterns. @@ -606,6 +593,8 @@ declare_features! ( (unstable, non_exhaustive_omitted_patterns_lint, "1.57.0", Some(89554)), /// Allows `for` binders in where-clauses (incomplete, non_lifetime_binders, "1.69.0", Some(108185)), + /// Target feaures on nvptx. + (unstable, nvptx_target_feature, "1.91.0", Some(150254)), /// Allows using enums in offset_of! (unstable, offset_of_enum, "1.75.0", Some(120141)), /// Allows using fields with slice type in offset_of! @@ -618,6 +607,10 @@ declare_features! ( (incomplete, pin_ergonomics, "1.83.0", Some(130494)), /// Allows postfix match `expr.match { ... }` (unstable, postfix_match, "1.79.0", Some(121618)), + /// Target features on powerpc. + (unstable, powerpc_target_feature, "1.27.0", Some(150255)), + /// The prfchw target feature on x86. + (unstable, prfchw_target_feature, "1.78.0", Some(150256)), /// Allows macro attributes on expressions, statements and non-inline modules. (unstable, proc_macro_hygiene, "1.30.0", Some(54727)), /// Allows the use of raw-dylibs on ELF platforms @@ -633,12 +626,20 @@ declare_features! ( (unstable, repr_simd, "1.4.0", Some(27731)), /// Allows bounding the return type of AFIT/RPITIT. (unstable, return_type_notation, "1.70.0", Some(109417)), + /// Target features on riscv. + (unstable, riscv_target_feature, "1.45.0", Some(150257)), + /// The rtm target feature on x86. + (unstable, rtm_target_feature, "1.35.0", Some(150258)), /// Allows `extern "rust-cold"`. (unstable, rust_cold_cc, "1.63.0", Some(97544)), + /// Target features on s390x. + (unstable, s390x_target_feature, "1.82.0", Some(150259)), /// Allows the use of the `sanitize` attribute. (unstable, sanitize, "1.91.0", Some(39699)), /// Allows the use of SIMD types in functions declared in `extern` blocks. (unstable, simd_ffi, "1.0.0", Some(27731)), + /// Target features on sparc. + (unstable, sparc_target_feature, "1.84.0", Some(132783)), /// Allows specialization of implementations (RFC 1210). (incomplete, specialization, "1.7.0", Some(31844)), /// Allows using `#[rustc_align_static(...)]` on static items. @@ -647,8 +648,6 @@ declare_features! ( (unstable, stmt_expr_attributes, "1.6.0", Some(15701)), /// Allows lints part of the strict provenance effort. (unstable, strict_provenance_lints, "1.61.0", Some(130351)), - /// Allows string patterns to dereference values to match them. - (unstable, string_deref_patterns, "1.67.0", Some(87121)), /// Allows `super let` statements. (unstable, super_let, "1.88.0", Some(139076)), /// Allows subtrait items to shadow supertrait items. @@ -685,10 +684,14 @@ declare_features! ( (internal, unsized_fn_params, "1.49.0", Some(48055)), /// Allows using the `#[used(linker)]` (or `#[used(compiler)]`) attribute. (unstable, used_with_arg, "1.60.0", Some(93798)), + /// Target features on wasm. + (unstable, wasm_target_feature, "1.30.0", Some(150260)), /// Allows use of attributes in `where` clauses. (unstable, where_clause_attrs, "1.87.0", Some(115590)), /// Allows use of x86 `AMX` target-feature attributes and intrinsics (unstable, x86_amx_intrinsics, "1.81.0", Some(126622)), + /// The x87 target feature on x86. + (unstable, x87_target_feature, "1.85.0", Some(150261)), /// Allows use of the `xop` target-feature (unstable, xop_target_feature, "1.81.0", Some(127208)), /// Allows `do yeet` expressions diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index 39530f5c3f8b..fa8998f0546d 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -1,9 +1,9 @@ use std::borrow::Cow; -use std::fmt; use std::path::PathBuf; pub use ReprAttr::*; use rustc_abi::Align; +pub use rustc_ast::attr::data_structures::*; use rustc_ast::token::DocFragmentKind; use rustc_ast::{AttrStyle, ast}; use rustc_data_structures::fx::FxIndexMap; @@ -60,7 +60,17 @@ impl InlineAttr { } } -#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq, HashStable_Generic)] +#[derive( + Copy, + Clone, + Encodable, + Decodable, + Debug, + PartialEq, + Eq, + HashStable_Generic, + PrintAttribute +)] pub enum InstructionSetAttr { ArmA32, ArmT32, @@ -202,83 +212,6 @@ impl StrippedCfgItem { } } -#[derive(Encodable, Decodable, Clone, Debug, PartialEq, Eq, Hash)] -#[derive(HashStable_Generic, PrintAttribute)] -pub enum CfgEntry { - All(ThinVec, Span), - Any(ThinVec, Span), - Not(Box, Span), - Bool(bool, Span), - NameValue { name: Symbol, value: Option, span: Span }, - Version(Option, Span), -} - -impl CfgEntry { - pub fn span(&self) -> Span { - let (Self::All(_, span) - | Self::Any(_, span) - | Self::Not(_, span) - | Self::Bool(_, span) - | Self::NameValue { span, .. } - | Self::Version(_, span)) = self; - *span - } - - /// Same as `PartialEq` but doesn't check spans and ignore order of cfgs. - pub fn is_equivalent_to(&self, other: &Self) -> bool { - match (self, other) { - (Self::All(a, _), Self::All(b, _)) | (Self::Any(a, _), Self::Any(b, _)) => { - a.len() == b.len() && a.iter().all(|a| b.iter().any(|b| a.is_equivalent_to(b))) - } - (Self::Not(a, _), Self::Not(b, _)) => a.is_equivalent_to(b), - (Self::Bool(a, _), Self::Bool(b, _)) => a == b, - ( - Self::NameValue { name: name1, value: value1, .. }, - Self::NameValue { name: name2, value: value2, .. }, - ) => name1 == name2 && value1 == value2, - (Self::Version(a, _), Self::Version(b, _)) => a == b, - _ => false, - } - } -} - -impl fmt::Display for CfgEntry { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fn write_entries( - name: &str, - entries: &[CfgEntry], - f: &mut fmt::Formatter<'_>, - ) -> fmt::Result { - write!(f, "{name}(")?; - for (nb, entry) in entries.iter().enumerate() { - if nb != 0 { - f.write_str(", ")?; - } - entry.fmt(f)?; - } - f.write_str(")") - } - match self { - Self::All(entries, _) => write_entries("all", entries, f), - Self::Any(entries, _) => write_entries("any", entries, f), - Self::Not(entry, _) => write!(f, "not({entry})"), - Self::Bool(value, _) => write!(f, "{value}"), - Self::NameValue { name, value, .. } => { - match value { - // We use `as_str` and debug display to have characters escaped and `"` - // characters surrounding the string. - Some(value) => write!(f, "{name} = {:?}", value.as_str()), - None => write!(f, "{name}"), - } - } - Self::Version(version, _) => match version { - Some(version) => write!(f, "{version}"), - None => Ok(()), - }, - } - } -} - /// Possible values for the `#[linkage]` attribute, allowing to specify the /// linkage type for a `MonoItem`. /// @@ -703,6 +636,12 @@ pub enum AttributeKind { span: Span, }, + /// Represents the trace attribute of `#[cfg_attr]` + CfgAttrTrace, + + /// Represents the trace attribute of `#[cfg]` + CfgTrace(ThinVec<(CfgEntry, Span)>), + /// Represents `#[cfi_encoding]` CfiEncoding { encoding: Symbol }, @@ -807,6 +746,9 @@ pub enum AttributeKind { /// Represents `#[inline]` and `#[rustc_force_inline]`. Inline(InlineAttr, Span), + /// Represents `#[instruction_set]` + InstructionSet(InstructionSetAttr), + /// Represents `#[link]`. Link(ThinVec, Span), @@ -952,6 +894,9 @@ pub enum AttributeKind { /// Represents `#[rustc_main]`. RustcMain, + /// Represents `#[rustc_must_implement_one_of]` + RustcMustImplementOneOf { attr_span: Span, fn_names: ThinVec }, + /// Represents `#[rustc_never_returns_null_ptr]` RustcNeverReturnsNullPointer, diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index 6d159a6ee68a..3efa876ed6a9 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -26,6 +26,8 @@ impl AttributeKind { AsPtr(..) => Yes, AutomaticallyDerived(..) => Yes, BodyStability { .. } => No, + CfgAttrTrace => Yes, + CfgTrace(..) => Yes, CfiEncoding { .. } => Yes, Coinductive(..) => No, Cold(..) => No, @@ -54,6 +56,7 @@ impl AttributeKind { Fundamental { .. } => Yes, Ignore { .. } => No, Inline(..) => No, + InstructionSet(..) => No, Link(..) => No, LinkName { .. } => Yes, // Needed for rustdoc LinkOrdinal { .. } => No, @@ -101,6 +104,7 @@ impl AttributeKind { RustcLintQueryInstability => Yes, RustcLintUntrackedQueryInformation => Yes, RustcMain => No, + RustcMustImplementOneOf { .. } => No, RustcNeverReturnsNullPointer => Yes, RustcNoImplicitAutorefs => Yes, RustcObjectLifetimeDefault => No, diff --git a/compiler/rustc_hir/src/attrs/pretty_printing.rs b/compiler/rustc_hir/src/attrs/pretty_printing.rs index f8ac2a547ca8..806f5c4d3ed9 100644 --- a/compiler/rustc_hir/src/attrs/pretty_printing.rs +++ b/compiler/rustc_hir/src/attrs/pretty_printing.rs @@ -2,6 +2,8 @@ use std::num::NonZero; use std::ops::Deref; use rustc_abi::Align; +use rustc_ast::attr::data_structures::CfgEntry; +use rustc_ast::attr::version::RustcVersion; use rustc_ast::token::{CommentKind, DocFragmentKind}; use rustc_ast::{AttrStyle, IntTy, UintTy}; use rustc_ast_pretty::pp::Printer; @@ -182,4 +184,6 @@ print_debug!( Transparency, SanitizerSet, DefId, + RustcVersion, + CfgEntry, ); diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 95abe5c40dd4..e93deaa84944 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -563,29 +563,6 @@ pub enum Res { /// to get the underlying type. alias_to: DefId, - /// Whether the `Self` type is disallowed from mentioning generics (i.e. when used in an - /// anonymous constant). - /// - /// HACK(min_const_generics): self types also have an optional requirement to **not** - /// mention any generic parameters to allow the following with `min_const_generics`: - /// ``` - /// # struct Foo; - /// impl Foo { fn test() -> [u8; size_of::()] { todo!() } } - /// - /// struct Bar([u8; baz::()]); - /// const fn baz() -> usize { 10 } - /// ``` - /// We do however allow `Self` in repeat expression even if it is generic to not break code - /// which already works on stable while causing the `const_evaluatable_unchecked` future - /// compat lint: - /// ``` - /// fn foo() { - /// let _bar = [1_u8; size_of::<*mut T>()]; - /// } - /// ``` - // FIXME(generic_const_exprs): Remove this bodge once that feature is stable. - forbid_generic: bool, - /// Is this within an `impl Foo for bar`? is_trait_impl: bool, }, @@ -910,8 +887,8 @@ impl Res { Res::PrimTy(id) => Res::PrimTy(id), Res::Local(id) => Res::Local(map(id)), Res::SelfTyParam { trait_ } => Res::SelfTyParam { trait_ }, - Res::SelfTyAlias { alias_to, forbid_generic, is_trait_impl } => { - Res::SelfTyAlias { alias_to, forbid_generic, is_trait_impl } + Res::SelfTyAlias { alias_to, is_trait_impl } => { + Res::SelfTyAlias { alias_to, is_trait_impl } } Res::ToolMod => Res::ToolMod, Res::NonMacroAttr(attr_kind) => Res::NonMacroAttr(attr_kind), @@ -926,8 +903,8 @@ impl Res { Res::PrimTy(id) => Res::PrimTy(id), Res::Local(id) => Res::Local(map(id)?), Res::SelfTyParam { trait_ } => Res::SelfTyParam { trait_ }, - Res::SelfTyAlias { alias_to, forbid_generic, is_trait_impl } => { - Res::SelfTyAlias { alias_to, forbid_generic, is_trait_impl } + Res::SelfTyAlias { alias_to, is_trait_impl } => { + Res::SelfTyAlias { alias_to, is_trait_impl } } Res::ToolMod => Res::ToolMod, Res::NonMacroAttr(attr_kind) => Res::NonMacroAttr(attr_kind), diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index e176c703b33e..aacd6324bb03 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -150,10 +150,13 @@ impl From for LifetimeSyntax { /// `LifetimeSource::OutlivesBound` or `LifetimeSource::PreciseCapturing` /// — there's no way to "elide" these lifetimes. #[derive(Debug, Copy, Clone, HashStable_Generic)] -// Raise the aligement to at least 4 bytes - this is relied on in other parts of the compiler(for pointer tagging): -// https://github.com/rust-lang/rust/blob/ce5fdd7d42aba9a2925692e11af2bd39cf37798a/compiler/rustc_data_structures/src/tagged_ptr.rs#L163 -// Removing this `repr(4)` will cause the compiler to not build on platforms like `m68k` Linux, where the aligement of u32 and usize is only 2. -// Since `repr(align)` may only raise aligement, this has no effect on platforms where the aligement is already sufficient. +// Raise the alignment to at least 4 bytes. +// This is relied on in other parts of the compiler (for pointer tagging): +// +// Removing this `repr(4)` will cause the compiler to not build on platforms +// like `m68k` Linux, where the alignment of u32 and usize is only 2. +// Since `repr(align)` may only raise alignment, this has no effect on +// platforms where the alignment is already sufficient. #[repr(align(4))] pub struct Lifetime { #[stable_hasher(ignore)] @@ -420,7 +423,7 @@ impl<'hir> ConstItemRhs<'hir> { pub fn span<'tcx>(&self, tcx: impl crate::intravisit::HirTyCtxt<'tcx>) -> Span { match self { ConstItemRhs::Body(body_id) => tcx.hir_body(*body_id).value.span, - ConstItemRhs::TypeConst(ct_arg) => ct_arg.span(), + ConstItemRhs::TypeConst(ct_arg) => ct_arg.span, } } } @@ -437,13 +440,14 @@ impl<'hir> ConstItemRhs<'hir> { /// versus const args that are literals or have arbitrary computations (e.g., `{ 1 + 3 }`). /// /// For an explanation of the `Unambig` generic parameter see the dev-guide: -/// +/// #[derive(Clone, Copy, Debug, HashStable_Generic)] #[repr(C)] pub struct ConstArg<'hir, Unambig = ()> { #[stable_hasher(ignore)] pub hir_id: HirId, pub kind: ConstArgKind<'hir, Unambig>, + pub span: Span, } impl<'hir> ConstArg<'hir, AmbigArg> { @@ -472,7 +476,7 @@ impl<'hir> ConstArg<'hir> { /// Functions accepting ambiguous consts will not handle the [`ConstArgKind::Infer`] variant, if /// infer consts are relevant to you then care should be taken to handle them separately. pub fn try_as_ambig_ct(&self) -> Option<&ConstArg<'hir, AmbigArg>> { - if let ConstArgKind::Infer(_, ()) = self.kind { + if let ConstArgKind::Infer(()) = self.kind { return None; } @@ -491,22 +495,13 @@ impl<'hir, Unambig> ConstArg<'hir, Unambig> { _ => None, } } - - pub fn span(&self) -> Span { - match self.kind { - ConstArgKind::Struct(path, _) => path.span(), - ConstArgKind::Path(path) => path.span(), - ConstArgKind::Anon(anon) => anon.span, - ConstArgKind::Error(span, _) => span, - ConstArgKind::Infer(span, _) => span, - } - } } /// See [`ConstArg`]. #[derive(Clone, Copy, Debug, HashStable_Generic)] #[repr(u8, C)] pub enum ConstArgKind<'hir, Unambig = ()> { + Tup(&'hir [&'hir ConstArg<'hir, Unambig>]), /// **Note:** Currently this is only used for bare const params /// (`N` where `fn foo(...)`), /// not paths to any const (`N` where `const N: usize = ...`). @@ -516,11 +511,13 @@ pub enum ConstArgKind<'hir, Unambig = ()> { Anon(&'hir AnonConst), /// Represents construction of struct/struct variants Struct(QPath<'hir>, &'hir [&'hir ConstArgExprField<'hir>]), + /// Tuple constructor variant + TupleCall(QPath<'hir>, &'hir [&'hir ConstArg<'hir>]), /// Error const - Error(Span, ErrorGuaranteed), + Error(ErrorGuaranteed), /// This variant is not always used to represent inference consts, sometimes /// [`GenericArg::Infer`] is used instead. - Infer(Span, Unambig), + Infer(Unambig), } #[derive(Clone, Copy, Debug, HashStable_Generic)] @@ -566,7 +563,7 @@ impl GenericArg<'_> { match self { GenericArg::Lifetime(l) => l.ident.span, GenericArg::Type(t) => t.span, - GenericArg::Const(c) => c.span(), + GenericArg::Const(c) => c.span, GenericArg::Infer(i) => i.span, } } @@ -1193,7 +1190,7 @@ pub enum AttrArgs { #[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable)] pub struct AttrPath { - pub segments: Box<[Ident]>, + pub segments: Box<[Symbol]>, pub span: Span, } @@ -1209,7 +1206,7 @@ impl AttrPath { segments: path .segments .iter() - .map(|i| Ident { name: i.ident.name, span: lower_span(i.ident.span) }) + .map(|i| i.ident.name) .collect::>() .into_boxed_slice(), span: lower_span(path.span), @@ -1219,7 +1216,11 @@ impl AttrPath { impl fmt::Display for AttrPath { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", join_path_idents(&self.segments)) + write!( + f, + "{}", + join_path_idents(self.segments.iter().map(|i| Ident { name: *i, span: DUMMY_SP })) + ) } } @@ -1324,7 +1325,7 @@ impl AttributeExt for Attribute { /// For a single-segment attribute, returns its name; otherwise, returns `None`. #[inline] - fn ident(&self) -> Option { + fn name(&self) -> Option { match &self { Attribute::Unparsed(n) => { if let [ident] = n.path.segments.as_ref() { @@ -1340,7 +1341,7 @@ impl AttributeExt for Attribute { #[inline] fn path_matches(&self, name: &[Symbol]) -> bool { match &self { - Attribute::Unparsed(n) => n.path.segments.iter().map(|ident| &ident.name).eq(name), + Attribute::Unparsed(n) => n.path.segments.iter().eq(name), _ => false, } } @@ -1361,6 +1362,7 @@ impl AttributeExt for Attribute { // FIXME: should not be needed anymore when all attrs are parsed Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span, Attribute::Parsed(AttributeKind::Deprecation { span, .. }) => *span, + Attribute::Parsed(AttributeKind::CfgTrace(cfgs)) => cfgs[0].1, a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"), } } @@ -1376,13 +1378,20 @@ impl AttributeExt for Attribute { } #[inline] - fn ident_path(&self) -> Option> { + fn symbol_path(&self) -> Option> { match &self { Attribute::Unparsed(n) => Some(n.path.segments.iter().copied().collect()), _ => None, } } + fn path_span(&self) -> Option { + match &self { + Attribute::Unparsed(attr) => Some(attr.path.span), + Attribute::Parsed(_) => None, + } + } + #[inline] fn doc_str(&self) -> Option { match &self { @@ -1462,11 +1471,6 @@ impl Attribute { AttributeExt::value_span(self) } - #[inline] - pub fn ident(&self) -> Option { - AttributeExt::ident(self) - } - #[inline] pub fn path_matches(&self, name: &[Symbol]) -> bool { AttributeExt::path_matches(self, name) @@ -1502,11 +1506,6 @@ impl Attribute { AttributeExt::path(self) } - #[inline] - pub fn ident_path(&self) -> Option> { - AttributeExt::ident_path(self) - } - #[inline] pub fn doc_str(&self) -> Option { AttributeExt::doc_str(self) @@ -1941,7 +1940,6 @@ pub enum PatExprKind<'hir> { // once instead of matching on unop neg expressions everywhere. negated: bool, }, - ConstBlock(ConstBlock), /// A path pattern for a unit struct/variant or a (maybe-associated) constant. Path(QPath<'hir>), } @@ -3372,7 +3370,7 @@ pub enum AmbigArg {} /// Represents a type in the `HIR`. /// /// For an explanation of the `Unambig` generic parameter see the dev-guide: -/// +/// #[derive(Debug, Clone, Copy, HashStable_Generic)] #[repr(C)] pub struct Ty<'hir, Unambig = ()> { @@ -3711,7 +3709,7 @@ pub enum InferDelegationKind { /// The various kinds of types recognized by the compiler. /// /// For an explanation of the `Unambig` generic parameter see the dev-guide: -/// +/// // SAFETY: `repr(u8)` is required so that `TyKind<()>` and `TyKind` are layout compatible #[repr(u8, C)] #[derive(Debug, Clone, Copy, HashStable_Generic)] diff --git a/compiler/rustc_hir/src/hir/tests.rs b/compiler/rustc_hir/src/hir/tests.rs index 4f9609fd360d..2ac33a369cbd 100644 --- a/compiler/rustc_hir/src/hir/tests.rs +++ b/compiler/rustc_hir/src/hir/tests.rs @@ -24,12 +24,16 @@ define_tests! { cast_ptr TyKind Ptr { 0: MutTy { ty: &Ty { span: DUMMY_SP, hir_id: HirId::INVALID, kind: TyKind::Never }, mutbl: Mutability::Not }} cast_array TyKind Array { 0: &Ty { span: DUMMY_SP, hir_id: HirId::INVALID, kind: TyKind::Never }, - 1: &ConstArg { hir_id: HirId::INVALID, kind: ConstArgKind::Anon(&AnonConst { + 1: &ConstArg { hir_id: HirId::INVALID, - def_id: LocalDefId { local_def_index: DefIndex::ZERO }, - body: BodyId { hir_id: HirId::INVALID }, + kind: ConstArgKind::Anon(&AnonConst { + hir_id: HirId::INVALID, + def_id: LocalDefId { local_def_index: DefIndex::ZERO }, + body: BodyId { hir_id: HirId::INVALID }, + span: DUMMY_SP, + }), span: DUMMY_SP, - })} + }, } cast_anon ConstArgKind Anon { diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index e63f51f8e6a4..59db60fdc55c 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -792,7 +792,6 @@ pub fn walk_pat_expr<'v, V: Visitor<'v>>(visitor: &mut V, expr: &'v PatExpr<'v>) try_visit!(visitor.visit_id(*hir_id)); match kind { PatExprKind::Lit { lit, negated } => visitor.visit_lit(*hir_id, *lit, *negated), - PatExprKind::ConstBlock(c) => visitor.visit_inline_const(c), PatExprKind::Path(qpath) => visitor.visit_qpath(qpath, *hir_id, *span), } } @@ -1069,8 +1068,8 @@ pub fn walk_unambig_const_arg<'v, V: Visitor<'v>>( match const_arg.try_as_ambig_ct() { Some(ambig_ct) => visitor.visit_const_arg(ambig_ct), None => { - let ConstArg { hir_id, kind: _ } = const_arg; - visitor.visit_infer(*hir_id, const_arg.span(), InferKind::Const(const_arg)) + let ConstArg { hir_id, kind: _, span } = const_arg; + visitor.visit_infer(*hir_id, *span, InferKind::Const(const_arg)) } } } @@ -1079,9 +1078,13 @@ pub fn walk_const_arg<'v, V: Visitor<'v>>( visitor: &mut V, const_arg: &'v ConstArg<'v, AmbigArg>, ) -> V::Result { - let ConstArg { hir_id, kind } = const_arg; + let ConstArg { hir_id, kind, span: _ } = const_arg; try_visit!(visitor.visit_id(*hir_id)); match kind { + ConstArgKind::Tup(exprs) => { + walk_list!(visitor, visit_const_arg, *exprs); + V::Result::output() + } ConstArgKind::Struct(qpath, field_exprs) => { try_visit!(visitor.visit_qpath(qpath, *hir_id, qpath.span())); @@ -1091,9 +1094,16 @@ pub fn walk_const_arg<'v, V: Visitor<'v>>( V::Result::output() } + ConstArgKind::TupleCall(qpath, args) => { + try_visit!(visitor.visit_qpath(qpath, *hir_id, qpath.span())); + for arg in *args { + try_visit!(visitor.visit_const_arg_unambig(*arg)); + } + V::Result::output() + } ConstArgKind::Path(qpath) => visitor.visit_qpath(qpath, *hir_id, qpath.span()), ConstArgKind::Anon(anon) => visitor.visit_anon_const(*anon), - ConstArgKind::Error(_, _) => V::Result::output(), // errors and spans are not important + ConstArgKind::Error(_) => V::Result::output(), // errors and spans are not important } } diff --git a/compiler/rustc_hir/src/lib.rs b/compiler/rustc_hir/src/lib.rs index 7c9c15c16df4..fa46c0f085a2 100644 --- a/compiler/rustc_hir/src/lib.rs +++ b/compiler/rustc_hir/src/lib.rs @@ -33,7 +33,6 @@ pub mod pat_util; mod stability; mod stable_hash_impls; mod target; -mod version; pub mod weak_lang_items; #[cfg(test)] @@ -42,9 +41,9 @@ mod tests; #[doc(no_inline)] pub use hir::*; pub use lang_items::{LangItem, LanguageItems}; +pub use rustc_ast::attr::version::*; pub use stability::*; pub use stable_hash_impls::HashStableContext; pub use target::{MethodKind, Target}; -pub use version::*; arena_types!(rustc_arena::declare_arena); diff --git a/compiler/rustc_hir_analysis/README.md b/compiler/rustc_hir_analysis/README.md index b61dbd8c9648..c47271dbdf2b 100644 --- a/compiler/rustc_hir_analysis/README.md +++ b/compiler/rustc_hir_analysis/README.md @@ -1,5 +1,5 @@ For high-level intro to how type checking works in rustc, see the -[type checking] chapter of the [rustc dev guide]. +[hir typeck] chapter of the [rustc dev guide]. -[type checking]: https://rustc-dev-guide.rust-lang.org/type-checking.html +[hir typeck]: https://rustc-dev-guide.rust-lang.org/hir-typeck/summary.html [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/ diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 8022a48ee137..416a6b19edfc 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -208,14 +208,6 @@ hir_analysis_field_already_declared_previous_nested = .previous_decl_label = `{$field_name}` first declared here in this unnamed field .previous_nested_field_decl_note = field `{$field_name}` first declared here -hir_analysis_function_not_found_in_trait = function not found in this trait - -hir_analysis_function_not_have_default_implementation = function doesn't have a default implementation - .note = required by this annotation - -hir_analysis_functions_names_duplicated = functions names are duplicated - .note = all `#[rustc_must_implement_one_of]` arguments must be unique - hir_analysis_generic_args_on_overridden_impl = could not resolve generic parameters on overridden impl hir_analysis_impl_not_marked_default = `{$ident}` specializes an item from a parent `impl`, but that item is not marked `default` @@ -381,16 +373,6 @@ hir_analysis_missing_type_params = *[other] parameters } must be specified on the object type -hir_analysis_must_be_name_of_associated_function = must be a name of an associated function - -hir_analysis_must_implement_not_function = not a function - -hir_analysis_must_implement_not_function_note = all `#[rustc_must_implement_one_of]` arguments must be associated function names - -hir_analysis_must_implement_not_function_span_note = required by this annotation - -hir_analysis_must_implement_one_of_attribute = the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args - hir_analysis_no_variant_named = no variant named `{$ident}` found for enum `{$ty}` hir_analysis_not_supported_delegation = {$descr} diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index a81df02f023f..ad66003a6bf9 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -1340,9 +1340,7 @@ fn check_impl_items_against_trait<'tcx>( } if let Some(missing_items) = must_implement_one_of { - let attr_span = tcx - .get_attr(trait_ref.def_id, sym::rustc_must_implement_one_of) - .map(|attr| attr.span()); + let attr_span = find_attr!(tcx.get_all_attrs(trait_ref.def_id), AttributeKind::RustcMustImplementOneOf {attr_span, ..} => *attr_span); missing_items_must_implement_one_of_err( tcx, diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index 4e8333f678b6..9eaf5319cb04 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -4,7 +4,7 @@ use rustc_abi::ExternAbi; use rustc_errors::DiagMessage; use rustc_hir::{self as hir, LangItem}; use rustc_middle::traits::{ObligationCause, ObligationCauseCode}; -use rustc_middle::ty::{self, Ty, TyCtxt}; +use rustc_middle::ty::{self, Const, Ty, TyCtxt}; use rustc_span::def_id::LocalDefId; use rustc_span::{Span, Symbol, sym}; @@ -315,7 +315,17 @@ pub(crate) fn check_intrinsic_type( let type_id = tcx.type_of(tcx.lang_items().type_id().unwrap()).instantiate_identity(); (0, 0, vec![type_id, type_id], tcx.types.bool) } - sym::offload => (3, 0, vec![param(0), param(1)], param(2)), + sym::offload => ( + 3, + 0, + vec![ + param(0), + Ty::new_array_with_const_len(tcx, tcx.types.u32, Const::from_target_usize(tcx, 3)), + Ty::new_array_with_const_len(tcx, tcx.types.u32, Const::from_target_usize(tcx, 3)), + param(1), + ], + param(2), + ), sym::offset => (2, 0, vec![param(0), param(1)], param(0)), sym::arith_offset => ( 1, diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs index 0e8cdc266f89..0c611e6c4c9e 100644 --- a/compiler/rustc_hir_analysis/src/check/region.rs +++ b/compiler/rustc_hir_analysis/src/check/region.rs @@ -701,31 +701,25 @@ fn resolve_local<'tcx>( /// Note: ET is intended to match "rvalues or places based on rvalues". fn record_subexpr_extended_temp_scopes( scope_tree: &mut ScopeTree, - mut expr: &hir::Expr<'_>, + expr: &hir::Expr<'_>, lifetime: Option, ) { - debug!(?expr, ?lifetime); + // Note: give all the expressions matching `ET` with the + // extended temporary lifetime, not just the innermost rvalue, + // because in MIR building if we must compile e.g., `*rvalue()` + // into a temporary, we request the temporary scope of the + // outer expression. - loop { - // Note: give all the expressions matching `ET` with the - // extended temporary lifetime, not just the innermost rvalue, - // because in MIR building if we must compile e.g., `*rvalue()` - // into a temporary, we request the temporary scope of the - // outer expression. + scope_tree.record_extended_temp_scope(expr.hir_id.local_id, lifetime); - scope_tree.record_extended_temp_scope(expr.hir_id.local_id, lifetime); - - match expr.kind { - hir::ExprKind::AddrOf(_, _, subexpr) - | hir::ExprKind::Unary(hir::UnOp::Deref, subexpr) - | hir::ExprKind::Field(subexpr, _) - | hir::ExprKind::Index(subexpr, _, _) => { - expr = subexpr; - } - _ => { - return; - } + match expr.kind { + hir::ExprKind::AddrOf(_, _, subexpr) + | hir::ExprKind::Unary(hir::UnOp::Deref, subexpr) + | hir::ExprKind::Field(subexpr, _) + | hir::ExprKind::Index(subexpr, _, _) => { + record_subexpr_extended_temp_scopes(scope_tree, subexpr, lifetime); } + _ => {} } } diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 16f5222f621c..725294dfd377 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -327,7 +327,7 @@ pub(crate) fn check_trait_item<'tcx>( let mut res = Ok(()); - if matches!(tcx.def_kind(def_id), DefKind::AssocFn) { + if tcx.def_kind(def_id) == DefKind::AssocFn { for &assoc_ty_def_id in tcx.associated_types_for_impl_traits_in_associated_fn(def_id.to_def_id()) { diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index 2e06684e0c7a..bacdf0049806 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -22,7 +22,6 @@ use std::ops::Bound; use rustc_abi::{ExternAbi, Size}; use rustc_ast::Recovered; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; -use rustc_data_structures::unord::UnordMap; use rustc_errors::{ Applicability, Diag, DiagCtxtHandle, E0228, ErrorGuaranteed, StashKey, struct_span_code_err, }; @@ -916,84 +915,15 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef { } else { ty::trait_def::TraitSpecializationKind::None }; - let must_implement_one_of = attrs - .iter() - .find(|attr| attr.has_name(sym::rustc_must_implement_one_of)) - // Check that there are at least 2 arguments of `#[rustc_must_implement_one_of]` - // and that they are all identifiers - .and_then(|attr| match attr.meta_item_list() { - Some(items) if items.len() < 2 => { - tcx.dcx().emit_err(errors::MustImplementOneOfAttribute { span: attr.span() }); - None - } - Some(items) => items - .into_iter() - .map(|item| item.ident().ok_or(item.span())) - .collect::, _>>() - .map_err(|span| { - tcx.dcx().emit_err(errors::MustBeNameOfAssociatedFunction { span }); - }) - .ok() - .zip(Some(attr.span())), - // Error is reported by `rustc_attr!` - None => None, - }) - // Check that all arguments of `#[rustc_must_implement_one_of]` reference - // functions in the trait with default implementations - .and_then(|(list, attr_span)| { - let errors = list.iter().filter_map(|ident| { - let item = tcx - .associated_items(def_id) - .filter_by_name_unhygienic(ident.name) - .find(|item| item.ident(tcx) == *ident); - - match item { - Some(item) if matches!(item.kind, ty::AssocKind::Fn { .. }) => { - if !item.defaultness(tcx).has_value() { - tcx.dcx().emit_err(errors::FunctionNotHaveDefaultImplementation { - span: tcx.def_span(item.def_id), - note_span: attr_span, - }); - - return Some(()); - } - - return None; - } - Some(item) => { - tcx.dcx().emit_err(errors::MustImplementNotFunction { - span: tcx.def_span(item.def_id), - span_note: errors::MustImplementNotFunctionSpanNote { span: attr_span }, - note: errors::MustImplementNotFunctionNote {}, - }); - } - None => { - tcx.dcx().emit_err(errors::FunctionNotFoundInTrait { span: ident.span }); - } - } - - Some(()) - }); - - (errors.count() == 0).then_some(list) - }) - // Check for duplicates - .and_then(|list| { - let mut set: UnordMap = Default::default(); - let mut no_dups = true; - - for ident in &*list { - if let Some(dup) = set.insert(ident.name, ident.span) { - tcx.dcx() - .emit_err(errors::FunctionNamesDuplicated { spans: vec![dup, ident.span] }); - - no_dups = false; - } - } - - no_dups.then_some(list) - }); + let must_implement_one_of = find_attr!( + attrs, + AttributeKind::RustcMustImplementOneOf { fn_names, .. } => + fn_names + .iter() + .cloned() + .collect::>() + ); let deny_explicit_impl = find_attr!(attrs, AttributeKind::DenyExplicitImpl(_)); let implement_via_object = !find_attr!(attrs, AttributeKind::DoNotImplementViaObject(_)); @@ -1549,23 +1479,27 @@ fn rendered_precise_capturing_args<'tcx>( fn const_param_default<'tcx>( tcx: TyCtxt<'tcx>, - def_id: LocalDefId, + local_def_id: LocalDefId, ) -> ty::EarlyBinder<'tcx, Const<'tcx>> { let hir::Node::GenericParam(hir::GenericParam { kind: hir::GenericParamKind::Const { default: Some(default_ct), .. }, .. - }) = tcx.hir_node_by_def_id(def_id) + }) = tcx.hir_node_by_def_id(local_def_id) else { span_bug!( - tcx.def_span(def_id), + tcx.def_span(local_def_id), "`const_param_default` expected a generic parameter with a constant" ) }; - let icx = ItemCtxt::new(tcx, def_id); - let identity_args = ty::GenericArgs::identity_for_item(tcx, def_id); + + let icx = ItemCtxt::new(tcx, local_def_id); + + let def_id = local_def_id.to_def_id(); + let identity_args = ty::GenericArgs::identity_for_item(tcx, tcx.parent(def_id)); + let ct = icx .lowerer() - .lower_const_arg(default_ct, FeedConstTy::Param(def_id.to_def_id(), identity_args)); + .lower_const_arg(default_ct, FeedConstTy::with_type_of(tcx, def_id, identity_args)); ty::EarlyBinder::bind(ct) } @@ -1623,7 +1557,7 @@ fn const_of_item<'tcx>( let identity_args = ty::GenericArgs::identity_for_item(tcx, def_id); let ct = icx .lowerer() - .lower_const_arg(ct_arg, FeedConstTy::Param(def_id.to_def_id(), identity_args)); + .lower_const_arg(ct_arg, FeedConstTy::with_type_of(tcx, def_id.to_def_id(), identity_args)); if let Err(e) = icx.check_tainted_by_errors() && !ct.references_error() { diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs index 2eefe1eb3e92..178c47b09c84 100644 --- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs @@ -543,7 +543,7 @@ pub(super) fn explicit_predicates_of<'tcx>( } } } else { - if matches!(def_kind, DefKind::AnonConst) + if def_kind == DefKind::AnonConst && tcx.features().generic_const_exprs() && let Some(defaulted_param_def_id) = tcx.hir_opt_const_param_default_param_def_id(tcx.local_def_id_to_hir_id(def_id)) diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index 8e17a4962520..b388396ac4fc 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -741,66 +741,6 @@ pub(crate) struct ParenSugarAttribute { pub span: Span, } -#[derive(Diagnostic)] -#[diag(hir_analysis_must_implement_one_of_attribute)] -pub(crate) struct MustImplementOneOfAttribute { - #[primary_span] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag(hir_analysis_must_be_name_of_associated_function)] -pub(crate) struct MustBeNameOfAssociatedFunction { - #[primary_span] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag(hir_analysis_function_not_have_default_implementation)] -pub(crate) struct FunctionNotHaveDefaultImplementation { - #[primary_span] - pub span: Span, - #[note] - pub note_span: Span, -} - -#[derive(Diagnostic)] -#[diag(hir_analysis_must_implement_not_function)] -pub(crate) struct MustImplementNotFunction { - #[primary_span] - pub span: Span, - #[subdiagnostic] - pub span_note: MustImplementNotFunctionSpanNote, - #[subdiagnostic] - pub note: MustImplementNotFunctionNote, -} - -#[derive(Subdiagnostic)] -#[note(hir_analysis_must_implement_not_function_span_note)] -pub(crate) struct MustImplementNotFunctionSpanNote { - #[primary_span] - pub span: Span, -} - -#[derive(Subdiagnostic)] -#[note(hir_analysis_must_implement_not_function_note)] -pub(crate) struct MustImplementNotFunctionNote {} - -#[derive(Diagnostic)] -#[diag(hir_analysis_function_not_found_in_trait)] -pub(crate) struct FunctionNotFoundInTrait { - #[primary_span] - pub span: Span, -} - -#[derive(Diagnostic)] -#[diag(hir_analysis_functions_names_duplicated)] -#[note] -pub(crate) struct FunctionNamesDuplicated { - #[primary_span] - pub spans: Vec, -} - #[derive(Diagnostic)] #[diag(hir_analysis_simd_ffi_highly_experimental)] #[help] diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index 555ef5c45e12..9ae6a9fac504 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -610,9 +610,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { AttributeKind::TypeConst(_) ) { - if tcx.features().min_generic_const_args() - || tcx.features().associated_const_equality() - { + if tcx.features().min_generic_const_args() { let mut err = self.dcx().struct_span_err( constraint.span, "use of trait associated const without `#[type_const]`", diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs index 15d7da3a0070..edb79592e6c5 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs @@ -239,7 +239,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // `trait_object_dummy_self`, so check for that. let references_self = match pred.skip_binder().term.kind() { ty::TermKind::Ty(ty) => ty.walk().any(|arg| arg == dummy_self.into()), - // FIXME(associated_const_equality): We should walk the const instead of not doing anything + // FIXME(mgca): We should walk the const instead of not doing anything ty::TermKind::Const(_) => false, }; diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs index 5fc201db68e5..92b77a2042b1 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs @@ -359,12 +359,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { None }; - // FIXME(associated_const_equality): This has quite a few false positives and negatives. + // FIXME(mgca): This has quite a few false positives and negatives. let wrap_in_braces_sugg = if let Some(constraint) = constraint && let Some(hir_ty) = constraint.ty() && let ty = self.lower_ty(hir_ty) && (ty.is_enum() || ty.references_error()) - && tcx.features().associated_const_equality() + && tcx.features().min_generic_const_args() { Some(errors::AssocKindMismatchWrapInBracesSugg { lo: hir_ty.span.shrink_to_lo(), @@ -381,7 +381,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { { let span = match term { hir::Term::Ty(ty) => ty.span, - hir::Term::Const(ct) => ct.span(), + hir::Term::Const(ct) => ct.span, }; (span, Some(ident.span), assoc_item.as_tag(), assoc_tag) } else { @@ -1466,7 +1466,7 @@ pub fn prohibit_assoc_item_constraint( hir::AssocItemConstraintKind::Equality { term: hir::Term::Const(c) }, GenericParamDefKind::Const { .. }, ) => { - suggest_direct_use(&mut err, c.span()); + suggest_direct_use(&mut err, c.span); } (hir::AssocItemConstraintKind::Bound { bounds }, _) => { // Suggest `impl Trait for Foo` when finding diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 23110d2c5c87..aaa566760013 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -38,8 +38,8 @@ use rustc_middle::middle::stability::AllowUnstable; use rustc_middle::mir::interpret::LitToConstInput; use rustc_middle::ty::print::PrintPolyTraitRefExt as _; use rustc_middle::ty::{ - self, Const, GenericArgKind, GenericArgsRef, GenericParamDefKind, Ty, TyCtxt, TypeVisitableExt, - TypingMode, Upcast, fold_regions, + self, Const, GenericArgKind, GenericArgsRef, GenericParamDefKind, Ty, TyCtxt, + TypeSuperFoldable, TypeVisitableExt, TypingMode, Upcast, fold_regions, }; use rustc_middle::{bug, span_bug}; use rustc_session::lint::builtin::AMBIGUOUS_ASSOCIATED_ITEMS; @@ -259,17 +259,26 @@ impl AssocItemQSelf { /// Use this enum with `::lower_const_arg` to instruct it with the /// desired behavior. #[derive(Debug, Clone, Copy)] -pub enum FeedConstTy<'a, 'tcx> { - /// Feed the type. - /// +pub enum FeedConstTy<'tcx> { + /// Feed the type to the (anno) const arg. + WithTy(Ty<'tcx>), + /// Don't feed the type. + No, +} + +impl<'tcx> FeedConstTy<'tcx> { /// The `DefId` belongs to the const param that we are supplying /// this (anon) const arg to. /// /// The list of generic args is used to instantiate the parameters /// used by the type of the const param specified by `DefId`. - Param(DefId, &'a [ty::GenericArg<'tcx>]), - /// Don't feed the type. - No, + pub fn with_type_of( + tcx: TyCtxt<'tcx>, + def_id: DefId, + generic_args: &[ty::GenericArg<'tcx>], + ) -> Self { + Self::WithTy(tcx.type_of(def_id).instantiate(tcx, generic_args)) + } } #[derive(Debug, Clone, Copy)] @@ -314,6 +323,7 @@ pub enum PermitVariants { enum TypeRelativePath<'tcx> { AssocItem(DefId, GenericArgsRef<'tcx>), Variant { adt: Ty<'tcx>, variant_did: DefId }, + Ctor { ctor_def_id: DefId, args: GenericArgsRef<'tcx> }, } /// New-typed boolean indicating whether explicit late-bound lifetimes @@ -394,7 +404,118 @@ pub trait GenericArgsLowerer<'a, 'tcx> { ) -> ty::GenericArg<'tcx>; } +struct ForbidMCGParamUsesFolder<'tcx> { + tcx: TyCtxt<'tcx>, + anon_const_def_id: LocalDefId, + span: Span, + is_self_alias: bool, +} + +impl<'tcx> ForbidMCGParamUsesFolder<'tcx> { + fn error(&self) -> ErrorGuaranteed { + let msg = if self.is_self_alias { + "generic `Self` types are currently not permitted in anonymous constants" + } else { + "generic parameters may not be used in const operations" + }; + let mut diag = self.tcx.dcx().struct_span_err(self.span, msg); + if self.is_self_alias { + let anon_const_hir_id: HirId = HirId::make_owner(self.anon_const_def_id); + let parent_impl = self.tcx.hir_parent_owner_iter(anon_const_hir_id).find_map( + |(_, node)| match node { + hir::OwnerNode::Item(hir::Item { + kind: hir::ItemKind::Impl(impl_), .. + }) => Some(impl_), + _ => None, + }, + ); + if let Some(impl_) = parent_impl { + diag.span_note(impl_.self_ty.span, "not a concrete type"); + } + } + diag.emit() + } +} + +impl<'tcx> ty::TypeFolder> for ForbidMCGParamUsesFolder<'tcx> { + fn cx(&self) -> TyCtxt<'tcx> { + self.tcx + } + + fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> { + if matches!(t.kind(), ty::Param(..)) { + return Ty::new_error(self.tcx, self.error()); + } + t.super_fold_with(self) + } + + fn fold_const(&mut self, c: Const<'tcx>) -> Const<'tcx> { + if matches!(c.kind(), ty::ConstKind::Param(..)) { + return Const::new_error(self.tcx, self.error()); + } + c.super_fold_with(self) + } + + fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { + if matches!(r.kind(), ty::RegionKind::ReEarlyParam(..) | ty::RegionKind::ReLateParam(..)) { + return ty::Region::new_error(self.tcx, self.error()); + } + r + } +} + impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { + /// See `check_param_uses_if_mcg`. + /// + /// FIXME(mgca): this is pub only for instantiate_value_path and would be nice to avoid altogether + pub fn check_param_res_if_mcg_for_instantiate_value_path( + &self, + res: Res, + span: Span, + ) -> Result<(), ErrorGuaranteed> { + let tcx = self.tcx(); + let parent_def_id = self.item_def_id(); + if let Res::Def(DefKind::ConstParam, _) = res + && tcx.def_kind(parent_def_id) == DefKind::AnonConst + && let ty::AnonConstKind::MCG = tcx.anon_const_kind(parent_def_id) + { + let folder = ForbidMCGParamUsesFolder { + tcx, + anon_const_def_id: parent_def_id, + span, + is_self_alias: false, + }; + return Err(folder.error()); + } + Ok(()) + } + + /// Check for uses of generic parameters that are not in scope due to this being + /// in a non-generic anon const context. + #[must_use = "need to use transformed output"] + fn check_param_uses_if_mcg(&self, term: T, span: Span, is_self_alias: bool) -> T + where + T: ty::TypeFoldable>, + { + let tcx = self.tcx(); + let parent_def_id = self.item_def_id(); + if tcx.def_kind(parent_def_id) == DefKind::AnonConst + && let ty::AnonConstKind::MCG = tcx.anon_const_kind(parent_def_id) + // Fast path if contains no params/escaping bound vars. + && (term.has_param() || term.has_escaping_bound_vars()) + { + let mut folder = ForbidMCGParamUsesFolder { + tcx, + anon_const_def_id: parent_def_id, + span, + is_self_alias, + }; + term.fold_with(&mut folder) + } else { + term + } + } + /// Lower a lifetime from the HIR to our internal notion of a lifetime called a *region*. #[instrument(level = "debug", skip(self), ret)] pub fn lower_lifetime( @@ -403,7 +524,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { reason: RegionInferReason<'_>, ) -> ty::Region<'tcx> { if let Some(resolved) = self.tcx().named_bound_var(lifetime.hir_id) { - self.lower_resolved_lifetime(resolved) + let region = self.lower_resolved_lifetime(resolved); + self.check_param_uses_if_mcg(region, lifetime.ident.span, false) } else { self.re_infer(lifetime.ident.span, reason) } @@ -411,7 +533,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { /// Lower a lifetime from the HIR to our internal notion of a lifetime called a *region*. #[instrument(level = "debug", skip(self), ret)] - pub fn lower_resolved_lifetime(&self, resolved: rbv::ResolvedArg) -> ty::Region<'tcx> { + fn lower_resolved_lifetime(&self, resolved: rbv::ResolvedArg) -> ty::Region<'tcx> { let tcx = self.tcx(); match resolved { @@ -610,7 +732,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // Ambig portions of `ConstArg` are handled in the match arm below .lower_const_arg( ct.as_unambig_ct(), - FeedConstTy::Param(param.def_id, preceding_args), + FeedConstTy::with_type_of(tcx, param.def_id, preceding_args), ) .into(), (&GenericParamDefKind::Const { .. }, GenericArg::Infer(inf)) => { @@ -1256,11 +1378,17 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { TypeRelativePath::AssocItem(def_id, args) => { let alias_ty = ty::AliasTy::new_from_args(tcx, def_id, args); let ty = Ty::new_alias(tcx, alias_ty.kind(tcx), alias_ty); + let ty = self.check_param_uses_if_mcg(ty, span, false); Ok((ty, tcx.def_kind(def_id), def_id)) } TypeRelativePath::Variant { adt, variant_did } => { + let adt = self.check_param_uses_if_mcg(adt, span, false); Ok((adt, DefKind::Variant, variant_did)) } + TypeRelativePath::Ctor { .. } => { + let e = tcx.dcx().span_err(span, "expected type, found tuple constructor"); + Err(e) + } } } @@ -1275,7 +1403,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { span: Span, ) -> Result, ErrorGuaranteed> { let tcx = self.tcx(); - let (def_id, args) = match self.lower_type_relative_path( + match self.lower_type_relative_path( self_ty, hir_self_ty, segment, @@ -1292,15 +1420,25 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { err.note("the declaration in the trait must be marked with `#[type_const]`"); return Err(err.emit()); } - (def_id, args) + let ct = Const::new_unevaluated(tcx, ty::UnevaluatedConst::new(def_id, args)); + let ct = self.check_param_uses_if_mcg(ct, span, false); + Ok(ct) } + TypeRelativePath::Ctor { ctor_def_id, args } => match tcx.def_kind(ctor_def_id) { + DefKind::Ctor(_, CtorKind::Fn) => { + Ok(ty::Const::zero_sized(tcx, Ty::new_fn_def(tcx, ctor_def_id, args))) + } + DefKind::Ctor(ctor_of, CtorKind::Const) => { + Ok(self.construct_const_ctor_value(ctor_def_id, ctor_of, args)) + } + _ => unreachable!(), + }, // FIXME(mgca): implement support for this once ready to support all adt ctor expressions, // not just const ctors TypeRelativePath::Variant { .. } => { span_bug!(span, "unexpected variant res for type associated const path") } - }; - Ok(Const::new_unevaluated(tcx, ty::UnevaluatedConst::new(def_id, args))) + } } /// Lower a [type-relative][hir::QPath::TypeRelative] (and type-level) path. @@ -1326,6 +1464,23 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { .iter() .find(|vd| tcx.hygienic_eq(segment.ident, vd.ident(tcx), adt_def.did())); if let Some(variant_def) = variant_def { + // FIXME(mgca): do we want constructor resolutions to take priority over + // other possible resolutions? + if matches!(mode, LowerTypeRelativePathMode::Const) + && let Some((_, ctor_def_id)) = variant_def.ctor + { + tcx.check_stability(variant_def.def_id, Some(qpath_hir_id), span, None); + let _ = self.prohibit_generic_args( + slice::from_ref(segment).iter(), + GenericsArgsErrExtend::EnumVariant { + qself: hir_self_ty, + assoc_segment: segment, + adt_def, + }, + ); + let ty::Adt(_, enum_args) = self_ty.kind() else { unreachable!() }; + return Ok(TypeRelativePath::Ctor { ctor_def_id, args: enum_args }); + } if let PermitVariants::Yes = mode.permit_variants() { tcx.check_stability(variant_def.def_id, Some(qpath_hir_id), span, None); let _ = self.prohibit_generic_args( @@ -2032,9 +2187,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { GenericsArgsErrExtend::None }, ); - tcx.types.self_param + self.check_param_uses_if_mcg(tcx.types.self_param, span, false) } - Res::SelfTyAlias { alias_to: def_id, forbid_generic, .. } => { + Res::SelfTyAlias { alias_to: def_id, .. } => { // `Self` in impl (we know the concrete type). assert_eq!(opt_self_ty, None); // Try to evaluate any array length constants. @@ -2043,42 +2198,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { path.segments.iter(), GenericsArgsErrExtend::SelfTyAlias { def_id, span }, ); - // HACK(min_const_generics): Forbid generic `Self` types - // here as we can't easily do that during nameres. - // - // We do this before normalization as we otherwise allow - // ```rust - // trait AlwaysApplicable { type Assoc; } - // impl AlwaysApplicable for T { type Assoc = usize; } - // - // trait BindsParam { - // type ArrayTy; - // } - // impl BindsParam for ::Assoc { - // type ArrayTy = [u8; Self::MAX]; - // } - // ``` - // Note that the normalization happens in the param env of - // the anon const, which is empty. This is why the - // `AlwaysApplicable` impl needs a `T: ?Sized` bound for - // this to compile if we were to normalize here. - if forbid_generic && ty.has_param() { - let mut err = self.dcx().struct_span_err( - path.span, - "generic `Self` types are currently not permitted in anonymous constants", - ); - if let Some(hir::Node::Item(&hir::Item { - kind: hir::ItemKind::Impl(impl_), - .. - })) = tcx.hir_get_if_local(def_id) - { - err.span_note(impl_.self_ty.span, "not a concrete type"); - } - let reported = err.emit(); - Ty::new_error(tcx, reported) - } else { - ty - } + self.check_param_uses_if_mcg(ty, span, true) } Res::Def(DefKind::AssocTy, def_id) => { let trait_segment = if let [modules @ .., trait_, _item] = path.segments { @@ -2138,7 +2258,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { /// and late-bound ones to [`ty::Bound`]. pub(crate) fn lower_ty_param(&self, hir_id: HirId) -> Ty<'tcx> { let tcx = self.tcx(); - match tcx.named_bound_var(hir_id) { + + let ty = match tcx.named_bound_var(hir_id) { Some(rbv::ResolvedArg::LateBound(debruijn, index, def_id)) => { let br = ty::BoundTy { var: ty::BoundVar::from_u32(index), @@ -2154,7 +2275,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { } Some(rbv::ResolvedArg::Error(guar)) => Ty::new_error(tcx, guar), arg => bug!("unexpected bound var resolution for {hir_id:?}: {arg:?}"), - } + }; + self.check_param_uses_if_mcg(ty, tcx.hir_span(hir_id), false) } /// Lower a const parameter from the HIR to our internal notion of a constant. @@ -2164,7 +2286,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { pub(crate) fn lower_const_param(&self, param_def_id: DefId, path_hir_id: HirId) -> Const<'tcx> { let tcx = self.tcx(); - match tcx.named_bound_var(path_hir_id) { + let ct = match tcx.named_bound_var(path_hir_id) { Some(rbv::ResolvedArg::EarlyBound(_)) => { // Find the name and index of the const parameter by indexing the generics of // the parent item and construct a `ParamConst`. @@ -2181,7 +2303,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { ), Some(rbv::ResolvedArg::Error(guar)) => ty::Const::new_error(tcx, guar), arg => bug!("unexpected bound var resolution for {:?}: {arg:?}", path_hir_id), - } + }; + self.check_param_uses_if_mcg(ct, tcx.hir_span(path_hir_id), false) } /// Lower a [`hir::ConstArg`] to a (type-level) [`ty::Const`](Const). @@ -2189,15 +2312,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { pub fn lower_const_arg( &self, const_arg: &hir::ConstArg<'tcx>, - feed: FeedConstTy<'_, 'tcx>, + feed: FeedConstTy<'tcx>, ) -> Const<'tcx> { let tcx = self.tcx(); - if let FeedConstTy::Param(param_def_id, args) = feed + if let FeedConstTy::WithTy(anon_const_type) = feed && let hir::ConstArgKind::Anon(anon) = &const_arg.kind { - let anon_const_type = tcx.type_of(param_def_id).instantiate(tcx, args); - // FIXME(generic_const_parameter_types): Ideally we remove these errors below when // we have the ability to intermix typeck of anon const const args with the parent // bodies typeck. @@ -2210,7 +2331,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { && (anon_const_type.has_free_regions() || anon_const_type.has_erased_regions()) { let e = self.dcx().span_err( - const_arg.span(), + const_arg.span, "anonymous constants with lifetimes in their type are not yet supported", ); tcx.feed_anon_const_type(anon.def_id, ty::EarlyBinder::bind(Ty::new_error(tcx, e))); @@ -2221,7 +2342,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // variables otherwise we will ICE. if anon_const_type.has_non_region_infer() { let e = self.dcx().span_err( - const_arg.span(), + const_arg.span, "anonymous constants with inferred types are not yet supported", ); tcx.feed_anon_const_type(anon.def_id, ty::EarlyBinder::bind(Ty::new_error(tcx, e))); @@ -2231,21 +2352,19 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // give the anon const any of the generics from the parent. if anon_const_type.has_non_region_param() { let e = self.dcx().span_err( - const_arg.span(), + const_arg.span, "anonymous constants referencing generics are not yet supported", ); tcx.feed_anon_const_type(anon.def_id, ty::EarlyBinder::bind(Ty::new_error(tcx, e))); return ty::Const::new_error(tcx, e); } - tcx.feed_anon_const_type( - anon.def_id, - ty::EarlyBinder::bind(tcx.type_of(param_def_id).instantiate(tcx, args)), - ); + tcx.feed_anon_const_type(anon.def_id, ty::EarlyBinder::bind(anon_const_type)); } let hir_id = const_arg.hir_id; match const_arg.kind { + hir::ConstArgKind::Tup(exprs) => self.lower_const_arg_tup(exprs, feed, const_arg.span), hir::ConstArgKind::Path(hir::QPath::Resolved(maybe_qself, path)) => { debug!(?maybe_qself, ?path); let opt_self_ty = maybe_qself.as_ref().map(|qself| self.lower_ty(qself)); @@ -2259,19 +2378,139 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { hir_self_ty, segment, hir_id, - const_arg.span(), + const_arg.span, ) .unwrap_or_else(|guar| Const::new_error(tcx, guar)) } hir::ConstArgKind::Struct(qpath, inits) => { - self.lower_const_arg_struct(hir_id, qpath, inits, const_arg.span()) + self.lower_const_arg_struct(hir_id, qpath, inits, const_arg.span) + } + hir::ConstArgKind::TupleCall(qpath, args) => { + self.lower_const_arg_tuple_call(hir_id, qpath, args, const_arg.span) } hir::ConstArgKind::Anon(anon) => self.lower_const_arg_anon(anon), - hir::ConstArgKind::Infer(span, ()) => self.ct_infer(None, span), - hir::ConstArgKind::Error(_, e) => ty::Const::new_error(tcx, e), + hir::ConstArgKind::Infer(()) => self.ct_infer(None, const_arg.span), + hir::ConstArgKind::Error(e) => ty::Const::new_error(tcx, e), } } + fn lower_const_arg_tuple_call( + &self, + hir_id: HirId, + qpath: hir::QPath<'tcx>, + args: &'tcx [&'tcx hir::ConstArg<'tcx>], + span: Span, + ) -> Const<'tcx> { + let tcx = self.tcx(); + + let non_adt_or_variant_res = || { + let e = tcx.dcx().span_err(span, "tuple constructor with invalid base path"); + ty::Const::new_error(tcx, e) + }; + + let ctor_const = match qpath { + hir::QPath::Resolved(maybe_qself, path) => { + let opt_self_ty = maybe_qself.as_ref().map(|qself| self.lower_ty(qself)); + self.lower_resolved_const_path(opt_self_ty, path, hir_id) + } + hir::QPath::TypeRelative(hir_self_ty, segment) => { + let self_ty = self.lower_ty(hir_self_ty); + match self.lower_type_relative_const_path( + self_ty, + hir_self_ty, + segment, + hir_id, + span, + ) { + Ok(c) => c, + Err(_) => return non_adt_or_variant_res(), + } + } + }; + + let Some(value) = ctor_const.try_to_value() else { + return non_adt_or_variant_res(); + }; + + let (adt_def, adt_args, variant_did) = match value.ty.kind() { + ty::FnDef(def_id, fn_args) + if let DefKind::Ctor(CtorOf::Variant, _) = tcx.def_kind(*def_id) => + { + let parent_did = tcx.parent(*def_id); + let enum_did = tcx.parent(parent_did); + (tcx.adt_def(enum_did), fn_args, parent_did) + } + ty::FnDef(def_id, fn_args) + if let DefKind::Ctor(CtorOf::Struct, _) = tcx.def_kind(*def_id) => + { + let parent_did = tcx.parent(*def_id); + (tcx.adt_def(parent_did), fn_args, parent_did) + } + _ => return non_adt_or_variant_res(), + }; + + let variant_def = adt_def.variant_with_id(variant_did); + let variant_idx = adt_def.variant_index_with_id(variant_did).as_u32(); + + if args.len() != variant_def.fields.len() { + let e = tcx.dcx().span_err( + span, + format!( + "tuple constructor has {} arguments but {} were provided", + variant_def.fields.len(), + args.len() + ), + ); + return ty::Const::new_error(tcx, e); + } + + let fields = variant_def + .fields + .iter() + .zip(args) + .map(|(field_def, arg)| { + self.lower_const_arg(arg, FeedConstTy::with_type_of(tcx, field_def.did, adt_args)) + }) + .collect::>(); + + let opt_discr_const = if adt_def.is_enum() { + let valtree = ty::ValTree::from_scalar_int(tcx, variant_idx.into()); + Some(ty::Const::new_value(tcx, valtree, tcx.types.u32)) + } else { + None + }; + + let valtree = ty::ValTree::from_branches(tcx, opt_discr_const.into_iter().chain(fields)); + let adt_ty = Ty::new_adt(tcx, adt_def, adt_args); + ty::Const::new_value(tcx, valtree, adt_ty) + } + + fn lower_const_arg_tup( + &self, + exprs: &'tcx [&'tcx hir::ConstArg<'tcx>], + feed: FeedConstTy<'tcx>, + span: Span, + ) -> Const<'tcx> { + let tcx = self.tcx(); + + let FeedConstTy::WithTy(ty) = feed else { + return Const::new_error_with_message(tcx, span, "unsupported const tuple"); + }; + + let ty::Tuple(tys) = ty.kind() else { + return Const::new_error_with_message(tcx, span, "const tuple must have a tuple type"); + }; + + let exprs = exprs + .iter() + .zip(tys.iter()) + .map(|(expr, ty)| self.lower_const_arg(expr, FeedConstTy::WithTy(ty))) + .collect::>(); + + let valtree = ty::ValTree::from_branches(tcx, exprs); + ty::Const::new_value(tcx, valtree, ty) + } + fn lower_const_arg_struct( &self, hir_id: HirId, @@ -2350,7 +2589,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { return ty::Const::new_error(tcx, e); } - self.lower_const_arg(expr.expr, FeedConstTy::Param(field_def.did, adt_args)) + self.lower_const_arg( + expr.expr, + FeedConstTy::with_type_of(tcx, field_def.did, adt_args), + ) } None => { let e = tcx.dcx().span_err( @@ -2386,7 +2628,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { ) -> Const<'tcx> { let tcx = self.tcx(); let span = path.span; - match path.res { + let ct = match path.res { Res::Def(DefKind::ConstParam, def_id) => { assert_eq!(opt_self_ty, None); let _ = self.prohibit_generic_args( @@ -2395,7 +2637,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { ); self.lower_const_param(def_id, hir_id) } - Res::Def(DefKind::Const | DefKind::Ctor(_, CtorKind::Const), did) => { + Res::Def(DefKind::Const, did) => { assert_eq!(opt_self_ty, None); let [leading_segments @ .., segment] = path.segments else { bug!() }; let _ = self @@ -2403,6 +2645,35 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { let args = self.lower_generic_args_of_path_segment(span, did, segment); ty::Const::new_unevaluated(tcx, ty::UnevaluatedConst::new(did, args)) } + Res::Def(DefKind::Ctor(ctor_of, CtorKind::Const), did) => { + assert_eq!(opt_self_ty, None); + let [leading_segments @ .., segment] = path.segments else { bug!() }; + let _ = self + .prohibit_generic_args(leading_segments.iter(), GenericsArgsErrExtend::None); + + let parent_did = tcx.parent(did); + let generics_did = match ctor_of { + CtorOf::Variant => tcx.parent(parent_did), + CtorOf::Struct => parent_did, + }; + let args = self.lower_generic_args_of_path_segment(span, generics_did, segment); + + self.construct_const_ctor_value(did, ctor_of, args) + } + Res::Def(DefKind::Ctor(_, CtorKind::Fn), did) => { + assert_eq!(opt_self_ty, None); + let [leading_segments @ .., segment] = path.segments else { bug!() }; + let _ = self + .prohibit_generic_args(leading_segments.iter(), GenericsArgsErrExtend::None); + let parent_did = tcx.parent(did); + let generics_did = if let DefKind::Ctor(CtorOf::Variant, _) = tcx.def_kind(did) { + tcx.parent(parent_did) + } else { + parent_did + }; + let args = self.lower_generic_args_of_path_segment(span, generics_did, segment); + ty::Const::zero_sized(tcx, Ty::new_fn_def(tcx, did, args)) + } Res::Def(DefKind::AssocConst, did) => { let trait_segment = if let [modules @ .., trait_, _item] = path.segments { let _ = self.prohibit_generic_args(modules.iter(), GenericsArgsErrExtend::None); @@ -2438,9 +2709,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { DefKind::Mod | DefKind::Enum | DefKind::Variant - | DefKind::Ctor(CtorOf::Variant, CtorKind::Fn) | DefKind::Struct - | DefKind::Ctor(CtorOf::Struct, CtorKind::Fn) | DefKind::OpaqueTy | DefKind::TyAlias | DefKind::TraitAlias @@ -2475,7 +2744,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { span, format!("invalid Res {res:?} for const path"), ), - } + }; + self.check_param_uses_if_mcg(ct, span, false) } /// Literals are eagerly converted to a constant, everything else becomes `Unevaluated`. @@ -2520,20 +2790,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { _ => expr, }; - // FIXME(mgca): remove this delayed bug once we start checking this - // when lowering `Ty/ConstKind::Param`s more generally. - if let hir::ExprKind::Path(hir::QPath::Resolved( - _, - &hir::Path { res: Res::Def(DefKind::ConstParam, _), .. }, - )) = expr.kind - { - let e = tcx.dcx().span_delayed_bug( - expr.span, - "try_lower_anon_const_lit: received const param which shouldn't be possible", - ); - return Some(ty::Const::new_error(tcx, e)); - }; - let lit_input = match expr.kind { hir::ExprKind::Lit(lit) => Some(LitToConstInput { lit: lit.node, ty, neg: false }), hir::ExprKind::Unary(hir::UnOp::Neg, expr) => match expr.kind { @@ -2787,6 +3043,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { let args = ty::GenericArgs::for_item(tcx, def_id, |param, _| { if let Some(i) = (param.index as usize).checked_sub(offset) { let (lifetime, _) = lifetimes[i]; + // FIXME(mgca): should we be calling self.check_params_use_if_mcg here too? self.lower_resolved_lifetime(lifetime).into() } else { tcx.mk_param_from_def(param) @@ -2972,4 +3229,31 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { } Some(r) } + + fn construct_const_ctor_value( + &self, + ctor_def_id: DefId, + ctor_of: CtorOf, + args: GenericArgsRef<'tcx>, + ) -> Const<'tcx> { + let tcx = self.tcx(); + let parent_did = tcx.parent(ctor_def_id); + + let adt_def = tcx.adt_def(match ctor_of { + CtorOf::Variant => tcx.parent(parent_did), + CtorOf::Struct => parent_did, + }); + + let variant_idx = adt_def.variant_index_with_id(parent_did); + + let valtree = if adt_def.is_enum() { + let discr = ty::ValTree::from_scalar_int(tcx, variant_idx.as_u32().into()); + ty::ValTree::from_branches(tcx, [ty::Const::new_value(tcx, discr, tcx.types.u32)]) + } else { + ty::ValTree::zst(tcx) + }; + + let adt_ty = Ty::new_adt(tcx, adt_def, args); + ty::Const::new_value(tcx, valtree, adt_ty) + } } diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 65f6a11e8e9b..7296ba6f964a 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -301,7 +301,7 @@ pub fn lower_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> { pub fn lower_const_arg_for_rustdoc<'tcx>( tcx: TyCtxt<'tcx>, hir_ct: &hir::ConstArg<'tcx>, - feed: FeedConstTy<'_, 'tcx>, + feed: FeedConstTy<'tcx>, ) -> Const<'tcx> { let env_def_id = tcx.hir_get_parent_item(hir_ct.hir_id); collect::ItemCtxt::new(tcx, env_def_id.def_id).lowerer().lower_const_arg(hir_ct, feed) diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index f99533922110..2c160ccef2b6 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -17,12 +17,12 @@ use rustc_ast_pretty::pprust::state::MacHeader; use rustc_ast_pretty::pprust::{Comments, PrintState}; use rustc_hir::attrs::{AttributeKind, PrintAttribute}; use rustc_hir::{ - BindingMode, ByRef, ConstArgKind, GenericArg, GenericBound, GenericParam, GenericParamKind, - HirId, ImplicitSelfKind, LifetimeParamKind, Node, PatKind, PreciseCapturingArg, RangeEnd, Term, - TyPatKind, + BindingMode, ByRef, ConstArg, ConstArgExprField, ConstArgKind, GenericArg, GenericBound, + GenericParam, GenericParamKind, HirId, ImplicitSelfKind, LifetimeParamKind, Node, PatKind, + PreciseCapturingArg, RangeEnd, Term, TyPatKind, }; use rustc_span::source_map::SourceMap; -use rustc_span::{FileName, Ident, Span, Symbol, kw, sym}; +use rustc_span::{DUMMY_SP, FileName, Ident, Span, Symbol, kw, sym}; use {rustc_ast as ast, rustc_hir as hir}; pub fn id_to_string(cx: &dyn rustc_hir::intravisit::HirTyCtxt<'_>, hir_id: HirId) -> String { @@ -136,7 +136,11 @@ impl<'a> State<'a> { .path .segments .iter() - .map(|i| ast::PathSegment { ident: *i, args: None, id: DUMMY_NODE_ID }) + .map(|i| ast::PathSegment { + ident: Ident { name: *i, span: DUMMY_SP }, + args: None, + id: DUMMY_NODE_ID, + }) .collect(), tokens: None, }; @@ -1137,15 +1141,50 @@ impl<'a> State<'a> { fn print_const_arg(&mut self, const_arg: &hir::ConstArg<'_>) { match &const_arg.kind { - // FIXME(mgca): proper printing for struct exprs - ConstArgKind::Struct(..) => self.word("/* STRUCT EXPR */"), + ConstArgKind::Tup(exprs) => { + self.popen(); + self.commasep_cmnt( + Inconsistent, + exprs, + |s, arg| s.print_const_arg(arg), + |arg| arg.span, + ); + self.pclose(); + } + ConstArgKind::Struct(qpath, fields) => self.print_const_struct(qpath, fields), + ConstArgKind::TupleCall(qpath, args) => self.print_const_ctor(qpath, args), ConstArgKind::Path(qpath) => self.print_qpath(qpath, true), ConstArgKind::Anon(anon) => self.print_anon_const(anon), - ConstArgKind::Error(_, _) => self.word("/*ERROR*/"), + ConstArgKind::Error(_) => self.word("/*ERROR*/"), ConstArgKind::Infer(..) => self.word("_"), } } + fn print_const_struct(&mut self, qpath: &hir::QPath<'_>, fields: &&[&ConstArgExprField<'_>]) { + self.print_qpath(qpath, true); + self.word(" "); + self.word("{"); + if !fields.is_empty() { + self.nbsp(); + } + self.commasep(Inconsistent, *fields, |s, field| { + s.word(field.field.as_str().to_string()); + s.word(":"); + s.nbsp(); + s.print_const_arg(field.expr); + }); + self.word("}"); + } + + fn print_const_ctor(&mut self, qpath: &hir::QPath<'_>, args: &&[&ConstArg<'_, ()>]) { + self.print_qpath(qpath, true); + self.word("("); + self.commasep(Inconsistent, *args, |s, arg| { + s.print_const_arg(arg); + }); + self.word(")"); + } + fn print_call_post(&mut self, args: &[hir::Expr<'_>]) { self.popen(); self.commasep_exprs(Inconsistent, args); @@ -1880,7 +1919,6 @@ impl<'a> State<'a> { } self.print_literal(lit); } - hir::PatExprKind::ConstBlock(c) => self.print_inline_const(c), hir::PatExprKind::Path(qpath) => self.print_qpath(qpath, true), } } diff --git a/compiler/rustc_hir_typeck/messages.ftl b/compiler/rustc_hir_typeck/messages.ftl index 325be43a0065..0c4b1f891ead 100644 --- a/compiler/rustc_hir_typeck/messages.ftl +++ b/compiler/rustc_hir_typeck/messages.ftl @@ -133,6 +133,10 @@ hir_typeck_fru_suggestion = hir_typeck_functional_record_update_on_non_struct = functional record update syntax requires a struct +hir_typeck_gpu_kernel_abi_cannot_be_called = + functions with the "gpu-kernel" ABI cannot be called + .note = an `extern "gpu-kernel"` function must be launched on the GPU by the runtime + hir_typeck_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml` hir_typeck_help_set_edition_standalone = pass `--edition {$edition}` to `rustc` diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs index 714c6a104a9e..b60d053957a9 100644 --- a/compiler/rustc_hir_typeck/src/callee.rs +++ b/compiler/rustc_hir_typeck/src/callee.rs @@ -169,27 +169,27 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } }; - let valid = match canon_abi { + match canon_abi { // Rust doesn't know how to call functions with this ABI. - CanonAbi::Custom => false, - - // These is an entry point for the host, and cannot be called on the GPU. - CanonAbi::GpuKernel => false, - + CanonAbi::Custom // The interrupt ABIs should only be called by the CPU. They have complex // pre- and postconditions, and can use non-standard instructions like `iret` on x86. - CanonAbi::Interrupt(_) => false, + | CanonAbi::Interrupt(_) => { + let err = crate::errors::AbiCannotBeCalled { span, abi }; + self.tcx.dcx().emit_err(err); + } + + // This is an entry point for the host, and cannot be called directly. + CanonAbi::GpuKernel => { + let err = crate::errors::GpuKernelAbiCannotBeCalled { span }; + self.tcx.dcx().emit_err(err); + } CanonAbi::C | CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::Arm(_) - | CanonAbi::X86(_) => true, - }; - - if !valid { - let err = crate::errors::AbiCannotBeCalled { span, abi }; - self.tcx.dcx().emit_err(err); + | CanonAbi::X86(_) => {} } } diff --git a/compiler/rustc_hir_typeck/src/errors.rs b/compiler/rustc_hir_typeck/src/errors.rs index 620002915fa8..0cf7f09e9376 100644 --- a/compiler/rustc_hir_typeck/src/errors.rs +++ b/compiler/rustc_hir_typeck/src/errors.rs @@ -1198,6 +1198,14 @@ pub(crate) struct AbiCannotBeCalled { pub abi: ExternAbi, } +#[derive(Diagnostic)] +#[diag(hir_typeck_gpu_kernel_abi_cannot_be_called)] +pub(crate) struct GpuKernelAbiCannotBeCalled { + #[primary_span] + #[note] + pub span: Span, +} + #[derive(Diagnostic)] #[diag(hir_typeck_const_continue_bad_label)] pub(crate) struct ConstContinueBadLabel { diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index c4fa39c6c2c8..9d7e09b020a7 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -1705,7 +1705,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { return; }; if let hir::TyKind::Array(_, ct) = ty.peel_refs().kind { - let span = ct.span(); + let span = ct.span; self.dcx().try_steal_modify_and_emit_err( span, StashKey::UnderscoreForArrayLengths, @@ -1746,7 +1746,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { expr: &'tcx hir::Expr<'tcx>, ) -> Ty<'tcx> { let tcx = self.tcx; - let count_span = count.span(); + let count_span = count.span; let count = self.try_structurally_resolve_const( count_span, self.normalize(count_span, self.lower_const_arg(count, FeedConstTy::No)), diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index da719e615fd7..a66ff2a23c25 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -216,7 +216,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Don't write user type annotations for const param types, since we give them // identity args just so that we can trivially substitute their `EarlyBinder`. // We enforce that they match their type in MIR later on. - if matches!(self.tcx.def_kind(def_id), DefKind::ConstParam) { + if self.tcx.def_kind(def_id) == DefKind::ConstParam { return; } @@ -525,7 +525,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pub(crate) fn lower_const_arg( &self, const_arg: &'tcx hir::ConstArg<'tcx>, - feed: FeedConstTy<'_, 'tcx>, + feed: FeedConstTy<'tcx>, ) -> ty::Const<'tcx> { let ct = self.lowerer().lower_const_arg(const_arg, feed); self.register_wf_obligation( @@ -1004,6 +1004,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err_extend, ); + if let Err(e) = self.lowerer().check_param_res_if_mcg_for_instantiate_value_path(res, span) + { + return (Ty::new_error(self.tcx, e), res); + } + if let Res::Local(hid) = res { let ty = self.local_ty(span, hid); let ty = self.normalize(span, ty); @@ -1223,7 +1228,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Ambiguous parts of `ConstArg` are handled in the match arms below .lower_const_arg( ct.as_unambig_ct(), - FeedConstTy::Param(param.def_id, preceding_args), + FeedConstTy::with_type_of(self.fcx.tcx, param.def_id, preceding_args), ) .into(), (&GenericParamDefKind::Const { .. }, GenericArg::Infer(inf)) => { diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index b8a587016427..39c28c4f4e99 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -115,18 +115,6 @@ fn typeck_with_inspect<'tcx>( return tcx.typeck(typeck_root_def_id); } - // We can't handle bodies containing generic parameters even though - // these generic parameters aren't part of its `generics_of` right now. - // - // See the FIXME on `check_anon_const_invalid_param_uses`. - if tcx.features().min_generic_const_args() - && let DefKind::AnonConst = tcx.def_kind(def_id) - && let ty::AnonConstKind::MCG = tcx.anon_const_kind(def_id) - && let Err(e) = tcx.check_anon_const_invalid_param_uses(def_id) - { - e.raise_fatal(); - } - let id = tcx.local_def_id_to_hir_id(def_id); let node = tcx.hir_node(id); let span = tcx.def_span(def_id); diff --git a/compiler/rustc_hir_typeck/src/method/confirm.rs b/compiler/rustc_hir_typeck/src/method/confirm.rs index e81537008bb5..aab4e3985555 100644 --- a/compiler/rustc_hir_typeck/src/method/confirm.rs +++ b/compiler/rustc_hir_typeck/src/method/confirm.rs @@ -447,7 +447,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> { // We handle the ambig portions of `ConstArg` in the match arms below .lower_const_arg( ct.as_unambig_ct(), - FeedConstTy::Param(param.def_id, preceding_args), + FeedConstTy::with_type_of(self.cfcx.tcx, param.def_id, preceding_args), ) .into(), (GenericParamDefKind::Const { .. }, GenericArg::Infer(inf)) => { diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 1a25f6a582f2..beb0337d8c59 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -190,8 +190,8 @@ impl PickConstraintsForShadowed { // An item never shadows itself candidate.item.def_id != self.def_id // and we're only concerned about inherent impls doing the shadowing. - // Shadowing can only occur if the shadowed is further along - // the Receiver dereferencing chain than the shadowed. + // Shadowing can only occur if the impl being shadowed is further along + // the Receiver dereferencing chain than the impl doing the shadowing. && match candidate.kind { CandidateKind::InherentImplCandidate { receiver_steps, .. } => match self.receiver_steps { Some(shadowed_receiver_steps) => receiver_steps > shadowed_receiver_steps, diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index 18bc00d65351..331fb91becad 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -1384,13 +1384,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { && let hir::Node::Stmt(&hir::Stmt { kind: hir::StmtKind::Semi(parent), .. }) | hir::Node::Expr(parent) = tcx.parent_hir_node(path_expr.hir_id) { - let replacement_span = - if let hir::ExprKind::Call(..) | hir::ExprKind::Struct(..) = parent.kind { - // We want to replace the parts that need to go, like `()` and `{}`. + // We want to replace the parts that need to go, like `()` and `{}`. + let replacement_span = match parent.kind { + hir::ExprKind::Call(callee, _) if callee.hir_id == path_expr.hir_id => { span.with_hi(parent.span.hi()) - } else { - span - }; + } + hir::ExprKind::Struct(..) => span.with_hi(parent.span.hi()), + _ => span, + }; match (variant.ctor, parent.kind) { (None, hir::ExprKind::Struct(..)) => { // We want a struct and we have a struct. We won't suggest changing diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index 06fd89837d51..90e22b2cd381 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -925,9 +925,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } ty } - rustc_hir::PatExprKind::ConstBlock(c) => { - self.check_expr_const_block(c, Expectation::NoExpectation) - } rustc_hir::PatExprKind::Path(qpath) => { let (res, opt_ty, segments) = self.resolve_ty_and_res_fully_qualified_call(qpath, lt.hir_id, lt.span); @@ -999,20 +996,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pat_ty = self.tcx.types.str_; } - if self.tcx.features().string_deref_patterns() - && let hir::PatExprKind::Lit { - lit: Spanned { node: ast::LitKind::Str(..), .. }, .. - } = lt.kind - { - let tcx = self.tcx; - let expected = self.resolve_vars_if_possible(expected); - pat_ty = match expected.kind() { - ty::Adt(def, _) if tcx.is_lang_item(def.did(), LangItem::String) => expected, - ty::Str => Ty::new_static_str(tcx), - _ => pat_ty, - }; - } - // Somewhat surprising: in this case, the subtyping relation goes the // opposite way as the other cases. Actually what we really want is not // a subtyping relation at all but rather that there exists a LUB diff --git a/compiler/rustc_infer/src/infer/freshen.rs b/compiler/rustc_infer/src/infer/freshen.rs index ddc0b1168062..c058bebddcf0 100644 --- a/compiler/rustc_infer/src/infer/freshen.rs +++ b/compiler/rustc_infer/src/infer/freshen.rs @@ -60,45 +60,35 @@ impl<'a, 'tcx> TypeFreshener<'a, 'tcx> { } } - fn freshen_ty(&mut self, input: Result, ty::InferTy>, mk_fresh: F) -> Ty<'tcx> + fn freshen_ty(&mut self, input: ty::InferTy, mk_fresh: F) -> Ty<'tcx> where F: FnOnce(u32) -> Ty<'tcx>, { - match input { - Ok(ty) => ty.fold_with(self), - Err(key) => match self.ty_freshen_map.entry(key) { - Entry::Occupied(entry) => *entry.get(), - Entry::Vacant(entry) => { - let index = self.ty_freshen_count; - self.ty_freshen_count += 1; - let t = mk_fresh(index); - entry.insert(t); - t - } - }, + match self.ty_freshen_map.entry(input) { + Entry::Occupied(entry) => *entry.get(), + Entry::Vacant(entry) => { + let index = self.ty_freshen_count; + self.ty_freshen_count += 1; + let t = mk_fresh(index); + entry.insert(t); + t + } } } - fn freshen_const( - &mut self, - input: Result, ty::InferConst>, - freshener: F, - ) -> ty::Const<'tcx> + fn freshen_const(&mut self, input: ty::InferConst, freshener: F) -> ty::Const<'tcx> where F: FnOnce(u32) -> ty::InferConst, { - match input { - Ok(ct) => ct.fold_with(self), - Err(key) => match self.const_freshen_map.entry(key) { - Entry::Occupied(entry) => *entry.get(), - Entry::Vacant(entry) => { - let index = self.const_freshen_count; - self.const_freshen_count += 1; - let ct = ty::Const::new_infer(self.infcx.tcx, freshener(index)); - entry.insert(ct); - ct - } - }, + match self.const_freshen_map.entry(input) { + Entry::Occupied(entry) => *entry.get(), + Entry::Vacant(entry) => { + let index = self.const_freshen_count; + self.const_freshen_count += 1; + let ct = ty::Const::new_infer(self.infcx.tcx, freshener(index)); + entry.insert(ct); + ct + } } } } @@ -130,7 +120,7 @@ impl<'a, 'tcx> TypeFolder> for TypeFreshener<'a, 'tcx> { t } else { match *t.kind() { - ty::Infer(v) => self.fold_infer_ty(v).unwrap_or(t), + ty::Infer(v) => self.fold_infer_ty(v), // This code is hot enough that a non-debug assertion here makes a noticeable // difference on benchmarks like `wg-grammar`. @@ -146,27 +136,24 @@ impl<'a, 'tcx> TypeFolder> for TypeFreshener<'a, 'tcx> { match ct.kind() { ty::ConstKind::Infer(ty::InferConst::Var(v)) => { let mut inner = self.infcx.inner.borrow_mut(); - let input = - inner.const_unification_table().probe_value(v).known().ok_or_else(|| { - ty::InferConst::Var(inner.const_unification_table().find(v).vid) - }); - drop(inner); - self.freshen_const(input, ty::InferConst::Fresh) - } - ty::ConstKind::Infer(ty::InferConst::Fresh(i)) => { - if i >= self.const_freshen_count { - bug!( - "Encountered a freshend const with id {} \ - but our counter is only at {}", - i, - self.const_freshen_count, - ); + match inner.const_unification_table().probe_value(v).known() { + Some(const_) => { + drop(inner); + const_.fold_with(self) + } + None => { + let input = + ty::InferConst::Var(inner.const_unification_table().find(v).vid); + self.freshen_const(input, ty::InferConst::Fresh) + } } - ct + } + ty::ConstKind::Infer(ty::InferConst::Fresh(_)) => { + bug!("trying to freshen already-freshened const {ct:?}"); } ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(_) => { - bug!("unexpected const {:?}", ct) + bug!("unexpected const {ct:?}") } ty::ConstKind::Param(_) @@ -181,56 +168,49 @@ impl<'a, 'tcx> TypeFolder> for TypeFreshener<'a, 'tcx> { impl<'a, 'tcx> TypeFreshener<'a, 'tcx> { // This is separate from `fold_ty` to keep that method small and inlinable. #[inline(never)] - fn fold_infer_ty(&mut self, v: ty::InferTy) -> Option> { - match v { + fn fold_infer_ty(&mut self, ty: ty::InferTy) -> Ty<'tcx> { + match ty { ty::TyVar(v) => { let mut inner = self.infcx.inner.borrow_mut(); - let input = inner - .type_variables() - .probe(v) - .known() - .ok_or_else(|| ty::TyVar(inner.type_variables().root_var(v))); - drop(inner); - Some(self.freshen_ty(input, |n| Ty::new_fresh(self.infcx.tcx, n))) + match inner.type_variables().probe(v).known() { + Some(ty) => { + drop(inner); + ty.fold_with(self) + } + None => { + let input = ty::TyVar(inner.type_variables().root_var(v)); + self.freshen_ty(input, |n| Ty::new_fresh(self.infcx.tcx, n)) + } + } } ty::IntVar(v) => { let mut inner = self.infcx.inner.borrow_mut(); let value = inner.int_unification_table().probe_value(v); - let input = match value { - ty::IntVarValue::IntType(ty) => Ok(Ty::new_int(self.infcx.tcx, ty)), - ty::IntVarValue::UintType(ty) => Ok(Ty::new_uint(self.infcx.tcx, ty)), + match value { + ty::IntVarValue::IntType(ty) => Ty::new_int(self.infcx.tcx, ty), + ty::IntVarValue::UintType(ty) => Ty::new_uint(self.infcx.tcx, ty), ty::IntVarValue::Unknown => { - Err(ty::IntVar(inner.int_unification_table().find(v))) + let input = ty::IntVar(inner.int_unification_table().find(v)); + self.freshen_ty(input, |n| Ty::new_fresh_int(self.infcx.tcx, n)) } - }; - drop(inner); - Some(self.freshen_ty(input, |n| Ty::new_fresh_int(self.infcx.tcx, n))) + } } ty::FloatVar(v) => { let mut inner = self.infcx.inner.borrow_mut(); let value = inner.float_unification_table().probe_value(v); - let input = match value { - ty::FloatVarValue::Known(ty) => Ok(Ty::new_float(self.infcx.tcx, ty)), + match value { + ty::FloatVarValue::Known(ty) => Ty::new_float(self.infcx.tcx, ty), ty::FloatVarValue::Unknown => { - Err(ty::FloatVar(inner.float_unification_table().find(v))) + let input = ty::FloatVar(inner.float_unification_table().find(v)); + self.freshen_ty(input, |n| Ty::new_fresh_float(self.infcx.tcx, n)) } - }; - drop(inner); - Some(self.freshen_ty(input, |n| Ty::new_fresh_float(self.infcx.tcx, n))) + } } - ty::FreshTy(ct) | ty::FreshIntTy(ct) | ty::FreshFloatTy(ct) => { - if ct >= self.ty_freshen_count { - bug!( - "Encountered a freshend type with id {} \ - but our counter is only at {}", - ct, - self.ty_freshen_count - ); - } - None + ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_) => { + bug!("trying to freshen already-freshened type {ty:?}"); } } } diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 53567c6071e3..c9ea420944e2 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -637,10 +637,6 @@ impl<'tcx> InferCtxt<'tcx> { self.typing_mode } - pub fn freshen>>(&self, t: T) -> T { - t.fold_with(&mut self.freshener()) - } - /// Returns the origin of the type variable identified by `vid`. /// /// No attempt is made to resolve `vid` to its root variable. @@ -658,10 +654,6 @@ impl<'tcx> InferCtxt<'tcx> { } } - pub fn freshener<'b>(&'b self) -> TypeFreshener<'b, 'tcx> { - freshen::TypeFreshener::new(self) - } - pub fn unresolved_variables(&self) -> Vec> { let mut inner = self.inner.borrow_mut(); let mut vars: Vec> = inner diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index c0f8f33692e8..b2c4a9158197 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -55,7 +55,11 @@ pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec) -> Cfg { cfgs.into_iter() .map(|s| { let psess = ParseSess::emitter_with_note( - vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE], + vec![ + crate::DEFAULT_LOCALE_RESOURCE, + rustc_parse::DEFAULT_LOCALE_RESOURCE, + rustc_session::DEFAULT_LOCALE_RESOURCE, + ], format!("this occurred on the command line: `--cfg={s}`"), ); let filename = FileName::cfg_spec_source_code(&s); @@ -129,7 +133,11 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec) -> Ch for s in specs { let psess = ParseSess::emitter_with_note( - vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE], + vec![ + crate::DEFAULT_LOCALE_RESOURCE, + rustc_parse::DEFAULT_LOCALE_RESOURCE, + rustc_session::DEFAULT_LOCALE_RESOURCE, + ], format!("this occurred on the command line: `--check-cfg={s}`"), ); let filename = FileName::cfg_spec_source_code(&s); diff --git a/compiler/rustc_lexer/Cargo.toml b/compiler/rustc_lexer/Cargo.toml index 6d524b9d8873..057dce5b2f8d 100644 --- a/compiler/rustc_lexer/Cargo.toml +++ b/compiler/rustc_lexer/Cargo.toml @@ -15,8 +15,8 @@ Rust lexer used by rustc. No stability guarantees are provided. # Note that this crate purposefully does not depend on other rustc crates [dependencies] memchr = "2.7.6" -unicode-properties = { version = "0.1.0", default-features = false, features = ["emoji"] } -unicode-xid = "0.2.0" +unicode-properties = { version = "0.1.4", default-features = false, features = ["emoji"] } +unicode-ident = "1.0.22" [dev-dependencies] expect-test = "1.4.0" diff --git a/compiler/rustc_lexer/src/lib.rs b/compiler/rustc_lexer/src/lib.rs index f6790f7ed1e9..27ffcbc943bd 100644 --- a/compiler/rustc_lexer/src/lib.rs +++ b/compiler/rustc_lexer/src/lib.rs @@ -34,8 +34,25 @@ use LiteralKind::*; use TokenKind::*; use cursor::EOF_CHAR; pub use cursor::{Cursor, FrontmatterAllowed}; +pub use unicode_ident::UNICODE_VERSION; use unicode_properties::UnicodeEmoji; -pub use unicode_xid::UNICODE_VERSION as UNICODE_XID_VERSION; + +// Make sure that the Unicode version of the dependencies is the same. +const _: () = { + let properties = unicode_properties::UNICODE_VERSION; + let ident = unicode_ident::UNICODE_VERSION; + + if properties.0 != ident.0 as u64 + || properties.1 != ident.1 as u64 + || properties.2 != ident.2 as u64 + { + panic!( + "unicode-properties and unicode-ident must use the same Unicode version, \ + `unicode_properties::UNICODE_VERSION` and `unicode_ident::UNICODE_VERSION` are \ + different." + ); + } +}; /// Parsed token. /// It doesn't contain information about data that has been parsed, @@ -370,14 +387,14 @@ pub fn is_horizontal_whitespace(c: char) -> bool { /// a formal definition of valid identifier name. pub fn is_id_start(c: char) -> bool { // This is XID_Start OR '_' (which formally is not a XID_Start). - c == '_' || unicode_xid::UnicodeXID::is_xid_start(c) + c == '_' || unicode_ident::is_xid_start(c) } /// True if `c` is valid as a non-first character of an identifier. /// See [Rust language reference](https://doc.rust-lang.org/reference/identifiers.html) for /// a formal definition of valid identifier name. pub fn is_id_continue(c: char) -> bool { - unicode_xid::UnicodeXID::is_xid_continue(c) + unicode_ident::is_xid_continue(c) } /// The passed string is lexically an identifier. diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl index 1160bd9ffa74..b49b090272d4 100644 --- a/compiler/rustc_lint/messages.ftl +++ b/compiler/rustc_lint/messages.ftl @@ -472,6 +472,9 @@ lint_improper_ctypes_union_non_exhaustive = this union is non-exhaustive lint_improper_ctypes_unsafe_binder = unsafe binders are incompatible with foreign function interfaces +lint_improper_gpu_kernel_arg = passing type `{$ty}` to a function with "gpu-kernel" ABI may have unexpected behavior + .help = use primitive types and raw pointers to get reliable behavior + lint_int_to_ptr_transmutes = transmuting an integer to a pointer creates a pointer without provenance .note = this is dangerous because dereferencing the resulting pointer is undefined behavior .note_exposed_provenance = exposed provenance semantics can be used to create a pointer based on some previously exposed provenance @@ -599,6 +602,10 @@ lint_mismatched_lifetime_syntaxes_suggestion_mixed = lint_mismatched_lifetime_syntaxes_suggestion_mixed_only_paths = use `'_` for type paths +lint_missing_gpu_kernel_export_name = function with the "gpu-kernel" ABI has a mangled name + .note = mangled names make it hard to find the kernel, this is usually not intended + .help = use `unsafe(no_mangle)` or `unsafe(export_name = "")` + lint_mixed_script_confusables = the usage of Script Group `{$set}` in this crate consists solely of mixed script confusables .includes_note = the usage includes {$includes} diff --git a/compiler/rustc_lint/src/gpukernel_abi.rs b/compiler/rustc_lint/src/gpukernel_abi.rs new file mode 100644 index 000000000000..dbdf5b6e7955 --- /dev/null +++ b/compiler/rustc_lint/src/gpukernel_abi.rs @@ -0,0 +1,194 @@ +use std::iter; + +use rustc_abi::ExternAbi; +use rustc_hir::attrs::AttributeKind; +use rustc_hir::{self as hir, find_attr}; +use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable}; +use rustc_session::{declare_lint, declare_lint_pass}; +use rustc_span::Span; +use rustc_span::def_id::LocalDefId; + +use crate::lints::{ImproperGpuKernelArg, MissingGpuKernelExportName}; +use crate::{LateContext, LateLintPass, LintContext}; + +declare_lint! { + /// The `improper_gpu_kernel_arg` lint detects incorrect use of types in `gpu-kernel` + /// arguments. + /// + /// ### Example + /// + /// ```rust,ignore (fails on non-GPU targets) + /// #[unsafe(no_mangle)] + /// extern "gpu-kernel" fn kernel(_: [i32; 10]) {} + /// ``` + /// + /// This will produce: + /// + /// ```text + /// warning: passing type `[i32; 10]` to a function with "gpu-kernel" ABI may have unexpected behavior + /// --> t.rs:2:34 + /// | + /// 2 | extern "gpu-kernel" fn kernel(_: [i32; 10]) {} + /// | ^^^^^^^^^ + /// | + /// = help: use primitive types and raw pointers to get reliable behavior + /// = note: `#[warn(improper_gpu_kernel_arg)]` on by default + /// ``` + /// + /// ### Explanation + /// + /// The compiler has several checks to verify that types used as arguments in `gpu-kernel` + /// functions follow certain rules to ensure proper compatibility with the foreign interfaces. + /// This lint is issued when it detects a probable mistake in a signature. + IMPROPER_GPU_KERNEL_ARG, + Warn, + "GPU kernel entry points have a limited ABI" +} + +declare_lint! { + /// The `missing_gpu_kernel_export_name` lint detects `gpu-kernel` functions that have a mangled name. + /// + /// ### Example + /// + /// ```rust,ignore (fails on non-GPU targets) + /// extern "gpu-kernel" fn kernel() { } + /// ``` + /// + /// This will produce: + /// + /// ```text + /// warning: function with the "gpu-kernel" ABI has a mangled name + /// --> t.rs:1:1 + /// | + /// 1 | extern "gpu-kernel" fn kernel() {} + /// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + /// | + /// = help: use `unsafe(no_mangle)` or `unsafe(export_name = "")` + /// = note: mangled names make it hard to find the kernel, this is usually not intended + /// = note: `#[warn(missing_gpu_kernel_export_name)]` on by default + /// ``` + /// + /// ### Explanation + /// + /// `gpu-kernel` functions are usually searched by name in the compiled file. + /// A mangled name is usually unintentional as it would need to be searched by the mangled name. + /// + /// To use an unmangled name for the kernel, either `no_mangle` or `export_name` can be used. + /// ```rust,ignore (fails on non-GPU targets) + /// // Can be found by the name "kernel" + /// #[unsafe(no_mangle)] + /// extern "gpu-kernel" fn kernel() { } + /// + /// // Can be found by the name "new_name" + /// #[unsafe(export_name = "new_name")] + /// extern "gpu-kernel" fn other_kernel() { } + /// ``` + MISSING_GPU_KERNEL_EXPORT_NAME, + Warn, + "mangled gpu-kernel function" +} + +declare_lint_pass!(ImproperGpuKernelLint => [ + IMPROPER_GPU_KERNEL_ARG, + MISSING_GPU_KERNEL_EXPORT_NAME, +]); + +/// Check for valid and invalid types. +struct CheckGpuKernelTypes<'tcx> { + tcx: TyCtxt<'tcx>, + // If one or more invalid types were encountered while folding. + has_invalid: bool, +} + +impl<'tcx> TypeFolder> for CheckGpuKernelTypes<'tcx> { + fn cx(&self) -> TyCtxt<'tcx> { + self.tcx + } + + fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> { + match ty.kind() { + ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) => {} + // Thin pointers are allowed but fat pointers with metadata are not + ty::RawPtr(_, _) => { + if !ty.pointee_metadata_ty_or_projection(self.tcx).is_unit() { + self.has_invalid = true; + } + } + + ty::Adt(_, _) + | ty::Alias(_, _) + | ty::Array(_, _) + | ty::Bound(_, _) + | ty::Closure(_, _) + | ty::Coroutine(_, _) + | ty::CoroutineClosure(_, _) + | ty::CoroutineWitness(..) + | ty::Dynamic(_, _) + | ty::FnDef(_, _) + | ty::FnPtr(..) + | ty::Foreign(_) + | ty::Never + | ty::Pat(_, _) + | ty::Placeholder(_) + | ty::Ref(_, _, _) + | ty::Slice(_) + | ty::Str + | ty::Tuple(_) => self.has_invalid = true, + + _ => return ty.super_fold_with(self), + } + ty + } +} + +/// `ImproperGpuKernelLint` checks `gpu-kernel` function definitions: +/// +/// - `extern "gpu-kernel" fn` arguments should be primitive types. +/// - `extern "gpu-kernel" fn` should have an unmangled name. +impl<'tcx> LateLintPass<'tcx> for ImproperGpuKernelLint { + fn check_fn( + &mut self, + cx: &LateContext<'tcx>, + kind: hir::intravisit::FnKind<'tcx>, + decl: &'tcx hir::FnDecl<'_>, + _: &'tcx hir::Body<'_>, + span: Span, + id: LocalDefId, + ) { + use hir::intravisit::FnKind; + + let abi = match kind { + FnKind::ItemFn(_, _, header, ..) => header.abi, + FnKind::Method(_, sig, ..) => sig.header.abi, + _ => return, + }; + + if abi != ExternAbi::GpuKernel { + return; + } + + let sig = cx.tcx.fn_sig(id).instantiate_identity(); + let sig = cx.tcx.instantiate_bound_regions_with_erased(sig); + + for (input_ty, input_hir) in iter::zip(sig.inputs(), decl.inputs) { + let mut checker = CheckGpuKernelTypes { tcx: cx.tcx, has_invalid: false }; + input_ty.fold_with(&mut checker); + if checker.has_invalid { + cx.tcx.emit_node_span_lint( + IMPROPER_GPU_KERNEL_ARG, + input_hir.hir_id, + input_hir.span, + ImproperGpuKernelArg { ty: *input_ty }, + ); + } + } + + // Check for no_mangle/export_name, so the kernel can be found when querying the compiled object for the kernel function by name + if !find_attr!( + cx.tcx.get_all_attrs(id), + AttributeKind::NoMangle(..) | AttributeKind::ExportName { .. } + ) { + cx.emit_span_lint(MISSING_GPU_KERNEL_EXPORT_NAME, span, MissingGpuKernelExportName); + } + } +} diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 4e7a3e405176..ec7ce1ade929 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -46,6 +46,7 @@ mod expect; mod for_loops_over_fallibles; mod foreign_modules; mod function_cast_as_integer; +mod gpukernel_abi; mod if_let_rescope; mod impl_trait_overcaptures; mod interior_mutable_consts; @@ -92,6 +93,7 @@ use drop_forget_useless::*; use enum_intrinsics_non_enums::EnumIntrinsicsNonEnums; use for_loops_over_fallibles::*; use function_cast_as_integer::*; +use gpukernel_abi::*; use if_let_rescope::IfLetRescope; use impl_trait_overcaptures::ImplTraitOvercaptures; use interior_mutable_consts::*; @@ -196,6 +198,7 @@ late_lint_methods!( DerefIntoDynSupertrait: DerefIntoDynSupertrait, DropForgetUseless: DropForgetUseless, ImproperCTypesLint: ImproperCTypesLint, + ImproperGpuKernelLint: ImproperGpuKernelLint, InvalidFromUtf8: InvalidFromUtf8, VariantSizeDifferences: VariantSizeDifferences, PathStatements: PathStatements, diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index fde9546bd1c7..841b11c99687 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -2009,6 +2009,19 @@ impl<'a> LintDiagnostic<'a, ()> for ImproperCTypes<'_> { } } +#[derive(LintDiagnostic)] +#[diag(lint_improper_gpu_kernel_arg)] +#[help] +pub(crate) struct ImproperGpuKernelArg<'a> { + pub ty: Ty<'a>, +} + +#[derive(LintDiagnostic)] +#[diag(lint_missing_gpu_kernel_export_name)] +#[help] +#[note] +pub(crate) struct MissingGpuKernelExportName; + #[derive(LintDiagnostic)] #[diag(lint_variant_size_differences)] pub(crate) struct VariantSizeDifferencesDiag { diff --git a/compiler/rustc_lint/src/pass_by_value.rs b/compiler/rustc_lint/src/pass_by_value.rs index 29006732aade..f4a506d50a41 100644 --- a/compiler/rustc_lint/src/pass_by_value.rs +++ b/compiler/rustc_lint/src/pass_by_value.rs @@ -74,12 +74,9 @@ fn gen_args(cx: &LateContext<'_>, segment: &PathSegment<'_>) -> String { GenericArg::Type(ty) => { cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_else(|_| "_".into()) } - GenericArg::Const(c) => cx - .tcx - .sess - .source_map() - .span_to_snippet(c.span()) - .unwrap_or_else(|_| "_".into()), + GenericArg::Const(c) => { + cx.tcx.sess.source_map().span_to_snippet(c.span).unwrap_or_else(|_| "_".into()) + } GenericArg::Infer(_) => String::from("_"), }) .collect::>(); diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 95cbec1b37b4..733f5fd0df0a 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -23,7 +23,11 @@ #include "llvm/MC/TargetRegistry.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Passes/PassBuilder.h" +#if LLVM_VERSION_GE(22, 0) +#include "llvm/Plugins/PassPlugin.h" +#else #include "llvm/Passes/PassPlugin.h" +#endif #include "llvm/Passes/StandardInstrumentations.h" #include "llvm/Support/CBindingWrapping.h" #include "llvm/Support/FileSystem.h" diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 02e6abf24627..38e8886910f7 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1458,39 +1458,6 @@ extern "C" void LLVMRustPositionAfter(LLVMBuilderRef B, LLVMValueRef Instr) { } } -extern "C" LLVMValueRef LLVMRustGetInsertPoint(LLVMBuilderRef B) { - llvm::IRBuilderBase &IRB = *unwrap(B); - - llvm::IRBuilderBase::InsertPoint ip = IRB.saveIP(); - llvm::BasicBlock *BB = ip.getBlock(); - - if (!BB) - return nullptr; - - auto it = ip.getPoint(); - - if (it == BB->end()) - return nullptr; - - llvm::Instruction *I = &*it; - return wrap(I); -} - -extern "C" void LLVMRustRestoreInsertPoint(LLVMBuilderRef B, - LLVMValueRef Instr) { - llvm::IRBuilderBase &IRB = *unwrap(B); - - if (!Instr) { - llvm::BasicBlock *BB = IRB.GetInsertBlock(); - if (BB) - IRB.SetInsertPoint(BB); - return; - } - - llvm::Instruction *I = unwrap(Instr); - IRB.SetInsertPoint(I); -} - extern "C" LLVMValueRef LLVMRustGetFunctionCall(LLVMValueRef Fn, const char *Name, size_t NameLen) { auto targetName = StringRef(Name, NameLen); @@ -1572,16 +1539,8 @@ extern "C" uint64_t LLVMRustModuleCost(LLVMModuleRef M) { return std::distance(std::begin(f), std::end(f)); } -extern "C" void LLVMRustModuleInstructionStats(LLVMModuleRef M, - RustStringRef Str) { - auto OS = RawRustStringOstream(Str); - auto JOS = llvm::json::OStream(OS); - auto Module = unwrap(M); - - JOS.object([&] { - JOS.attribute("module", Module->getName()); - JOS.attribute("total", Module->getInstructionCount()); - }); +extern "C" uint64_t LLVMRustModuleInstructionStats(LLVMModuleRef M) { + return unwrap(M)->getInstructionCount(); } // Transfers ownership of DiagnosticHandler unique_ptr to the caller. diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs index af8ff5643f2c..2702c4498df6 100644 --- a/compiler/rustc_metadata/src/errors.rs +++ b/compiler/rustc_metadata/src/errors.rs @@ -464,6 +464,7 @@ pub struct CannotFindCrate { pub profiler_runtime: Symbol, pub locator_triple: TargetTuple, pub is_ui_testing: bool, + pub is_tier_3: bool, } impl Diagnostic<'_, G> for CannotFindCrate { @@ -483,11 +484,13 @@ impl Diagnostic<'_, G> for CannotFindCrate { diag.note(fluent::metadata_target_no_std_support); } + let has_precompiled_std = !self.is_tier_3; + if self.missing_core { if env!("CFG_RELEASE_CHANNEL") == "dev" && !self.is_ui_testing { // Note: Emits the nicer suggestion only for the dev channel. diag.help(fluent::metadata_consider_adding_std); - } else { + } else if has_precompiled_std { // NOTE: this suggests using rustup, even though the user may not have it installed. // That's because they could choose to install it; or this may give them a hint which // target they need to install from their distro. @@ -502,7 +505,9 @@ impl Diagnostic<'_, G> for CannotFindCrate { if !self.missing_core && self.span.is_dummy() { diag.note(fluent::metadata_std_required); } - if self.is_nightly_build { + // Recommend -Zbuild-std even on stable builds for Tier 3 targets because + // it's the recommended way to use the target, the user should switch to nightly. + if self.is_nightly_build || !has_precompiled_std { diag.help(fluent::metadata_consider_building_std); } } else if self.crate_name == self.profiler_runtime { diff --git a/compiler/rustc_metadata/src/locator.rs b/compiler/rustc_metadata/src/locator.rs index c4083a27e72b..6c30ce0ddb3d 100644 --- a/compiler/rustc_metadata/src/locator.rs +++ b/compiler/rustc_metadata/src/locator.rs @@ -1224,6 +1224,7 @@ impl CrateError { profiler_runtime: Symbol::intern(&sess.opts.unstable_opts.profiler_runtime), locator_triple: locator.triple, is_ui_testing: sess.opts.unstable_opts.ui_testing, + is_tier_3: sess.target.metadata.tier == Some(3), }; // The diagnostic for missing core is very good, but it is followed by a lot of // other diagnostics that do not add information. @@ -1249,6 +1250,7 @@ impl CrateError { profiler_runtime: Symbol::intern(&sess.opts.unstable_opts.profiler_runtime), locator_triple: sess.opts.target_triple.clone(), is_ui_testing: sess.opts.unstable_opts.ui_testing, + is_tier_3: sess.target.metadata.tier == Some(3), }; // The diagnostic for missing core is very good, but it is followed by a lot of // other diagnostics that do not add information. diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 36fe7f380069..7bd3f7db55f9 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -559,6 +559,15 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) { .filter_map(|(cnum, data)| data.used().then_some(cnum)), ) }, + duplicate_crate_names: |tcx, c: CrateNum| { + let name = tcx.crate_name(c); + tcx.arena.alloc_from_iter( + tcx.crates(()) + .into_iter() + .filter(|k| tcx.crate_name(**k) == name && **k != c) + .map(|c| *c), + ) + }, ..providers.queries }; provide_extern(&mut providers.extern_queries); diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 920c896d5a47..d0e8bc50c495 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -1441,6 +1441,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { // Skip encoding defs for these as they should not have had a `DefId` created hir::ConstArgKind::Error(..) | hir::ConstArgKind::Struct(..) + | hir::ConstArgKind::TupleCall(..) + | hir::ConstArgKind::Tup(..) | hir::ConstArgKind::Path(..) | hir::ConstArgKind::Infer(..) => true, hir::ConstArgKind::Anon(..) => false, diff --git a/compiler/rustc_middle/src/hir/map.rs b/compiler/rustc_middle/src/hir/map.rs index d62ddc915d17..ca783311586f 100644 --- a/compiler/rustc_middle/src/hir/map.rs +++ b/compiler/rustc_middle/src/hir/map.rs @@ -2,8 +2,6 @@ //! eliminated, and all its methods are now on `TyCtxt`. But the module name //! stays as `map` because there isn't an obviously better name for it. -use std::ops::ControlFlow; - use rustc_abi::ExternAbi; use rustc_ast::visit::{VisitorResult, walk_list}; use rustc_data_structures::fingerprint::Fingerprint; @@ -1005,7 +1003,7 @@ impl<'tcx> TyCtxt<'tcx> { Node::Field(field) => field.span, Node::AnonConst(constant) => constant.span, Node::ConstBlock(constant) => self.hir_body(constant.body).value.span, - Node::ConstArg(const_arg) => const_arg.span(), + Node::ConstArg(const_arg) => const_arg.span, Node::Expr(expr) => expr.span, Node::ExprField(field) => field.span, Node::ConstArgExprField(field) => field.span, @@ -1090,52 +1088,6 @@ impl<'tcx> TyCtxt<'tcx> { None } - - // FIXME(mgca): this is pretty iffy. In the long term we should make - // HIR ty lowering able to return `Error` versions of types/consts when - // lowering them in contexts that aren't supposed to use generic parameters. - // - // This current impl strategy is incomplete and doesn't handle `Self` ty aliases. - pub fn check_anon_const_invalid_param_uses( - self, - anon: LocalDefId, - ) -> Result<(), ErrorGuaranteed> { - struct GenericParamVisitor<'tcx>(TyCtxt<'tcx>); - impl<'tcx> Visitor<'tcx> for GenericParamVisitor<'tcx> { - type NestedFilter = nested_filter::OnlyBodies; - type Result = ControlFlow; - - fn maybe_tcx(&mut self) -> TyCtxt<'tcx> { - self.0 - } - - fn visit_path( - &mut self, - path: &crate::hir::Path<'tcx>, - _id: HirId, - ) -> ControlFlow { - if let Res::Def( - DefKind::TyParam | DefKind::ConstParam | DefKind::LifetimeParam, - _, - ) = path.res - { - let e = self.0.dcx().struct_span_err( - path.span, - "generic parameters may not be used in const operations", - ); - return ControlFlow::Break(e.emit()); - } - - intravisit::walk_path(self, path) - } - } - - let body = self.hir_maybe_body_owned_by(anon).unwrap(); - match GenericParamVisitor(self).visit_expr(&body.value) { - ControlFlow::Break(e) => Err(e), - ControlFlow::Continue(()) => Ok(()), - } - } } impl<'tcx> intravisit::HirTyCtxt<'tcx> for TyCtxt<'tcx> { diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index bed902e8334b..e4715f6e2c10 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -265,9 +265,16 @@ fn explain_lint_level_source( "`{flag} {hyphen_case_lint_name}` implied by `{flag} {hyphen_case_flag_val}`" )); if matches!(orig_level, Level::Warn | Level::Deny) { - err.help_once(format!( - "to override `{flag} {hyphen_case_flag_val}` add `#[allow({name})]`" - )); + let help = if name == "dead_code" { + format!( + "to override `{flag} {hyphen_case_flag_val}` add `#[expect({name})]` or `#[allow({name})]`" + ) + } else { + format!( + "to override `{flag} {hyphen_case_flag_val}` add `#[allow({name})]`" + ) + }; + err.help_once(help); } } } diff --git a/compiler/rustc_middle/src/metadata.rs b/compiler/rustc_middle/src/metadata.rs index 2b0be9865799..9e5b3ef61905 100644 --- a/compiler/rustc_middle/src/metadata.rs +++ b/compiler/rustc_middle/src/metadata.rs @@ -26,7 +26,7 @@ impl Reexport { } } -/// This structure is supposed to keep enough data to re-create `NameBinding`s for other crates +/// This structure is supposed to keep enough data to re-create `Decl`s for other crates /// during name resolution. Right now the bindings are not recreated entirely precisely so we may /// need to add more data in the future to correctly support macros 2.0, for example. /// Module child can be either a proper item or a reexport (including private imports). @@ -45,16 +45,9 @@ pub struct ModChild { pub reexport_chain: SmallVec<[Reexport; 2]>, } -#[derive(Debug, TyEncodable, TyDecodable, HashStable)] -pub enum AmbigModChildKind { - GlobVsGlob, - GlobVsExpanded, -} - /// Same as `ModChild`, however, it includes ambiguity error. #[derive(Debug, TyEncodable, TyDecodable, HashStable)] pub struct AmbigModChild { pub main: ModChild, pub second: ModChild, - pub kind: AmbigModChildKind, } diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 2d84e919359e..a31f03362a3d 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -1896,7 +1896,8 @@ fn pretty_print_const_value_tcx<'tcx>( // Aggregates, printed as array/tuple/struct/variant construction syntax. // // NB: the `has_non_region_param` check ensures that we can use - // the `destructure_const` query with an empty `ty::ParamEnv` without + // the `try_destructure_mir_constant_for_user_output ` query with + // an empty `TypingEnv::fully_monomorphized` without // introducing ICEs (e.g. via `layout_of`) from missing bounds. // E.g. `transmute([0usize; 2]): (u8, *mut T)` needs to know `T: Sized` // to be able to destructure the tuple into `(0u8, *mut T)` diff --git a/compiler/rustc_middle/src/mir/statement.rs b/compiler/rustc_middle/src/mir/statement.rs index 1ba1ae3e1531..c1f8c46baddb 100644 --- a/compiler/rustc_middle/src/mir/statement.rs +++ b/compiler/rustc_middle/src/mir/statement.rs @@ -25,7 +25,7 @@ impl<'tcx> Statement<'tcx> { /// Changes a statement to a nop. This is both faster than deleting instructions and avoids /// invalidating statement indices in `Location`s. pub fn make_nop(&mut self, drop_debuginfo: bool) { - if matches!(self.kind, StatementKind::Nop) { + if self.kind == StatementKind::Nop { return; } let replaced_stmt = std::mem::replace(&mut self.kind, StatementKind::Nop); diff --git a/compiler/rustc_middle/src/query/erase.rs b/compiler/rustc_middle/src/query/erase.rs index 774dd88997f2..711a597d4603 100644 --- a/compiler/rustc_middle/src/query/erase.rs +++ b/compiler/rustc_middle/src/query/erase.rs @@ -402,7 +402,7 @@ tcx_lifetime! { rustc_middle::ty::ClauseKind, rustc_middle::ty::ClosureTypeInfo, rustc_middle::ty::Const, - rustc_middle::ty::DestructuredConst, + rustc_middle::ty::DestructuredAdtConst, rustc_middle::ty::ExistentialTraitRef, rustc_middle::ty::FnSig, rustc_middle::ty::GenericArg, diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 676f0d82e4fb..5f40c36423b3 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -1312,8 +1312,9 @@ rustc_queries! { return_result_from_ensure_ok } - /// Return the set of (transitive) callees that may result in a recursive call to `key`. - query mir_callgraph_cyclic(key: LocalDefId) -> &'tcx UnordSet { + /// Return the set of (transitive) callees that may result in a recursive call to `key`, + /// if we were able to walk all callees. + query mir_callgraph_cyclic(key: LocalDefId) -> &'tcx Option> { fatal_cycle arena_cache desc { |tcx| @@ -1408,12 +1409,6 @@ rustc_queries! { desc { "converting type-level constant value to MIR constant value"} } - /// Destructures array, ADT or tuple constants into the constants - /// of their fields. - query destructure_const(key: ty::Const<'tcx>) -> ty::DestructuredConst<'tcx> { - desc { "destructuring type level constant"} - } - // FIXME get rid of this with valtrees query lit_to_const( key: LitToConstInput<'tcx> @@ -2339,6 +2334,7 @@ rustc_queries! { eval_always desc { "fetching all foreign CrateNum instances" } } + // Crates that are loaded non-speculatively (not for diagnostics or doc links). // FIXME: This is currently only used for collecting lang items, but should be used instead of // `crates` in most other cases too. @@ -2347,6 +2343,14 @@ rustc_queries! { desc { "fetching `CrateNum`s for all crates loaded non-speculatively" } } + /// All crates that share the same name as crate `c`. + /// + /// This normally occurs when multiple versions of the same dependency are present in the + /// dependency tree. + query duplicate_crate_names(c: CrateNum) -> &'tcx [CrateNum] { + desc { "fetching `CrateNum`s with same name as `{c:?}`" } + } + /// A list of all traits in a crate, used by rustdoc and error reporting. query traits(_: CrateNum) -> &'tcx [DefId] { desc { "fetching all traits in a crate" } diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index 31745cae3c06..3683c1cfb7dd 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -827,23 +827,22 @@ pub enum PatKind<'tcx> { /// much simpler. /// * raw pointers derived from integers, other raw pointers will have already resulted in an /// error. - /// * `String`, if `string_deref_patterns` is enabled. Constant { value: ty::Value<'tcx>, }, - /// Pattern obtained by converting a constant (inline or named) to its pattern - /// representation using `const_to_pat`. This is used for unsafety checking. + /// Wrapper node representing a named constant that was lowered to a pattern + /// using `const_to_pat`. + /// + /// This is used by some diagnostics for non-exhaustive matches, to map + /// the pattern node back to the `DefId` of its original constant. + /// + /// FIXME(#150498): Can we make this an `Option` field on `Pat` + /// instead, so that non-diagnostic code can ignore it more easily? ExpandedConstant { /// [DefId] of the constant item. def_id: DefId, /// The pattern that the constant lowered to. - /// - /// HACK: we need to keep the `DefId` of inline constants around for unsafety checking; - /// therefore when a range pattern contains inline constants, we re-wrap the range pattern - /// with the `ExpandedConstant` nodes that correspond to the range endpoints. Hence - /// `subpattern` may actually be a range pattern, and `def_id` be the constant for one of - /// its endpoints. subpattern: Box>, }, diff --git a/compiler/rustc_middle/src/ty/consts/valtree.rs b/compiler/rustc_middle/src/ty/consts/valtree.rs index 8afee2dfe3bc..6501ddeed6fa 100644 --- a/compiler/rustc_middle/src/ty/consts/valtree.rs +++ b/compiler/rustc_middle/src/ty/consts/valtree.rs @@ -1,6 +1,7 @@ use std::fmt; use std::ops::Deref; +use rustc_abi::{FIRST_VARIANT, VariantIdx}; use rustc_data_structures::intern::Interned; use rustc_hir::def::Namespace; use rustc_macros::{ @@ -189,6 +190,26 @@ impl<'tcx> Value<'tcx> { ValTreeKind::Leaf(_) => None, } } + + /// Destructures array, ADT or tuple constants into the constants + /// of their fields. + pub fn destructure_adt_const(&self) -> ty::DestructuredAdtConst<'tcx> { + let fields = self.to_branch(); + + let (variant, fields) = match self.ty.kind() { + ty::Adt(def, _) if def.variants().is_empty() => { + bug!("unreachable") + } + ty::Adt(def, _) if def.is_enum() => { + let (head, rest) = fields.split_first().unwrap(); + (VariantIdx::from_u32(head.to_leaf().to_u32()), rest) + } + ty::Adt(_, _) => (FIRST_VARIANT, fields), + _ => bug!("destructure_adt_const called on non-ADT type: {:?}", self.ty), + }; + + ty::DestructuredAdtConst { variant, fields } + } } impl<'tcx> rustc_type_ir::inherent::ValueConst> for Value<'tcx> { diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 25cc739f5ff9..a2f4714d1b2c 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -907,10 +907,6 @@ impl<'tcx> rustc_type_ir::inherent::Features> for &'tcx rustc_featu self.coroutine_clone() } - fn associated_const_equality(self) -> bool { - self.associated_const_equality() - } - fn feature_bound_holds_in_crate(self, symbol: Symbol) -> bool { // We don't consider feature bounds to hold in the crate when `staged_api` feature is // enabled, even if it is enabled through `#[feature]`. diff --git a/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs b/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs index 953ad62be0a8..d03e593e37b9 100644 --- a/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs +++ b/compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs @@ -160,7 +160,7 @@ impl<'tcx> InhabitedPredicate<'tcx> { pub fn all(tcx: TyCtxt<'tcx>, iter: impl IntoIterator) -> Self { let mut result = Self::True; for pred in iter { - if matches!(pred, Self::False) { + if pred == Self::False { return Self::False; } result = result.and(tcx, pred); @@ -171,7 +171,7 @@ impl<'tcx> InhabitedPredicate<'tcx> { pub fn any(tcx: TyCtxt<'tcx>, iter: impl IntoIterator) -> Self { let mut result = Self::False; for pred in iter { - if matches!(pred, Self::True) { + if pred == Self::True { return Self::True; } result = result.or(tcx, pred); diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 5cc5ab0d5268..e2a94b607de1 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -220,9 +220,8 @@ pub struct ResolverAstLowering { /// Information about functions signatures for delegation items expansion pub delegation_fn_sigs: LocalDefIdMap, - // NodeIds (either delegation.id or item_id in case of a trait impl) for signature resolution, - // for details see https://github.com/rust-lang/rust/issues/118212#issuecomment-2160686914 - pub delegation_sig_resolution_nodes: LocalDefIdMap, + // Information about delegations which is used when handling recursive delegations + pub delegation_infos: LocalDefIdMap, } bitflags::bitflags! { @@ -235,14 +234,27 @@ bitflags::bitflags! { pub const DELEGATION_INHERIT_ATTRS_START: DelegationFnSigAttrs = DelegationFnSigAttrs::MUST_USE; +#[derive(Debug)] +pub struct DelegationInfo { + // NodeId (either delegation.id or item_id in case of a trait impl) for signature resolution, + // for details see https://github.com/rust-lang/rust/issues/118212#issuecomment-2160686914 + pub resolution_node: ast::NodeId, + pub attrs: DelegationAttrs, +} + +#[derive(Debug)] +pub struct DelegationAttrs { + pub flags: DelegationFnSigAttrs, + pub to_inherit: AttrVec, +} + #[derive(Debug)] pub struct DelegationFnSig { pub header: ast::FnHeader, pub param_count: usize, pub has_self: bool, pub c_variadic: bool, - pub attrs_flags: DelegationFnSigAttrs, - pub to_inherit_attrs: AttrVec, + pub attrs: DelegationAttrs, } #[derive(Clone, Copy, Debug, HashStable)] @@ -2319,8 +2331,8 @@ impl<'tcx> fmt::Debug for SymbolName<'tcx> { /// The constituent parts of a type level constant of kind ADT or array. #[derive(Copy, Clone, Debug, HashStable)] -pub struct DestructuredConst<'tcx> { - pub variant: Option, +pub struct DestructuredAdtConst<'tcx> { + pub variant: VariantIdx, pub fields: &'tcx [ty::Const<'tcx>], } diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index c4f2917ad9e5..2a65517de403 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1919,66 +1919,65 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { self.pretty_print_byte_str(bytes)?; return Ok(()); } - // Aggregates, printed as array/tuple/struct/variant construction syntax. - (ty::ValTreeKind::Branch(_), ty::Array(..) | ty::Tuple(..) | ty::Adt(..)) => { - let contents = self.tcx().destructure_const(ty::Const::new_value( - self.tcx(), - cv.valtree, - cv.ty, - )); - let fields = contents.fields.iter().copied(); + (ty::ValTreeKind::Branch(fields), ty::Array(..) | ty::Tuple(..)) => { + let fields_iter = fields.iter().copied(); + match *cv.ty.kind() { ty::Array(..) => { write!(self, "[")?; - self.comma_sep(fields)?; + self.comma_sep(fields_iter)?; write!(self, "]")?; } ty::Tuple(..) => { write!(self, "(")?; - self.comma_sep(fields)?; - if contents.fields.len() == 1 { + self.comma_sep(fields_iter)?; + if fields.len() == 1 { write!(self, ",")?; } write!(self, ")")?; } - ty::Adt(def, _) if def.variants().is_empty() => { - self.typed_value( - |this| { - write!(this, "unreachable()")?; - Ok(()) - }, - |this| this.print_type(cv.ty), - ": ", - )?; - } - ty::Adt(def, args) => { - let variant_idx = - contents.variant.expect("destructed const of adt without variant idx"); - let variant_def = &def.variant(variant_idx); - self.pretty_print_value_path(variant_def.def_id, args)?; - match variant_def.ctor_kind() { - Some(CtorKind::Const) => {} - Some(CtorKind::Fn) => { - write!(self, "(")?; - self.comma_sep(fields)?; - write!(self, ")")?; - } - None => { - write!(self, " {{ ")?; - let mut first = true; - for (field_def, field) in iter::zip(&variant_def.fields, fields) { - if !first { - write!(self, ", ")?; - } - write!(self, "{}: ", field_def.name)?; - field.print(self)?; - first = false; + _ => unreachable!(), + } + return Ok(()); + } + (ty::ValTreeKind::Branch(_), ty::Adt(def, args)) => { + let contents = cv.destructure_adt_const(); + let fields = contents.fields.iter().copied(); + + if def.variants().is_empty() { + self.typed_value( + |this| { + write!(this, "unreachable()")?; + Ok(()) + }, + |this| this.print_type(cv.ty), + ": ", + )?; + } else { + let variant_idx = contents.variant; + let variant_def = &def.variant(variant_idx); + self.pretty_print_value_path(variant_def.def_id, args)?; + match variant_def.ctor_kind() { + Some(CtorKind::Const) => {} + Some(CtorKind::Fn) => { + write!(self, "(")?; + self.comma_sep(fields)?; + write!(self, ")")?; + } + None => { + write!(self, " {{ ")?; + let mut first = true; + for (field_def, field) in iter::zip(&variant_def.fields, fields) { + if !first { + write!(self, ", ")?; } - write!(self, " }}")?; + write!(self, "{}: ", field_def.name)?; + field.print(self)?; + first = false; } + write!(self, " }}")?; } } - _ => unreachable!(), } return Ok(()); } @@ -3381,7 +3380,7 @@ define_print_and_forward_display! { fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, Namespace, DefId)) { // Iterate all (non-anonymous) local crate items no matter where they are defined. for id in tcx.hir_free_items() { - if matches!(tcx.def_kind(id.owner_id), DefKind::Use) { + if tcx.def_kind(id.owner_id) == DefKind::Use { continue; } diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index c3834607e923..c282f2211f65 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1218,6 +1218,12 @@ impl<'tcx> Ty<'tcx> { *self.kind() == Str } + /// Returns true if this type is `&str`. The reference's lifetime is ignored. + #[inline] + pub fn is_imm_ref_str(self) -> bool { + matches!(self.kind(), ty::Ref(_, inner, hir::Mutability::Not) if inner.is_str()) + } + #[inline] pub fn is_param(self, index: u32) -> bool { match self.kind() { diff --git a/compiler/rustc_mir_build/src/builder/matches/buckets.rs b/compiler/rustc_mir_build/src/builder/matches/buckets.rs index f8af50ee52fe..0d2e9bf87585 100644 --- a/compiler/rustc_mir_build/src/builder/matches/buckets.rs +++ b/compiler/rustc_mir_build/src/builder/matches/buckets.rs @@ -1,12 +1,14 @@ use std::cmp::Ordering; use rustc_data_structures::fx::FxIndexMap; -use rustc_middle::mir::{BinOp, Place}; +use rustc_middle::mir::Place; use rustc_middle::span_bug; use tracing::debug; use crate::builder::Builder; -use crate::builder::matches::{Candidate, PatConstKind, Test, TestBranch, TestKind, TestableCase}; +use crate::builder::matches::{ + Candidate, PatConstKind, SliceLenOp, Test, TestBranch, TestKind, TestableCase, +}; /// Output of [`Builder::partition_candidates_into_buckets`]. pub(crate) struct PartitionedCandidates<'tcx, 'b, 'c> { @@ -212,66 +214,71 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { Some(if value { TestBranch::Success } else { TestBranch::Failure }) } + // Determine how the proposed slice-length test interacts with the + // slice pattern we're currently looking at. + // + // Keep in mind the invariant that a case is not allowed to succeed + // on multiple arms of the same test. For example, even though the + // test `len == 4` logically implies `len >= 4` on its success arm, + // the case `len >= 4` could also succeed on the test's failure arm, + // so it can't be included in the success bucket or failure bucket. ( - &TestKind::Len { len: test_len, op: BinOp::Eq }, - &TestableCase::Slice { len, variable_length }, + &TestKind::SliceLen { len: test_len, op: SliceLenOp::Equal }, + &TestableCase::Slice { len: pat_len, op: pat_op }, ) => { - match (test_len.cmp(&len), variable_length) { - (Ordering::Equal, false) => { - // on true, min_len = len = $actual_length, - // on false, len != $actual_length + match (test_len.cmp(&pat_len), pat_op) { + (Ordering::Equal, SliceLenOp::Equal) => { + // E.g. test is `len == 4` and pattern is `len == 4`. + // Pattern is fully matched on the success arm. fully_matched = true; Some(TestBranch::Success) } (Ordering::Less, _) => { - // test_len < pat_len. If $actual_len = test_len, - // then $actual_len < pat_len and we don't have - // enough elements. + // E.g. test is `len == 4` and pattern is `len == 5` or `len >= 5`. + // Pattern can only succeed on the failure arm, but isn't fully matched. fully_matched = false; Some(TestBranch::Failure) } - (Ordering::Equal | Ordering::Greater, true) => { - // This can match both if $actual_len = test_len >= pat_len, - // and if $actual_len > test_len. We can't advance. + (Ordering::Equal | Ordering::Greater, SliceLenOp::GreaterOrEqual) => { + // E.g. test is `len == 4` and pattern is `len >= 4` or `len >= 3`. + // Pattern could succeed on both arms, so it can't be bucketed. fully_matched = false; None } - (Ordering::Greater, false) => { - // test_len != pat_len, so if $actual_len = test_len, then - // $actual_len != pat_len. + (Ordering::Greater, SliceLenOp::Equal) => { + // E.g. test is `len == 4` and pattern is `len == 3`. + // Pattern can only succeed on the failure arm, but isn't fully matched. fully_matched = false; Some(TestBranch::Failure) } } } ( - &TestKind::Len { len: test_len, op: BinOp::Ge }, - &TestableCase::Slice { len, variable_length }, + &TestKind::SliceLen { len: test_len, op: SliceLenOp::GreaterOrEqual }, + &TestableCase::Slice { len: pat_len, op: pat_op }, ) => { - // the test is `$actual_len >= test_len` - match (test_len.cmp(&len), variable_length) { - (Ordering::Equal, true) => { - // $actual_len >= test_len = pat_len, - // so we can match. + match (test_len.cmp(&pat_len), pat_op) { + (Ordering::Equal, SliceLenOp::GreaterOrEqual) => { + // E.g. test is `len >= 4` and pattern is `len >= 4`. + // Pattern is fully matched on the success arm. fully_matched = true; Some(TestBranch::Success) } - (Ordering::Less, _) | (Ordering::Equal, false) => { - // test_len <= pat_len. If $actual_len < test_len, - // then it is also < pat_len, so the test passing is - // necessary (but insufficient). + (Ordering::Less, _) | (Ordering::Equal, SliceLenOp::Equal) => { + // E.g. test is `len >= 4` and pattern is `len == 5` or `len >= 5` or `len == 4`. + // Pattern can only succeed on the success arm, but isn't fully matched. fully_matched = false; Some(TestBranch::Success) } - (Ordering::Greater, false) => { - // test_len > pat_len. If $actual_len >= test_len > pat_len, - // then we know we won't have a match. + (Ordering::Greater, SliceLenOp::Equal) => { + // E.g. test is `len >= 4` and pattern is `len == 3`. + // Pattern can only succeed on the failure arm, but isn't fully matched. fully_matched = false; Some(TestBranch::Failure) } - (Ordering::Greater, true) => { - // test_len < pat_len, and is therefore less - // strict. This can still go both ways. + (Ordering::Greater, SliceLenOp::GreaterOrEqual) => { + // E.g. test is `len >= 4` and pattern is `len >= 3`. + // Pattern could succeed on both arms, so it can't be bucketed. fully_matched = false; None } @@ -307,7 +314,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } ( - TestKind::Eq { value: test_val, .. }, + TestKind::StringEq { value: test_val, .. }, + TestableCase::Constant { value: case_val, kind: PatConstKind::String }, + ) + | ( + TestKind::ScalarEq { value: test_val, .. }, TestableCase::Constant { value: case_val, kind: PatConstKind::Float | PatConstKind::Other, @@ -338,9 +349,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { TestKind::Switch { .. } | TestKind::SwitchInt { .. } | TestKind::If - | TestKind::Len { .. } + | TestKind::SliceLen { .. } | TestKind::Range { .. } - | TestKind::Eq { .. } + | TestKind::StringEq { .. } + | TestKind::ScalarEq { .. } | TestKind::Deref { .. }, _, ) => { diff --git a/compiler/rustc_mir_build/src/builder/matches/match_pair.rs b/compiler/rustc_mir_build/src/builder/matches/match_pair.rs index 798110c8b090..f0114c2193c3 100644 --- a/compiler/rustc_mir_build/src/builder/matches/match_pair.rs +++ b/compiler/rustc_mir_build/src/builder/matches/match_pair.rs @@ -2,13 +2,14 @@ use std::sync::Arc; use rustc_abi::FieldIdx; use rustc_middle::mir::*; +use rustc_middle::span_bug; use rustc_middle::thir::*; use rustc_middle::ty::{self, Ty, TypeVisitableExt}; use crate::builder::Builder; use crate::builder::expr::as_place::{PlaceBase, PlaceBuilder}; use crate::builder::matches::{ - FlatPat, MatchPairTree, PatConstKind, PatternExtraData, TestableCase, + FlatPat, MatchPairTree, PatConstKind, PatternExtraData, SliceLenOp, TestableCase, }; impl<'a, 'tcx> Builder<'a, 'tcx> { @@ -173,9 +174,21 @@ impl<'tcx> MatchPairTree<'tcx> { PatConstKind::IntOrChar } else if pat_ty.is_floating_point() { PatConstKind::Float + } else if pat_ty.is_str() { + // Deref-patterns can cause string-literal patterns to have + // type `str` instead of the usual `&str`. + if !cx.tcx.features().deref_patterns() { + span_bug!( + pattern.span, + "const pattern has type `str` but deref_patterns is not enabled" + ); + } + PatConstKind::String + } else if pat_ty.is_imm_ref_str() { + PatConstKind::String } else { // FIXME(Zalathar): This still covers several different - // categories (e.g. raw pointer, string, pattern-type) + // categories (e.g. raw pointer, pattern-type) // which could be split out into their own kinds. PatConstKind::Other }; @@ -277,11 +290,20 @@ impl<'tcx> MatchPairTree<'tcx> { ); if prefix.is_empty() && slice.is_some() && suffix.is_empty() { + // This pattern is shaped like `[..]`. It can match a slice + // of any length, so no length test is needed. None } else { + // Any other shape of slice pattern requires a length test. + // Slice patterns with a `..` subpattern require a minimum + // length; those without `..` require an exact length. Some(TestableCase::Slice { len: u64::try_from(prefix.len() + suffix.len()).unwrap(), - variable_length: slice.is_some(), + op: if slice.is_some() { + SliceLenOp::GreaterOrEqual + } else { + SliceLenOp::Equal + }, }) } } diff --git a/compiler/rustc_mir_build/src/builder/matches/mod.rs b/compiler/rustc_mir_build/src/builder/matches/mod.rs index 1da983462887..9080e2ba801b 100644 --- a/compiler/rustc_mir_build/src/builder/matches/mod.rs +++ b/compiler/rustc_mir_build/src/builder/matches/mod.rs @@ -1264,7 +1264,7 @@ enum TestableCase<'tcx> { Variant { adt_def: ty::AdtDef<'tcx>, variant_index: VariantIdx }, Constant { value: ty::Value<'tcx>, kind: PatConstKind }, Range(Arc>), - Slice { len: u64, variable_length: bool }, + Slice { len: u64, op: SliceLenOp }, Deref { temp: Place<'tcx>, mutability: Mutability }, Never, Or { pats: Box<[FlatPat<'tcx>]> }, @@ -1290,9 +1290,10 @@ enum PatConstKind { /// These types don't support `SwitchInt` and require an equality test, /// but can also interact with range pattern tests. Float, + /// Constant string values, tested via string equality. + String, /// Any other constant-pattern is usually tested via some kind of equality /// check. Types that might be encountered here include: - /// - `&str` /// - raw pointers derived from integer values /// - pattern types, e.g. `pattern_type!(u32 is 1..)` Other, @@ -1332,7 +1333,21 @@ pub(crate) struct MatchPairTree<'tcx> { pattern_span: Span, } -/// See [`Test`] for more. +/// A runtime test to perform to determine which candidates match a scrutinee place. +/// +/// The kind of test to perform is indicated by [`TestKind`]. +#[derive(Debug)] +pub(crate) struct Test<'tcx> { + span: Span, + kind: TestKind<'tcx>, +} + +/// The kind of runtime test to perform to determine which candidates match a +/// scrutinee place. This is the main component of [`Test`]. +/// +/// Some of these variants don't contain the constant value(s) being tested +/// against, because those values are stored in the corresponding bucketed +/// candidates instead. #[derive(Clone, Debug, PartialEq)] enum TestKind<'tcx> { /// Test what enum variant a value is. @@ -1354,21 +1369,27 @@ enum TestKind<'tcx> { /// Test whether a `bool` is `true` or `false`. If, - /// Test for equality with value, possibly after an unsizing coercion to - /// `cast_ty`, - Eq { + /// Tests the place against a string constant using string equality. + StringEq { + /// Constant `&str` value to test against. value: ty::Value<'tcx>, - // Integer types are handled by `SwitchInt`, and constants with ADT - // types and `&[T]` types are converted back into patterns, so this can - // only be `&str` or floats. - cast_ty: Ty<'tcx>, + /// Type of the corresponding pattern node. Usually `&str`, but could + /// be `str` for patterns like `deref!("..."): String`. + pat_ty: Ty<'tcx>, + }, + + /// Tests the place against a constant using scalar equality. + ScalarEq { + value: ty::Value<'tcx>, + /// Type of the corresponding pattern node. + pat_ty: Ty<'tcx>, }, /// Test whether the value falls within an inclusive or exclusive range. Range(Arc>), /// Test that the length of the slice is `== len` or `>= len`. - Len { len: u64, op: BinOp }, + SliceLen { len: u64, op: SliceLenOp }, /// Call `Deref::deref[_mut]` on the value. Deref { @@ -1381,14 +1402,15 @@ enum TestKind<'tcx> { Never, } -/// A test to perform to determine which [`Candidate`] matches a value. -/// -/// [`Test`] is just the test to perform; it does not include the value -/// to be tested. -#[derive(Debug)] -pub(crate) struct Test<'tcx> { - span: Span, - kind: TestKind<'tcx>, +/// Indicates the kind of slice-length constraint imposed by a slice pattern, +/// or its corresponding test. +#[derive(Debug, Clone, Copy, PartialEq)] +enum SliceLenOp { + /// The slice pattern can only match a slice with exactly `len` elements. + Equal, + /// The slice pattern can match a slice with `len` or more elements + /// (i.e. it contains a `..` subpattern in the middle). + GreaterOrEqual, } /// The branch to be taken after a test. diff --git a/compiler/rustc_mir_build/src/builder/matches/test.rs b/compiler/rustc_mir_build/src/builder/matches/test.rs index 4a2823bf5d6b..c2e39d47a92c 100644 --- a/compiler/rustc_mir_build/src/builder/matches/test.rs +++ b/compiler/rustc_mir_build/src/builder/matches/test.rs @@ -20,7 +20,7 @@ use tracing::{debug, instrument}; use crate::builder::Builder; use crate::builder::matches::{ - MatchPairTree, PatConstKind, Test, TestBranch, TestKind, TestableCase, + MatchPairTree, PatConstKind, SliceLenOp, Test, TestBranch, TestKind, TestableCase, }; impl<'a, 'tcx> Builder<'a, 'tcx> { @@ -38,11 +38,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { TestableCase::Constant { value: _, kind: PatConstKind::IntOrChar } => { TestKind::SwitchInt } - TestableCase::Constant { value, kind: PatConstKind::Float } => { - TestKind::Eq { value, cast_ty: match_pair.pattern_ty } + TestableCase::Constant { value, kind: PatConstKind::String } => { + TestKind::StringEq { value, pat_ty: match_pair.pattern_ty } } - TestableCase::Constant { value, kind: PatConstKind::Other } => { - TestKind::Eq { value, cast_ty: match_pair.pattern_ty } + TestableCase::Constant { value, kind: PatConstKind::Float | PatConstKind::Other } => { + TestKind::ScalarEq { value, pat_ty: match_pair.pattern_ty } } TestableCase::Range(ref range) => { @@ -50,10 +50,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { TestKind::Range(Arc::clone(range)) } - TestableCase::Slice { len, variable_length } => { - let op = if variable_length { BinOp::Ge } else { BinOp::Eq }; - TestKind::Len { len, op } - } + TestableCase::Slice { len, op } => TestKind::SliceLen { len, op }, TestableCase::Deref { temp, mutability } => TestKind::Deref { temp, mutability }, @@ -144,17 +141,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { self.cfg.terminate(block, self.source_info(match_start_span), terminator); } - TestKind::Eq { value, mut cast_ty } => { + TestKind::StringEq { value, pat_ty } => { let tcx = self.tcx; let success_block = target_block(TestBranch::Success); let fail_block = target_block(TestBranch::Failure); - let mut expect_ty = value.ty; - let mut expect = self.literal_operand(test.span, Const::from_ty_value(tcx, value)); + let expected_value_ty = value.ty; + let expected_value_operand = + self.literal_operand(test.span, Const::from_ty_value(tcx, value)); - let mut place = place; - let mut block = block; - match cast_ty.kind() { + let mut actual_value_ty = pat_ty; + let mut actual_value_place = place; + + match pat_ty.kind() { ty::Str => { // String literal patterns may have type `str` if `deref_patterns` is // enabled, in order to allow `deref!("..."): String`. In this case, `value` @@ -175,39 +174,43 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ref_place, Rvalue::Ref(re_erased, BorrowKind::Shared, place), ); - place = ref_place; - cast_ty = ref_str_ty; - } - ty::Adt(def, _) if tcx.is_lang_item(def.did(), LangItem::String) => { - if !tcx.features().string_deref_patterns() { - span_bug!( - test.span, - "matching on `String` went through without enabling string_deref_patterns" - ); - } - let re_erased = tcx.lifetimes.re_erased; - let ref_str_ty = Ty::new_imm_ref(tcx, re_erased, tcx.types.str_); - let ref_str = self.temp(ref_str_ty, test.span); - let eq_block = self.cfg.start_new_block(); - // `let ref_str: &str = ::deref(&place);` - self.call_deref( - block, - eq_block, - place, - Mutability::Not, - cast_ty, - ref_str, - test.span, - ); - // Since we generated a `ref_str = ::deref(&place) -> eq_block` terminator, - // we need to add all further statements to `eq_block`. - // Similarly, the normal test code should be generated for the `&str`, instead of the `String`. - block = eq_block; - place = ref_str; - cast_ty = ref_str_ty; + actual_value_place = ref_place; + actual_value_ty = ref_str_ty; } + _ => {} + } + + assert_eq!(expected_value_ty, actual_value_ty); + assert!(actual_value_ty.is_imm_ref_str()); + + // Compare two strings using `::eq`. + // (Interestingly this means that exhaustiveness analysis relies, for soundness, + // on the `PartialEq` impl for `str` to be correct!) + self.string_compare( + block, + success_block, + fail_block, + source_info, + expected_value_operand, + Operand::Copy(actual_value_place), + ); + } + + TestKind::ScalarEq { value, pat_ty } => { + let tcx = self.tcx; + let success_block = target_block(TestBranch::Success); + let fail_block = target_block(TestBranch::Failure); + + let mut expected_value_ty = value.ty; + let mut expected_value_operand = + self.literal_operand(test.span, Const::from_ty_value(tcx, value)); + + let mut actual_value_ty = pat_ty; + let mut actual_value_place = place; + + match pat_ty.kind() { &ty::Pat(base, _) => { - assert_eq!(cast_ty, value.ty); + assert_eq!(pat_ty, value.ty); assert!(base.is_trivially_pure_clone_copy()); let transmuted_place = self.temp(base, test.span); @@ -215,7 +218,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { block, self.source_info(scrutinee_span), transmuted_place, - Rvalue::Cast(CastKind::Transmute, Operand::Copy(place), base), + Rvalue::Cast( + CastKind::Transmute, + Operand::Copy(actual_value_place), + base, + ), ); let transmuted_expect = self.temp(base, test.span); @@ -223,54 +230,29 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { block, self.source_info(test.span), transmuted_expect, - Rvalue::Cast(CastKind::Transmute, expect, base), + Rvalue::Cast(CastKind::Transmute, expected_value_operand, base), ); - place = transmuted_place; - expect = Operand::Copy(transmuted_expect); - cast_ty = base; - expect_ty = base; + actual_value_place = transmuted_place; + actual_value_ty = base; + expected_value_operand = Operand::Copy(transmuted_expect); + expected_value_ty = base; } _ => {} } - assert_eq!(expect_ty, cast_ty); - if !cast_ty.is_scalar() { - // Use `PartialEq::eq` instead of `BinOp::Eq` - // (the binop can only handle primitives) - // Make sure that we do *not* call any user-defined code here. - // The only type that can end up here is string literals, which have their - // comparison defined in `core`. - // (Interestingly this means that exhaustiveness analysis relies, for soundness, - // on the `PartialEq` impl for `str` to b correct!) - match *cast_ty.kind() { - ty::Ref(_, deref_ty, _) if deref_ty == self.tcx.types.str_ => {} - _ => { - span_bug!( - source_info.span, - "invalid type for non-scalar compare: {cast_ty}" - ) - } - }; - self.string_compare( - block, - success_block, - fail_block, - source_info, - expect, - Operand::Copy(place), - ); - } else { - self.compare( - block, - success_block, - fail_block, - source_info, - BinOp::Eq, - expect, - Operand::Copy(place), - ); - } + assert_eq!(expected_value_ty, actual_value_ty); + assert!(actual_value_ty.is_scalar()); + + self.compare( + block, + success_block, + fail_block, + source_info, + BinOp::Eq, + expected_value_operand, + Operand::Copy(actual_value_place), + ); } TestKind::Range(ref range) => { @@ -312,7 +294,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - TestKind::Len { len, op } => { + TestKind::SliceLen { len, op } => { let usize_ty = self.tcx.types.usize; let actual = self.temp(usize_ty, test.span); @@ -332,7 +314,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { success_block, fail_block, source_info, - op, + match op { + SliceLenOp::Equal => BinOp::Eq, + SliceLenOp::GreaterOrEqual => BinOp::Ge, + }, Operand::Move(actual), Operand::Move(expected), ); diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs index a06c030b103b..4f03e3d965c6 100644 --- a/compiler/rustc_mir_build/src/check_unsafety.rs +++ b/compiler/rustc_mir_build/src/check_unsafety.rs @@ -410,14 +410,6 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { visit::walk_pat(self, pat); self.inside_adt = old_inside_adt; } - PatKind::ExpandedConstant { def_id, .. } => { - if let Some(def) = def_id.as_local() - && matches!(self.tcx.def_kind(def_id), DefKind::InlineConst) - { - self.visit_inner_body(def); - } - visit::walk_pat(self, pat); - } _ => { visit::walk_pat(self, pat); } diff --git a/compiler/rustc_mir_build/src/thir/constant.rs b/compiler/rustc_mir_build/src/thir/constant.rs index 563212a51f31..7964a58a7ab0 100644 --- a/compiler/rustc_mir_build/src/thir/constant.rs +++ b/compiler/rustc_mir_build/src/thir/constant.rs @@ -1,5 +1,5 @@ use rustc_abi::Size; -use rustc_ast::{self as ast}; +use rustc_ast::{self as ast, UintTy}; use rustc_hir::LangItem; use rustc_middle::bug; use rustc_middle::mir::interpret::LitToConstInput; @@ -44,12 +44,14 @@ pub(crate) fn lit_to_const<'tcx>( ty::ValTree::from_raw_bytes(tcx, str_bytes) } (ast::LitKind::ByteStr(byte_sym, _), ty::Ref(_, inner_ty, _)) - if matches!(inner_ty.kind(), ty::Slice(_) | ty::Array(..)) => + if let ty::Slice(ty) | ty::Array(ty, _) = inner_ty.kind() + && let ty::Uint(UintTy::U8) = ty.kind() => { ty::ValTree::from_raw_bytes(tcx, byte_sym.as_byte_str()) } - (ast::LitKind::ByteStr(byte_sym, _), ty::Slice(_) | ty::Array(..)) - if tcx.features().deref_patterns() => + (ast::LitKind::ByteStr(byte_sym, _), ty::Slice(inner_ty) | ty::Array(inner_ty, _)) + if tcx.features().deref_patterns() + && let ty::Uint(UintTy::U8) = inner_ty.kind() => { // Byte string literal patterns may have type `[u8]` or `[u8; N]` if `deref_patterns` is // enabled, in order to allow, e.g., `deref!(b"..."): Vec`. diff --git a/compiler/rustc_mir_build/src/thir/cx/block.rs b/compiler/rustc_mir_build/src/thir/cx/block.rs index 57ddb8eddb8e..7cdd70a7fc27 100644 --- a/compiler/rustc_mir_build/src/thir/cx/block.rs +++ b/compiler/rustc_mir_build/src/thir/cx/block.rs @@ -2,8 +2,6 @@ use rustc_hir as hir; use rustc_index::Idx; use rustc_middle::middle::region; use rustc_middle::thir::*; -use rustc_middle::ty; -use rustc_middle::ty::CanonicalUserTypeAnnotation; use tracing::debug; use crate::thir::cx::ThirBuildCx; @@ -73,29 +71,9 @@ impl<'tcx> ThirBuildCx<'tcx> { let else_block = local.els.map(|els| self.mirror_block(els)); - let mut pattern = self.pattern_from_hir(local.pat); + let pattern = self.pattern_from_hir_with_annotation(local.pat, local.ty); debug!(?pattern); - if let Some(ty) = &local.ty - && let Some(&user_ty) = - self.typeck_results.user_provided_types().get(ty.hir_id) - { - debug!("mirror_stmts: user_ty={:?}", user_ty); - let annotation = CanonicalUserTypeAnnotation { - user_ty: Box::new(user_ty), - span: ty.span, - inferred_ty: self.typeck_results.node_type(ty.hir_id), - }; - pattern = Box::new(Pat { - ty: pattern.ty, - span: pattern.span, - kind: PatKind::AscribeUserType { - ascription: Ascription { annotation, variance: ty::Covariant }, - subpattern: pattern, - }, - }); - } - let span = match local.init { Some(init) => local.span.with_hi(init.span.hi()), None => local.span, diff --git a/compiler/rustc_mir_build/src/thir/cx/mod.rs b/compiler/rustc_mir_build/src/thir/cx/mod.rs index d26dfac0c2ab..79e85a243f40 100644 --- a/compiler/rustc_mir_build/src/thir/cx/mod.rs +++ b/compiler/rustc_mir_build/src/thir/cx/mod.rs @@ -12,9 +12,6 @@ use rustc_hir::{self as hir, HirId, find_attr}; use rustc_middle::bug; use rustc_middle::thir::*; use rustc_middle::ty::{self, TyCtxt}; -use tracing::instrument; - -use crate::thir::pattern::pat_from_hir; /// Query implementation for [`TyCtxt::thir_body`]. pub(crate) fn thir_body( @@ -111,9 +108,22 @@ impl<'tcx> ThirBuildCx<'tcx> { } } - #[instrument(level = "debug", skip(self))] - fn pattern_from_hir(&mut self, p: &'tcx hir::Pat<'tcx>) -> Box> { - pat_from_hir(self.tcx, self.typing_env, self.typeck_results, p) + fn pattern_from_hir(&mut self, pat: &'tcx hir::Pat<'tcx>) -> Box> { + self.pattern_from_hir_with_annotation(pat, None) + } + + fn pattern_from_hir_with_annotation( + &mut self, + pat: &'tcx hir::Pat<'tcx>, + let_stmt_type: Option<&hir::Ty<'tcx>>, + ) -> Box> { + crate::thir::pattern::pat_from_hir( + self.tcx, + self.typing_env, + self.typeck_results, + pat, + let_stmt_type, + ) } fn closure_env_param(&self, owner_def: LocalDefId, expr_id: HirId) -> Option> { diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index c4479c402ab2..bf480cf601ee 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -5,7 +5,7 @@ use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_errors::codes::*; use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan, struct_span_code_err}; use rustc_hir::def::*; -use rustc_hir::def_id::LocalDefId; +use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::{self as hir, BindingMode, ByRef, HirId, MatchSource}; use rustc_infer::infer::TyCtxtInferExt; use rustc_lint::Level; @@ -687,12 +687,7 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> { unpeeled_pat = subpattern; } - if let PatKind::ExpandedConstant { def_id, .. } = unpeeled_pat.kind - && let DefKind::Const = self.tcx.def_kind(def_id) - && let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(pat.span) - // We filter out paths with multiple path::segments. - && snippet.chars().all(|c| c.is_alphanumeric() || c == '_') - { + if let Some(def_id) = is_const_pat_that_looks_like_binding(self.tcx, unpeeled_pat) { let span = self.tcx.def_span(def_id); let variable = self.tcx.item_name(def_id).to_string(); // When we encounter a constant as the binding name, point at the `const` definition. @@ -1209,6 +1204,26 @@ fn pat_is_catchall(pat: &DeconstructedPat<'_, '_>) -> bool { } } +/// If the given pattern is a named constant that looks like it could have been +/// intended to be a binding, returns the `DefId` of the named constant. +/// +/// Diagnostics use this to give more detailed suggestions for non-exhaustive +/// matches. +fn is_const_pat_that_looks_like_binding<'tcx>(tcx: TyCtxt<'tcx>, pat: &Pat<'tcx>) -> Option { + // The pattern must be a named constant, and the name that appears in + // the pattern's source text must resemble a plain identifier without any + // `::` namespace separators or other non-identifier characters. + if let PatKind::ExpandedConstant { def_id, .. } = pat.kind + && matches!(tcx.def_kind(def_id), DefKind::Const) + && let Ok(snippet) = tcx.sess.source_map().span_to_snippet(pat.span) + && snippet.chars().all(|c| c.is_alphanumeric() || c == '_') + { + Some(def_id) + } else { + None + } +} + /// Report that a match is not exhaustive. fn report_non_exhaustive_match<'p, 'tcx>( cx: &PatCtxt<'p, 'tcx>, @@ -1303,12 +1318,7 @@ fn report_non_exhaustive_match<'p, 'tcx>( for &arm in arms { let arm = &thir.arms[arm]; - if let PatKind::ExpandedConstant { def_id, .. } = arm.pattern.kind - && !matches!(cx.tcx.def_kind(def_id), DefKind::InlineConst) - && let Ok(snippet) = cx.tcx.sess.source_map().span_to_snippet(arm.pattern.span) - // We filter out paths with multiple path::segments. - && snippet.chars().all(|c| c.is_alphanumeric() || c == '_') - { + if let Some(def_id) = is_const_pat_that_looks_like_binding(cx.tcx, &arm.pattern) { let const_name = cx.tcx.item_name(def_id); err.span_label( arm.pattern.span, diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index ce4c89a8eb2e..2da9a43f71d8 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -187,7 +187,7 @@ impl<'tcx> ConstToPat<'tcx> { } // Wrap the pattern in a marker node to indicate that it is the result of lowering a - // constant. This is used for diagnostics, and for unsafety checking of inline const blocks. + // constant. This is used for diagnostics. let kind = PatKind::ExpandedConstant { subpattern: inlined_const_as_pat, def_id: uv.def }; Box::new(Pat { kind, ty, span: self.span }) } diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs index 3eac6ae344bb..4128508955cb 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs @@ -4,6 +4,7 @@ mod check_match; mod const_to_pat; mod migration; +use std::assert_matches::assert_matches; use std::cmp::Ordering; use std::sync::Arc; @@ -11,19 +12,17 @@ use rustc_abi::{FieldIdx, Integer}; use rustc_errors::codes::*; use rustc_hir::def::{CtorOf, DefKind, Res}; use rustc_hir::pat_util::EnumerateAndAdjustIterator; -use rustc_hir::{self as hir, LangItem, RangeEnd}; +use rustc_hir::{self as hir, RangeEnd}; use rustc_index::Idx; -use rustc_infer::infer::TyCtxtInferExt; use rustc_middle::mir::interpret::LitToConstInput; use rustc_middle::thir::{ Ascription, DerefPatBorrowMode, FieldPat, LocalVarId, Pat, PatKind, PatRange, PatRangeBoundary, }; use rustc_middle::ty::adjustment::{PatAdjust, PatAdjustment}; use rustc_middle::ty::layout::IntegerExt; -use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, TyCtxt, TypingMode}; +use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, TyCtxt}; use rustc_middle::{bug, span_bug}; -use rustc_span::def_id::DefId; -use rustc_span::{ErrorGuaranteed, Span}; +use rustc_span::ErrorGuaranteed; use tracing::{debug, instrument}; pub(crate) use self::check_match::check_match; @@ -40,11 +39,14 @@ struct PatCtxt<'tcx> { rust_2024_migration: Option>, } +#[instrument(level = "debug", skip(tcx, typing_env, typeck_results), ret)] pub(super) fn pat_from_hir<'tcx>( tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, typeck_results: &'tcx ty::TypeckResults<'tcx>, pat: &'tcx hir::Pat<'tcx>, + // Present if `pat` came from a let statement with an explicit type annotation + let_stmt_type: Option<&hir::Ty<'tcx>>, ) -> Box> { let mut pcx = PatCtxt { tcx, @@ -55,12 +57,35 @@ pub(super) fn pat_from_hir<'tcx>( .get(pat.hir_id) .map(PatMigration::new), }; - let result = pcx.lower_pattern(pat); - debug!("pat_from_hir({:?}) = {:?}", pat, result); + + let mut thir_pat = pcx.lower_pattern(pat); + + // If this pattern came from a let statement with an explicit type annotation + // (e.g. `let x: Foo = ...`), retain that user type information in the THIR pattern. + if let Some(let_stmt_type) = let_stmt_type + && let Some(&user_ty) = typeck_results.user_provided_types().get(let_stmt_type.hir_id) + { + debug!(?user_ty); + let annotation = CanonicalUserTypeAnnotation { + user_ty: Box::new(user_ty), + span: let_stmt_type.span, + inferred_ty: typeck_results.node_type(let_stmt_type.hir_id), + }; + thir_pat = Box::new(Pat { + ty: thir_pat.ty, + span: thir_pat.span, + kind: PatKind::AscribeUserType { + ascription: Ascription { annotation, variance: ty::Covariant }, + subpattern: thir_pat, + }, + }); + } + if let Some(m) = pcx.rust_2024_migration { m.emit(tcx, pat.hir_id); } - result + + thir_pat } impl<'tcx> PatCtxt<'tcx> { @@ -131,16 +156,20 @@ impl<'tcx> PatCtxt<'tcx> { fn lower_pattern_range_endpoint( &mut self, + pat: &'tcx hir::Pat<'tcx>, // Range pattern containing the endpoint expr: Option<&'tcx hir::PatExpr<'tcx>>, - // Out-parameters collecting extra data to be reapplied by the caller + // Out-parameter collecting extra data to be reapplied by the caller ascriptions: &mut Vec>, - expanded_consts: &mut Vec, ) -> Result>, ErrorGuaranteed> { + assert_matches!(pat.kind, hir::PatKind::Range(..)); + + // For partly-bounded ranges like `X..` or `..X`, an endpoint will be absent. + // Return None in that case; the caller will use NegInfinity or PosInfinity instead. let Some(expr) = expr else { return Ok(None) }; // Lower the endpoint into a temporary `PatKind` that will then be // deconstructed to obtain the constant value and other data. - let mut kind: PatKind<'tcx> = self.lower_pat_expr(expr, None); + let mut kind: PatKind<'tcx> = self.lower_pat_expr(pat, expr); // Unpeel any ascription or inline-const wrapper nodes. loop { @@ -149,8 +178,10 @@ impl<'tcx> PatCtxt<'tcx> { ascriptions.push(ascription); kind = subpattern.kind; } - PatKind::ExpandedConstant { def_id, subpattern } => { - expanded_consts.push(def_id); + PatKind::ExpandedConstant { def_id: _, subpattern } => { + // Expanded-constant nodes are currently only needed by + // diagnostics that don't apply to range patterns, so we + // can just discard them here. kind = subpattern.kind; } _ => break, @@ -215,12 +246,14 @@ impl<'tcx> PatCtxt<'tcx> { fn lower_pattern_range( &mut self, + pat: &'tcx hir::Pat<'tcx>, lo_expr: Option<&'tcx hir::PatExpr<'tcx>>, hi_expr: Option<&'tcx hir::PatExpr<'tcx>>, end: RangeEnd, - ty: Ty<'tcx>, - span: Span, ) -> Result, ErrorGuaranteed> { + let ty = self.typeck_results.node_type(pat.hir_id); + let span = pat.span; + if lo_expr.is_none() && hi_expr.is_none() { let msg = "found twice-open range pattern (`..`) outside of error recovery"; self.tcx.dcx().span_bug(span, msg); @@ -228,10 +261,8 @@ impl<'tcx> PatCtxt<'tcx> { // Collect extra data while lowering the endpoints, to be reapplied later. let mut ascriptions = vec![]; - let mut expanded_consts = vec![]; - let mut lower_endpoint = - |expr| self.lower_pattern_range_endpoint(expr, &mut ascriptions, &mut expanded_consts); + |expr| self.lower_pattern_range_endpoint(pat, expr, &mut ascriptions); let lo = lower_endpoint(lo_expr)?.unwrap_or(PatRangeBoundary::NegInfinity); let hi = lower_endpoint(hi_expr)?.unwrap_or(PatRangeBoundary::PosInfinity); @@ -283,10 +314,11 @@ impl<'tcx> PatCtxt<'tcx> { let subpattern = Box::new(Pat { span, ty, kind }); kind = PatKind::AscribeUserType { ascription, subpattern }; } - for def_id in expanded_consts { - let subpattern = Box::new(Pat { span, ty, kind }); - kind = PatKind::ExpandedConstant { def_id, subpattern }; - } + // `PatKind::ExpandedConstant` wrappers from range endpoints used to + // also be preserved here, but that was only needed for unsafeck of + // inline `const { .. }` patterns, which were removed by + // . + Ok(kind) } @@ -302,12 +334,10 @@ impl<'tcx> PatCtxt<'tcx> { hir::PatKind::Never => PatKind::Never, - hir::PatKind::Expr(value) => self.lower_pat_expr(value, Some(ty)), + hir::PatKind::Expr(value) => self.lower_pat_expr(pat, value), - hir::PatKind::Range(ref lo_expr, ref hi_expr, end) => { - let (lo_expr, hi_expr) = (lo_expr.as_deref(), hi_expr.as_deref()); - self.lower_pattern_range(lo_expr, hi_expr, end, ty, span) - .unwrap_or_else(PatKind::Error) + hir::PatKind::Range(lo_expr, hi_expr, end) => { + self.lower_pattern_range(pat, lo_expr, hi_expr, end).unwrap_or_else(PatKind::Error) } hir::PatKind::Deref(subpattern) => { @@ -330,7 +360,7 @@ impl<'tcx> PatCtxt<'tcx> { }, hir::PatKind::Slice(prefix, slice, suffix) => { - self.slice_or_array_pattern(pat.span, ty, prefix, slice, suffix) + self.slice_or_array_pattern(pat, prefix, slice, suffix) } hir::PatKind::Tuple(pats, ddpos) => { @@ -392,7 +422,7 @@ impl<'tcx> PatCtxt<'tcx> { }; let variant_def = adt_def.variant_of_res(res); let subpatterns = self.lower_tuple_subpats(pats, variant_def.fields.len(), ddpos); - self.lower_variant_or_leaf(res, pat.hir_id, pat.span, ty, subpatterns) + self.lower_variant_or_leaf(pat, None, res, subpatterns) } hir::PatKind::Struct(ref qpath, fields, _) => { @@ -409,7 +439,7 @@ impl<'tcx> PatCtxt<'tcx> { }) .collect(); - self.lower_variant_or_leaf(res, pat.hir_id, pat.span, ty, subpatterns) + self.lower_variant_or_leaf(pat, None, res, subpatterns) } hir::PatKind::Or(pats) => PatKind::Or { pats: self.lower_patterns(pats) }, @@ -448,12 +478,13 @@ impl<'tcx> PatCtxt<'tcx> { fn slice_or_array_pattern( &mut self, - span: Span, - ty: Ty<'tcx>, + pat: &'tcx hir::Pat<'tcx>, prefix: &'tcx [hir::Pat<'tcx>], slice: Option<&'tcx hir::Pat<'tcx>>, suffix: &'tcx [hir::Pat<'tcx>], ) -> PatKind<'tcx> { + let ty = self.typeck_results.node_type(pat.hir_id); + let prefix = self.lower_patterns(prefix); let slice = self.lower_opt_pattern(slice); let suffix = self.lower_patterns(suffix); @@ -468,18 +499,32 @@ impl<'tcx> PatCtxt<'tcx> { assert!(len >= prefix.len() as u64 + suffix.len() as u64); PatKind::Array { prefix, slice, suffix } } - _ => span_bug!(span, "bad slice pattern type {:?}", ty), + _ => span_bug!(pat.span, "bad slice pattern type {ty:?}"), } } fn lower_variant_or_leaf( &mut self, + pat: &'tcx hir::Pat<'tcx>, + expr: Option<&'tcx hir::PatExpr<'tcx>>, res: Res, - hir_id: hir::HirId, - span: Span, - ty: Ty<'tcx>, subpatterns: Vec>, ) -> PatKind<'tcx> { + // Check whether the caller should have provided an `expr` for this pattern kind. + assert_matches!( + (pat.kind, expr), + (hir::PatKind::Expr(..) | hir::PatKind::Range(..), Some(_)) + | (hir::PatKind::Struct(..) | hir::PatKind::TupleStruct(..), None) + ); + + // Use the id/span of the `hir::PatExpr`, if provided. + // Otherwise, use the id/span of the `hir::Pat`. + let (hir_id, span) = match expr { + Some(expr) => (expr.hir_id, expr.span), + None => (pat.hir_id, pat.span), + }; + let ty = self.typeck_results.node_type(hir_id); + let res = match res { Res::Def(DefKind::Ctor(CtorOf::Variant, ..), variant_ctor_id) => { let variant_id = self.tcx.parent(variant_ctor_id); @@ -566,7 +611,16 @@ impl<'tcx> PatCtxt<'tcx> { /// it to `const_to_pat`. Any other path (like enum variants without fields) /// is converted to the corresponding pattern via `lower_variant_or_leaf`. #[instrument(skip(self), level = "debug")] - fn lower_path(&mut self, qpath: &hir::QPath<'_>, id: hir::HirId, span: Span) -> Box> { + fn lower_path( + &mut self, + pat: &'tcx hir::Pat<'tcx>, // Pattern that directly contains `expr` + expr: &'tcx hir::PatExpr<'tcx>, + qpath: &hir::QPath<'_>, + ) -> Box> { + assert_matches!(pat.kind, hir::PatKind::Expr(..) | hir::PatKind::Range(..)); + + let id = expr.hir_id; + let span = expr.span; let ty = self.typeck_results.node_type(id); let res = self.typeck_results.qpath_res(qpath, id); @@ -578,7 +632,7 @@ impl<'tcx> PatCtxt<'tcx> { _ => { // The path isn't the name of a constant, so it must actually // be a unit struct or unit variant (e.g. `Option::None`). - let kind = self.lower_variant_or_leaf(res, id, span, ty, vec![]); + let kind = self.lower_variant_or_leaf(pat, Some(expr), res, vec![]); return Box::new(Pat { span, ty, kind }); } }; @@ -613,94 +667,31 @@ impl<'tcx> PatCtxt<'tcx> { pattern } - /// Lowers an inline const block (e.g. `const { 1 + 1 }`) to a pattern. - fn lower_inline_const( - &mut self, - block: &'tcx hir::ConstBlock, - id: hir::HirId, - span: Span, - ) -> PatKind<'tcx> { - let tcx = self.tcx; - let def_id = block.def_id; - let ty = tcx.typeck(def_id).node_type(block.hir_id); - - let typeck_root_def_id = tcx.typeck_root_def_id(def_id.to_def_id()); - let parent_args = ty::GenericArgs::identity_for_item(tcx, typeck_root_def_id); - let args = ty::InlineConstArgs::new(tcx, ty::InlineConstArgsParts { parent_args, ty }).args; - - let ct = ty::UnevaluatedConst { def: def_id.to_def_id(), args }; - let c = ty::Const::new_unevaluated(self.tcx, ct); - let pattern = self.const_to_pat(c, ty, id, span); - - // Apply a type ascription for the inline constant. - let annotation = { - let infcx = tcx.infer_ctxt().build(TypingMode::non_body_analysis()); - let args = ty::InlineConstArgs::new( - tcx, - ty::InlineConstArgsParts { parent_args, ty: infcx.next_ty_var(span) }, - ) - .args; - infcx.canonicalize_user_type_annotation(ty::UserType::new(ty::UserTypeKind::TypeOf( - def_id.to_def_id(), - ty::UserArgs { args, user_self_ty: None }, - ))) - }; - let annotation = - CanonicalUserTypeAnnotation { user_ty: Box::new(annotation), span, inferred_ty: ty }; - PatKind::AscribeUserType { - subpattern: pattern, - ascription: Ascription { - annotation, - // Note that we use `Contravariant` here. See the `variance` field documentation - // for details. - variance: ty::Contravariant, - }, - } - } - /// Lowers the kinds of "expression" that can appear in a HIR pattern: /// - Paths (e.g. `FOO`, `foo::BAR`, `Option::None`) - /// - Inline const blocks (e.g. `const { 1 + 1 }`) /// - Literals, possibly negated (e.g. `-128u8`, `"hello"`) fn lower_pat_expr( &mut self, + pat: &'tcx hir::Pat<'tcx>, // Pattern that directly contains `expr` expr: &'tcx hir::PatExpr<'tcx>, - pat_ty: Option>, ) -> PatKind<'tcx> { + assert_matches!(pat.kind, hir::PatKind::Expr(..) | hir::PatKind::Range(..)); match &expr.kind { - hir::PatExprKind::Path(qpath) => self.lower_path(qpath, expr.hir_id, expr.span).kind, - hir::PatExprKind::ConstBlock(anon_const) => { - self.lower_inline_const(anon_const, expr.hir_id, expr.span) - } + hir::PatExprKind::Path(qpath) => self.lower_path(pat, expr, qpath).kind, hir::PatExprKind::Lit { lit, negated } => { // We handle byte string literal patterns by using the pattern's type instead of the // literal's type in `const_to_pat`: if the literal `b"..."` matches on a slice reference, // the pattern's type will be `&[u8]` whereas the literal's type is `&[u8; 3]`; using the // pattern's type means we'll properly translate it to a slice reference pattern. This works // because slices and arrays have the same valtree representation. - // HACK: As an exception, use the literal's type if `pat_ty` is `String`; this can happen if - // `string_deref_patterns` is enabled. There's a special case for that when lowering to MIR. - // FIXME(deref_patterns): This hack won't be necessary once `string_deref_patterns` is - // superseded by a more general implementation of deref patterns. - let ct_ty = match pat_ty { - Some(pat_ty) - if let ty::Adt(def, _) = *pat_ty.kind() - && self.tcx.is_lang_item(def.did(), LangItem::String) => - { - if !self.tcx.features().string_deref_patterns() { - span_bug!( - expr.span, - "matching on `String` went through without enabling string_deref_patterns" - ); - } - self.typeck_results.node_type(expr.hir_id) - } - Some(pat_ty) => pat_ty, - None => self.typeck_results.node_type(expr.hir_id), - }; - let lit_input = LitToConstInput { lit: lit.node, ty: ct_ty, neg: *negated }; + // + // Under `feature(deref_patterns)`, this adjustment can also convert string literal + // patterns to `str`, and byte-string literal patterns to `[u8; N]` or `[u8]`. + + let pat_ty = self.typeck_results.node_type(pat.hir_id); + let lit_input = LitToConstInput { lit: lit.node, ty: pat_ty, neg: *negated }; let constant = self.tcx.at(expr.span).lit_to_const(lit_input); - self.const_to_pat(constant, ct_ty, expr.hir_id, lit.span).kind + self.const_to_pat(constant, pat_ty, expr.hir_id, lit.span).kind } } } diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs index daf304c1bf9d..ac94ee5c8104 100644 --- a/compiler/rustc_mir_dataflow/src/value_analysis.rs +++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs @@ -1,3 +1,4 @@ +use std::assert_matches::debug_assert_matches; use std::fmt::{Debug, Formatter}; use std::ops::Range; @@ -350,41 +351,56 @@ pub struct Map<'tcx> { projections: FxHashMap<(PlaceIndex, TrackElem), PlaceIndex>, places: IndexVec>, value_count: usize, + mode: PlaceCollectionMode, // The Range corresponds to a slice into `inner_values_buffer`. inner_values: IndexVec>, inner_values_buffer: Vec, } +#[derive(Copy, Clone, Debug)] +pub enum PlaceCollectionMode { + Full { value_limit: Option }, + OnDemand, +} + impl<'tcx> Map<'tcx> { /// Returns a map that only tracks places whose type has scalar layout. /// /// This is currently the only way to create a [`Map`]. The way in which the tracked places are /// chosen is an implementation detail and may not be relied upon (other than that their type /// are scalars). - pub fn new(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, value_limit: Option) -> Self { + #[tracing::instrument(level = "trace", skip(tcx, body))] + pub fn new(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, mode: PlaceCollectionMode) -> Self { + tracing::trace!(def_id=?body.source.def_id()); + let capacity = 4 * body.local_decls.len(); let mut map = Self { locals: IndexVec::from_elem(None, &body.local_decls), projections: FxHashMap::default(), - places: IndexVec::new(), + places: IndexVec::with_capacity(capacity), value_count: 0, + mode, inner_values: IndexVec::new(), inner_values_buffer: Vec::new(), }; - let exclude = excluded_locals(body); - map.register(tcx, body, exclude, value_limit); + map.register_locals(tcx, body); + match mode { + PlaceCollectionMode::Full { value_limit } => { + map.collect_places(tcx, body); + map.propagate_assignments(tcx, body); + map.create_values(tcx, body, value_limit); + map.trim_useless_places(); + } + PlaceCollectionMode::OnDemand => {} + } debug!("registered {} places ({} nodes in total)", map.value_count, map.places.len()); map } /// Register all non-excluded places that have scalar layout. #[tracing::instrument(level = "trace", skip(self, tcx, body))] - fn register( - &mut self, - tcx: TyCtxt<'tcx>, - body: &Body<'tcx>, - exclude: DenseBitSet, - value_limit: Option, - ) { + fn register_locals(&mut self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) { + let exclude = excluded_locals(body); + // Start by constructing the places for each bare local. for (local, decl) in body.local_decls.iter_enumerated() { if exclude.contains(local) { @@ -399,23 +415,85 @@ impl<'tcx> Map<'tcx> { let place = self.places.push(PlaceInfo::new(decl.ty, None)); self.locals[local] = Some(place); } + } - // Collect syntactic places and assignments between them. - let mut collector = - PlaceCollector { tcx, body, map: self, assignments: Default::default() }; + /// Collect syntactic places from body, and create `PlaceIndex` for them. + #[tracing::instrument(level = "trace", skip(self, tcx, body))] + fn collect_places(&mut self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) { + let mut collector = PlaceCollector { tcx, body, map: self }; collector.visit_body(body); - let PlaceCollector { mut assignments, .. } = collector; + } - // Just collecting syntactic places is not enough. We may need to propagate this pattern: - // _1 = (const 5u32, const 13i64); - // _2 = _1; - // _3 = (_2.0 as u32); - // - // `_1.0` does not appear, but we still need to track it. This is achieved by propagating - // projections from assignments. We recorded an assignment between `_2` and `_1`, so we - // want `_1` and `_2` to have the same sub-places. - // - // This is what this fixpoint loop does. While we are still creating places, run through + /// Just collecting syntactic places is not enough. We may need to propagate this pattern: + /// _1 = (const 5u32, const 13i64); + /// _2 = _1; + /// _3 = (_2.0 as u32); + /// + /// `_1.0` does not appear, but we still need to track it. This is achieved by propagating + /// projections from assignments. We recorded an assignment between `_2` and `_1`, so we + /// want `_1` and `_2` to have the same sub-places. + #[tracing::instrument(level = "trace", skip(self, tcx, body))] + fn propagate_assignments(&mut self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) { + // Collect syntactic places and assignments between them. + let mut assignments = FxIndexSet::default(); + + for bbdata in body.basic_blocks.iter() { + for stmt in bbdata.statements.iter() { + let Some((lhs, rhs)) = stmt.kind.as_assign() else { continue }; + match rhs { + Rvalue::Use(Operand::Move(rhs) | Operand::Copy(rhs)) + | Rvalue::CopyForDeref(rhs) => { + let Some(lhs) = self.register_place_and_discr(tcx, body, *lhs) else { + continue; + }; + let Some(rhs) = self.register_place_and_discr(tcx, body, *rhs) else { + continue; + }; + assignments.insert((lhs, rhs)); + } + Rvalue::Aggregate(kind, fields) => { + let Some(mut lhs) = self.register_place_and_discr(tcx, body, *lhs) else { + continue; + }; + match **kind { + // Do not propagate unions. + AggregateKind::Adt(_, _, _, _, Some(_)) => continue, + AggregateKind::Adt(_, variant, _, _, None) => { + let ty = self.places[lhs].ty; + if ty.is_enum() { + lhs = self.register_place_index( + ty, + lhs, + TrackElem::Variant(variant), + ); + } + } + AggregateKind::RawPtr(..) + | AggregateKind::Array(_) + | AggregateKind::Tuple + | AggregateKind::Closure(..) + | AggregateKind::Coroutine(..) + | AggregateKind::CoroutineClosure(..) => {} + } + for (index, field) in fields.iter_enumerated() { + if let Some(rhs) = field.place() + && let Some(rhs) = self.register_place_and_discr(tcx, body, rhs) + { + let lhs = self.register_place_index( + self.places[rhs].ty, + lhs, + TrackElem::Field(index), + ); + assignments.insert((lhs, rhs)); + } + } + } + _ => {} + } + } + } + + // This is a fixpoint loop does. While we are still creating places, run through // all the assignments, and register places for children. let mut num_places = 0; while num_places < self.places.len() { @@ -428,8 +506,11 @@ impl<'tcx> Map<'tcx> { let mut child = self.places[lhs].first_child; while let Some(lhs_child) = child { let PlaceInfo { ty, proj_elem, next_sibling, .. } = self.places[lhs_child]; - let rhs_child = - self.register_place(ty, rhs, proj_elem.expect("child is not a projection")); + let rhs_child = self.register_place_index( + ty, + rhs, + proj_elem.expect("child is not a projection"), + ); assignments.insert((lhs_child, rhs_child)); child = next_sibling; } @@ -438,16 +519,22 @@ impl<'tcx> Map<'tcx> { let mut child = self.places[rhs].first_child; while let Some(rhs_child) = child { let PlaceInfo { ty, proj_elem, next_sibling, .. } = self.places[rhs_child]; - let lhs_child = - self.register_place(ty, lhs, proj_elem.expect("child is not a projection")); + let lhs_child = self.register_place_index( + ty, + lhs, + proj_elem.expect("child is not a projection"), + ); assignments.insert((lhs_child, rhs_child)); child = next_sibling; } } } - drop(assignments); + } - // Create values for places whose type have scalar layout. + /// Create values for places whose type have scalar layout. + #[tracing::instrument(level = "trace", skip(self, tcx, body))] + fn create_values(&mut self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>, value_limit: Option) { + debug_assert_matches!(self.mode, PlaceCollectionMode::Full { .. }); let typing_env = body.typing_env(tcx); for place_info in self.places.iter_mut() { // The user requires a bound on the number of created values. @@ -481,8 +568,12 @@ impl<'tcx> Map<'tcx> { self.cache_preorder_invoke(place); } } + } - // Trim useless places. + /// Trim useless places. + #[tracing::instrument(level = "trace", skip(self))] + fn trim_useless_places(&mut self) { + debug_assert_matches!(self.mode, PlaceCollectionMode::Full { .. }); for opt_place in self.locals.iter_mut() { if let Some(place) = *opt_place && self.inner_values[place].is_empty() @@ -495,7 +586,12 @@ impl<'tcx> Map<'tcx> { } #[tracing::instrument(level = "trace", skip(self), ret)] - fn register_place(&mut self, ty: Ty<'tcx>, base: PlaceIndex, elem: TrackElem) -> PlaceIndex { + pub fn register_place_index( + &mut self, + ty: Ty<'tcx>, + base: PlaceIndex, + elem: TrackElem, + ) -> PlaceIndex { *self.projections.entry((base, elem)).or_insert_with(|| { let next = self.places.push(PlaceInfo::new(ty, Some(elem))); self.places[next].next_sibling = self.places[base].first_child; @@ -504,9 +600,124 @@ impl<'tcx> Map<'tcx> { }) } + #[tracing::instrument(level = "trace", skip(self, tcx, body), ret)] + pub fn register_place( + &mut self, + tcx: TyCtxt<'tcx>, + body: &Body<'tcx>, + place: Place<'tcx>, + tail: Option, + ) -> Option { + // Create a place for this projection. + let mut place_index = self.locals[place.local]?; + let mut ty = PlaceTy::from_ty(body.local_decls[place.local].ty); + tracing::trace!(?place_index, ?ty); + + for proj in place.projection { + let track_elem = proj.try_into().ok()?; + ty = ty.projection_ty(tcx, proj); + place_index = self.register_place_index(ty.ty, place_index, track_elem); + tracing::trace!(?proj, ?place_index, ?ty); + } + + if let Some(tail) = tail { + let ty = match tail { + TrackElem::Discriminant => ty.ty.discriminant_ty(tcx), + TrackElem::Variant(..) | TrackElem::Field(..) => todo!(), + TrackElem::DerefLen => tcx.types.usize, + }; + place_index = self.register_place_index(ty, place_index, tail); + } + + Some(place_index) + } + + #[tracing::instrument(level = "trace", skip(self, tcx, body), ret)] + fn register_place_and_discr( + &mut self, + tcx: TyCtxt<'tcx>, + body: &Body<'tcx>, + place: Place<'tcx>, + ) -> Option { + let place = self.register_place(tcx, body, place, None)?; + let ty = self.places[place].ty; + + if let ty::Ref(_, ref_ty, _) | ty::RawPtr(ref_ty, _) = ty.kind() + && let ty::Slice(..) = ref_ty.kind() + { + self.register_place_index(tcx.types.usize, place, TrackElem::DerefLen); + } else if ty.is_enum() { + let discriminant_ty = ty.discriminant_ty(tcx); + self.register_place_index(discriminant_ty, place, TrackElem::Discriminant); + } + + Some(place) + } + + #[tracing::instrument(level = "trace", skip(self, tcx, typing_env), ret)] + pub fn register_value( + &mut self, + tcx: TyCtxt<'tcx>, + typing_env: ty::TypingEnv<'tcx>, + place: PlaceIndex, + ) -> Option { + let place_info = &mut self.places[place]; + if let Some(value) = place_info.value_index { + return Some(value); + } + + if let Ok(ty) = tcx.try_normalize_erasing_regions(typing_env, place_info.ty) { + place_info.ty = ty; + } + + // Allocate a value slot if it doesn't have one, and the user requested one. + if let Ok(layout) = tcx.layout_of(typing_env.as_query_input(place_info.ty)) + && layout.backend_repr.is_scalar() + { + place_info.value_index = Some(self.value_count.into()); + self.value_count += 1; + } + + place_info.value_index + } + + #[tracing::instrument(level = "trace", skip(self, f))] + pub fn register_copy_tree( + &mut self, + // Tree to copy. + source: PlaceIndex, + // Tree to build. + target: PlaceIndex, + f: &mut impl FnMut(ValueIndex, ValueIndex), + ) { + if let Some(source_value) = self.places[source].value_index { + let target_value = *self.places[target].value_index.get_or_insert_with(|| { + let value_index = self.value_count.into(); + self.value_count += 1; + value_index + }); + f(source_value, target_value) + } + + // Iterate over `source` children and recurse. + let mut source_child_iter = self.places[source].first_child; + while let Some(source_child) = source_child_iter { + source_child_iter = self.places[source_child].next_sibling; + + // Try to find corresponding child and recurse. Reasoning is similar as above. + let source_info = &self.places[source_child]; + let source_ty = source_info.ty; + let source_elem = source_info.proj_elem.unwrap(); + let target_child = self.register_place_index(source_ty, target, source_elem); + self.register_copy_tree(source_child, target_child, f); + } + } + /// Precompute the list of values inside `root` and store it inside /// as a slice within `inner_values_buffer`. + #[tracing::instrument(level = "trace", skip(self))] fn cache_preorder_invoke(&mut self, root: PlaceIndex) { + debug_assert_matches!(self.mode, PlaceCollectionMode::Full { .. }); let start = self.inner_values_buffer.len(); if let Some(vi) = self.places[root].value_index { self.inner_values_buffer.push(vi); @@ -528,44 +739,6 @@ struct PlaceCollector<'a, 'tcx> { tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, map: &'a mut Map<'tcx>, - assignments: FxIndexSet<(PlaceIndex, PlaceIndex)>, -} - -impl<'tcx> PlaceCollector<'_, 'tcx> { - #[tracing::instrument(level = "trace", skip(self))] - fn register_place(&mut self, place: Place<'tcx>) -> Option { - // Create a place for this projection. - let mut place_index = self.map.locals[place.local]?; - let mut ty = PlaceTy::from_ty(self.body.local_decls[place.local].ty); - tracing::trace!(?place_index, ?ty); - - if let ty::Ref(_, ref_ty, _) | ty::RawPtr(ref_ty, _) = ty.ty.kind() - && let ty::Slice(..) = ref_ty.kind() - { - self.map.register_place(self.tcx.types.usize, place_index, TrackElem::DerefLen); - } else if ty.ty.is_enum() { - let discriminant_ty = ty.ty.discriminant_ty(self.tcx); - self.map.register_place(discriminant_ty, place_index, TrackElem::Discriminant); - } - - for proj in place.projection { - let track_elem = proj.try_into().ok()?; - ty = ty.projection_ty(self.tcx, proj); - place_index = self.map.register_place(ty.ty, place_index, track_elem); - tracing::trace!(?proj, ?place_index, ?ty); - - if let ty::Ref(_, ref_ty, _) | ty::RawPtr(ref_ty, _) = ty.ty.kind() - && let ty::Slice(..) = ref_ty.kind() - { - self.map.register_place(self.tcx.types.usize, place_index, TrackElem::DerefLen); - } else if ty.ty.is_enum() { - let discriminant_ty = ty.ty.discriminant_ty(self.tcx); - self.map.register_place(discriminant_ty, place_index, TrackElem::Discriminant); - } - } - - Some(place_index) - } } impl<'tcx> Visitor<'tcx> for PlaceCollector<'_, 'tcx> { @@ -575,51 +748,7 @@ impl<'tcx> Visitor<'tcx> for PlaceCollector<'_, 'tcx> { return; } - self.register_place(*place); - } - - fn visit_assign(&mut self, lhs: &Place<'tcx>, rhs: &Rvalue<'tcx>, location: Location) { - self.super_assign(lhs, rhs, location); - - match rhs { - Rvalue::Use(Operand::Move(rhs) | Operand::Copy(rhs)) | Rvalue::CopyForDeref(rhs) => { - let Some(lhs) = self.register_place(*lhs) else { return }; - let Some(rhs) = self.register_place(*rhs) else { return }; - self.assignments.insert((lhs, rhs)); - } - Rvalue::Aggregate(kind, fields) => { - let Some(mut lhs) = self.register_place(*lhs) else { return }; - match **kind { - // Do not propagate unions. - AggregateKind::Adt(_, _, _, _, Some(_)) => return, - AggregateKind::Adt(_, variant, _, _, None) => { - let ty = self.map.places[lhs].ty; - if ty.is_enum() { - lhs = self.map.register_place(ty, lhs, TrackElem::Variant(variant)); - } - } - AggregateKind::RawPtr(..) - | AggregateKind::Array(_) - | AggregateKind::Tuple - | AggregateKind::Closure(..) - | AggregateKind::Coroutine(..) - | AggregateKind::CoroutineClosure(..) => {} - } - for (index, field) in fields.iter_enumerated() { - if let Some(rhs) = field.place() - && let Some(rhs) = self.register_place(rhs) - { - let lhs = self.map.register_place( - self.map.places[rhs].ty, - lhs, - TrackElem::Field(index), - ); - self.assignments.insert((lhs, rhs)); - } - } - } - _ => {} - } + self.map.register_place_and_discr(self.tcx, self.body, *place); } } @@ -694,6 +823,7 @@ impl<'tcx> Map<'tcx> { /// /// `tail_elem` allows to support discriminants that are not a place in MIR, but that we track /// as such. + #[tracing::instrument(level = "trace", skip(self, f))] pub fn for_each_aliasing_place( &self, place: PlaceRef<'_>, @@ -728,6 +858,7 @@ impl<'tcx> Map<'tcx> { } /// Invoke the given function on all the descendants of the given place, except one branch. + #[tracing::instrument(level = "trace", skip(self, f))] fn for_each_variant_sibling( &self, parent: PlaceIndex, @@ -754,9 +885,22 @@ impl<'tcx> Map<'tcx> { } /// Invoke a function on each value in the given place and all descendants. + #[tracing::instrument(level = "trace", skip(self, f))] fn for_each_value_inside(&self, root: PlaceIndex, f: &mut impl FnMut(ValueIndex)) { - for &v in self.values_inside(root) { - f(v) + if let Some(range) = self.inner_values.get(root) { + // Optimized path: we have cached the inner values. + let values = &self.inner_values_buffer[range.clone()]; + for &v in values { + f(v) + } + } else { + if let Some(root) = self.places[root].value_index { + f(root) + } + + for child in self.children(root) { + self.for_each_value_inside(child, f); + } } } @@ -769,7 +913,9 @@ impl<'tcx> Map<'tcx> { f: &mut impl FnMut(PlaceIndex, &O), ) { // Fast path is there is nothing to do. - if self.inner_values[root].is_empty() { + if let Some(value_range) = self.inner_values.get(root) + && value_range.is_empty() + { return; } diff --git a/compiler/rustc_mir_transform/src/dataflow_const_prop.rs b/compiler/rustc_mir_transform/src/dataflow_const_prop.rs index 011c10b8bd1d..5254f60a1503 100644 --- a/compiler/rustc_mir_transform/src/dataflow_const_prop.rs +++ b/compiler/rustc_mir_transform/src/dataflow_const_prop.rs @@ -21,7 +21,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_mir_dataflow::fmt::DebugWithContext; use rustc_mir_dataflow::lattice::{FlatSet, HasBottom}; use rustc_mir_dataflow::value_analysis::{ - Map, PlaceIndex, State, TrackElem, ValueOrPlace, debug_with_context, + Map, PlaceCollectionMode, PlaceIndex, State, TrackElem, ValueOrPlace, debug_with_context, }; use rustc_mir_dataflow::{Analysis, ResultsVisitor, visit_reachable_results}; use rustc_span::DUMMY_SP; @@ -55,10 +55,10 @@ impl<'tcx> crate::MirPass<'tcx> for DataflowConstProp { // `O(num_nodes * tracked_places * n)` in terms of time complexity. Since the number of // map nodes is strongly correlated to the number of tracked places, this becomes more or // less `O(n)` if we place a constant limit on the number of tracked places. - let place_limit = if tcx.sess.mir_opt_level() < 4 { Some(PLACE_LIMIT) } else { None }; + let value_limit = if tcx.sess.mir_opt_level() < 4 { Some(PLACE_LIMIT) } else { None }; // Decide which places to track during the analysis. - let map = Map::new(tcx, body, place_limit); + let map = Map::new(tcx, body, PlaceCollectionMode::Full { value_limit }); // Perform the actual dataflow analysis. let const_ = debug_span!("analyze") diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 9e3ca9b30d53..1e9665f4337d 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -775,8 +775,11 @@ fn check_mir_is_available<'tcx, I: Inliner<'tcx>>( { // If we know for sure that the function we're calling will itself try to // call us, then we avoid inlining that function. - if inliner.tcx().mir_callgraph_cyclic(caller_def_id.expect_local()).contains(&callee_def_id) - { + let Some(cyclic_callees) = inliner.tcx().mir_callgraph_cyclic(caller_def_id.expect_local()) + else { + return Err("call graph cycle detection bailed due to recursion limit"); + }; + if cyclic_callees.contains(&callee_def_id) { debug!("query cycle avoidance"); return Err("caller might be reachable from callee"); } diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs index 25a9baffe582..9d031b654802 100644 --- a/compiler/rustc_mir_transform/src/inline/cycle.rs +++ b/compiler/rustc_mir_transform/src/inline/cycle.rs @@ -68,7 +68,7 @@ fn process<'tcx>( involved: &mut FxHashSet, recursion_limiter: &mut FxHashMap, recursion_limit: Limit, -) -> bool { +) -> Option { trace!(%caller); let mut reaches_root = false; @@ -127,10 +127,9 @@ fn process<'tcx>( recursion_limiter, recursion_limit, ) - }) + })? } else { - // Pessimistically assume that there could be recursion. - true + return None; }; seen.insert(callee, callee_reaches_root); callee_reaches_root @@ -144,14 +143,14 @@ fn process<'tcx>( } } - reaches_root + Some(reaches_root) } #[instrument(level = "debug", skip(tcx), ret)] pub(crate) fn mir_callgraph_cyclic<'tcx>( tcx: TyCtxt<'tcx>, root: LocalDefId, -) -> UnordSet { +) -> Option> { assert!( !tcx.is_constructor(root.to_def_id()), "you should not call `mir_callgraph_reachable` on enum/struct constructor functions" @@ -164,16 +163,16 @@ pub(crate) fn mir_callgraph_cyclic<'tcx>( // limit, we will hit the limit first and give up on looking for inlining. And in any case, // the default recursion limits are quite generous for us. If we need to recurse 64 times // into the call graph, we're probably not going to find any useful MIR inlining. - let recursion_limit = tcx.recursion_limit() / 2; + let recursion_limit = tcx.recursion_limit() / 8; let mut involved = FxHashSet::default(); let typing_env = ty::TypingEnv::post_analysis(tcx, root); let root_instance = ty::Instance::new_raw(root.to_def_id(), ty::GenericArgs::identity_for_item(tcx, root)); if !should_recurse(tcx, root_instance) { trace!("cannot walk, skipping"); - return involved.into(); + return Some(involved.into()); } - process( + match process( tcx, typing_env, root_instance, @@ -182,8 +181,10 @@ pub(crate) fn mir_callgraph_cyclic<'tcx>( &mut involved, &mut FxHashMap::default(), recursion_limit, - ); - involved.into() + ) { + Some(_) => Some(involved.into()), + _ => None, + } } pub(crate) fn mir_inliner_callees<'tcx>( diff --git a/compiler/rustc_mir_transform/src/jump_threading.rs b/compiler/rustc_mir_transform/src/jump_threading.rs index e2959ca64bda..9e8de4926c6e 100644 --- a/compiler/rustc_mir_transform/src/jump_threading.rs +++ b/compiler/rustc_mir_transform/src/jump_threading.rs @@ -62,7 +62,9 @@ use rustc_middle::mir::interpret::Scalar; use rustc_middle::mir::visit::Visitor; use rustc_middle::mir::*; use rustc_middle::ty::{self, ScalarInt, TyCtxt}; -use rustc_mir_dataflow::value_analysis::{Map, PlaceIndex, TrackElem, ValueIndex}; +use rustc_mir_dataflow::value_analysis::{ + Map, PlaceCollectionMode, PlaceIndex, TrackElem, ValueIndex, +}; use rustc_span::DUMMY_SP; use tracing::{debug, instrument, trace}; @@ -71,7 +73,6 @@ use crate::cost_checker::CostChecker; pub(super) struct JumpThreading; const MAX_COST: u8 = 100; -const MAX_PLACES: usize = 100; impl<'tcx> crate::MirPass<'tcx> for JumpThreading { fn is_enabled(&self, sess: &rustc_session::Session) -> bool { @@ -95,7 +96,7 @@ impl<'tcx> crate::MirPass<'tcx> for JumpThreading { typing_env, ecx: InterpCx::new(tcx, DUMMY_SP, typing_env, DummyMachine), body, - map: Map::new(tcx, body, Some(MAX_PLACES)), + map: Map::new(tcx, body, PlaceCollectionMode::OnDemand), maybe_loop_headers: loops::maybe_loop_headers(body), entry_states: IndexVec::from_elem(ConditionSet::default(), &body.basic_blocks), }; @@ -273,6 +274,19 @@ impl ConditionSet { } impl<'a, 'tcx> TOFinder<'a, 'tcx> { + fn place(&mut self, place: Place<'tcx>, tail: Option) -> Option { + self.map.register_place(self.tcx, self.body, place, tail) + } + + fn value(&mut self, place: PlaceIndex) -> Option { + self.map.register_value(self.tcx, self.typing_env, place) + } + + fn place_value(&mut self, place: Place<'tcx>, tail: Option) -> Option { + let place = self.place(place, tail)?; + self.value(place) + } + /// Construct the condition set for `bb` from the terminator, without executing its effect. #[instrument(level = "trace", skip(self))] fn populate_from_outgoing_edges(&mut self, bb: BasicBlock) -> ConditionSet { @@ -397,7 +411,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { #[instrument(level = "trace", skip(self, state))] fn process_immediate(&mut self, lhs: PlaceIndex, rhs: ImmTy<'tcx>, state: &mut ConditionSet) { - if let Some(lhs) = self.map.value(lhs) + if let Some(lhs) = self.value(lhs) && let Immediate::Scalar(Scalar::Int(int)) = *rhs { state.fulfill_matches(lhs, int) @@ -412,10 +426,6 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { constant: OpTy<'tcx>, state: &mut ConditionSet, ) { - let values_inside = self.map.values_inside(lhs); - if !state.active.iter().any(|&(_, cond)| values_inside.contains(&cond.place)) { - return; - } self.map.for_each_projection_value( lhs, constant, @@ -450,9 +460,13 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { #[instrument(level = "trace", skip(self, state))] fn process_copy(&mut self, lhs: PlaceIndex, rhs: PlaceIndex, state: &mut ConditionSet) { let mut renames = FxHashMap::default(); - self.map.for_each_value_pair(rhs, lhs, &mut |rhs, lhs| { - renames.insert(lhs, rhs); - }); + self.map.register_copy_tree( + lhs, // tree to copy + rhs, // tree to build + &mut |lhs, rhs| { + renames.insert(lhs, rhs); + }, + ); state.for_each_mut(|c| { if let Some(rhs) = renames.get(&c.place) { c.place = *rhs @@ -474,7 +488,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { } // Transfer the conditions on the copied rhs. Operand::Move(rhs) | Operand::Copy(rhs) => { - let Some(rhs) = self.map.find(rhs.as_ref()) else { return }; + let Some(rhs) = self.place(*rhs, None) else { return }; self.process_copy(lhs, rhs, state) } Operand::RuntimeChecks(_) => {} @@ -488,12 +502,12 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { rvalue: &Rvalue<'tcx>, state: &mut ConditionSet, ) { - let Some(lhs) = self.map.find(lhs_place.as_ref()) else { return }; + let Some(lhs) = self.place(*lhs_place, None) else { return }; match rvalue { Rvalue::Use(operand) => self.process_operand(lhs, operand, state), // Transfer the conditions on the copy rhs. Rvalue::Discriminant(rhs) => { - let Some(rhs) = self.map.find_discr(rhs.as_ref()) else { return }; + let Some(rhs) = self.place(*rhs, Some(TrackElem::Discriminant)) else { return }; self.process_copy(lhs, rhs, state) } // If we expect `lhs ?= A`, we have an opportunity if we assume `constant == A`. @@ -503,33 +517,37 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { // Do not support unions. AggregateKind::Adt(.., Some(_)) => return, AggregateKind::Adt(_, variant_index, ..) if agg_ty.is_enum() => { - if let Some(discr_target) = self.map.apply(lhs, TrackElem::Discriminant) - && let Some(discr_value) = self - .ecx - .discriminant_for_variant(agg_ty, *variant_index) - .discard_err() + let discr_ty = agg_ty.discriminant_ty(self.tcx); + let discr_target = + self.map.register_place_index(discr_ty, lhs, TrackElem::Discriminant); + if let Some(discr_value) = + self.ecx.discriminant_for_variant(agg_ty, *variant_index).discard_err() { self.process_immediate(discr_target, discr_value, state); } - if let Some(idx) = self.map.apply(lhs, TrackElem::Variant(*variant_index)) { - idx - } else { - return; - } + self.map.register_place_index( + agg_ty, + lhs, + TrackElem::Variant(*variant_index), + ) } _ => lhs, }; for (field_index, operand) in operands.iter_enumerated() { - if let Some(field) = self.map.apply(lhs, TrackElem::Field(field_index)) { - self.process_operand(field, operand, state); - } + let operand_ty = operand.ty(self.body, self.tcx); + let field = self.map.register_place_index( + operand_ty, + lhs, + TrackElem::Field(field_index), + ); + self.process_operand(field, operand, state); } } // Transfer the conditions on the copy rhs, after inverting the value of the condition. Rvalue::UnaryOp(UnOp::Not, Operand::Move(operand) | Operand::Copy(operand)) => { let layout = self.ecx.layout_of(operand.ty(self.body, self.tcx).ty).unwrap(); - let Some(lhs) = self.map.value(lhs) else { return }; - let Some(operand) = self.map.find_value(operand.as_ref()) else { return }; + let Some(lhs) = self.value(lhs) else { return }; + let Some(operand) = self.place_value(*operand, None) else { return }; state.retain_mut(|mut c| { if c.place == lhs { let value = self @@ -563,8 +581,8 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { // Avoid handling them, though this could be extended in the future. return; } - let Some(lhs) = self.map.value(lhs) else { return }; - let Some(operand) = self.map.find_value(operand.as_ref()) else { return }; + let Some(lhs) = self.value(lhs) else { return }; + let Some(operand) = self.place_value(*operand, None) else { return }; let Some(value) = value.const_.try_eval_scalar_int(self.tcx, self.typing_env) else { return; @@ -593,7 +611,9 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { // If we expect `discriminant(place) ?= A`, // we have an opportunity if `variant_index ?= A`. StatementKind::SetDiscriminant { box place, variant_index } => { - let Some(discr_target) = self.map.find_discr(place.as_ref()) else { return }; + let Some(discr_target) = self.place(*place, Some(TrackElem::Discriminant)) else { + return; + }; let enum_ty = place.ty(self.body, self.tcx).ty; // `SetDiscriminant` guarantees that the discriminant is now `variant_index`. // Even if the discriminant write does nothing due to niches, it is UB to set the @@ -609,7 +629,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume( Operand::Copy(place) | Operand::Move(place), )) => { - let Some(place) = self.map.find_value(place.as_ref()) else { return }; + let Some(place) = self.place_value(*place, None) else { return }; state.fulfill_matches(place, ScalarInt::TRUE); } StatementKind::Assign(box (lhs_place, rhs)) => { @@ -666,7 +686,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> { state: &mut ConditionSet, ) { let Some(discr) = discr.place() else { return }; - let Some(discr_idx) = self.map.find_value(discr.as_ref()) else { return }; + let Some(discr_idx) = self.place_value(discr, None) else { return }; let discr_ty = discr.ty(self.body, self.tcx).ty; let Ok(discr_layout) = self.ecx.layout_of(discr_ty) else { return }; diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index cd699436e012..4b2f8e03afc1 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -1582,7 +1582,7 @@ impl<'v> RootCollector<'_, 'v> { } fn process_impl_item(&mut self, id: hir::ImplItemId) { - if matches!(self.tcx.def_kind(id.owner_id), DefKind::AssocFn) { + if self.tcx.def_kind(id.owner_id) == DefKind::AssocFn { self.push_if_root(id.owner_id.def_id); } } @@ -1720,7 +1720,7 @@ fn create_mono_items_for_default_impls<'tcx>( ) { let impl_ = tcx.impl_trait_header(item.owner_id); - if matches!(impl_.polarity, ty::ImplPolarity::Negative) { + if impl_.polarity == ty::ImplPolarity::Negative { return; } diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index 1c8d6db08c31..e7af1d45cff8 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -580,6 +580,16 @@ fn internalize_symbols<'tcx>( } } + // When LTO inlines the caller of a naked function, it will attempt but fail to make the + // naked function symbol visible. To ensure that LTO works correctly, do not default + // naked functions to internal linkage and default visibility. + if let MonoItem::Fn(instance) = item { + let flags = cx.tcx.codegen_instance_attrs(instance.def).flags; + if flags.contains(CodegenFnAttrFlags::NAKED) { + continue; + } + } + // If we got here, we did not find any uses from other CGUs, so // it's fine to make this monomorphization internal. data.linkage = Linkage::Internal; diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs index 2f6ff12e1e8d..05ea217c1de0 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs @@ -868,7 +868,7 @@ where .map(|(pred, _)| pred), )); - // FIXME(associated_const_equality): Also add associated consts to + // FIXME(mgca): Also add associated consts to // the requirements here. for associated_type_def_id in cx.associated_type_def_ids(trait_ref.def_id) { // associated types that require `Self: Sized` do not show up in the built-in diff --git a/compiler/rustc_parse/Cargo.toml b/compiler/rustc_parse/Cargo.toml index 5239c6290bfb..04a51c905661 100644 --- a/compiler/rustc_parse/Cargo.toml +++ b/compiler/rustc_parse/Cargo.toml @@ -20,8 +20,8 @@ rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } thin-vec = "0.2.12" tracing = "0.1" -unicode-normalization = "0.1.11" -unicode-width = "0.2.0" +unicode-normalization = "0.1.25" +unicode-width = "0.2.2" # tidy-alphabetical-end [dev-dependencies] diff --git a/compiler/rustc_parse/src/lexer/tokentrees.rs b/compiler/rustc_parse/src/lexer/tokentrees.rs index 634f4c30b260..f3415aa47d33 100644 --- a/compiler/rustc_parse/src/lexer/tokentrees.rs +++ b/compiler/rustc_parse/src/lexer/tokentrees.rs @@ -117,7 +117,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> { candidate = Some(*delimiter_span); } } - let (_, _) = self.diag_info.open_delimiters.pop().unwrap(); + self.diag_info.open_delimiters.pop().unwrap(); self.diag_info.unmatched_delims.push(UnmatchedDelim { found_delim: Some(close_delim), found_span: self.token.span, diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index df8f970e0599..1fb44df65347 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -22,10 +22,10 @@ use rustc_ast::token; use rustc_ast::tokenstream::TokenStream; use rustc_ast_pretty::pprust; use rustc_errors::{Diag, EmissionGuarantee, FatalError, PResult, pluralize}; +pub use rustc_lexer::UNICODE_VERSION; use rustc_session::parse::ParseSess; use rustc_span::source_map::SourceMap; use rustc_span::{FileName, SourceFile, Span}; -pub use unicode_normalization::UNICODE_VERSION as UNICODE_NORMALIZATION_VERSION; pub const MACRO_ARGUMENTS: Option<&str> = Some("macro arguments"); @@ -39,6 +39,44 @@ pub mod lexer; mod errors; +// Make sure that the Unicode version of the dependencies is the same. +const _: () = { + let rustc_lexer = rustc_lexer::UNICODE_VERSION; + let rustc_span = rustc_span::UNICODE_VERSION; + let normalization = unicode_normalization::UNICODE_VERSION; + let width = unicode_width::UNICODE_VERSION; + + if rustc_lexer.0 != rustc_span.0 + || rustc_lexer.1 != rustc_span.1 + || rustc_lexer.2 != rustc_span.2 + { + panic!( + "rustc_lexer and rustc_span must use the same Unicode version, \ + `rustc_lexer::UNICODE_VERSION` and `rustc_span::UNICODE_VERSION` are \ + different." + ); + } + + if rustc_lexer.0 != normalization.0 + || rustc_lexer.1 != normalization.1 + || rustc_lexer.2 != normalization.2 + { + panic!( + "rustc_lexer and unicode-normalization must use the same Unicode version, \ + `rustc_lexer::UNICODE_VERSION` and `unicode_normalization::UNICODE_VERSION` are \ + different." + ); + } + + if rustc_lexer.0 != width.0 || rustc_lexer.1 != width.1 || rustc_lexer.2 != width.2 { + panic!( + "rustc_lexer and unicode-width must use the same Unicode version, \ + `rustc_lexer::UNICODE_VERSION` and `unicode_width::UNICODE_VERSION` are \ + different." + ); + } +}; + rustc_fluent_macro::fluent_messages! { "../messages.ftl" } // Unwrap the result if `Ok`, otherwise emit the diagnostics and abort. diff --git a/compiler/rustc_parse/src/parser/asm.rs b/compiler/rustc_parse/src/parser/asm.rs index caec877232a6..3fab234adaad 100644 --- a/compiler/rustc_parse/src/parser/asm.rs +++ b/compiler/rustc_parse/src/parser/asm.rs @@ -77,7 +77,7 @@ fn eat_operand_keyword<'a>( exp: ExpKeywordPair, asm_macro: AsmMacro, ) -> PResult<'a, bool> { - if matches!(asm_macro, AsmMacro::Asm) { + if asm_macro == AsmMacro::Asm { Ok(p.eat_keyword(exp)) } else { let span = p.token.span; diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index 63109c7ba5cb..1cb9a1b65d65 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -1,7 +1,7 @@ use rustc_ast as ast; use rustc_ast::token::{self, MetaVarKind}; use rustc_ast::tokenstream::ParserRange; -use rustc_ast::{Attribute, attr}; +use rustc_ast::{AttrItemKind, Attribute, attr}; use rustc_errors::codes::*; use rustc_errors::{Diag, PResult}; use rustc_span::{BytePos, Span}; @@ -313,7 +313,7 @@ impl<'a> Parser<'a> { this.expect(exp!(CloseParen))?; } Ok(( - ast::AttrItem { unsafety, path, args, tokens: None }, + ast::AttrItem { unsafety, path, args: AttrItemKind::Unparsed(args), tokens: None }, Trailing::No, UsePreAttrPos::No, )) diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs index 44fdf146f9c7..e04178645fdd 100644 --- a/compiler/rustc_parse/src/parser/attr_wrapper.rs +++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs @@ -86,9 +86,9 @@ fn has_cfg_or_cfg_attr(attrs: &[Attribute]) -> bool { // NOTE: Builtin attributes like `cfg` and `cfg_attr` cannot be renamed via imports. // Therefore, the absence of a literal `cfg` or `cfg_attr` guarantees that // we don't need to do any eager expansion. - attrs.iter().any(|attr| { - attr.ident().is_some_and(|ident| ident.name == sym::cfg || ident.name == sym::cfg_attr) - }) + attrs + .iter() + .any(|attr| attr.name().is_some_and(|ident| ident == sym::cfg || ident == sym::cfg_attr)) } impl<'a> Parser<'a> { @@ -398,10 +398,8 @@ impl<'a> Parser<'a> { /// - any single-segment, non-builtin attributes are present, e.g. `derive`, /// `test`, `global_allocator`. fn needs_tokens(attrs: &[ast::Attribute]) -> bool { - attrs.iter().any(|attr| match attr.ident() { + attrs.iter().any(|attr| match attr.name() { None => !attr.is_doc_comment(), - Some(ident) => { - ident.name == sym::cfg_attr || !rustc_feature::is_builtin_attr_name(ident.name) - } + Some(name) => name == sym::cfg_attr || !rustc_feature::is_builtin_attr_name(name), }) } diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index d7d343ac16b4..70ec80a50812 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -3084,22 +3084,24 @@ impl<'a> Parser<'a> { } let mut err = self.dcx().struct_span_fatal(spans, "encountered diff marker"); - match middlediff3 { + let middle_marker = match middlediff3 { // We're using diff3 Some(middlediff3) => { err.span_label( - start, - "between this marker and `|||||||` is the code that we're merging into", - ); - err.span_label(middlediff3, "between this marker and `=======` is the base code (what the two refs diverged from)"); - } - None => { - err.span_label( - start, - "between this marker and `=======` is the code that we're merging into", + middlediff3, + "between this marker and `=======` is the base code (what the two refs \ + diverged from)", ); + "|||||||" } + None => "=======", }; + err.span_label( + start, + format!( + "between this marker and `{middle_marker}` is the code that you are merging into", + ), + ); if let Some(middle) = middle { err.span_label(middle, "between this marker and `>>>>>>>` is the incoming code"); @@ -3114,16 +3116,15 @@ impl<'a> Parser<'a> { containing conflict markers", ); err.help( - "if you're having merge conflicts after pulling new code:\n\ - the top section is the code you already had and the bottom section is the remote code\n\ - if you're in the middle of a rebase:\n\ - the top section is the code being rebased onto and the bottom section is the code \ - coming from the current commit being rebased", + "if you are in a merge, the top section is the code you already had checked out and \ + the bottom section is the new code\n\ + if you are in a rebase, the top section is the code being rebased onto and the bottom \ + section is the code you had checked out which is being rebased", ); err.note( - "for an explanation on these markers from the `git` documentation:\n\ - visit ", + "for an explanation on these markers from the `git` documentation, visit \ + ", ); err.emit(); diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 3f0853a3c54d..8835fba1adcd 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1521,7 +1521,7 @@ impl<'a> Parser<'a> { }, ) } else if this.check_inline_const(0) { - this.parse_const_block(lo, false) + this.parse_const_block(lo) } else if this.may_recover() && this.is_do_catch_block() { this.recover_do_catch() } else if this.is_try_block() { @@ -1622,15 +1622,13 @@ impl<'a> Parser<'a> { let first_expr = self.parse_expr()?; if self.eat(exp!(Semi)) { // Repeating array syntax: `[ 0; 512 ]` - let count = if self.token.is_keyword(kw::Const) - && self.look_ahead(1, |t| *t == token::OpenBrace) - { + let count = if self.eat_keyword(exp!(Const)) { // While we could just disambiguate `Direct` from `AnonConst` by // treating all const block exprs as `AnonConst`, that would // complicate the DefCollector and likely all other visitors. // So we strip the const blockiness and just store it as a block // in the AST with the extra disambiguator on the AnonConst - self.parse_expr_anon_const(|_, _| MgcaDisambiguation::AnonConst)? + self.parse_mgca_const_block(false)? } else { self.parse_expr_anon_const(|this, expr| this.mgca_direct_lit_hack(expr))? }; @@ -3100,7 +3098,7 @@ impl<'a> Parser<'a> { pub(crate) fn eat_label(&mut self) -> Option

+/// This type is not properly implemented yet, and the documentation below is thus not accurate. +///
+/// +/// That is, if a reference (or a `Box`) is wrapped in `MaybeDangling` (including when in a +/// (nested) field of a compound type wrapped in `MaybeDangling`), it does not have to follow +/// pointer aliasing rules or be dereferenceable. +/// +/// This can be useful when the value can become dangling while the function holding it is still +/// executing (particularly in concurrent code). As a somewhat absurd example, consider this code: +/// +/// ```rust,no_run +/// #![feature(box_as_ptr)] +/// # use std::alloc::{dealloc, Layout}; +/// # use std::mem; +/// +/// let mut boxed = Box::new(0_u32); +/// let ptr = Box::as_mut_ptr(&mut boxed); +/// +/// // Safety: the pointer comes from a box and thus was allocated before; `box` is not used afterwards +/// unsafe { dealloc(ptr.cast(), Layout::new::()) }; +/// +/// mem::forget(boxed); // <-- this is UB! +/// ``` +/// +/// Even though the `Box`e's destructor is not run (and thus we don't have a double free bug), this +/// code is still UB. This is because when moving `boxed` into `forget`, its validity invariants +/// are asserted, causing UB since the `Box` is dangling. The safety comment is as such wrong, as +/// moving the `boxed` variable as part of the `forget` call *is* a use. +/// +/// To fix this we could use `MaybeDangling`: +/// +// FIXME: remove `no_run` once the semantics are actually implemented +/// ```rust,no_run +/// #![feature(maybe_dangling, box_as_ptr)] +/// # use std::alloc::{dealloc, Layout}; +/// # use std::mem::{self, MaybeDangling}; +/// +/// let mut boxed = MaybeDangling::new(Box::new(0_u32)); +/// let ptr = Box::as_mut_ptr(boxed.as_mut()); +/// +/// // Safety: the pointer comes from a box and thus was allocated before; `box` is not used afterwards +/// unsafe { dealloc(ptr.cast(), Layout::new::()) }; +/// +/// mem::forget(boxed); // <-- this is OK! +/// ``` +/// +/// Note that the bit pattern must still be valid for the wrapped type. That is, [references] +/// (and [boxes]) still must be aligned and non-null. +/// +/// Additionally note that safe code can still assume that the inner value in a `MaybeDangling` is +/// **not** dangling -- functions like [`as_ref`] and [`into_inner`] are safe. It is not sound to +/// return a dangling reference in a `MaybeDangling` to safe code. However, it *is* sound +/// to hold such values internally inside your code -- and there's no way to do that without +/// this type. Note that other types can use this type and thus get the same effect; in particular, +/// [`ManuallyDrop`] will use `MaybeDangling`. +/// +/// Note that `MaybeDangling` doesn't prevent drops from being run, which can lead to UB if the +/// drop observes a dangling value. If you need to prevent drops from being run use [`ManuallyDrop`] +/// instead. +/// +/// [references]: prim@reference +/// [boxes]: ../../std/boxed/struct.Box.html +/// [`into_inner`]: MaybeDangling::into_inner +/// [`as_ref`]: MaybeDangling::as_ref +/// [`ManuallyDrop`]: crate::mem::ManuallyDrop +#[repr(transparent)] +#[rustc_pub_transparent] +#[derive(Debug, Copy, Clone, Default)] +pub struct MaybeDangling(P); + +impl MaybeDangling

{ + /// Wraps a value in a `MaybeDangling`, allowing it to dangle. + pub const fn new(x: P) -> Self + where + P: Sized, + { + MaybeDangling(x) + } + + /// Returns a reference to the inner value. + /// + /// Note that this is UB if the inner value is currently dangling. + pub const fn as_ref(&self) -> &P { + &self.0 + } + + /// Returns a mutable reference to the inner value. + /// + /// Note that this is UB if the inner value is currently dangling. + pub const fn as_mut(&mut self) -> &mut P { + &mut self.0 + } + + /// Extracts the value from the `MaybeDangling` container. + /// + /// Note that this is UB if the inner value is currently dangling. + pub const fn into_inner(self) -> P + where + P: Sized, + { + // FIXME: replace this with `self.0` when const checker can figure out that `self` isn't actually dropped + // SAFETY: this is equivalent to `self.0` + let x = unsafe { ptr::read(&self.0) }; + mem::forget(self); + x + } +} diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index ad5fda0cfe4d..4f7edce1e977 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -19,6 +19,10 @@ mod maybe_uninit; #[stable(feature = "maybe_uninit", since = "1.36.0")] pub use maybe_uninit::MaybeUninit; +mod maybe_dangling; +#[unstable(feature = "maybe_dangling", issue = "118166")] +pub use maybe_dangling::MaybeDangling; + mod transmutability; #[unstable(feature = "transmutability", issue = "99571")] pub use transmutability::{Assume, TransmuteFrom}; diff --git a/library/core/src/num/int_bits.rs b/library/core/src/num/int_bits.rs new file mode 100644 index 000000000000..44be6de47327 --- /dev/null +++ b/library/core/src/num/int_bits.rs @@ -0,0 +1,171 @@ +//! Implementations for `uN::gather_bits` and `uN::scatter_bits` +//! +//! For the purposes of this implementation, the operations can be thought +//! of as operating on the input bits as a list, starting from the least +//! significant bit. Gathering is like `Vec::retain` that deletes bits +//! where the mask has a zero. Scattering is like doing the inverse by +//! inserting the zeros that gathering would delete. +//! +//! Key observation: Each bit that is gathered/scattered needs to be +//! shifted by the count of zeros up to the corresponding mask bit. +//! +//! With that in mind, the general idea is to decompose the operation into +//! a sequence of stages in `0..log2(BITS)`, where each stage shifts some +//! of the bits by `n = 1 << stage`. The masks for each stage are computed +//! via prefix counts of zeros in the mask. +//! +//! # Gathering +//! +//! Consider the input as a sequence of runs of data (bitstrings A,B,C,...), +//! split by fixed-width groups of zeros ('.'), initially at width `n = 1`. +//! Counting the groups of zeros, each stage shifts the odd-indexed runs of +//! data right by `n`, effectively swapping them with the preceding zeros. +//! For the next stage, `n` is doubled as all the zeros are now paired. +//! ```text +//! .A.B.C.D.E.F.G.H +//! ..AB..CD..EF..GH +//! ....ABCD....EFGH +//! ........ABCDEFGH +//! ``` +//! What makes this nontrivial is that the lengths of the bitstrings are not +//! the same. Using lowercase for individual bits, the above might look like +//! ```text +//! .a.bbb.ccccc.dd.e..g.hh +//! ..abbb..cccccdd..e..ghh +//! ....abbbcccccdd....eghh +//! ........abbbcccccddeghh +//! ``` +//! +//! # Scattering +//! +//! For `scatter_bits`, the stages are reversed. We start with a single run of +//! data in the low bits. Each stage then splits each run of data in two by +//! shifting part of it left by `n`, which is halved each stage. +//! ```text +//! ........ABCDEFGH +//! ....ABCD....EFGH +//! ..AB..CD..EF..GH +//! .A.B.C.D.E.F.G.H +//! ``` +//! +//! # Stage masks +//! +//! To facilitate the shifts at each stage, we compute a mask that covers both +//! the bitstrings to shift, and the zeros they shift into. +//! ```text +//! .A.B.C.D.E.F.G.H +//! ## ## ## ## +//! ..AB..CD..EF..GH +//! #### #### +//! ....ABCD....EFGH +//! ######## +//! ........ABCDEFGH +//! ``` + +macro_rules! uint_impl { + ($U:ident) => { + pub(super) mod $U { + const STAGES: usize = $U::BITS.ilog2() as usize; + #[inline] + const fn prepare(sparse: $U) -> [$U; STAGES] { + // We'll start with `zeros` as a mask of the bits to be removed, + // and compute into `masks` the parts that shift at each stage. + let mut zeros = !sparse; + let mut masks = [0; STAGES]; + let mut stage = 0; + while stage < STAGES { + let n = 1 << stage; + // Suppose `zeros` has bits set at ranges `{ a..a+n, b..b+n, ... }`. + // Then `parity` will be computed as `{ a.. } XOR { b.. } XOR ...`, + // which will be the ranges `{ a..b, c..d, e.. }`. + let mut parity = zeros; + let mut len = n; + while len < $U::BITS { + parity ^= parity << len; + len <<= 1; + } + masks[stage] = parity; + + // Toggle off the bits that are shifted into: + // { a..a+n, b..b+n, ... } & !{ a..b, c..d, e.. } + // == { b..b+n, d..d+n, ... } + zeros &= !parity; + // Expand the remaining ranges down to the bits that were + // shifted from: { b-n..b+n, d-n..d+n, ... } + zeros ^= zeros >> n; + + stage += 1; + } + masks + } + + #[inline(always)] + pub(in super::super) const fn gather_impl(mut x: $U, sparse: $U) -> $U { + let masks = prepare(sparse); + x &= sparse; + let mut stage = 0; + while stage < STAGES { + let n = 1 << stage; + // Consider each two runs of data with their leading + // groups of `n` 0-bits. Suppose that the run that is + // shifted right has length `a`, and the other one has + // length `b`. Assume that only zeros are shifted in. + // ```text + // [0; n], [X; a], [0; n], [Y; b] // x + // [0; n], [X; a], [0; n], [0; b] // q + // [0; n], [0; a + n], [Y; b] // x ^= q + // [0; n + n], [X; a], [0; b] // q >> n + // [0; n], [0; n], [X; a], [Y; b] // x ^= q << n + // ``` + // Only zeros are shifted out, satisfying the assumption + // for the next group. + + // In effect, the upper run of data is swapped with the + // group of `n` zeros below it. + let q = x & masks[stage]; + x ^= q; + x ^= q >> n; + + stage += 1; + } + x + } + #[inline(always)] + pub(in super::super) const fn scatter_impl(mut x: $U, sparse: $U) -> $U { + let masks = prepare(sparse); + let mut stage = STAGES; + while stage > 0 { + stage -= 1; + let n = 1 << stage; + // Consider each run of data with the `2 * n` arbitrary bits + // above it. Suppose that the run has length `a + b`, with + // `a` being the length of the part that needs to be + // shifted. Assume that only zeros are shifted in. + // ```text + // [_; n], [_; n], [X; a], [Y; b] // x + // [0; n], [_; n], [X; a], [0; b] // q + // [_; n], [0; n + a], [Y; b] // x ^= q + // [_; n], [X; a], [0; b + n] // q << n + // [_; n], [X; a], [0; n], [Y; b] // x ^= q << n + // ``` + // Only zeros are shifted out, satisfying the assumption + // for the next group. + + // In effect, `n` 0-bits are inserted somewhere in each run + // of data to spread it, and the two groups of `n` bits + // above are XOR'd together. + let q = x & masks[stage]; + x ^= q; + x ^= q << n; + } + x & sparse + } + } + }; +} + +uint_impl!(u8); +uint_impl!(u16); +uint_impl!(u32); +uint_impl!(u64); +uint_impl!(u128); diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index f49f5f3c3afb..9a27f8a0b5e6 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1421,8 +1421,15 @@ macro_rules! int_impl { /// # Examples /// /// ``` - #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(4), 0x10);")] - #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(129), 0);")] + #[doc = concat!("assert_eq!(0x1_", stringify!($SelfT), ".unbounded_shl(4), 0x10);")] + #[doc = concat!("assert_eq!(0x1_", stringify!($SelfT), ".unbounded_shl(129), 0);")] + #[doc = concat!("assert_eq!(0b101_", stringify!($SelfT), ".unbounded_shl(0), 0b101);")] + #[doc = concat!("assert_eq!(0b101_", stringify!($SelfT), ".unbounded_shl(1), 0b1010);")] + #[doc = concat!("assert_eq!(0b101_", stringify!($SelfT), ".unbounded_shl(2), 0b10100);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shl(", stringify!($BITS), "), 0);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shl(1).unbounded_shl(", stringify!($BITS_MINUS_ONE), "), 0);")] + #[doc = concat!("assert_eq!((-13_", stringify!($SelfT), ").unbounded_shl(", stringify!($BITS), "), 0);")] + #[doc = concat!("assert_eq!((-13_", stringify!($SelfT), ").unbounded_shl(1).unbounded_shl(", stringify!($BITS_MINUS_ONE), "), 0);")] /// ``` #[stable(feature = "unbounded_shifts", since = "1.87.0")] #[rustc_const_stable(feature = "unbounded_shifts", since = "1.87.0")] @@ -1594,9 +1601,16 @@ macro_rules! int_impl { /// # Examples /// /// ``` - #[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(4), 0x1);")] - #[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(129), 0);")] + #[doc = concat!("assert_eq!(0x10_", stringify!($SelfT), ".unbounded_shr(4), 0x1);")] + #[doc = concat!("assert_eq!(0x10_", stringify!($SelfT), ".unbounded_shr(129), 0);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.unbounded_shr(129), -1);")] + #[doc = concat!("assert_eq!(0b1010_", stringify!($SelfT), ".unbounded_shr(0), 0b1010);")] + #[doc = concat!("assert_eq!(0b1010_", stringify!($SelfT), ".unbounded_shr(1), 0b101);")] + #[doc = concat!("assert_eq!(0b1010_", stringify!($SelfT), ".unbounded_shr(2), 0b10);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shr(", stringify!($BITS), "), 0);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shr(1).unbounded_shr(", stringify!($BITS_MINUS_ONE), "), 0);")] + #[doc = concat!("assert_eq!((-13_", stringify!($SelfT), ").unbounded_shr(", stringify!($BITS), "), -1);")] + #[doc = concat!("assert_eq!((-13_", stringify!($SelfT), ").unbounded_shr(1).unbounded_shr(", stringify!($BITS_MINUS_ONE), "), -1);")] /// ``` #[stable(feature = "unbounded_shifts", since = "1.87.0")] #[rustc_const_stable(feature = "unbounded_shifts", since = "1.87.0")] diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index 35141dfeb3a6..558426c94e5d 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -44,6 +44,7 @@ mod int_macros; // import int_impl! mod uint_macros; // import uint_impl! mod error; +mod int_bits; mod int_log10; mod int_sqrt; pub(crate) mod libm; diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index bf901c9b4ad3..eea5ce348355 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -492,27 +492,8 @@ macro_rules! uint_impl { #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] - pub const fn gather_bits(self, mut mask: Self) -> Self { - let mut bit_position = 1; - let mut result = 0; - - // Iterate through the mask bits, unsetting the lowest bit after - // each iteration. We fill the bits in the result starting from the - // least significant bit. - while mask != 0 { - // Find the next lowest set bit in the mask - let next_mask_bit = mask.isolate_lowest_one(); - - // Retrieve the masked bit and if present, set it in the result - let src_bit = (self & next_mask_bit) != 0; - result |= if src_bit { bit_position } else { 0 }; - - // Unset lowest set bit in the mask, prepare next position to set - mask ^= next_mask_bit; - bit_position <<= 1; - } - - result + pub const fn gather_bits(self, mask: Self) -> Self { + crate::num::int_bits::$ActualT::gather_impl(self as $ActualT, mask as $ActualT) as $SelfT } /// Returns an integer with the least significant bits of `self` @@ -528,25 +509,8 @@ macro_rules! uint_impl { #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] - pub const fn scatter_bits(mut self, mut mask: Self) -> Self { - let mut result = 0; - - // Iterate through the mask bits, unsetting the lowest bit after - // each iteration and right-shifting `self` by one to get the next - // bit into the least significant bit position. - while mask != 0 { - // Find the next bit position to potentially set - let next_mask_bit = mask.isolate_lowest_one(); - - // If bit is set, deposit it at the masked bit position - result |= if (self & 1) != 0 { next_mask_bit } else { 0 }; - - // Unset lowest set bit in the mask, shift in next `self` bit - mask ^= next_mask_bit; - self >>= 1; - } - - result + pub const fn scatter_bits(self, mask: Self) -> Self { + crate::num::int_bits::$ActualT::scatter_impl(self as $ActualT, mask as $ActualT) as $SelfT } /// Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, @@ -1880,8 +1844,24 @@ macro_rules! uint_impl { /// # Examples /// /// ``` - #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(4), 0x10);")] - #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(129), 0);")] + #[doc = concat!("assert_eq!(0x1_", stringify!($SelfT), ".unbounded_shl(4), 0x10);")] + #[doc = concat!("assert_eq!(0x1_", stringify!($SelfT), ".unbounded_shl(129), 0);")] + #[doc = concat!("assert_eq!(0b101_", stringify!($SelfT), ".unbounded_shl(0), 0b101);")] + #[doc = concat!("assert_eq!(0b101_", stringify!($SelfT), ".unbounded_shl(1), 0b1010);")] + #[doc = concat!("assert_eq!(0b101_", stringify!($SelfT), ".unbounded_shl(2), 0b10100);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shl(", stringify!($BITS), "), 0);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shl(1).unbounded_shl(", stringify!($BITS_MINUS_ONE), "), 0);")] + /// + #[doc = concat!("let start : ", stringify!($SelfT), " = 13;")] + /// let mut running = start; + /// for i in 0..160 { + /// // The unbounded shift left by i is the same as `<< 1` i times + /// assert_eq!(running, start.unbounded_shl(i)); + /// // Which is not always the case for a wrapping shift + #[doc = concat!(" assert_eq!(running == start.wrapping_shl(i), i < ", stringify!($BITS), ");")] + /// + /// running <<= 1; + /// } /// ``` #[stable(feature = "unbounded_shifts", since = "1.87.0")] #[rustc_const_stable(feature = "unbounded_shifts", since = "1.87.0")] @@ -2049,8 +2029,24 @@ macro_rules! uint_impl { /// # Examples /// /// ``` - #[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(4), 0x1);")] - #[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(129), 0);")] + #[doc = concat!("assert_eq!(0x10_", stringify!($SelfT), ".unbounded_shr(4), 0x1);")] + #[doc = concat!("assert_eq!(0x10_", stringify!($SelfT), ".unbounded_shr(129), 0);")] + #[doc = concat!("assert_eq!(0b1010_", stringify!($SelfT), ".unbounded_shr(0), 0b1010);")] + #[doc = concat!("assert_eq!(0b1010_", stringify!($SelfT), ".unbounded_shr(1), 0b101);")] + #[doc = concat!("assert_eq!(0b1010_", stringify!($SelfT), ".unbounded_shr(2), 0b10);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shr(", stringify!($BITS), "), 0);")] + #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shr(1).unbounded_shr(", stringify!($BITS_MINUS_ONE), "), 0);")] + /// + #[doc = concat!("let start = ", stringify!($SelfT), "::rotate_right(13, 4);")] + /// let mut running = start; + /// for i in 0..160 { + /// // The unbounded shift right by i is the same as `>> 1` i times + /// assert_eq!(running, start.unbounded_shr(i)); + /// // Which is not always the case for a wrapping shift + #[doc = concat!(" assert_eq!(running == start.wrapping_shr(i), i < ", stringify!($BITS), ");")] + /// + /// running >>= 1; + /// } /// ``` #[stable(feature = "unbounded_shifts", since = "1.87.0")] #[rustc_const_stable(feature = "unbounded_shifts", since = "1.87.0")] diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 0345ec419416..ed31d4efaa75 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -2797,6 +2797,95 @@ impl Option> { } } +impl<'a, T> Option<&'a Option> { + /// Converts from `Option<&Option>` to `Option<&T>`. + /// + /// # Examples + /// + /// Basic usage: + /// + /// ``` + /// #![feature(option_reference_flattening)] + /// + /// let x: Option<&Option> = Some(&Some(6)); + /// assert_eq!(Some(&6), x.flatten_ref()); + /// + /// let x: Option<&Option> = Some(&None); + /// assert_eq!(None, x.flatten_ref()); + /// + /// let x: Option<&Option> = None; + /// assert_eq!(None, x.flatten_ref()); + /// ``` + #[inline] + #[unstable(feature = "option_reference_flattening", issue = "149221")] + pub const fn flatten_ref(self) -> Option<&'a T> { + match self { + Some(inner) => inner.as_ref(), + None => None, + } + } +} + +impl<'a, T> Option<&'a mut Option> { + /// Converts from `Option<&mut Option>` to `&Option`. + /// + /// # Examples + /// + /// Basic usage: + /// + /// ``` + /// #![feature(option_reference_flattening)] + /// + /// let y = &mut Some(6); + /// let x: Option<&mut Option> = Some(y); + /// assert_eq!(Some(&6), x.flatten_ref()); + /// + /// let y: &mut Option = &mut None; + /// let x: Option<&mut Option> = Some(y); + /// assert_eq!(None, x.flatten_ref()); + /// + /// let x: Option<&mut Option> = None; + /// assert_eq!(None, x.flatten_ref()); + /// ``` + #[inline] + #[unstable(feature = "option_reference_flattening", issue = "149221")] + pub const fn flatten_ref(self) -> Option<&'a T> { + match self { + Some(inner) => inner.as_ref(), + None => None, + } + } + + /// Converts from `Option<&mut Option>` to `Option<&mut T>`. + /// + /// # Examples + /// + /// Basic usage: + /// + /// ``` + /// #![feature(option_reference_flattening)] + /// + /// let y: &mut Option = &mut Some(6); + /// let x: Option<&mut Option> = Some(y); + /// assert_eq!(Some(&mut 6), x.flatten_mut()); + /// + /// let y: &mut Option = &mut None; + /// let x: Option<&mut Option> = Some(y); + /// assert_eq!(None, x.flatten_mut()); + /// + /// let x: Option<&mut Option> = None; + /// assert_eq!(None, x.flatten_mut()); + /// ``` + #[inline] + #[unstable(feature = "option_reference_flattening", issue = "149221")] + pub const fn flatten_mut(self) -> Option<&'a mut T> { + match self { + Some(inner) => inner.as_mut(), + None => None, + } + } +} + impl [Option; N] { /// Transposes a `[Option; N]` into a `Option<[T; N]>`. /// diff --git a/library/core/src/panic.rs b/library/core/src/panic.rs index 7a42b3d0fc78..81520c3ecd1b 100644 --- a/library/core/src/panic.rs +++ b/library/core/src/panic.rs @@ -166,10 +166,9 @@ pub macro const_panic { const fn do_panic($($arg: $ty),*) -> ! { $crate::intrinsics::const_eval_select!( @capture { $($arg: $ty = $arg),* } -> !: - #[noinline] - if const #[track_caller] #[inline] { // Inline this, to prevent codegen + if const #[track_caller] { $crate::panic!($const_msg) - } else #[track_caller] { // Do not inline this, it makes perf worse + } else #[track_caller] { $crate::panic!($runtime_msg) } ) @@ -195,7 +194,7 @@ pub macro const_panic { #[doc(hidden)] pub macro const_assert { ($condition: expr, $const_msg:literal, $runtime_msg:literal, $($arg:tt)*) => {{ - if !$crate::intrinsics::likely($condition) { + if !($condition) { $crate::panic::const_panic!($const_msg, $runtime_msg, $($arg)*) } }} diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 29fe77390a16..335c5c6ee944 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -880,6 +880,7 @@ pub const fn null_mut() -> *mut T { #[must_use] #[stable(feature = "strict_provenance", since = "1.84.0")] #[rustc_const_stable(feature = "strict_provenance", since = "1.84.0")] +#[rustc_diagnostic_item = "ptr_without_provenance"] pub const fn without_provenance(addr: usize) -> *const T { without_provenance_mut(addr) } @@ -918,6 +919,7 @@ pub const fn dangling() -> *const T { #[must_use] #[stable(feature = "strict_provenance", since = "1.84.0")] #[rustc_const_stable(feature = "strict_provenance", since = "1.84.0")] +#[rustc_diagnostic_item = "ptr_without_provenance_mut"] #[allow(integer_to_ptr_transmutes)] // Expected semantics here. pub const fn without_provenance_mut(addr: usize) -> *mut T { // An int-to-pointer transmute currently has exactly the intended semantics: it creates a diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index cfcb51dd2577..0ddf94559e80 100644 --- a/library/core/src/slice/iter.rs +++ b/library/core/src/slice/iter.rs @@ -2495,19 +2495,13 @@ impl<'a, T> Iterator for RChunksMut<'a, T> { && end < self.v.len() { let end = self.v.len() - end; - let start = match end.checked_sub(self.chunk_size) { - Some(sum) => sum, - None => 0, - }; - // SAFETY: This type ensures that self.v is a valid pointer with a correct len. - // Therefore the bounds check in split_at_mut guarantees the split point is inbounds. - let (head, tail) = unsafe { self.v.split_at_mut(start) }; - // SAFETY: This type ensures that self.v is a valid pointer with a correct len. - // Therefore the bounds check in split_at_mut guarantees the split point is inbounds. - let (nth, _) = unsafe { tail.split_at_mut(end - start) }; - self.v = head; + // SAFETY: The self.v contract ensures that any split_at_mut is valid. + let (rest, _) = unsafe { self.v.split_at_mut(end) }; + // SAFETY: The self.v contract ensures that any split_at_mut is valid. + let (rest, chunk) = unsafe { rest.split_at_mut(end.saturating_sub(self.chunk_size)) }; + self.v = rest; // SAFETY: Nothing else points to or will point to the contents of this slice. - Some(unsafe { &mut *nth }) + Some(unsafe { &mut *chunk }) } else { self.v = &mut []; None diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 889fd4cd65df..1bca13b14ed4 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -4809,8 +4809,6 @@ impl [T] { /// # Examples /// Basic usage: /// ``` - /// #![feature(substr_range)] - /// /// let nums: &[u32] = &[1, 7, 1, 1]; /// let num = &nums[2]; /// @@ -4819,8 +4817,6 @@ impl [T] { /// ``` /// Returning `None` with an unaligned element: /// ``` - /// #![feature(substr_range)] - /// /// let arr: &[[u32; 2]] = &[[0, 1], [2, 3]]; /// let flat_arr: &[u32] = arr.as_flattened(); /// @@ -4834,7 +4830,7 @@ impl [T] { /// assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1 /// ``` #[must_use] - #[unstable(feature = "substr_range", issue = "126769")] + #[stable(feature = "element_offset", since = "CURRENT_RUSTC_VERSION")] pub fn element_offset(&self, element: &T) -> Option { if T::IS_ZST { panic!("elements are zero-sized"); diff --git a/library/core/src/time.rs b/library/core/src/time.rs index 940129d68816..b4efc09684e7 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -1131,6 +1131,46 @@ impl Duration { let rhs_nanos = (rhs.secs as f32) * (NANOS_PER_SEC as f32) + (rhs.nanos.as_inner() as f32); self_nanos / rhs_nanos } + + /// Divides `Duration` by `Duration` and returns `u128`, rounding the result towards zero. + /// + /// # Examples + /// ``` + /// #![feature(duration_integer_division)] + /// use std::time::Duration; + /// + /// let dur = Duration::new(2, 0); + /// assert_eq!(dur.div_duration_floor(Duration::new(1, 000_000_001)), 1); + /// assert_eq!(dur.div_duration_floor(Duration::new(1, 000_000_000)), 2); + /// assert_eq!(dur.div_duration_floor(Duration::new(0, 999_999_999)), 2); + /// ``` + #[unstable(feature = "duration_integer_division", issue = "149573")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] + #[inline] + pub const fn div_duration_floor(self, rhs: Duration) -> u128 { + self.as_nanos().div_floor(rhs.as_nanos()) + } + + /// Divides `Duration` by `Duration` and returns `u128`, rounding the result towards positive infinity. + /// + /// # Examples + /// ``` + /// #![feature(duration_integer_division)] + /// use std::time::Duration; + /// + /// let dur = Duration::new(2, 0); + /// assert_eq!(dur.div_duration_ceil(Duration::new(1, 000_000_001)), 2); + /// assert_eq!(dur.div_duration_ceil(Duration::new(1, 000_000_000)), 2); + /// assert_eq!(dur.div_duration_ceil(Duration::new(0, 999_999_999)), 3); + /// ``` + #[unstable(feature = "duration_integer_division", issue = "149573")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] + #[inline] + pub const fn div_duration_ceil(self, rhs: Duration) -> u128 { + self.as_nanos().div_ceil(rhs.as_nanos()) + } } #[stable(feature = "duration", since = "1.3.0")] @@ -1315,39 +1355,54 @@ impl fmt::Debug for Duration { // need to perform rounding to match the semantics of printing // normal floating point numbers. However, we only need to do work // when rounding up. This happens if the first digit of the - // remaining ones is >= 5. + // remaining ones is >= 5. When the first digit is exactly 5, rounding + // follows IEEE-754 round-ties-to-even semantics: we only round up + // if the last written digit is odd. let integer_part = if fractional_part > 0 && fractional_part >= divisor * 5 { - // Round up the number contained in the buffer. We go through - // the buffer backwards and keep track of the carry. - let mut rev_pos = pos; - let mut carry = true; - while carry && rev_pos > 0 { - rev_pos -= 1; - - // If the digit in the buffer is not '9', we just need to - // increment it and can stop then (since we don't have a - // carry anymore). Otherwise, we set it to '0' (overflow) - // and continue. - if buf[rev_pos] < b'9' { - buf[rev_pos] += 1; - carry = false; - } else { - buf[rev_pos] = b'0'; - } - } - - // If we still have the carry bit set, that means that we set - // the whole buffer to '0's and need to increment the integer - // part. - if carry { - // If `integer_part == u64::MAX` and precision < 9, any - // carry of the overflow during rounding of the - // `fractional_part` into the `integer_part` will cause the - // `integer_part` itself to overflow. Avoid this by using an - // `Option`, with `None` representing `u64::MAX + 1`. - integer_part.checked_add(1) + // For ties (fractional_part == divisor * 5), only round up if last digit is odd + let is_tie = fractional_part == divisor * 5; + let last_digit_is_odd = if pos > 0 { + (buf[pos - 1] - b'0') % 2 == 1 } else { + // No fractional digits - check the integer part + (integer_part % 2) == 1 + }; + + if is_tie && !last_digit_is_odd { Some(integer_part) + } else { + // Round up the number contained in the buffer. We go through + // the buffer backwards and keep track of the carry. + let mut rev_pos = pos; + let mut carry = true; + while carry && rev_pos > 0 { + rev_pos -= 1; + + // If the digit in the buffer is not '9', we just need to + // increment it and can stop then (since we don't have a + // carry anymore). Otherwise, we set it to '0' (overflow) + // and continue. + if buf[rev_pos] < b'9' { + buf[rev_pos] += 1; + carry = false; + } else { + buf[rev_pos] = b'0'; + } + } + + // If we still have the carry bit set, that means that we set + // the whole buffer to '0's and need to increment the integer + // part. + if carry { + // If `integer_part == u64::MAX` and precision < 9, any + // carry of the overflow during rounding of the + // `fractional_part` into the `integer_part` will cause the + // `integer_part` itself to overflow. Avoid this by using an + // `Option`, with `None` representing `u64::MAX + 1`. + integer_part.checked_add(1) + } else { + Some(integer_part) + } } } else { Some(integer_part) diff --git a/library/core/src/unicode/unicode_data.rs b/library/core/src/unicode/unicode_data.rs index 3c38b44224f8..429b60a68f43 100644 --- a/library/core/src/unicode/unicode_data.rs +++ b/library/core/src/unicode/unicode_data.rs @@ -767,7 +767,8 @@ pub mod conversions { LOWERCASE_TABLE .binary_search_by(|&(key, _)| key.cmp(&c)) .map(|i| { - let u = LOWERCASE_TABLE[i].1; + // SAFETY: i is the result of the binary search + let u = unsafe { LOWERCASE_TABLE.get_unchecked(i) }.1; char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| { // SAFETY: Index comes from statically generated table unsafe { *LOWERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) } @@ -784,7 +785,8 @@ pub mod conversions { UPPERCASE_TABLE .binary_search_by(|&(key, _)| key.cmp(&c)) .map(|i| { - let u = UPPERCASE_TABLE[i].1; + // SAFETY: i is the result of the binary search + let u = unsafe { UPPERCASE_TABLE.get_unchecked(i) }.1; char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| { // SAFETY: Index comes from statically generated table unsafe { *UPPERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) } diff --git a/library/coretests/tests/time.rs b/library/coretests/tests/time.rs index fb3c50f9bde9..ff80ff680943 100644 --- a/library/coretests/tests/time.rs +++ b/library/coretests/tests/time.rs @@ -439,7 +439,6 @@ fn debug_formatting_precision_two() { assert_eq!(format!("{:.2?}", Duration::new(4, 001_000_000)), "4.00s"); assert_eq!(format!("{:.2?}", Duration::new(2, 100_000_000)), "2.10s"); assert_eq!(format!("{:.2?}", Duration::new(2, 104_990_000)), "2.10s"); - assert_eq!(format!("{:.2?}", Duration::new(2, 105_000_000)), "2.11s"); assert_eq!(format!("{:.2?}", Duration::new(8, 999_999_999)), "9.00s"); } @@ -480,6 +479,15 @@ fn debug_formatting_precision_high() { assert_eq!(format!("{:.20?}", Duration::new(4, 001_000_000)), "4.00100000000000000000s"); } +#[test] +fn debug_formatting_round_to_even() { + assert_eq!(format!("{:.0?}", Duration::new(1, 500_000_000)), "2s"); + assert_eq!(format!("{:.0?}", Duration::new(2, 500_000_000)), "2s"); + assert_eq!(format!("{:.0?}", Duration::new(0, 1_500_000)), "2ms"); + assert_eq!(format!("{:.0?}", Duration::new(0, 2_500_000)), "2ms"); + assert_eq!(format!("{:.2?}", Duration::new(2, 105_000_000)), "2.10s"); +} + #[test] fn duration_const() { // test that the methods of `Duration` are usable in a const context diff --git a/library/proc_macro/src/bridge/symbol.rs b/library/proc_macro/src/bridge/symbol.rs index 0d6a725fddd9..e070ec07681d 100644 --- a/library/proc_macro/src/bridge/symbol.rs +++ b/library/proc_macro/src/bridge/symbol.rs @@ -77,10 +77,7 @@ impl Symbol { // Mimics the behavior of `Symbol::can_be_raw` from `rustc_span` fn can_be_raw(string: &str) -> bool { - match string { - "_" | "super" | "self" | "Self" | "crate" | "$crate" => false, - _ => true, - } + !matches!(string, "_" | "super" | "self" | "Self" | "crate" | "$crate") } } diff --git a/library/proc_macro/src/escape.rs b/library/proc_macro/src/escape.rs index 87a4d1d50fd4..1f11a6633ff1 100644 --- a/library/proc_macro/src/escape.rs +++ b/library/proc_macro/src/escape.rs @@ -17,8 +17,7 @@ pub(crate) fn escape_bytes(bytes: &[u8], opt: EscapeOptions) -> String { escape_single_byte(byte, opt, &mut repr); } } else { - let mut chunks = bytes.utf8_chunks(); - while let Some(chunk) = chunks.next() { + for chunk in bytes.utf8_chunks() { for ch in chunk.valid().chars() { escape_single_char(ch, opt, &mut repr); } diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index a0b6656c8ded..a005f743ddfa 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -3,7 +3,7 @@ //! This library, provided by the standard distribution, provides the types //! consumed in the interfaces of procedurally defined macro definitions such as //! function-like macros `#[proc_macro]`, macro attributes `#[proc_macro_attribute]` and -//! custom derive attributes`#[proc_macro_derive]`. +//! custom derive attributes `#[proc_macro_derive]`. //! //! See [the book] for more. //! @@ -210,7 +210,6 @@ impl FromStr for TokenStream { /// `TokenTree::Punct`, or `TokenTree::Literal`. #[stable(feature = "proc_macro_lib", since = "1.15.0")] impl fmt::Display for TokenStream { - #[allow(clippy::recursive_format_impl)] // clippy doesn't see the specialization fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match &self.0 { Some(ts) => write!(f, "{}", ts.to_string()), @@ -219,7 +218,7 @@ impl fmt::Display for TokenStream { } } -/// Prints token in a form convenient for debugging. +/// Prints tokens in a form convenient for debugging. #[stable(feature = "proc_macro_lib", since = "1.15.0")] impl fmt::Debug for TokenStream { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -571,7 +570,7 @@ impl Span { /// This path should not be embedded in the output of the macro; prefer `file()` instead. #[stable(feature = "proc_macro_span_file", since = "1.88.0")] pub fn local_file(&self) -> Option { - self.0.local_file().map(|s| PathBuf::from(s)) + self.0.local_file().map(PathBuf::from) } /// Creates a new span encompassing `self` and `other`. @@ -750,7 +749,6 @@ impl From for TokenTree { /// `TokenTree::Punct`, or `TokenTree::Literal`. #[stable(feature = "proc_macro_lib2", since = "1.29.0")] impl fmt::Display for TokenTree { - #[allow(clippy::recursive_format_impl)] // clippy doesn't see the specialization fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { TokenTree::Group(t) => write!(f, "{t}"), @@ -888,7 +886,6 @@ impl Group { /// with `Delimiter::None` delimiters. #[stable(feature = "proc_macro_lib2", since = "1.29.0")] impl fmt::Display for Group { - #[allow(clippy::recursive_format_impl)] // clippy doesn't see the specialization fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", TokenStream::from(TokenTree::from(self.clone()))) } @@ -1041,6 +1038,8 @@ impl Ident { /// The `string` argument must be a valid identifier permitted by the /// language (including keywords, e.g. `self` or `fn`). Otherwise, the function will panic. /// + /// The constructed identifier will be NFC-normalized. See the [Reference] for more info. + /// /// Note that `span`, currently in rustc, configures the hygiene information /// for this identifier. /// @@ -1055,6 +1054,8 @@ impl Ident { /// /// Due to the current importance of hygiene this constructor, unlike other /// tokens, requires a `Span` to be specified at construction. + /// + /// [Reference]: https://doc.rust-lang.org/nightly/reference/identifiers.html#r-ident.normalization #[stable(feature = "proc_macro_lib2", since = "1.29.0")] pub fn new(string: &str, span: Span) -> Ident { Ident(bridge::Ident { diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 83a0826ac425..43caf7734fdb 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -71,7 +71,7 @@ fortanix-sgx-abi = { version = "0.6.1", features = [ ], public = true } [target.'cfg(target_os = "motor")'.dependencies] -moto-rt = { version = "0.15", features = ['rustc-dep-of-std'], public = true } +moto-rt = { version = "0.16", features = ['rustc-dep-of-std'], public = true } [target.'cfg(target_os = "hermit")'.dependencies] hermit-abi = { version = "0.5.0", features = [ diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index f078dec21d0a..4edd35b310bd 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -152,6 +152,43 @@ pub enum TryLockError { WouldBlock, } +/// An object providing access to a directory on the filesystem. +/// +/// Directories are automatically closed when they go out of scope. Errors detected +/// on closing are ignored by the implementation of `Drop`. +/// +/// # Platform-specific behavior +/// +/// On supported systems (including Windows and some UNIX-based OSes), this function acquires a +/// handle/file descriptor for the directory. This allows functions like [`Dir::open_file`] to +/// avoid [TOCTOU] errors when the directory itself is being moved. +/// +/// On other systems, it stores an absolute path (see [`canonicalize()`]). In the latter case, no +/// [TOCTOU] guarantees are made. +/// +/// # Examples +/// +/// Opens a directory and then a file inside it. +/// +/// ```no_run +/// #![feature(dirfd)] +/// use std::{fs::Dir, io}; +/// +/// fn main() -> std::io::Result<()> { +/// let dir = Dir::open("foo")?; +/// let mut file = dir.open_file("bar.txt")?; +/// let contents = io::read_to_string(file)?; +/// assert_eq!(contents, "Hello, world!"); +/// Ok(()) +/// } +/// ``` +/// +/// [TOCTOU]: self#time-of-check-to-time-of-use-toctou +#[unstable(feature = "dirfd", issue = "120426")] +pub struct Dir { + inner: fs_imp::Dir, +} + /// Metadata information about a file. /// /// This structure is returned from the [`metadata`] or @@ -1554,6 +1591,87 @@ impl Seek for Arc { } } +impl Dir { + /// Attempts to open a directory at `path` in read-only mode. + /// + /// # Errors + /// + /// This function will return an error if `path` does not point to an existing directory. + /// Other errors may also be returned according to [`OpenOptions::open`]. + /// + /// # Examples + /// + /// ```no_run + /// #![feature(dirfd)] + /// use std::{fs::Dir, io}; + /// + /// fn main() -> std::io::Result<()> { + /// let dir = Dir::open("foo")?; + /// let mut f = dir.open_file("bar.txt")?; + /// let contents = io::read_to_string(f)?; + /// assert_eq!(contents, "Hello, world!"); + /// Ok(()) + /// } + /// ``` + #[unstable(feature = "dirfd", issue = "120426")] + pub fn open>(path: P) -> io::Result { + fs_imp::Dir::open(path.as_ref(), &OpenOptions::new().read(true).0) + .map(|inner| Self { inner }) + } + + /// Attempts to open a file in read-only mode relative to this directory. + /// + /// # Errors + /// + /// This function will return an error if `path` does not point to an existing file. + /// Other errors may also be returned according to [`OpenOptions::open`]. + /// + /// # Examples + /// + /// ```no_run + /// #![feature(dirfd)] + /// use std::{fs::Dir, io}; + /// + /// fn main() -> std::io::Result<()> { + /// let dir = Dir::open("foo")?; + /// let mut f = dir.open_file("bar.txt")?; + /// let contents = io::read_to_string(f)?; + /// assert_eq!(contents, "Hello, world!"); + /// Ok(()) + /// } + /// ``` + #[unstable(feature = "dirfd", issue = "120426")] + pub fn open_file>(&self, path: P) -> io::Result { + self.inner + .open_file(path.as_ref(), &OpenOptions::new().read(true).0) + .map(|f| File { inner: f }) + } +} + +impl AsInner for Dir { + #[inline] + fn as_inner(&self) -> &fs_imp::Dir { + &self.inner + } +} +impl FromInner for Dir { + fn from_inner(f: fs_imp::Dir) -> Dir { + Dir { inner: f } + } +} +impl IntoInner for Dir { + fn into_inner(self) -> fs_imp::Dir { + self.inner + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl fmt::Debug for Dir { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.inner.fmt(f) + } +} + impl OpenOptions { /// Creates a blank new set of options ready for configuration. /// diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 0a5d1153d860..6a86705f2fad 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -1,7 +1,11 @@ use rand::RngCore; +#[cfg(not(miri))] +use super::Dir; use crate::assert_matches::assert_matches; use crate::fs::{self, File, FileTimes, OpenOptions, TryLockError}; +#[cfg(not(miri))] +use crate::io; use crate::io::prelude::*; use crate::io::{BorrowedBuf, ErrorKind, SeekFrom}; use crate::mem::MaybeUninit; @@ -212,6 +216,7 @@ fn file_test_io_seek_and_write() { target_os = "cygwin", target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd", @@ -244,6 +249,7 @@ fn file_lock_multiple_shared() { target_os = "cygwin", target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd", @@ -277,6 +283,7 @@ fn file_lock_blocking() { target_os = "cygwin", target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd", @@ -307,6 +314,7 @@ fn file_lock_drop() { target_os = "cygwin", target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd", @@ -2461,3 +2469,30 @@ fn test_fs_set_times_nofollow() { assert_ne!(target_metadata.accessed().unwrap(), accessed); assert_ne!(target_metadata.modified().unwrap(), modified); } + +#[test] +// FIXME: libc calls fail on miri +#[cfg(not(miri))] +fn test_dir_smoke_test() { + let tmpdir = tmpdir(); + let dir = Dir::open(tmpdir.path()); + check!(dir); +} + +#[test] +// FIXME: libc calls fail on miri +#[cfg(not(miri))] +fn test_dir_read_file() { + let tmpdir = tmpdir(); + let mut f = check!(File::create(tmpdir.join("foo.txt"))); + check!(f.write(b"bar")); + check!(f.flush()); + drop(f); + let dir = check!(Dir::open(tmpdir.path())); + let f = check!(dir.open_file("foo.txt")); + let buf = check!(io::read_to_string(f)); + assert_eq!("bar", &buf); + let f = check!(dir.open_file(tmpdir.join("foo.txt"))); + let buf = check!(io::read_to_string(f)); + assert_eq!("bar", &buf); +} diff --git a/library/std/src/io/buffered/bufreader/buffer.rs b/library/std/src/io/buffered/bufreader/buffer.rs index 9b600cd55758..ad8608bf6190 100644 --- a/library/std/src/io/buffered/bufreader/buffer.rs +++ b/library/std/src/io/buffered/bufreader/buffer.rs @@ -48,7 +48,7 @@ impl Buffer { #[inline] pub fn buffer(&self) -> &[u8] { - // SAFETY: self.pos and self.cap are valid, and self.cap => self.pos, and + // SAFETY: self.pos and self.filled are valid, and self.filled >= self.pos, and // that region is initialized because those are all invariants of this type. unsafe { self.buf.get_unchecked(self.pos..self.filled).assume_init_ref() } } diff --git a/library/std/src/io/buffered/linewritershim.rs b/library/std/src/io/buffered/linewritershim.rs index 5ebeada59bb5..967e24812b9f 100644 --- a/library/std/src/io/buffered/linewritershim.rs +++ b/library/std/src/io/buffered/linewritershim.rs @@ -52,7 +52,7 @@ impl<'a, W: ?Sized + Write> LineWriterShim<'a, W> { } impl<'a, W: ?Sized + Write> Write for LineWriterShim<'a, W> { - /// Writes some data into this BufReader with line buffering. + /// Writes some data into this BufWriter with line buffering. /// /// This means that, if any newlines are present in the data, the data up to /// the last newline is sent directly to the underlying writer, and data @@ -146,7 +146,7 @@ impl<'a, W: ?Sized + Write> Write for LineWriterShim<'a, W> { self.buffer.flush() } - /// Writes some vectored data into this BufReader with line buffering. + /// Writes some vectored data into this BufWriter with line buffering. /// /// This means that, if any newlines are present in the data, the data up to /// and including the buffer containing the last newline is sent directly to @@ -256,7 +256,7 @@ impl<'a, W: ?Sized + Write> Write for LineWriterShim<'a, W> { self.inner().is_write_vectored() } - /// Writes some data into this BufReader with line buffering. + /// Writes some data into this BufWriter with line buffering. /// /// This means that, if any newlines are present in the data, the data up to /// the last newline is sent directly to the underlying writer, and data diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 0dab29712f4f..f5b9f69a5f9f 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -681,9 +681,7 @@ pub mod arch { #[stable(feature = "simd_x86", since = "1.27.0")] pub use std_detect::is_x86_feature_detected; -// Platform-abstraction modules mod sys; -mod sys_common; pub mod alloc; diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs index 846ad37aad22..2acac6f086e4 100644 --- a/library/std/src/os/fd/owned.rs +++ b/library/std/src/os/fd/owned.rs @@ -91,7 +91,7 @@ impl OwnedFd { /// Creates a new `OwnedFd` instance that shares the same underlying file /// description as the existing `OwnedFd` instance. #[stable(feature = "io_safety", since = "1.63.0")] - pub fn try_clone(&self) -> crate::io::Result { + pub fn try_clone(&self) -> io::Result { self.as_fd().try_clone_to_owned() } } @@ -106,7 +106,7 @@ impl BorrowedFd<'_> { target_os = "motor" )))] #[stable(feature = "io_safety", since = "1.63.0")] - pub fn try_clone_to_owned(&self) -> crate::io::Result { + pub fn try_clone_to_owned(&self) -> io::Result { // We want to atomically duplicate this file descriptor and set the // CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This // is a POSIX flag that was added to Linux in 2.6.24. @@ -129,15 +129,15 @@ impl BorrowedFd<'_> { /// description as the existing `BorrowedFd` instance. #[cfg(any(target_arch = "wasm32", target_os = "hermit", target_os = "trusty"))] #[stable(feature = "io_safety", since = "1.63.0")] - pub fn try_clone_to_owned(&self) -> crate::io::Result { - Err(crate::io::Error::UNSUPPORTED_PLATFORM) + pub fn try_clone_to_owned(&self) -> io::Result { + Err(io::Error::UNSUPPORTED_PLATFORM) } /// Creates a new `OwnedFd` instance that shares the same underlying file /// description as the existing `BorrowedFd` instance. #[cfg(target_os = "motor")] #[stable(feature = "io_safety", since = "1.63.0")] - pub fn try_clone_to_owned(&self) -> crate::io::Result { + pub fn try_clone_to_owned(&self) -> io::Result { let fd = moto_rt::fs::duplicate(self.as_raw_fd()).map_err(crate::sys::map_motor_error)?; Ok(unsafe { OwnedFd::from_raw_fd(fd) }) } @@ -233,7 +233,7 @@ macro_rules! impl_is_terminal { impl crate::sealed::Sealed for $t {} #[stable(feature = "is_terminal", since = "1.70.0")] - impl crate::io::IsTerminal for $t { + impl io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { crate::sys::io::is_terminal(self) diff --git a/library/std/src/os/linux/process.rs b/library/std/src/os/linux/process.rs index fef321436f6a..60851db831bf 100644 --- a/library/std/src/os/linux/process.rs +++ b/library/std/src/os/linux/process.rs @@ -67,8 +67,10 @@ impl PidFd { /// Waits for the child to exit completely, returning the status that it exited with. /// /// Unlike [`Child::wait`] it does not ensure that the stdin handle is closed. - /// Additionally it will not return an `ExitStatus` if the child - /// has already been reaped. Instead an error will be returned. + /// + /// Additionally on kernels prior to 6.15 only the first attempt to + /// reap a child will return an ExitStatus, further attempts + /// will return an Error. /// /// [`Child::wait`]: process::Child::wait pub fn wait(&self) -> Result { @@ -77,8 +79,8 @@ impl PidFd { /// Attempts to collect the exit status of the child if it has already exited. /// - /// Unlike [`Child::try_wait`] this method will return an Error - /// if the child has already been reaped. + /// On kernels prior to 6.15, and unlike [`Child::try_wait`], only the first attempt + /// to reap a child will return an ExitStatus, further attempts will return an Error. /// /// [`Child::try_wait`]: process::Child::try_wait pub fn try_wait(&self) -> Result> { diff --git a/library/std/src/os/motor/mod.rs b/library/std/src/os/motor/mod.rs index 18da079c74a1..e8812f48a120 100644 --- a/library/std/src/os/motor/mod.rs +++ b/library/std/src/os/motor/mod.rs @@ -2,3 +2,7 @@ pub mod ffi; pub mod process; + +pub fn rt_version() -> u64 { + moto_rt::RT_VERSION +} diff --git a/library/std/src/os/solid/io.rs b/library/std/src/os/solid/io.rs index a1c8a86c9861..ac112e739170 100644 --- a/library/std/src/os/solid/io.rs +++ b/library/std/src/os/solid/io.rs @@ -49,7 +49,7 @@ use crate::marker::PhantomData; use crate::mem::ManuallyDrop; use crate::sys::{AsInner, FromInner, IntoInner}; -use crate::{fmt, net, sys}; +use crate::{fmt, io, net, sys}; /// Raw file descriptors. pub type RawFd = i32; @@ -110,7 +110,7 @@ impl BorrowedFd<'_> { impl OwnedFd { /// Creates a new `OwnedFd` instance that shares the same underlying file /// description as the existing `OwnedFd` instance. - pub fn try_clone(&self) -> crate::io::Result { + pub fn try_clone(&self) -> io::Result { self.as_fd().try_clone_to_owned() } } @@ -118,7 +118,7 @@ impl OwnedFd { impl BorrowedFd<'_> { /// Creates a new `OwnedFd` instance that shares the same underlying file /// description as the existing `BorrowedFd` instance. - pub fn try_clone_to_owned(&self) -> crate::io::Result { + pub fn try_clone_to_owned(&self) -> io::Result { let fd = sys::net::cvt(unsafe { crate::sys::abi::sockets::dup(self.as_raw_fd()) })?; Ok(unsafe { OwnedFd::from_raw_fd(fd) }) } @@ -184,7 +184,7 @@ macro_rules! impl_is_terminal { impl crate::sealed::Sealed for $t {} #[stable(feature = "is_terminal", since = "1.70.0")] - impl crate::io::IsTerminal for $t { + impl io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { crate::sys::io::is_terminal(self) diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs index 25b95014e08b..0748f6984a82 100644 --- a/library/std/src/os/unix/net/addr.rs +++ b/library/std/src/os/unix/net/addr.rs @@ -264,7 +264,7 @@ impl linux_ext::addr::SocketAddrExt for SocketAddr { if let AddressKind::Abstract(name) = self.address() { Some(name.as_bytes()) } else { None } } - fn from_abstract_name(name: N) -> crate::io::Result + fn from_abstract_name(name: N) -> io::Result where N: AsRef<[u8]>, { diff --git a/library/std/src/os/unix/net/stream.rs b/library/std/src/os/unix/net/stream.rs index 1fed1229d5ae..c0a8045884a5 100644 --- a/library/std/src/os/unix/net/stream.rs +++ b/library/std/src/os/unix/net/stream.rs @@ -58,6 +58,13 @@ use crate::time::Duration; /// } /// ``` /// +/// # `SOCK_CLOEXEC` +/// +/// On platforms that support it, we pass the close-on-exec flag to atomically create the socket and +/// set it as CLOEXEC. On Linux, this was added in 2.6.27. See [`socket(2)`] for more information. +/// +/// [`socket(2)`]: https://www.man7.org/linux/man-pages/man2/socket.2.html#:~:text=SOCK_CLOEXEC +/// /// # `SIGPIPE` /// /// Writes to the underlying socket in `SOCK_STREAM` mode are made with `MSG_NOSIGNAL` flag. diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs index afc58ca59cfa..13c0752b560b 100644 --- a/library/std/src/os/windows/io/handle.rs +++ b/library/std/src/os/windows/io/handle.rs @@ -184,7 +184,7 @@ impl OwnedHandle { /// Creates a new `OwnedHandle` instance that shares the same underlying /// object as the existing `OwnedHandle` instance. #[stable(feature = "io_safety", since = "1.63.0")] - pub fn try_clone(&self) -> crate::io::Result { + pub fn try_clone(&self) -> io::Result { self.as_handle().try_clone_to_owned() } } @@ -193,7 +193,7 @@ impl BorrowedHandle<'_> { /// Creates a new `OwnedHandle` instance that shares the same underlying /// object as the existing `BorrowedHandle` instance. #[stable(feature = "io_safety", since = "1.63.0")] - pub fn try_clone_to_owned(&self) -> crate::io::Result { + pub fn try_clone_to_owned(&self) -> io::Result { self.duplicate(0, false, sys::c::DUPLICATE_SAME_ACCESS) } @@ -409,7 +409,7 @@ macro_rules! impl_is_terminal { impl crate::sealed::Sealed for $t {} #[stable(feature = "is_terminal", since = "1.70.0")] - impl crate::io::IsTerminal for $t { + impl io::IsTerminal for $t { #[inline] fn is_terminal(&self) -> bool { crate::sys::io::is_terminal(self) @@ -546,7 +546,7 @@ impl From for fs::File { } #[stable(feature = "io_safety", since = "1.63.0")] -impl AsHandle for crate::io::Stdin { +impl AsHandle for io::Stdin { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } @@ -554,7 +554,7 @@ impl AsHandle for crate::io::Stdin { } #[stable(feature = "io_safety", since = "1.63.0")] -impl<'a> AsHandle for crate::io::StdinLock<'a> { +impl<'a> AsHandle for io::StdinLock<'a> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } @@ -562,7 +562,7 @@ impl<'a> AsHandle for crate::io::StdinLock<'a> { } #[stable(feature = "io_safety", since = "1.63.0")] -impl AsHandle for crate::io::Stdout { +impl AsHandle for io::Stdout { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } @@ -570,7 +570,7 @@ impl AsHandle for crate::io::Stdout { } #[stable(feature = "io_safety", since = "1.63.0")] -impl<'a> AsHandle for crate::io::StdoutLock<'a> { +impl<'a> AsHandle for io::StdoutLock<'a> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } @@ -578,7 +578,7 @@ impl<'a> AsHandle for crate::io::StdoutLock<'a> { } #[stable(feature = "io_safety", since = "1.63.0")] -impl AsHandle for crate::io::Stderr { +impl AsHandle for io::Stderr { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } @@ -586,7 +586,7 @@ impl AsHandle for crate::io::Stderr { } #[stable(feature = "io_safety", since = "1.63.0")] -impl<'a> AsHandle for crate::io::StderrLock<'a> { +impl<'a> AsHandle for io::StderrLock<'a> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index 19b3040dcb27..5da50480c723 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -184,6 +184,8 @@ pub use alloc_crate::sync::{Arc, Weak}; #[unstable(feature = "mpmc_channel", issue = "126840")] pub mod mpmc; pub mod mpsc; +#[unstable(feature = "oneshot_channel", issue = "143674")] +pub mod oneshot; pub(crate) mod once; // `pub(crate)` for the `sys::sync::once` implementations and `LazyLock`. diff --git a/library/std/src/sync/mpmc/mod.rs b/library/std/src/sync/mpmc/mod.rs index ee9795a52812..8df81a580f7b 100644 --- a/library/std/src/sync/mpmc/mod.rs +++ b/library/std/src/sync/mpmc/mod.rs @@ -654,7 +654,7 @@ impl Clone for Sender { #[unstable(feature = "mpmc_channel", issue = "126840")] impl fmt::Debug for Sender { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.pad("Sender { .. }") + f.debug_struct("Sender").finish_non_exhaustive() } } @@ -1380,7 +1380,7 @@ impl Clone for Receiver { #[unstable(feature = "mpmc_channel", issue = "126840")] impl fmt::Debug for Receiver { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.pad("Receiver { .. }") + f.debug_struct("Receiver").finish_non_exhaustive() } } diff --git a/library/std/src/sync/mpsc.rs b/library/std/src/sync/mpsc.rs index f91c26aa22cf..0ae23f6e13bf 100644 --- a/library/std/src/sync/mpsc.rs +++ b/library/std/src/sync/mpsc.rs @@ -1114,8 +1114,10 @@ impl error::Error for SendError {} impl fmt::Debug for TrySendError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { - TrySendError::Full(..) => "Full(..)".fmt(f), - TrySendError::Disconnected(..) => "Disconnected(..)".fmt(f), + TrySendError::Full(..) => f.debug_tuple("TrySendError::Full").finish_non_exhaustive(), + TrySendError::Disconnected(..) => { + f.debug_tuple("TrySendError::Disconnected").finish_non_exhaustive() + } } } } diff --git a/library/std/src/sync/nonpoison/mutex.rs b/library/std/src/sync/nonpoison/mutex.rs index ed3f8cfed821..307bf8eaf512 100644 --- a/library/std/src/sync/nonpoison/mutex.rs +++ b/library/std/src/sync/nonpoison/mutex.rs @@ -422,7 +422,7 @@ impl From for Mutex { } #[unstable(feature = "nonpoison_mutex", issue = "134645")] -impl Default for Mutex { +impl Default for Mutex { /// Creates a `Mutex`, with the `Default` value for T. fn default() -> Mutex { Mutex::new(Default::default()) diff --git a/library/std/src/sync/once_lock.rs b/library/std/src/sync/once_lock.rs index b9a7077e420e..f6ea3c1a039b 100644 --- a/library/std/src/sync/once_lock.rs +++ b/library/std/src/sync/once_lock.rs @@ -1,3 +1,4 @@ +use super::once::OnceExclusiveState; use crate::cell::UnsafeCell; use crate::fmt; use crate::marker::PhantomData; @@ -152,8 +153,8 @@ impl OnceLock { #[stable(feature = "once_cell", since = "1.70.0")] #[rustc_should_not_be_called_on_const_items] pub fn get(&self) -> Option<&T> { - if self.is_initialized() { - // Safe b/c checked is_initialized + if self.initialized() { + // Safe b/c checked initialized Some(unsafe { self.get_unchecked() }) } else { None @@ -170,8 +171,8 @@ impl OnceLock { #[inline] #[stable(feature = "once_cell", since = "1.70.0")] pub fn get_mut(&mut self) -> Option<&mut T> { - if self.is_initialized() { - // Safe b/c checked is_initialized and we have a unique access + if self.initialized_mut() { + // Safe b/c checked initialized and we have a unique access Some(unsafe { self.get_unchecked_mut() }) } else { None @@ -402,14 +403,12 @@ impl OnceLock { // NOTE: We need to perform an acquire on the state in this method // in order to correctly synchronize `LazyLock::force`. This is // currently done by calling `self.get()`, which in turn calls - // `self.is_initialized()`, which in turn performs the acquire. + // `self.initialized()`, which in turn performs the acquire. if let Some(value) = self.get() { return Ok(value); } self.initialize(f)?; - debug_assert!(self.is_initialized()); - // SAFETY: The inner value has been initialized Ok(unsafe { self.get_unchecked() }) } @@ -451,10 +450,10 @@ impl OnceLock { where F: FnOnce() -> Result, { - if self.get().is_none() { + if self.get_mut().is_none() { self.initialize(f)?; } - debug_assert!(self.is_initialized()); + // SAFETY: The inner value has been initialized Ok(unsafe { self.get_unchecked_mut() }) } @@ -503,22 +502,32 @@ impl OnceLock { #[inline] #[stable(feature = "once_cell", since = "1.70.0")] pub fn take(&mut self) -> Option { - if self.is_initialized() { + if self.initialized_mut() { self.once = Once::new(); // SAFETY: `self.value` is initialized and contains a valid `T`. - // `self.once` is reset, so `is_initialized()` will be false again + // `self.once` is reset, so `initialized()` will be false again // which prevents the value from being read twice. - unsafe { Some((&mut *self.value.get()).assume_init_read()) } + unsafe { Some(self.value.get_mut().assume_init_read()) } } else { None } } #[inline] - fn is_initialized(&self) -> bool { + fn initialized(&self) -> bool { self.once.is_completed() } + #[inline] + fn initialized_mut(&mut self) -> bool { + // `state()` does not perform an atomic load, so prefer it over `is_complete()`. + let state = self.once.state(); + match state { + OnceExclusiveState::Complete => true, + _ => false, + } + } + #[cold] #[optimize(size)] fn initialize(&self, f: F) -> Result<(), E> @@ -552,7 +561,7 @@ impl OnceLock { /// The cell must be initialized #[inline] unsafe fn get_unchecked(&self) -> &T { - debug_assert!(self.is_initialized()); + debug_assert!(self.initialized()); unsafe { (&*self.value.get()).assume_init_ref() } } @@ -561,8 +570,8 @@ impl OnceLock { /// The cell must be initialized #[inline] unsafe fn get_unchecked_mut(&mut self) -> &mut T { - debug_assert!(self.is_initialized()); - unsafe { (&mut *self.value.get()).assume_init_mut() } + debug_assert!(self.initialized_mut()); + unsafe { self.value.get_mut().assume_init_mut() } } } @@ -690,11 +699,11 @@ impl Eq for OnceLock {} unsafe impl<#[may_dangle] T> Drop for OnceLock { #[inline] fn drop(&mut self) { - if self.is_initialized() { + if self.initialized_mut() { // SAFETY: The cell is initialized and being dropped, so it can't // be accessed again. We also don't touch the `T` other than // dropping it, which validates our usage of #[may_dangle]. - unsafe { (&mut *self.value.get()).assume_init_drop() }; + unsafe { self.value.get_mut().assume_init_drop() }; } } } diff --git a/library/std/src/sync/oneshot.rs b/library/std/src/sync/oneshot.rs new file mode 100644 index 000000000000..b2c9ba34c0ff --- /dev/null +++ b/library/std/src/sync/oneshot.rs @@ -0,0 +1,466 @@ +//! A single-producer, single-consumer (oneshot) channel. +//! +//! This is an experimental module, so the API will likely change. + +use crate::sync::mpmc; +use crate::sync::mpsc::{RecvError, SendError}; +use crate::time::{Duration, Instant}; +use crate::{error, fmt}; + +/// Creates a new oneshot channel, returning the sender/receiver halves. +/// +/// # Examples +/// +/// ``` +/// #![feature(oneshot_channel)] +/// use std::sync::oneshot; +/// use std::thread; +/// +/// let (sender, receiver) = oneshot::channel(); +/// +/// // Spawn off an expensive computation. +/// thread::spawn(move || { +/// # fn expensive_computation() -> i32 { 42 } +/// sender.send(expensive_computation()).unwrap(); +/// // `sender` is consumed by `send`, so we cannot use it anymore. +/// }); +/// +/// # fn do_other_work() -> i32 { 42 } +/// do_other_work(); +/// +/// // Let's see what that answer was... +/// println!("{:?}", receiver.recv().unwrap()); +/// // `receiver` is consumed by `recv`, so we cannot use it anymore. +/// ``` +#[must_use] +#[unstable(feature = "oneshot_channel", issue = "143674")] +pub fn channel() -> (Sender, Receiver) { + // Using a `sync_channel` with capacity 1 means that the internal implementation will use the + // `Array`-flavored channel implementation. + let (sender, receiver) = mpmc::sync_channel(1); + (Sender { inner: sender }, Receiver { inner: receiver }) +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Sender +//////////////////////////////////////////////////////////////////////////////////////////////////// + +/// The sending half of a oneshot channel. +/// +/// # Examples +/// +/// ``` +/// #![feature(oneshot_channel)] +/// use std::sync::oneshot; +/// use std::thread; +/// +/// let (sender, receiver) = oneshot::channel(); +/// +/// thread::spawn(move || { +/// sender.send("Hello from thread!").unwrap(); +/// }); +/// +/// assert_eq!(receiver.recv().unwrap(), "Hello from thread!"); +/// ``` +/// +/// `Sender` cannot be sent between threads if it is sending non-`Send` types. +/// +/// ```compile_fail +/// #![feature(oneshot_channel)] +/// use std::sync::oneshot; +/// use std::thread; +/// use std::ptr; +/// +/// let (sender, receiver) = oneshot::channel(); +/// +/// struct NotSend(*mut ()); +/// thread::spawn(move || { +/// sender.send(NotSend(ptr::null_mut())); +/// }); +/// +/// let reply = receiver.try_recv().unwrap(); +/// ``` +#[unstable(feature = "oneshot_channel", issue = "143674")] +pub struct Sender { + /// The `oneshot` channel is simply a wrapper around a `mpmc` channel. + inner: mpmc::Sender, +} + +// SAFETY: Since the only methods in which synchronization must occur take full ownership of the +// [`Sender`], it is perfectly safe to share a `&Sender` between threads (as it is effectively +// useless without ownership). +#[unstable(feature = "oneshot_channel", issue = "143674")] +unsafe impl Sync for Sender {} + +impl Sender { + /// Attempts to send a value through this channel. This can only fail if the corresponding + /// [`Receiver`] has been dropped. + /// + /// This method is non-blocking (wait-free). + /// + /// # Examples + /// + /// ``` + /// #![feature(oneshot_channel)] + /// use std::sync::oneshot; + /// use std::thread; + /// + /// let (tx, rx) = oneshot::channel(); + /// + /// thread::spawn(move || { + /// // Perform some computation. + /// let result = 2 + 2; + /// tx.send(result).unwrap(); + /// }); + /// + /// assert_eq!(rx.recv().unwrap(), 4); + /// ``` + #[unstable(feature = "oneshot_channel", issue = "143674")] + pub fn send(self, t: T) -> Result<(), SendError> { + self.inner.send(t) + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl fmt::Debug for Sender { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Sender").finish_non_exhaustive() + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Receiver +//////////////////////////////////////////////////////////////////////////////////////////////////// + +/// The receiving half of a oneshot channel. +/// +/// # Examples +/// +/// ``` +/// #![feature(oneshot_channel)] +/// use std::sync::oneshot; +/// use std::thread; +/// use std::time::Duration; +/// +/// let (sender, receiver) = oneshot::channel(); +/// +/// thread::spawn(move || { +/// thread::sleep(Duration::from_millis(100)); +/// sender.send("Hello after delay!").unwrap(); +/// }); +/// +/// println!("Waiting for message..."); +/// println!("{}", receiver.recv().unwrap()); +/// ``` +/// +/// `Receiver` cannot be sent between threads if it is receiving non-`Send` types. +/// +/// ```compile_fail +/// # #![feature(oneshot_channel)] +/// # use std::sync::oneshot; +/// # use std::thread; +/// # use std::ptr; +/// # +/// let (sender, receiver) = oneshot::channel(); +/// +/// struct NotSend(*mut ()); +/// sender.send(NotSend(ptr::null_mut())); +/// +/// thread::spawn(move || { +/// let reply = receiver.try_recv().unwrap(); +/// }); +/// ``` +#[unstable(feature = "oneshot_channel", issue = "143674")] +pub struct Receiver { + /// The `oneshot` channel is simply a wrapper around a `mpmc` channel. + inner: mpmc::Receiver, +} + +// SAFETY: Since the only methods in which synchronization must occur take full ownership of the +// [`Receiver`], it is perfectly safe to share a `&Receiver` between threads (as it is unable to +// receive any values without ownership). +#[unstable(feature = "oneshot_channel", issue = "143674")] +unsafe impl Sync for Receiver {} + +impl Receiver { + /// Receives the value from the sending end, blocking the calling thread until it gets it. + /// + /// Can only fail if the corresponding [`Sender`] has been dropped. + /// + /// # Examples + /// + /// ``` + /// #![feature(oneshot_channel)] + /// use std::sync::oneshot; + /// use std::thread; + /// use std::time::Duration; + /// + /// let (tx, rx) = oneshot::channel(); + /// + /// thread::spawn(move || { + /// thread::sleep(Duration::from_millis(500)); + /// tx.send("Done!").unwrap(); + /// }); + /// + /// // This will block until the message arrives. + /// println!("{}", rx.recv().unwrap()); + /// ``` + #[unstable(feature = "oneshot_channel", issue = "143674")] + pub fn recv(self) -> Result { + self.inner.recv() + } + + // Fallible methods. + + /// Attempts to return a pending value on this receiver without blocking. + /// + /// # Examples + /// + /// ``` + /// #![feature(oneshot_channel)] + /// use std::sync::oneshot; + /// use std::thread; + /// use std::time::Duration; + /// + /// let (sender, mut receiver) = oneshot::channel(); + /// + /// thread::spawn(move || { + /// thread::sleep(Duration::from_millis(100)); + /// sender.send(42).unwrap(); + /// }); + /// + /// // Keep trying until we get the message, doing other work in the process. + /// loop { + /// match receiver.try_recv() { + /// Ok(value) => { + /// assert_eq!(value, 42); + /// break; + /// } + /// Err(oneshot::TryRecvError::Empty(rx)) => { + /// // Retake ownership of the receiver. + /// receiver = rx; + /// # fn do_other_work() { thread::sleep(Duration::from_millis(25)); } + /// do_other_work(); + /// } + /// Err(oneshot::TryRecvError::Disconnected) => panic!("Sender disconnected"), + /// } + /// } + /// ``` + #[unstable(feature = "oneshot_channel", issue = "143674")] + pub fn try_recv(self) -> Result> { + self.inner.try_recv().map_err(|err| match err { + mpmc::TryRecvError::Empty => TryRecvError::Empty(self), + mpmc::TryRecvError::Disconnected => TryRecvError::Disconnected, + }) + } + + /// Attempts to wait for a value on this receiver, returning an error if the corresponding + /// [`Sender`] half of this channel has been dropped, or if it waits more than `timeout`. + /// + /// # Examples + /// + /// ``` + /// #![feature(oneshot_channel)] + /// use std::sync::oneshot; + /// use std::thread; + /// use std::time::Duration; + /// + /// let (sender, receiver) = oneshot::channel(); + /// + /// thread::spawn(move || { + /// thread::sleep(Duration::from_millis(500)); + /// sender.send("Success!").unwrap(); + /// }); + /// + /// // Wait up to 1 second for the message + /// match receiver.recv_timeout(Duration::from_secs(1)) { + /// Ok(msg) => println!("Received: {}", msg), + /// Err(oneshot::RecvTimeoutError::Timeout(_)) => println!("Timed out!"), + /// Err(oneshot::RecvTimeoutError::Disconnected) => println!("Sender dropped!"), + /// } + /// ``` + #[unstable(feature = "oneshot_channel", issue = "143674")] + pub fn recv_timeout(self, timeout: Duration) -> Result> { + self.inner.recv_timeout(timeout).map_err(|err| match err { + mpmc::RecvTimeoutError::Timeout => RecvTimeoutError::Timeout(self), + mpmc::RecvTimeoutError::Disconnected => RecvTimeoutError::Disconnected, + }) + } + + /// Attempts to wait for a value on this receiver, returning an error if the corresponding + /// [`Sender`] half of this channel has been dropped, or if `deadline` is reached. + /// + /// # Examples + /// + /// ``` + /// #![feature(oneshot_channel)] + /// use std::sync::oneshot; + /// use std::thread; + /// use std::time::{Duration, Instant}; + /// + /// let (sender, receiver) = oneshot::channel(); + /// + /// thread::spawn(move || { + /// thread::sleep(Duration::from_millis(100)); + /// sender.send("Just in time!").unwrap(); + /// }); + /// + /// let deadline = Instant::now() + Duration::from_millis(500); + /// match receiver.recv_deadline(deadline) { + /// Ok(msg) => println!("Received: {}", msg), + /// Err(oneshot::RecvTimeoutError::Timeout(_)) => println!("Missed deadline!"), + /// Err(oneshot::RecvTimeoutError::Disconnected) => println!("Sender dropped!"), + /// } + /// ``` + #[unstable(feature = "oneshot_channel", issue = "143674")] + pub fn recv_deadline(self, deadline: Instant) -> Result> { + self.inner.recv_deadline(deadline).map_err(|err| match err { + mpmc::RecvTimeoutError::Timeout => RecvTimeoutError::Timeout(self), + mpmc::RecvTimeoutError::Disconnected => RecvTimeoutError::Disconnected, + }) + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl fmt::Debug for Receiver { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Receiver").finish_non_exhaustive() + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Receiver Errors +//////////////////////////////////////////////////////////////////////////////////////////////////// + +/// An error returned from the [`try_recv`](Receiver::try_recv) method. +/// +/// See the documentation for [`try_recv`] for more information on how to use this error. +/// +/// [`try_recv`]: Receiver::try_recv +#[unstable(feature = "oneshot_channel", issue = "143674")] +pub enum TryRecvError { + /// The [`Sender`] has not sent a message yet, but it might in the future (as it has not yet + /// disconnected). This variant contains the [`Receiver`] that [`try_recv`](Receiver::try_recv) + /// took ownership over. + Empty(Receiver), + /// The corresponding [`Sender`] half of this channel has become disconnected, and there will + /// never be any more data sent over the channel. + Disconnected, +} + +/// An error returned from the [`recv_timeout`](Receiver::recv_timeout) or +/// [`recv_deadline`](Receiver::recv_deadline) methods. +/// +/// # Examples +/// +/// Usage of this error is similar to [`TryRecvError`]. +/// +/// ``` +/// #![feature(oneshot_channel)] +/// use std::sync::oneshot::{self, RecvTimeoutError}; +/// use std::thread; +/// use std::time::Duration; +/// +/// let (sender, receiver) = oneshot::channel(); +/// +/// let send_failure = thread::spawn(move || { +/// // Simulate a long computation that takes longer than our timeout. +/// thread::sleep(Duration::from_millis(250)); +/// +/// // This will likely fail to send because we drop the receiver in the main thread. +/// sender.send("Goodbye!".to_string()).unwrap(); +/// }); +/// +/// // Try to receive the message with a short timeout. +/// match receiver.recv_timeout(Duration::from_millis(10)) { +/// Ok(msg) => println!("Received: {}", msg), +/// Err(RecvTimeoutError::Timeout(rx)) => { +/// println!("Timed out waiting for message!"); +/// +/// // Note that you can reuse the receiver without dropping it. +/// drop(rx); +/// }, +/// Err(RecvTimeoutError::Disconnected) => println!("Sender dropped!"), +/// } +/// +/// send_failure.join().unwrap_err(); +/// ``` +#[unstable(feature = "oneshot_channel", issue = "143674")] +pub enum RecvTimeoutError { + /// The [`Sender`] has not sent a message yet, but it might in the future (as it has not yet + /// disconnected). This variant contains the [`Receiver`] that either + /// [`recv_timeout`](Receiver::recv_timeout) or [`recv_deadline`](Receiver::recv_deadline) took + /// ownership over. + Timeout(Receiver), + /// The corresponding [`Sender`] half of this channel has become disconnected, and there will + /// never be any more data sent over the channel. + Disconnected, +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl fmt::Debug for TryRecvError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("TryRecvError").finish_non_exhaustive() + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl fmt::Display for TryRecvError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match *self { + TryRecvError::Empty(..) => "receiving on an empty oneshot channel".fmt(f), + TryRecvError::Disconnected => "receiving on a closed oneshot channel".fmt(f), + } + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl error::Error for TryRecvError {} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl From for TryRecvError { + /// Converts a `RecvError` into a `TryRecvError`. + /// + /// This conversion always returns `TryRecvError::Disconnected`. + /// + /// No data is allocated on the heap. + fn from(err: RecvError) -> TryRecvError { + match err { + RecvError => TryRecvError::Disconnected, + } + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl fmt::Debug for RecvTimeoutError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("RecvTimeoutError").finish_non_exhaustive() + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl fmt::Display for RecvTimeoutError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match *self { + RecvTimeoutError::Timeout(..) => "timed out waiting on oneshot channel".fmt(f), + RecvTimeoutError::Disconnected => "receiving on a closed oneshot channel".fmt(f), + } + } +} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl error::Error for RecvTimeoutError {} + +#[unstable(feature = "oneshot_channel", issue = "143674")] +impl From for RecvTimeoutError { + /// Converts a `RecvError` into a `RecvTimeoutError`. + /// + /// This conversion always returns `RecvTimeoutError::Disconnected`. + /// + /// No data is allocated on the heap. + fn from(err: RecvError) -> RecvTimeoutError { + match err { + RecvError => RecvTimeoutError::Disconnected, + } + } +} diff --git a/library/std/src/sync/poison/mutex.rs b/library/std/src/sync/poison/mutex.rs index 7f9e5fe62516..6eccd8a875ed 100644 --- a/library/std/src/sync/poison/mutex.rs +++ b/library/std/src/sync/poison/mutex.rs @@ -688,7 +688,7 @@ impl From for Mutex { } #[stable(feature = "mutex_default", since = "1.10.0")] -impl Default for Mutex { +impl Default for Mutex { /// Creates a `Mutex`, with the `Default` value for T. fn default() -> Mutex { Mutex::new(Default::default()) diff --git a/library/std/src/sys/args/windows.rs b/library/std/src/sys/args/windows.rs index b4de759e1a4c..c1988657ff1b 100644 --- a/library/std/src/sys/args/windows.rs +++ b/library/std/src/sys/args/windows.rs @@ -11,11 +11,11 @@ use crate::ffi::{OsStr, OsString}; use crate::num::NonZero; use crate::os::windows::prelude::*; use crate::path::{Path, PathBuf}; +use crate::sys::helpers::WStrUnits; use crate::sys::pal::os::current_exe; use crate::sys::pal::{ensure_no_nuls, fill_utf16_buf}; use crate::sys::path::get_long_path; use crate::sys::{AsInner, c, to_u16s}; -use crate::sys_common::wstr::WStrUnits; use crate::{io, iter, ptr}; pub fn args() -> Args { diff --git a/library/std/src/sys/configure_builtins.rs b/library/std/src/sys/configure_builtins.rs index f569ec0f5129..7cdf04ebb889 100644 --- a/library/std/src/sys/configure_builtins.rs +++ b/library/std/src/sys/configure_builtins.rs @@ -1,3 +1,7 @@ +//! The configure builtins provides runtime support compiler-builtin features +//! which require dynamic initialization to work as expected, e.g. aarch64 +//! outline-atomics. + /// Enable LSE atomic operations at startup, if supported. /// /// Linker sections are based on what [`ctor`] does, with priorities to run slightly before user diff --git a/library/std/src/sys/env/solid.rs b/library/std/src/sys/env/solid.rs index ea77fc3c1193..0ce5a22b4256 100644 --- a/library/std/src/sys/env/solid.rs +++ b/library/std/src/sys/env/solid.rs @@ -6,7 +6,7 @@ use crate::io; use crate::os::raw::{c_char, c_int}; use crate::os::solid::ffi::{OsStrExt, OsStringExt}; use crate::sync::{PoisonError, RwLock}; -use crate::sys::common::small_c_string::run_with_cstr; +use crate::sys::helpers::run_with_cstr; static ENV_LOCK: RwLock<()> = RwLock::new(()); diff --git a/library/std/src/sys/env/uefi.rs b/library/std/src/sys/env/uefi.rs index 1561df41cac3..5fe29a47a2ea 100644 --- a/library/std/src/sys/env/uefi.rs +++ b/library/std/src/sys/env/uefi.rs @@ -24,7 +24,7 @@ mod uefi_env { use crate::io; use crate::os::uefi::ffi::OsStringExt; use crate::ptr::NonNull; - use crate::sys::{helpers, unsupported_err}; + use crate::sys::pal::{helpers, unsupported_err}; pub(crate) fn get(key: &OsStr) -> Option { let shell = helpers::open_shell()?; diff --git a/library/std/src/sys/env/unix.rs b/library/std/src/sys/env/unix.rs index 78c7af65f9e3..66805ce3fa71 100644 --- a/library/std/src/sys/env/unix.rs +++ b/library/std/src/sys/env/unix.rs @@ -7,8 +7,8 @@ use crate::ffi::{CStr, OsStr, OsString}; use crate::io; use crate::os::unix::prelude::*; use crate::sync::{PoisonError, RwLock}; -use crate::sys::common::small_c_string::run_with_cstr; use crate::sys::cvt; +use crate::sys::helpers::run_with_cstr; // Use `_NSGetEnviron` on Apple platforms. // diff --git a/library/std/src/sys/env/wasi.rs b/library/std/src/sys/env/wasi.rs index 1327cbc3263b..c970aac18260 100644 --- a/library/std/src/sys/env/wasi.rs +++ b/library/std/src/sys/env/wasi.rs @@ -4,7 +4,7 @@ pub use super::common::Env; use crate::ffi::{CStr, OsStr, OsString}; use crate::io; use crate::os::wasi::prelude::*; -use crate::sys::common::small_c_string::run_with_cstr; +use crate::sys::helpers::run_with_cstr; use crate::sys::pal::os::{cvt, libc}; cfg_select! { diff --git a/library/std/src/sys/fs/common.rs b/library/std/src/sys/fs/common.rs index bfd684d295b8..4d47d392a826 100644 --- a/library/std/src/sys/fs/common.rs +++ b/library/std/src/sys/fs/common.rs @@ -1,9 +1,10 @@ #![allow(dead_code)] // not used on all platforms -use crate::fs; use crate::io::{self, Error, ErrorKind}; -use crate::path::Path; -use crate::sys_common::ignore_notfound; +use crate::path::{Path, PathBuf}; +use crate::sys::fs::{File, OpenOptions}; +use crate::sys::helpers::ignore_notfound; +use crate::{fmt, fs}; pub(crate) const NOT_FILE_ERROR: Error = io::const_error!( ErrorKind::InvalidInput, @@ -58,3 +59,23 @@ pub fn exists(path: &Path) -> io::Result { Err(error) => Err(error), } } + +pub struct Dir { + path: PathBuf, +} + +impl Dir { + pub fn open(path: &Path, _opts: &OpenOptions) -> io::Result { + path.canonicalize().map(|path| Self { path }) + } + + pub fn open_file(&self, path: &Path, opts: &OpenOptions) -> io::Result { + File::open(&self.path.join(path), &opts) + } +} + +impl fmt::Debug for Dir { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Dir").field("path", &self.path).finish() + } +} diff --git a/library/std/src/sys/fs/hermit.rs b/library/std/src/sys/fs/hermit.rs index 0914e4b6c907..1e281eb0d9d1 100644 --- a/library/std/src/sys/fs/hermit.rs +++ b/library/std/src/sys/fs/hermit.rs @@ -9,15 +9,16 @@ use crate::os::hermit::hermit_abi::{ use crate::os::hermit::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd}; use crate::path::{Path, PathBuf}; use crate::sync::Arc; -use crate::sys::common::small_c_string::run_path_with_cstr; use crate::sys::fd::FileDesc; -pub use crate::sys::fs::common::{copy, exists}; +pub use crate::sys::fs::common::{Dir, copy, exists}; +use crate::sys::helpers::run_path_with_cstr; use crate::sys::time::SystemTime; use crate::sys::{AsInner, AsInnerMut, FromInner, IntoInner, cvt, unsupported, unsupported_err}; use crate::{fmt, mem}; #[derive(Debug)] pub struct File(FileDesc); + #[derive(Clone)] pub struct FileAttr { stat_val: stat_struct, diff --git a/library/std/src/sys/fs/mod.rs b/library/std/src/sys/fs/mod.rs index 4a66227ce5f4..0c297c5766b8 100644 --- a/library/std/src/sys/fs/mod.rs +++ b/library/std/src/sys/fs/mod.rs @@ -17,7 +17,7 @@ cfg_select! { pub(crate) use unix::debug_assert_fd_is_open; #[cfg(any(target_os = "linux", target_os = "android"))] pub(super) use unix::CachedFileMetadata; - use crate::sys::common::small_c_string::run_path_with_cstr as with_native_path; + use crate::sys::helpers::run_path_with_cstr as with_native_path; } target_os = "windows" => { mod windows; @@ -59,7 +59,7 @@ pub fn with_native_path(path: &Path, f: &dyn Fn(&Path) -> io::Result) -> i } pub use imp::{ - DirBuilder, DirEntry, File, FileAttr, FilePermissions, FileTimes, FileType, OpenOptions, + Dir, DirBuilder, DirEntry, File, FileAttr, FilePermissions, FileTimes, FileType, OpenOptions, ReadDir, }; diff --git a/library/std/src/sys/fs/motor.rs b/library/std/src/sys/fs/motor.rs index 8f3336e2fa96..2ae01db24be5 100644 --- a/library/std/src/sys/fs/motor.rs +++ b/library/std/src/sys/fs/motor.rs @@ -4,7 +4,7 @@ use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom}; use crate::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd}; use crate::path::{Path, PathBuf}; use crate::sys::fd::FileDesc; -pub use crate::sys::fs::common::exists; +pub use crate::sys::fs::common::{Dir, exists}; use crate::sys::time::SystemTime; use crate::sys::{AsInner, AsInnerMut, FromInner, IntoInner, map_motor_error, unsupported}; diff --git a/library/std/src/sys/fs/solid.rs b/library/std/src/sys/fs/solid.rs index f6d5d3b784d3..114ffda57bc5 100644 --- a/library/std/src/sys/fs/solid.rs +++ b/library/std/src/sys/fs/solid.rs @@ -9,11 +9,11 @@ use crate::os::raw::{c_int, c_short}; use crate::os::solid::ffi::OsStrExt; use crate::path::{Path, PathBuf}; use crate::sync::Arc; -pub use crate::sys::fs::common::exists; +pub use crate::sys::fs::common::{Dir, exists}; +use crate::sys::helpers::ignore_notfound; use crate::sys::pal::{abi, error}; use crate::sys::time::SystemTime; use crate::sys::{unsupported, unsupported_err}; -use crate::sys_common::ignore_notfound; type CIntNotMinusOne = core::num::niche_types::NotAllOnes; diff --git a/library/std/src/sys/fs/uefi.rs b/library/std/src/sys/fs/uefi.rs index 21ef70b43dcd..74cacd6caff7 100644 --- a/library/std/src/sys/fs/uefi.rs +++ b/library/std/src/sys/fs/uefi.rs @@ -6,8 +6,9 @@ use crate::fs::TryLockError; use crate::hash::Hash; use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom}; use crate::path::{Path, PathBuf}; +pub use crate::sys::fs::common::Dir; +use crate::sys::pal::{helpers, unsupported}; use crate::sys::time::SystemTime; -use crate::sys::{helpers, unsupported}; const FILE_PERMISSIONS_MASK: u64 = r_efi::protocols::file::READ_ONLY; @@ -21,9 +22,13 @@ pub struct FileAttr { created: Option, } -pub struct ReadDir(!); +pub struct ReadDir(uefi_fs::File); -pub struct DirEntry(!); +pub struct DirEntry { + attr: FileAttr, + file_name: OsString, + path: PathBuf, +} #[derive(Clone, Debug)] pub struct OpenOptions { @@ -143,8 +148,10 @@ impl FileType { } impl fmt::Debug for ReadDir { - fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.0 + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut b = f.debug_struct("ReadDir"); + b.field("path", &self.0.path()); + b.finish() } } @@ -152,25 +159,43 @@ impl Iterator for ReadDir { type Item = io::Result; fn next(&mut self) -> Option> { - self.0 + match self.0.read_dir_entry() { + Ok(None) => None, + Ok(Some(x)) => { + let temp = DirEntry::from_uefi(x, self.0.path()); + // Ignore "." and "..". This is how ReadDir behaves in Unix. + if temp.file_name == "." || temp.file_name == ".." { + self.next() + } else { + Some(Ok(temp)) + } + } + Err(e) => Some(Err(e)), + } } } impl DirEntry { pub fn path(&self) -> PathBuf { - self.0 + self.path.clone() } pub fn file_name(&self) -> OsString { - self.0 + self.file_name.clone() } pub fn metadata(&self) -> io::Result { - self.0 + Ok(self.attr.clone()) } pub fn file_type(&self) -> io::Result { - self.0 + Ok(self.attr.file_type()) + } + + fn from_uefi(info: helpers::UefiBox, parent: &Path) -> Self { + let file_name = uefi_fs::file_name_from_uefi(&info); + let path = parent.join(&file_name); + Self { file_name, path, attr: FileAttr::from_uefi(info) } } } @@ -344,8 +369,17 @@ impl fmt::Debug for File { } } -pub fn readdir(_p: &Path) -> io::Result { - unsupported() +pub fn readdir(p: &Path) -> io::Result { + let path = crate::path::absolute(p)?; + let f = uefi_fs::File::from_path(&path, file::MODE_READ, 0)?; + let file_info = f.file_info()?; + let file_attr = FileAttr::from_uefi(file_info); + + if file_attr.file_type().is_dir() { + Ok(ReadDir(f)) + } else { + Err(io::const_error!(io::ErrorKind::NotADirectory, "expected a directory but got a file")) + } } pub fn unlink(p: &Path) -> io::Result<()> { @@ -360,8 +394,43 @@ pub fn unlink(p: &Path) -> io::Result<()> { } } -pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> { - unsupported() +/// The implementation mirrors `mv` implementation in UEFI shell: +/// https://github.com/tianocore/edk2/blob/66346d5edeac2a00d3cf2f2f3b5f66d423c07b3e/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c#L455 +/// +/// In a nutshell we do the following: +/// 1. Convert both old and new paths to absolute paths. +/// 2. Check that both lie in the same disk. +/// 3. Construct the target path relative to the current disk root. +/// 4. Set this target path as the file_name in the file_info structure. +pub fn rename(old: &Path, new: &Path) -> io::Result<()> { + let old_absolute = crate::path::absolute(old)?; + let new_absolute = crate::path::absolute(new)?; + + let mut old_components = old_absolute.components(); + let mut new_components = new_absolute.components(); + + let Some(old_disk) = old_components.next() else { + return Err(io::const_error!(io::ErrorKind::InvalidInput, "Old path is not valid")); + }; + let Some(new_disk) = new_components.next() else { + return Err(io::const_error!(io::ErrorKind::InvalidInput, "New path is not valid")); + }; + + // Ensure that paths are on the same device. + if old_disk != new_disk { + return Err(io::const_error!(io::ErrorKind::CrossesDevices, "Cannot rename across device")); + } + + // Construct an path relative the current disk root. + let new_relative = + [crate::path::Component::RootDir].into_iter().chain(new_components).collect::(); + + let f = uefi_fs::File::from_path(old, file::MODE_READ | file::MODE_WRITE, 0)?; + let file_info = f.file_info()?; + + let new_info = file_info.with_file_name(new_relative.as_os_str())?; + + f.set_file_info(new_info) } pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> { @@ -459,13 +528,18 @@ mod uefi_fs { use r_efi::protocols::{device_path, file, simple_file_system}; use crate::boxed::Box; + use crate::ffi::OsString; use crate::io; + use crate::os::uefi::ffi::OsStringExt; use crate::path::Path; use crate::ptr::NonNull; - use crate::sys::helpers::{self, UefiBox}; + use crate::sys::pal::helpers::{self, UefiBox}; use crate::sys::time::{self, SystemTime}; - pub(crate) struct File(NonNull); + pub(crate) struct File { + protocol: NonNull, + path: crate::path::PathBuf, + } impl File { pub(crate) fn from_path(path: &Path, open_mode: u64, attr: u64) -> io::Result { @@ -474,7 +548,8 @@ mod uefi_fs { let p = helpers::OwnedDevicePath::from_text(absolute.as_os_str())?; let (vol, mut path_remaining) = Self::open_volume_from_device_path(p.borrow())?; - vol.open(&mut path_remaining, open_mode, attr) + let protocol = Self::open(vol, &mut path_remaining, open_mode, attr)?; + Ok(Self { protocol, path: absolute }) } /// Open Filesystem volume given a devicepath to the volume, or a file/directory in the @@ -490,7 +565,7 @@ mod uefi_fs { /// and return the remaining file path "\abc\run.efi". fn open_volume_from_device_path( path: helpers::BorrowedDevicePath<'_>, - ) -> io::Result<(Self, Box<[u16]>)> { + ) -> io::Result<(NonNull, Box<[u16]>)> { let handles = match helpers::locate_handles(simple_file_system::PROTOCOL_GUID) { Ok(x) => x, Err(e) => return Err(e), @@ -512,7 +587,9 @@ mod uefi_fs { } // Open volume on device_handle using SIMPLE_FILE_SYSTEM_PROTOCOL - fn open_volume(device_handle: NonNull) -> io::Result { + fn open_volume( + device_handle: NonNull, + ) -> io::Result> { let simple_file_system_protocol = helpers::open_protocol::( device_handle, simple_file_system::PROTOCOL_GUID, @@ -531,11 +608,16 @@ mod uefi_fs { // Since no error was returned, file protocol should be non-NULL. let p = NonNull::new(file_protocol).unwrap(); - Ok(Self(p)) + Ok(p) } - fn open(&self, path: &mut [u16], open_mode: u64, attr: u64) -> io::Result { - let file_ptr = self.0.as_ptr(); + fn open( + protocol: NonNull, + path: &mut [u16], + open_mode: u64, + attr: u64, + ) -> io::Result> { + let file_ptr = protocol.as_ptr(); let mut file_opened = crate::ptr::null_mut(); let r = unsafe { @@ -548,11 +630,37 @@ mod uefi_fs { // Since no error was returned, file protocol should be non-NULL. let p = NonNull::new(file_opened).unwrap(); - Ok(File(p)) + Ok(p) + } + + pub(crate) fn read_dir_entry(&self) -> io::Result>> { + let file_ptr = self.protocol.as_ptr(); + let mut buf_size = 0; + + let r = unsafe { ((*file_ptr).read)(file_ptr, &mut buf_size, crate::ptr::null_mut()) }; + + if buf_size == 0 { + return Ok(None); + } + + assert!(r.is_error()); + if r != r_efi::efi::Status::BUFFER_TOO_SMALL { + return Err(io::Error::from_raw_os_error(r.as_usize())); + } + + let mut info: UefiBox = UefiBox::new(buf_size)?; + let r = + unsafe { ((*file_ptr).read)(file_ptr, &mut buf_size, info.as_mut_ptr().cast()) }; + + if r.is_error() { + Err(io::Error::from_raw_os_error(r.as_usize())) + } else { + Ok(Some(info)) + } } pub(crate) fn file_info(&self) -> io::Result> { - let file_ptr = self.0.as_ptr(); + let file_ptr = self.protocol.as_ptr(); let mut info_id = file::INFO_ID; let mut buf_size = 0; @@ -583,7 +691,7 @@ mod uefi_fs { } pub(crate) fn set_file_info(&self, mut info: UefiBox) -> io::Result<()> { - let file_ptr = self.0.as_ptr(); + let file_ptr = self.protocol.as_ptr(); let mut info_id = file::INFO_ID; let r = unsafe { @@ -594,7 +702,7 @@ mod uefi_fs { } pub(crate) fn delete(self) -> io::Result<()> { - let file_ptr = self.0.as_ptr(); + let file_ptr = self.protocol.as_ptr(); let r = unsafe { ((*file_ptr).delete)(file_ptr) }; // Spec states that even in case of failure, the file handle will be closed. @@ -602,12 +710,16 @@ mod uefi_fs { if r.is_error() { Err(io::Error::from_raw_os_error(r.as_usize())) } else { Ok(()) } } + + pub(crate) fn path(&self) -> &Path { + &self.path + } } impl Drop for File { fn drop(&mut self) { - let file_ptr = self.0.as_ptr(); - let _ = unsafe { ((*self.0.as_ptr()).close)(file_ptr) }; + let file_ptr = self.protocol.as_ptr(); + let _ = unsafe { ((*file_ptr).close)(file_ptr) }; } } @@ -647,7 +759,7 @@ mod uefi_fs { let (vol, mut path_remaining) = File::open_volume_from_device_path(p.borrow())?; // Check if file exists - match vol.open(&mut path_remaining, file::MODE_READ, 0) { + match File::open(vol, &mut path_remaining, file::MODE_READ, 0) { Ok(_) => { return Err(io::Error::new(io::ErrorKind::AlreadyExists, "Path already exists")); } @@ -655,7 +767,8 @@ mod uefi_fs { Err(e) => return Err(e), } - let _ = vol.open( + let _ = File::open( + vol, &mut path_remaining, file::MODE_READ | file::MODE_WRITE | file::MODE_CREATE, file::DIRECTORY, @@ -680,4 +793,9 @@ mod uefi_fs { let now = time::system_time_internal::now(); time.to_uefi_loose(now.timezone, now.daylight) } + + pub(crate) fn file_name_from_uefi(info: &UefiBox) -> OsString { + let fname = info.file_name(); + OsString::from_wide(&fname[..fname.len() - 1]) + } } diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs index de80f2ed053f..327b0eb7468a 100644 --- a/library/std/src/sys/fs/unix.rs +++ b/library/std/src/sys/fs/unix.rs @@ -89,9 +89,9 @@ use crate::os::unix::prelude::*; use crate::os::wasi::prelude::*; use crate::path::{Path, PathBuf}; use crate::sync::Arc; -use crate::sys::common::small_c_string::run_path_with_cstr; use crate::sys::fd::FileDesc; pub use crate::sys::fs::common::exists; +use crate::sys::helpers::run_path_with_cstr; use crate::sys::time::SystemTime; #[cfg(all(target_os = "linux", target_env = "gnu"))] use crate::sys::weak::syscall; @@ -257,7 +257,7 @@ cfg_has_statx! {{ // all DirEntry's will have a reference to this struct struct InnerReadDir { - dirp: Dir, + dirp: DirStream, root: PathBuf, } @@ -272,10 +272,134 @@ impl ReadDir { } } -struct Dir(*mut libc::DIR); +struct DirStream(*mut libc::DIR); -unsafe impl Send for Dir {} -unsafe impl Sync for Dir {} +// dir::Dir requires openat support +cfg_select! { + any( + target_os = "redox", + target_os = "espidf", + target_os = "horizon", + target_os = "vita", + target_os = "nto", + target_os = "vxworks", + ) => { + pub use crate::sys::fs::common::Dir; + } + _ => { + mod dir; + pub use dir::Dir; + } +} + +fn debug_path_fd<'a, 'b>( + fd: c_int, + f: &'a mut fmt::Formatter<'b>, + name: &str, +) -> fmt::DebugStruct<'a, 'b> { + let mut b = f.debug_struct(name); + + fn get_mode(fd: c_int) -> Option<(bool, bool)> { + let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) }; + if mode == -1 { + return None; + } + match mode & libc::O_ACCMODE { + libc::O_RDONLY => Some((true, false)), + libc::O_RDWR => Some((true, true)), + libc::O_WRONLY => Some((false, true)), + _ => None, + } + } + + b.field("fd", &fd); + if let Some(path) = get_path_from_fd(fd) { + b.field("path", &path); + } + if let Some((read, write)) = get_mode(fd) { + b.field("read", &read).field("write", &write); + } + + b +} + +fn get_path_from_fd(fd: c_int) -> Option { + #[cfg(any(target_os = "linux", target_os = "illumos", target_os = "solaris"))] + fn get_path(fd: c_int) -> Option { + let mut p = PathBuf::from("/proc/self/fd"); + p.push(&fd.to_string()); + run_path_with_cstr(&p, &readlink).ok() + } + + #[cfg(any(target_vendor = "apple", target_os = "netbsd"))] + fn get_path(fd: c_int) -> Option { + // FIXME: The use of PATH_MAX is generally not encouraged, but it + // is inevitable in this case because Apple targets and NetBSD define `fcntl` + // with `F_GETPATH` in terms of `MAXPATHLEN`, and there are no + // alternatives. If a better method is invented, it should be used + // instead. + let mut buf = vec![0; libc::PATH_MAX as usize]; + let n = unsafe { libc::fcntl(fd, libc::F_GETPATH, buf.as_ptr()) }; + if n == -1 { + cfg_select! { + target_os = "netbsd" => { + // fallback to procfs as last resort + let mut p = PathBuf::from("/proc/self/fd"); + p.push(&fd.to_string()); + return run_path_with_cstr(&p, &readlink).ok() + } + _ => { + return None; + } + } + } + let l = buf.iter().position(|&c| c == 0).unwrap(); + buf.truncate(l as usize); + buf.shrink_to_fit(); + Some(PathBuf::from(OsString::from_vec(buf))) + } + + #[cfg(target_os = "freebsd")] + fn get_path(fd: c_int) -> Option { + let info = Box::::new_zeroed(); + let mut info = unsafe { info.assume_init() }; + info.kf_structsize = size_of::() as libc::c_int; + let n = unsafe { libc::fcntl(fd, libc::F_KINFO, &mut *info) }; + if n == -1 { + return None; + } + let buf = unsafe { CStr::from_ptr(info.kf_path.as_mut_ptr()).to_bytes().to_vec() }; + Some(PathBuf::from(OsString::from_vec(buf))) + } + + #[cfg(target_os = "vxworks")] + fn get_path(fd: c_int) -> Option { + let mut buf = vec![0; libc::PATH_MAX as usize]; + let n = unsafe { libc::ioctl(fd, libc::FIOGETNAME, buf.as_ptr()) }; + if n == -1 { + return None; + } + let l = buf.iter().position(|&c| c == 0).unwrap(); + buf.truncate(l as usize); + Some(PathBuf::from(OsString::from_vec(buf))) + } + + #[cfg(not(any( + target_os = "linux", + target_os = "vxworks", + target_os = "freebsd", + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris", + target_vendor = "apple", + )))] + fn get_path(_fd: c_int) -> Option { + // FIXME(#24570): implement this for other Unix platforms + None + } + + get_path(fd) +} #[cfg(any( target_os = "aix", @@ -874,7 +998,7 @@ pub(crate) fn debug_assert_fd_is_open(fd: RawFd) { } } -impl Drop for Dir { +impl Drop for DirStream { fn drop(&mut self) { // dirfd isn't supported everywhere #[cfg(not(any( @@ -902,6 +1026,11 @@ impl Drop for Dir { } } +// SAFETY: `int dirfd (DIR *dirstream)` is MT-safe, implying that the pointer +// may be safely sent among threads. +unsafe impl Send for DirStream {} +unsafe impl Sync for DirStream {} + impl DirEntry { pub fn path(&self) -> PathBuf { self.dir.root.join(self.file_name_os_str()) @@ -1305,6 +1434,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1330,6 +1460,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1346,6 +1477,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1371,6 +1503,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1387,6 +1520,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1428,6 +1562,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1447,6 +1582,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1488,6 +1624,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1507,6 +1644,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1532,6 +1670,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1850,102 +1989,8 @@ impl FromRawFd for File { impl fmt::Debug for File { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - #[cfg(any(target_os = "linux", target_os = "illumos", target_os = "solaris"))] - fn get_path(fd: c_int) -> Option { - let mut p = PathBuf::from("/proc/self/fd"); - p.push(&fd.to_string()); - run_path_with_cstr(&p, &readlink).ok() - } - - #[cfg(any(target_vendor = "apple", target_os = "netbsd"))] - fn get_path(fd: c_int) -> Option { - // FIXME: The use of PATH_MAX is generally not encouraged, but it - // is inevitable in this case because Apple targets and NetBSD define `fcntl` - // with `F_GETPATH` in terms of `MAXPATHLEN`, and there are no - // alternatives. If a better method is invented, it should be used - // instead. - let mut buf = vec![0; libc::PATH_MAX as usize]; - let n = unsafe { libc::fcntl(fd, libc::F_GETPATH, buf.as_ptr()) }; - if n == -1 { - cfg_select! { - target_os = "netbsd" => { - // fallback to procfs as last resort - let mut p = PathBuf::from("/proc/self/fd"); - p.push(&fd.to_string()); - return run_path_with_cstr(&p, &readlink).ok() - } - _ => { - return None; - } - } - } - let l = buf.iter().position(|&c| c == 0).unwrap(); - buf.truncate(l as usize); - buf.shrink_to_fit(); - Some(PathBuf::from(OsString::from_vec(buf))) - } - - #[cfg(target_os = "freebsd")] - fn get_path(fd: c_int) -> Option { - let info = Box::::new_zeroed(); - let mut info = unsafe { info.assume_init() }; - info.kf_structsize = size_of::() as libc::c_int; - let n = unsafe { libc::fcntl(fd, libc::F_KINFO, &mut *info) }; - if n == -1 { - return None; - } - let buf = unsafe { CStr::from_ptr(info.kf_path.as_mut_ptr()).to_bytes().to_vec() }; - Some(PathBuf::from(OsString::from_vec(buf))) - } - - #[cfg(target_os = "vxworks")] - fn get_path(fd: c_int) -> Option { - let mut buf = vec![0; libc::PATH_MAX as usize]; - let n = unsafe { libc::ioctl(fd, libc::FIOGETNAME, buf.as_ptr()) }; - if n == -1 { - return None; - } - let l = buf.iter().position(|&c| c == 0).unwrap(); - buf.truncate(l as usize); - Some(PathBuf::from(OsString::from_vec(buf))) - } - - #[cfg(not(any( - target_os = "linux", - target_os = "vxworks", - target_os = "freebsd", - target_os = "netbsd", - target_os = "illumos", - target_os = "solaris", - target_vendor = "apple", - )))] - fn get_path(_fd: c_int) -> Option { - // FIXME(#24570): implement this for other Unix platforms - None - } - - fn get_mode(fd: c_int) -> Option<(bool, bool)> { - let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) }; - if mode == -1 { - return None; - } - match mode & libc::O_ACCMODE { - libc::O_RDONLY => Some((true, false)), - libc::O_RDWR => Some((true, true)), - libc::O_WRONLY => Some((false, true)), - _ => None, - } - } - let fd = self.as_raw_fd(); - let mut b = f.debug_struct("File"); - b.field("fd", &fd); - if let Some(path) = get_path(fd) { - b.field("path", &path); - } - if let Some((read, write)) = get_mode(fd) { - b.field("read", &read).field("write", &write); - } + let mut b = debug_path_fd(fd, f, "File"); b.finish() } } @@ -2023,7 +2068,7 @@ pub fn readdir(path: &Path) -> io::Result { Err(Error::last_os_error()) } else { let root = path.to_path_buf(); - let inner = InnerReadDir { dirp: Dir(ptr), root }; + let inner = InnerReadDir { dirp: DirStream(ptr), root }; Ok(ReadDir::new(inner)) } } @@ -2166,7 +2211,7 @@ fn open_from(from: &Path) -> io::Result<(crate::fs::File, crate::fs::Metadata)> fn set_times_impl(p: &CStr, times: FileTimes, follow_symlinks: bool) -> io::Result<()> { cfg_select! { - any(target_os = "redox", target_os = "espidf", target_os = "horizon", target_os = "nuttx", target_os = "vita") => { + any(target_os = "redox", target_os = "espidf", target_os = "horizon", target_os = "nuttx", target_os = "vita", target_os = "rtems") => { let _ = (p, times, follow_symlinks); Err(io::const_error!( io::ErrorKind::Unsupported, @@ -2483,14 +2528,14 @@ mod remove_dir_impl { use libc::{fdopendir, openat64 as openat, unlinkat}; use super::{ - AsRawFd, Dir, DirEntry, FromRawFd, InnerReadDir, IntoRawFd, OwnedFd, RawFd, ReadDir, lstat, + AsRawFd, DirEntry, DirStream, FromRawFd, InnerReadDir, IntoRawFd, OwnedFd, RawFd, ReadDir, + lstat, }; use crate::ffi::CStr; use crate::io; use crate::path::{Path, PathBuf}; - use crate::sys::common::small_c_string::run_path_with_cstr; + use crate::sys::helpers::{ignore_notfound, run_path_with_cstr}; use crate::sys::{cvt, cvt_r}; - use crate::sys_common::ignore_notfound; pub fn openat_nofollow_dironly(parent_fd: Option, p: &CStr) -> io::Result { let fd = cvt_r(|| unsafe { @@ -2508,7 +2553,7 @@ mod remove_dir_impl { if ptr.is_null() { return Err(io::Error::last_os_error()); } - let dirp = Dir(ptr); + let dirp = DirStream(ptr); // file descriptor is automatically closed by libc::closedir() now, so give up ownership let new_parent_fd = dir_fd.into_raw_fd(); // a valid root is not needed because we do not call any functions involving the full path diff --git a/library/std/src/sys/fs/unix/dir.rs b/library/std/src/sys/fs/unix/dir.rs new file mode 100644 index 000000000000..094d1bfd3168 --- /dev/null +++ b/library/std/src/sys/fs/unix/dir.rs @@ -0,0 +1,114 @@ +use libc::c_int; + +cfg_select! { + not( + any( + all(target_os = "linux", not(target_env = "musl")), + target_os = "l4re", + target_os = "android", + target_os = "hurd", + ) + ) => { + use libc::{open as open64, openat as openat64}; + } + _ => { + use libc::{open64, openat64}; + } +} + +use crate::ffi::CStr; +use crate::os::fd::{AsFd, BorrowedFd, IntoRawFd, OwnedFd, RawFd}; +#[cfg(target_family = "unix")] +use crate::os::unix::io::{AsRawFd, FromRawFd}; +#[cfg(target_os = "wasi")] +use crate::os::wasi::io::{AsRawFd, FromRawFd}; +use crate::path::Path; +use crate::sys::fd::FileDesc; +use crate::sys::fs::OpenOptions; +use crate::sys::fs::unix::{File, debug_path_fd}; +use crate::sys::helpers::run_path_with_cstr; +use crate::sys::{AsInner, FromInner, IntoInner, cvt_r}; +use crate::{fmt, fs, io}; + +pub struct Dir(OwnedFd); + +impl Dir { + pub fn open(path: &Path, opts: &OpenOptions) -> io::Result { + run_path_with_cstr(path, &|path| Self::open_with_c(path, opts)) + } + + pub fn open_file(&self, path: &Path, opts: &OpenOptions) -> io::Result { + run_path_with_cstr(path.as_ref(), &|path| self.open_file_c(path, &opts)) + } + + pub fn open_with_c(path: &CStr, opts: &OpenOptions) -> io::Result { + let flags = libc::O_CLOEXEC + | libc::O_DIRECTORY + | opts.get_access_mode()? + | opts.get_creation_mode()? + | (opts.custom_flags as c_int & !libc::O_ACCMODE); + let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode as c_int) })?; + Ok(Self(unsafe { OwnedFd::from_raw_fd(fd) })) + } + + fn open_file_c(&self, path: &CStr, opts: &OpenOptions) -> io::Result { + let flags = libc::O_CLOEXEC + | opts.get_access_mode()? + | opts.get_creation_mode()? + | (opts.custom_flags as c_int & !libc::O_ACCMODE); + let fd = cvt_r(|| unsafe { + openat64(self.0.as_raw_fd(), path.as_ptr(), flags, opts.mode as c_int) + })?; + Ok(File(unsafe { FileDesc::from_raw_fd(fd) })) + } +} + +impl fmt::Debug for Dir { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let fd = self.0.as_raw_fd(); + let mut b = debug_path_fd(fd, f, "Dir"); + b.finish() + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl AsRawFd for fs::Dir { + fn as_raw_fd(&self) -> RawFd { + self.as_inner().0.as_raw_fd() + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl IntoRawFd for fs::Dir { + fn into_raw_fd(self) -> RawFd { + self.into_inner().0.into_raw_fd() + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl FromRawFd for fs::Dir { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + Self::from_inner(Dir(unsafe { FromRawFd::from_raw_fd(fd) })) + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl AsFd for fs::Dir { + fn as_fd(&self) -> BorrowedFd<'_> { + self.as_inner().0.as_fd() + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl From for OwnedFd { + fn from(value: fs::Dir) -> Self { + value.into_inner().0 + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl From for fs::Dir { + fn from(value: OwnedFd) -> Self { + Self::from_inner(Dir(value)) + } +} diff --git a/library/std/src/sys/fs/unsupported.rs b/library/std/src/sys/fs/unsupported.rs index f222151d18e2..069b4fb8a29c 100644 --- a/library/std/src/sys/fs/unsupported.rs +++ b/library/std/src/sys/fs/unsupported.rs @@ -4,6 +4,7 @@ use crate::fs::TryLockError; use crate::hash::{Hash, Hasher}; use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom}; use crate::path::{Path, PathBuf}; +pub use crate::sys::fs::common::Dir; use crate::sys::time::SystemTime; use crate::sys::unsupported; diff --git a/library/std/src/sys/fs/vexos.rs b/library/std/src/sys/fs/vexos.rs index 381c87c62c68..81083a4fa81d 100644 --- a/library/std/src/sys/fs/vexos.rs +++ b/library/std/src/sys/fs/vexos.rs @@ -4,7 +4,7 @@ use crate::fs::TryLockError; use crate::hash::Hash; use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom}; use crate::path::{Path, PathBuf}; -use crate::sys::common::small_c_string::run_path_with_cstr; +use crate::sys::helpers::run_path_with_cstr; use crate::sys::time::SystemTime; use crate::sys::{unsupported, unsupported_err}; diff --git a/library/std/src/sys/fs/windows.rs b/library/std/src/sys/fs/windows.rs index b588b91c753b..2e3d50aa0e08 100644 --- a/library/std/src/sys/fs/windows.rs +++ b/library/std/src/sys/fs/windows.rs @@ -18,6 +18,8 @@ use crate::sys::time::SystemTime; use crate::sys::{Align8, AsInner, FromInner, IntoInner, c, cvt}; use crate::{fmt, ptr, slice}; +mod dir; +pub use dir::Dir; mod remove_dir_all; use remove_dir_all::remove_dir_all_iterative; @@ -274,7 +276,7 @@ impl OpenOptions { } } - fn get_creation_mode(&self) -> io::Result { + fn get_cmode_disposition(&self) -> io::Result<(u32, u32)> { match (self.write, self.append) { (true, false) => {} (false, false) => { @@ -296,16 +298,24 @@ impl OpenOptions { } Ok(match (self.create, self.truncate, self.create_new) { - (false, false, false) => c::OPEN_EXISTING, - (true, false, false) => c::OPEN_ALWAYS, - (false, true, false) => c::TRUNCATE_EXISTING, + (false, false, false) => (c::OPEN_EXISTING, c::FILE_OPEN), + (true, false, false) => (c::OPEN_ALWAYS, c::FILE_OPEN_IF), + (false, true, false) => (c::TRUNCATE_EXISTING, c::FILE_OVERWRITE), // `CREATE_ALWAYS` has weird semantics so we emulate it using // `OPEN_ALWAYS` and a manual truncation step. See #115745. - (true, true, false) => c::OPEN_ALWAYS, - (_, _, true) => c::CREATE_NEW, + (true, true, false) => (c::OPEN_ALWAYS, c::FILE_OVERWRITE_IF), + (_, _, true) => (c::CREATE_NEW, c::FILE_CREATE), }) } + fn get_creation_mode(&self) -> io::Result { + self.get_cmode_disposition().map(|(mode, _)| mode) + } + + fn get_disposition(&self) -> io::Result { + self.get_cmode_disposition().map(|(_, mode)| mode) + } + fn get_flags_and_attributes(&self) -> u32 { self.custom_flags | self.attributes @@ -1019,14 +1029,23 @@ impl FromRawHandle for File { } } +fn debug_path_handle<'a, 'b>( + handle: BorrowedHandle<'a>, + f: &'a mut fmt::Formatter<'b>, + name: &str, +) -> fmt::DebugStruct<'a, 'b> { + // FIXME(#24570): add more info here (e.g., mode) + let mut b = f.debug_struct(name); + b.field("handle", &handle.as_raw_handle()); + if let Ok(path) = get_path(handle) { + b.field("path", &path); + } + b +} + impl fmt::Debug for File { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - // FIXME(#24570): add more info here (e.g., mode) - let mut b = f.debug_struct("File"); - b.field("handle", &self.handle.as_raw_handle()); - if let Ok(path) = get_path(self) { - b.field("path", &path); - } + let mut b = debug_path_handle(self.handle.as_handle(), f, "File"); b.finish() } } @@ -1292,8 +1311,8 @@ pub fn rename(old: &WCStr, new: &WCStr) -> io::Result<()> { Layout::from_size_align(struct_size as usize, align_of::()) .unwrap(); - // SAFETY: We allocate enough memory for a full FILE_RENAME_INFO struct and a filename. let file_rename_info; + // SAFETY: We allocate enough memory for a full FILE_RENAME_INFO struct and a filename. unsafe { file_rename_info = alloc(layout).cast::(); if file_rename_info.is_null() { @@ -1530,10 +1549,10 @@ pub fn set_times_nofollow(p: &WCStr, times: FileTimes) -> io::Result<()> { file.set_times(times) } -fn get_path(f: &File) -> io::Result { +fn get_path(f: impl AsRawHandle) -> io::Result { fill_utf16_buf( |buf, sz| unsafe { - c::GetFinalPathNameByHandleW(f.handle.as_raw_handle(), buf, sz, c::VOLUME_NAME_DOS) + c::GetFinalPathNameByHandleW(f.as_raw_handle(), buf, sz, c::VOLUME_NAME_DOS) }, |buf| PathBuf::from(OsString::from_wide(buf)), ) @@ -1546,7 +1565,7 @@ pub fn canonicalize(p: &WCStr) -> io::Result { // This flag is so we can open directories too opts.custom_flags(c::FILE_FLAG_BACKUP_SEMANTICS); let f = File::open_native(p, &opts)?; - get_path(&f) + get_path(f.handle) } pub fn copy(from: &WCStr, to: &WCStr) -> io::Result { diff --git a/library/std/src/sys/fs/windows/dir.rs b/library/std/src/sys/fs/windows/dir.rs new file mode 100644 index 000000000000..3f617806c6c3 --- /dev/null +++ b/library/std/src/sys/fs/windows/dir.rs @@ -0,0 +1,153 @@ +use crate::os::windows::io::{ + AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, HandleOrInvalid, IntoRawHandle, + OwnedHandle, RawHandle, +}; +use crate::path::Path; +use crate::sys::api::{UnicodeStrRef, WinError}; +use crate::sys::fs::windows::debug_path_handle; +use crate::sys::fs::{File, OpenOptions}; +use crate::sys::handle::Handle; +use crate::sys::path::{WCStr, with_native_path}; +use crate::sys::{AsInner, FromInner, IntoInner, IoResult, c, to_u16s}; +use crate::{fmt, fs, io, ptr}; + +pub struct Dir { + handle: Handle, +} + +/// A wrapper around a raw NtCreateFile call. +/// +/// This isn't completely safe because `OBJECT_ATTRIBUTES` contains raw pointers. +unsafe fn nt_create_file( + opts: &OpenOptions, + object_attributes: &c::OBJECT_ATTRIBUTES, + create_options: c::NTCREATEFILE_CREATE_OPTIONS, +) -> io::Result { + let mut handle = ptr::null_mut(); + let mut io_status = c::IO_STATUS_BLOCK::PENDING; + // SYNCHRONIZE is included in FILE_GENERIC_READ, but not GENERIC_READ, so we add it manually + let access = opts.get_access_mode()? | c::SYNCHRONIZE; + // one of FILE_SYNCHRONOUS_IO_{,NON}ALERT is required for later operations to succeed. + let options = create_options | c::FILE_SYNCHRONOUS_IO_NONALERT; + let status = unsafe { + c::NtCreateFile( + &mut handle, + access, + object_attributes, + &mut io_status, + ptr::null(), + c::FILE_ATTRIBUTE_NORMAL, + opts.share_mode, + opts.get_disposition()?, + options, + ptr::null(), + 0, + ) + }; + if c::nt_success(status) { + // SAFETY: nt_success guarantees that handle is no longer null + unsafe { Ok(Handle::from_raw_handle(handle)) } + } else { + Err(WinError::new(unsafe { c::RtlNtStatusToDosError(status) })).io_result() + } +} + +impl Dir { + pub fn open(path: &Path, opts: &OpenOptions) -> io::Result { + with_native_path(path, &|path| Self::open_with_native(path, opts)) + } + + pub fn open_file(&self, path: &Path, opts: &OpenOptions) -> io::Result { + // NtCreateFile will fail if given an absolute path and a non-null RootDirectory + if path.is_absolute() { + return File::open(path, opts); + } + let path = to_u16s(path)?; + let path = &path[..path.len() - 1]; // trim 0 byte + self.open_file_native(&path, opts).map(|handle| File { handle }) + } + + fn open_with_native(path: &WCStr, opts: &OpenOptions) -> io::Result { + let creation = opts.get_creation_mode()?; + let sa = c::SECURITY_ATTRIBUTES { + nLength: size_of::() as u32, + lpSecurityDescriptor: ptr::null_mut(), + bInheritHandle: opts.inherit_handle as c::BOOL, + }; + let handle = unsafe { + c::CreateFileW( + path.as_ptr(), + opts.get_access_mode()?, + opts.share_mode, + &raw const sa, + creation, + // FILE_FLAG_BACKUP_SEMANTICS is required to open a directory + opts.get_flags_and_attributes() | c::FILE_FLAG_BACKUP_SEMANTICS, + ptr::null_mut(), + ) + }; + match OwnedHandle::try_from(unsafe { HandleOrInvalid::from_raw_handle(handle) }) { + Ok(handle) => Ok(Self { handle: Handle::from_inner(handle) }), + Err(_) => Err(io::Error::last_os_error()), + } + } + + fn open_file_native(&self, path: &[u16], opts: &OpenOptions) -> io::Result { + let name = UnicodeStrRef::from_slice(path); + let object_attributes = c::OBJECT_ATTRIBUTES { + RootDirectory: self.handle.as_raw_handle(), + ObjectName: name.as_ptr(), + ..c::OBJECT_ATTRIBUTES::with_length() + }; + unsafe { nt_create_file(opts, &object_attributes, c::FILE_NON_DIRECTORY_FILE) } + } +} + +impl fmt::Debug for Dir { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut b = debug_path_handle(self.handle.as_handle(), f, "Dir"); + b.finish() + } +} + +#[unstable(feature = "dirfd", issue = "120426")] +impl AsRawHandle for fs::Dir { + fn as_raw_handle(&self) -> RawHandle { + self.as_inner().handle.as_raw_handle() + } +} + +#[unstable(feature = "dirhandle", issue = "120426")] +impl IntoRawHandle for fs::Dir { + fn into_raw_handle(self) -> RawHandle { + self.into_inner().handle.into_raw_handle() + } +} + +#[unstable(feature = "dirhandle", issue = "120426")] +impl FromRawHandle for fs::Dir { + unsafe fn from_raw_handle(handle: RawHandle) -> Self { + Self::from_inner(Dir { handle: unsafe { FromRawHandle::from_raw_handle(handle) } }) + } +} + +#[unstable(feature = "dirhandle", issue = "120426")] +impl AsHandle for fs::Dir { + fn as_handle(&self) -> BorrowedHandle<'_> { + self.as_inner().handle.as_handle() + } +} + +#[unstable(feature = "dirhandle", issue = "120426")] +impl From for OwnedHandle { + fn from(value: fs::Dir) -> Self { + value.into_inner().handle.into_inner() + } +} + +#[unstable(feature = "dirhandle", issue = "120426")] +impl From for fs::Dir { + fn from(value: OwnedHandle) -> Self { + Self::from_inner(Dir { handle: Handle::from_inner(value) }) + } +} diff --git a/library/std/src/sys/helpers/mod.rs b/library/std/src/sys/helpers/mod.rs new file mode 100644 index 000000000000..a6236799caea --- /dev/null +++ b/library/std/src/sys/helpers/mod.rs @@ -0,0 +1,39 @@ +//! Small helper functions used inside `sys`. +//! +//! If any of these have uses outside of `sys`, please move them to a different +//! module. + +#[cfg_attr(not(target_os = "linux"), allow(unused))] // Not used on all platforms. +mod small_c_string; +#[cfg_attr(not(target_os = "windows"), allow(unused))] // Not used on all platforms. +mod wstr; + +#[cfg(test)] +mod tests; + +#[cfg_attr(not(target_os = "linux"), allow(unused))] // Not used on all platforms. +pub use small_c_string::{run_path_with_cstr, run_with_cstr}; +#[cfg_attr(not(target_os = "windows"), allow(unused))] // Not used on all platforms. +pub use wstr::WStrUnits; + +/// Computes `(value*numerator)/denom` without overflow, as long as both +/// `numerator*denom` and the overall result fit into `u64` (which is the case +/// for our time conversions). +#[cfg_attr(not(target_os = "windows"), allow(unused))] // Not used on all platforms. +pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 { + let q = value / denom; + let r = value % denom; + // Decompose value as (value/denom*denom + value%denom), + // substitute into (value*numerator)/denom and simplify. + // r < denom, so (denom*numerator) is the upper bound of (r*numerator) + q * numerator + r * numerator / denom +} + +#[cfg_attr(not(target_os = "linux"), allow(unused))] // Not used on all platforms. +pub fn ignore_notfound(result: crate::io::Result) -> crate::io::Result<()> { + match result { + Err(err) if err.kind() == crate::io::ErrorKind::NotFound => Ok(()), + Ok(_) => Ok(()), + Err(err) => Err(err), + } +} diff --git a/library/std/src/sys/pal/common/small_c_string.rs b/library/std/src/sys/helpers/small_c_string.rs similarity index 100% rename from library/std/src/sys/pal/common/small_c_string.rs rename to library/std/src/sys/helpers/small_c_string.rs diff --git a/library/std/src/sys/pal/common/tests.rs b/library/std/src/sys/helpers/tests.rs similarity index 89% rename from library/std/src/sys/pal/common/tests.rs rename to library/std/src/sys/helpers/tests.rs index b7698907070c..b67fdb9408d6 100644 --- a/library/std/src/sys/pal/common/tests.rs +++ b/library/std/src/sys/helpers/tests.rs @@ -1,9 +1,10 @@ use core::iter::repeat; +use super::mul_div_u64; +use super::small_c_string::run_path_with_cstr; use crate::ffi::CString; use crate::hint::black_box; use crate::path::Path; -use crate::sys::common::small_c_string::run_path_with_cstr; #[test] fn stack_allocation_works() { @@ -65,3 +66,8 @@ fn bench_heap_path_alloc(b: &mut test::Bencher) { .unwrap(); }); } + +#[test] +fn test_muldiv() { + assert_eq!(mul_div_u64(1_000_000_000_001, 1_000_000_000, 1_000_000), 1_000_000_000_001_000); +} diff --git a/library/std/src/sys_common/wstr.rs b/library/std/src/sys/helpers/wstr.rs similarity index 98% rename from library/std/src/sys_common/wstr.rs rename to library/std/src/sys/helpers/wstr.rs index f9a171fb7d8f..9c4b8e09e463 100644 --- a/library/std/src/sys_common/wstr.rs +++ b/library/std/src/sys/helpers/wstr.rs @@ -1,5 +1,4 @@ //! This module contains constructs to work with 16-bit characters (UCS-2 or UTF-16) -#![allow(dead_code)] use crate::marker::PhantomData; use crate::num::NonZero; diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 0c72f6a57fe8..c9035938cfdd 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -1,16 +1,9 @@ #![allow(unsafe_op_in_unsafe_fn)] -/// The configure builtins provides runtime support compiler-builtin features -/// which require dynamic initialization to work as expected, e.g. aarch64 -/// outline-atomics. -mod configure_builtins; - -/// The PAL (platform abstraction layer) contains platform-specific abstractions -/// for implementing the features in the other submodules, e.g. UNIX file -/// descriptors. -mod pal; - mod alloc; +mod configure_builtins; +mod helpers; +mod pal; mod personality; pub mod args; diff --git a/library/std/src/sys/net/connection/motor.rs b/library/std/src/sys/net/connection/motor.rs index 9beed0779752..79a528792106 100644 --- a/library/std/src/sys/net/connection/motor.rs +++ b/library/std/src/sys/net/connection/motor.rs @@ -144,8 +144,9 @@ impl TcpStream { } pub fn take_error(&self) -> io::Result> { - let e = moto_rt::net::take_error(self.inner.as_raw_fd()).map_err(map_motor_error)?; - if e == moto_rt::E_OK { Ok(None) } else { Ok(Some(map_motor_error(e))) } + moto_rt::net::take_error(self.inner.as_raw_fd()) + .map(|e| e.map(map_motor_error)) + .map_err(map_motor_error) } pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { @@ -212,8 +213,9 @@ impl TcpListener { } pub fn take_error(&self) -> io::Result> { - let e = moto_rt::net::take_error(self.inner.as_raw_fd()).map_err(map_motor_error)?; - if e == moto_rt::E_OK { Ok(None) } else { Ok(Some(map_motor_error(e))) } + moto_rt::net::take_error(self.inner.as_raw_fd()) + .map(|e| e.map(map_motor_error)) + .map_err(map_motor_error) } pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { @@ -363,10 +365,7 @@ impl UdpSocket { pub fn take_error(&self) -> io::Result> { moto_rt::net::take_error(self.inner.as_raw_fd()) - .map(|e| match e { - moto_rt::E_OK => None, - e => Some(map_motor_error(e)), - }) + .map(|e| e.map(map_motor_error)) .map_err(map_motor_error) } @@ -414,10 +413,12 @@ impl TryFrom<&str> for LookupHost { fn try_from(host_port: &str) -> io::Result { let (host, port_str) = host_port .rsplit_once(':') - .ok_or(moto_rt::E_INVALID_ARGUMENT) + .ok_or(moto_rt::Error::InvalidArgument) + .map_err(map_motor_error)?; + let port: u16 = port_str + .parse() + .map_err(|_| moto_rt::Error::InvalidArgument) .map_err(map_motor_error)?; - let port: u16 = - port_str.parse().map_err(|_| moto_rt::E_INVALID_ARGUMENT).map_err(map_motor_error)?; (host, port).try_into() } } diff --git a/library/std/src/sys/net/connection/socket/hermit.rs b/library/std/src/sys/net/connection/socket/hermit.rs index c32f8dcc8de8..d57a075eb42d 100644 --- a/library/std/src/sys/net/connection/socket/hermit.rs +++ b/library/std/src/sys/net/connection/socket/hermit.rs @@ -300,7 +300,6 @@ impl Socket { if raw == 0 { Ok(None) } else { Ok(Some(io::Error::from_raw_os_error(raw as i32))) } } - // This is used by sys_common code to abstract over Windows and Unix. pub fn as_raw(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/net/connection/socket/mod.rs b/library/std/src/sys/net/connection/socket/mod.rs index c6df9c6b8ae1..256b99dfa987 100644 --- a/library/std/src/sys/net/connection/socket/mod.rs +++ b/library/std/src/sys/net/connection/socket/mod.rs @@ -7,7 +7,7 @@ use crate::mem::MaybeUninit; use crate::net::{ Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs, }; -use crate::sys::common::small_c_string::run_with_cstr; +use crate::sys::helpers::run_with_cstr; use crate::sys::net::connection::each_addr; use crate::sys::{AsInner, FromInner}; use crate::time::Duration; diff --git a/library/std/src/sys/net/connection/socket/solid.rs b/library/std/src/sys/net/connection/socket/solid.rs index 673d75046d3f..e20a3fbb76b7 100644 --- a/library/std/src/sys/net/connection/socket/solid.rs +++ b/library/std/src/sys/net/connection/socket/solid.rs @@ -353,7 +353,6 @@ impl Socket { if raw == 0 { Ok(None) } else { Ok(Some(io::Error::from_raw_os_error(raw as i32))) } } - // This method is used by sys_common code to abstract over targets. pub fn as_raw(&self) -> c_int { self.as_raw_fd() } diff --git a/library/std/src/sys/net/connection/socket/unix.rs b/library/std/src/sys/net/connection/socket/unix.rs index 6d06a8d86bf1..d09ba97cfe01 100644 --- a/library/std/src/sys/net/connection/socket/unix.rs +++ b/library/std/src/sys/net/connection/socket/unix.rs @@ -614,7 +614,6 @@ impl Socket { if raw == 0 { Ok(None) } else { Ok(Some(io::Error::from_raw_os_error(raw as i32))) } } - // This is used by sys_common code to abstract over Windows and Unix. pub fn as_raw(&self) -> RawFd { self.as_raw_fd() } diff --git a/library/std/src/sys/net/connection/socket/windows.rs b/library/std/src/sys/net/connection/socket/windows.rs index 7355f0ce6bf5..3f99249efc47 100644 --- a/library/std/src/sys/net/connection/socket/windows.rs +++ b/library/std/src/sys/net/connection/socket/windows.rs @@ -439,7 +439,6 @@ impl Socket { if raw == 0 { Ok(None) } else { Ok(Some(io::Error::from_raw_os_error(raw as i32))) } } - // This is used by sys_common code to abstract over Windows and Unix. pub fn as_raw(&self) -> c::SOCKET { debug_assert_eq!(size_of::(), size_of::()); debug_assert_eq!(align_of::(), align_of::()); diff --git a/library/std/src/sys/net/connection/uefi/mod.rs b/library/std/src/sys/net/connection/uefi/mod.rs index db2d18646d02..107a3e23733d 100644 --- a/library/std/src/sys/net/connection/uefi/mod.rs +++ b/library/std/src/sys/net/connection/uefi/mod.rs @@ -16,26 +16,26 @@ pub struct TcpStream { } impl TcpStream { + fn new(inner: tcp::Tcp) -> Self { + Self { + inner, + read_timeout: Arc::new(Mutex::new(None)), + write_timeout: Arc::new(Mutex::new(None)), + } + } + pub fn connect(addr: A) -> io::Result { return each_addr(addr, inner); fn inner(addr: &SocketAddr) -> io::Result { let inner = tcp::Tcp::connect(addr, None)?; - Ok(TcpStream { - inner, - read_timeout: Arc::new(Mutex::new(None)), - write_timeout: Arc::new(Mutex::new(None)), - }) + Ok(TcpStream::new(inner)) } } pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result { let inner = tcp::Tcp::connect(addr, Some(timeout))?; - Ok(Self { - inner, - read_timeout: Arc::new(Mutex::new(None)), - write_timeout: Arc::new(Mutex::new(None)), - }) + Ok(Self::new(inner)) } pub fn set_read_timeout(&self, t: Option) -> io::Result<()> { @@ -148,16 +148,23 @@ pub struct TcpListener { } impl TcpListener { - pub fn bind(_: A) -> io::Result { - unsupported() + pub fn bind(addr: A) -> io::Result { + return each_addr(addr, inner); + + fn inner(addr: &SocketAddr) -> io::Result { + let inner = tcp::Tcp::bind(addr)?; + Ok(TcpListener { inner }) + } } pub fn socket_addr(&self) -> io::Result { - unsupported() + self.inner.socket_addr() } pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { - unsupported() + let tcp = self.inner.accept()?; + let addr = tcp.peer_addr()?; + Ok((TcpStream::new(tcp), addr)) } pub fn duplicate(&self) -> io::Result { diff --git a/library/std/src/sys/net/connection/uefi/tcp.rs b/library/std/src/sys/net/connection/uefi/tcp.rs index 1e7e829c85f3..3e79aa049187 100644 --- a/library/std/src/sys/net/connection/uefi/tcp.rs +++ b/library/std/src/sys/net/connection/uefi/tcp.rs @@ -2,7 +2,7 @@ use super::tcp4; use crate::io::{self, IoSlice, IoSliceMut}; use crate::net::SocketAddr; use crate::ptr::NonNull; -use crate::sys::{helpers, unsupported}; +use crate::sys::pal::{helpers, unsupported}; use crate::time::Duration; pub(crate) enum Tcp { @@ -18,7 +18,24 @@ impl Tcp { temp.connect(timeout)?; Ok(Tcp::V4(temp)) } - SocketAddr::V6(_) => todo!(), + SocketAddr::V6(_) => unsupported(), + } + } + + pub(crate) fn bind(addr: &SocketAddr) -> io::Result { + match addr { + SocketAddr::V4(x) => { + let temp = tcp4::Tcp4::new()?; + temp.configure(false, None, Some(x))?; + Ok(Tcp::V4(temp)) + } + SocketAddr::V6(_) => unsupported(), + } + } + + pub(crate) fn accept(&self) -> io::Result { + match self { + Self::V4(client) => client.accept().map(Tcp::V4), } } diff --git a/library/std/src/sys/net/connection/uefi/tcp4.rs b/library/std/src/sys/net/connection/uefi/tcp4.rs index 0409997f0272..00c93384e5f6 100644 --- a/library/std/src/sys/net/connection/uefi/tcp4.rs +++ b/library/std/src/sys/net/connection/uefi/tcp4.rs @@ -3,7 +3,7 @@ use r_efi::protocols::tcp4; use crate::io::{self, IoSlice, IoSliceMut}; use crate::net::SocketAddrV4; -use crate::ptr::NonNull; +use crate::ptr::{self, NonNull}; use crate::sync::atomic::{AtomicBool, Ordering}; use crate::sys::pal::helpers; use crate::time::{Duration, Instant}; @@ -12,9 +12,9 @@ const TYPE_OF_SERVICE: u8 = 8; const TIME_TO_LIVE: u8 = 255; pub(crate) struct Tcp4 { + handle: NonNull, protocol: NonNull, flag: AtomicBool, - #[expect(dead_code)] service_binding: helpers::ServiceProtocol, } @@ -22,10 +22,11 @@ const DEFAULT_ADDR: efi::Ipv4Address = efi::Ipv4Address { addr: [0u8; 4] }; impl Tcp4 { pub(crate) fn new() -> io::Result { - let service_binding = helpers::ServiceProtocol::open(tcp4::SERVICE_BINDING_PROTOCOL_GUID)?; - let protocol = helpers::open_protocol(service_binding.child_handle(), tcp4::PROTOCOL_GUID)?; + let (service_binding, handle) = + helpers::ServiceProtocol::open(tcp4::SERVICE_BINDING_PROTOCOL_GUID)?; + let protocol = helpers::open_protocol(handle, tcp4::PROTOCOL_GUID)?; - Ok(Self { service_binding, protocol, flag: AtomicBool::new(false) }) + Ok(Self { service_binding, handle, protocol, flag: AtomicBool::new(false) }) } pub(crate) fn configure( @@ -42,11 +43,14 @@ impl Tcp4 { (DEFAULT_ADDR, 0) }; - // FIXME: Remove when passive connections with proper subnet handling are added - assert!(station_address.is_none()); - let use_default_address = efi::Boolean::TRUE; - let (station_address, station_port) = (DEFAULT_ADDR, 0); - let subnet_mask = helpers::ipv4_to_r_efi(crate::net::Ipv4Addr::new(0, 0, 0, 0)); + let use_default_address: r_efi::efi::Boolean = + station_address.is_none_or(|addr| addr.ip().is_unspecified()).into(); + let (station_address, station_port) = if let Some(x) = station_address { + (helpers::ipv4_to_r_efi(*x.ip()), x.port()) + } else { + (DEFAULT_ADDR, 0) + }; + let subnet_mask = helpers::ipv4_to_r_efi(crate::net::Ipv4Addr::new(255, 255, 255, 0)); let mut config_data = tcp4::ConfigData { type_of_service: TYPE_OF_SERVICE, @@ -60,7 +64,7 @@ impl Tcp4 { station_port, subnet_mask, }, - control_option: crate::ptr::null_mut(), + control_option: ptr::null_mut(), }; let r = unsafe { ((*protocol).configure)(protocol, &mut config_data) }; @@ -74,17 +78,55 @@ impl Tcp4 { let r = unsafe { ((*protocol).get_mode_data)( protocol, - crate::ptr::null_mut(), + ptr::null_mut(), &mut config_data, - crate::ptr::null_mut(), - crate::ptr::null_mut(), - crate::ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), ) }; if r.is_error() { Err(io::Error::from_raw_os_error(r.as_usize())) } else { Ok(config_data) } } + pub(crate) fn accept(&self) -> io::Result { + let evt = unsafe { self.create_evt() }?; + let completion_token = + tcp4::CompletionToken { event: evt.as_ptr(), status: Status::SUCCESS }; + let mut listen_token = + tcp4::ListenToken { completion_token, new_child_handle: ptr::null_mut() }; + + let protocol = self.protocol.as_ptr(); + let r = unsafe { ((*protocol).accept)(protocol, &mut listen_token) }; + if r.is_error() { + return Err(io::Error::from_raw_os_error(r.as_usize())); + } + + unsafe { self.wait_or_cancel(None, &mut listen_token.completion_token) }?; + + if completion_token.status.is_error() { + Err(io::Error::from_raw_os_error(completion_token.status.as_usize())) + } else { + // EDK2 internals seem to assume a single ServiceBinding Protocol for TCP4 and TCP6, and + // thus does not use any service binding protocol data in destroying child sockets. It + // does seem to suggest that we need to cleanup even the protocols created by accept. To + // be on the safe side with other implementations, we will be using the same service + // binding protocol as the parent TCP4 handle. + // + // https://github.com/tianocore/edk2/blob/f80580f56b267c96f16f985dbf707b2f96947da4/NetworkPkg/TcpDxe/TcpDriver.c#L938 + + let handle = NonNull::new(listen_token.new_child_handle).unwrap(); + let protocol = helpers::open_protocol(handle, tcp4::PROTOCOL_GUID)?; + + Ok(Self { + handle, + service_binding: self.service_binding, + protocol, + flag: AtomicBool::new(false), + }) + } + } + pub(crate) fn connect(&self, timeout: Option) -> io::Result<()> { let evt = unsafe { self.create_evt() }?; let completion_token = @@ -352,6 +394,12 @@ impl Tcp4 { } } +impl Drop for Tcp4 { + fn drop(&mut self) { + let _ = unsafe { self.service_binding.destroy_child(self.handle) }; + } +} + extern "efiapi" fn toggle_atomic_flag(_: r_efi::efi::Event, ctx: *mut crate::ffi::c_void) { let flag = unsafe { AtomicBool::from_ptr(ctx.cast()) }; flag.store(true, Ordering::Relaxed); diff --git a/library/std/src/sys/pal/common/mod.rs b/library/std/src/sys/pal/common/mod.rs deleted file mode 100644 index 9af4dee401cf..000000000000 --- a/library/std/src/sys/pal/common/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -// This module contains code that is shared between all platforms, mostly utility or fallback code. -// This explicitly does not include code that is shared between only a few platforms, -// such as when reusing an implementation from `unix` or `unsupported`. -// In those cases the desired code should be included directly using the #[path] attribute, -// not moved to this module. -// -// Currently `sys_common` contains a lot of code that should live in this module, -// ideally `sys_common` would only contain platform-independent abstractions on top of `sys`. -// Progress on this is tracked in #84187. - -#![allow(dead_code)] - -pub mod small_c_string; - -#[cfg(test)] -mod tests; diff --git a/library/std/src/sys/pal/hermit/mod.rs b/library/std/src/sys/pal/hermit/mod.rs index 52bcd8da2420..0e1328a7972f 100644 --- a/library/std/src/sys/pal/hermit/mod.rs +++ b/library/std/src/sys/pal/hermit/mod.rs @@ -16,7 +16,7 @@ #![deny(unsafe_op_in_unsafe_fn)] #![allow(missing_docs, nonstandard_style)] -use crate::io::ErrorKind; +use crate::io; use crate::os::hermit::hermit_abi; use crate::os::raw::c_char; use crate::sys::env; @@ -25,15 +25,12 @@ pub mod futex; pub mod os; pub mod time; -pub fn unsupported() -> crate::io::Result { +pub fn unsupported() -> io::Result { Err(unsupported_err()) } -pub fn unsupported_err() -> crate::io::Error { - crate::io::const_error!( - crate::io::ErrorKind::Unsupported, - "operation not supported on HermitCore yet", - ) +pub fn unsupported_err() -> io::Error { + io::const_error!(io::ErrorKind::Unsupported, "operation not supported on HermitCore yet") } pub fn abort_internal() -> ! { @@ -83,24 +80,24 @@ pub(crate) fn is_interrupted(errno: i32) -> bool { errno == hermit_abi::errno::EINTR } -pub fn decode_error_kind(errno: i32) -> ErrorKind { +pub fn decode_error_kind(errno: i32) -> io::ErrorKind { match errno { - hermit_abi::errno::EACCES => ErrorKind::PermissionDenied, - hermit_abi::errno::EADDRINUSE => ErrorKind::AddrInUse, - hermit_abi::errno::EADDRNOTAVAIL => ErrorKind::AddrNotAvailable, - hermit_abi::errno::EAGAIN => ErrorKind::WouldBlock, - hermit_abi::errno::ECONNABORTED => ErrorKind::ConnectionAborted, - hermit_abi::errno::ECONNREFUSED => ErrorKind::ConnectionRefused, - hermit_abi::errno::ECONNRESET => ErrorKind::ConnectionReset, - hermit_abi::errno::EEXIST => ErrorKind::AlreadyExists, - hermit_abi::errno::EINTR => ErrorKind::Interrupted, - hermit_abi::errno::EINVAL => ErrorKind::InvalidInput, - hermit_abi::errno::ENOENT => ErrorKind::NotFound, - hermit_abi::errno::ENOTCONN => ErrorKind::NotConnected, - hermit_abi::errno::EPERM => ErrorKind::PermissionDenied, - hermit_abi::errno::EPIPE => ErrorKind::BrokenPipe, - hermit_abi::errno::ETIMEDOUT => ErrorKind::TimedOut, - _ => ErrorKind::Uncategorized, + hermit_abi::errno::EACCES => io::ErrorKind::PermissionDenied, + hermit_abi::errno::EADDRINUSE => io::ErrorKind::AddrInUse, + hermit_abi::errno::EADDRNOTAVAIL => io::ErrorKind::AddrNotAvailable, + hermit_abi::errno::EAGAIN => io::ErrorKind::WouldBlock, + hermit_abi::errno::ECONNABORTED => io::ErrorKind::ConnectionAborted, + hermit_abi::errno::ECONNREFUSED => io::ErrorKind::ConnectionRefused, + hermit_abi::errno::ECONNRESET => io::ErrorKind::ConnectionReset, + hermit_abi::errno::EEXIST => io::ErrorKind::AlreadyExists, + hermit_abi::errno::EINTR => io::ErrorKind::Interrupted, + hermit_abi::errno::EINVAL => io::ErrorKind::InvalidInput, + hermit_abi::errno::ENOENT => io::ErrorKind::NotFound, + hermit_abi::errno::ENOTCONN => io::ErrorKind::NotConnected, + hermit_abi::errno::EPERM => io::ErrorKind::PermissionDenied, + hermit_abi::errno::EPIPE => io::ErrorKind::BrokenPipe, + hermit_abi::errno::ETIMEDOUT => io::ErrorKind::TimedOut, + _ => io::ErrorKind::Uncategorized, } } @@ -133,16 +130,16 @@ impl IsNegative for i32 { } impl_is_negative! { i8 i16 i64 isize } -pub fn cvt(t: T) -> crate::io::Result { +pub fn cvt(t: T) -> io::Result { if t.is_negative() { let e = decode_error_kind(t.negate()); - Err(crate::io::Error::from(e)) + Err(io::Error::from(e)) } else { Ok(t) } } -pub fn cvt_r(mut f: F) -> crate::io::Result +pub fn cvt_r(mut f: F) -> io::Result where T: IsNegative, F: FnMut() -> T, diff --git a/library/std/src/sys/pal/itron/error.rs b/library/std/src/sys/pal/itron/error.rs index 8ff3017c6147..87be7d5b3546 100644 --- a/library/std/src/sys/pal/itron/error.rs +++ b/library/std/src/sys/pal/itron/error.rs @@ -1,6 +1,5 @@ use super::abi; -use crate::fmt; -use crate::io::ErrorKind; +use crate::{fmt, io}; /// Wraps a μITRON error code. #[derive(Debug, Copy, Clone)] @@ -84,39 +83,39 @@ pub fn is_interrupted(er: abi::ER) -> bool { er == abi::E_RLWAI } -pub fn decode_error_kind(er: abi::ER) -> ErrorKind { +pub fn decode_error_kind(er: abi::ER) -> io::ErrorKind { match er { // Success - er if er >= 0 => ErrorKind::Uncategorized, + er if er >= 0 => io::ErrorKind::Uncategorized, // μITRON 4.0 // abi::E_SYS - abi::E_NOSPT => ErrorKind::Unsupported, // Some("unsupported function"), - abi::E_RSFN => ErrorKind::InvalidInput, // Some("reserved function code"), - abi::E_RSATR => ErrorKind::InvalidInput, // Some("reserved attribute"), - abi::E_PAR => ErrorKind::InvalidInput, // Some("parameter error"), - abi::E_ID => ErrorKind::NotFound, // Some("invalid ID number"), + abi::E_NOSPT => io::ErrorKind::Unsupported, // Some("unsupported function"), + abi::E_RSFN => io::ErrorKind::InvalidInput, // Some("reserved function code"), + abi::E_RSATR => io::ErrorKind::InvalidInput, // Some("reserved attribute"), + abi::E_PAR => io::ErrorKind::InvalidInput, // Some("parameter error"), + abi::E_ID => io::ErrorKind::NotFound, // Some("invalid ID number"), // abi::E_CTX - abi::E_MACV => ErrorKind::PermissionDenied, // Some("memory access violation"), - abi::E_OACV => ErrorKind::PermissionDenied, // Some("object access violation"), + abi::E_MACV => io::ErrorKind::PermissionDenied, // Some("memory access violation"), + abi::E_OACV => io::ErrorKind::PermissionDenied, // Some("object access violation"), // abi::E_ILUSE - abi::E_NOMEM => ErrorKind::OutOfMemory, // Some("insufficient memory"), - abi::E_NOID => ErrorKind::OutOfMemory, // Some("no ID number available"), + abi::E_NOMEM => io::ErrorKind::OutOfMemory, // Some("insufficient memory"), + abi::E_NOID => io::ErrorKind::OutOfMemory, // Some("no ID number available"), // abi::E_OBJ - abi::E_NOEXS => ErrorKind::NotFound, // Some("non-existent object"), + abi::E_NOEXS => io::ErrorKind::NotFound, // Some("non-existent object"), // abi::E_QOVR - abi::E_RLWAI => ErrorKind::Interrupted, // Some("forced release from waiting"), - abi::E_TMOUT => ErrorKind::TimedOut, // Some("polling failure or timeout"), + abi::E_RLWAI => io::ErrorKind::Interrupted, // Some("forced release from waiting"), + abi::E_TMOUT => io::ErrorKind::TimedOut, // Some("polling failure or timeout"), // abi::E_DLT // abi::E_CLS // abi::E_WBLK // abi::E_BOVR // The TOPPERS third generation kernels - abi::E_NORES => ErrorKind::OutOfMemory, // Some("insufficient system resources"), + abi::E_NORES => io::ErrorKind::OutOfMemory, // Some("insufficient system resources"), // abi::E_RASTER // abi::E_COMM - _ => ErrorKind::Uncategorized, + _ => io::ErrorKind::Uncategorized, } } diff --git a/library/std/src/sys/pal/mod.rs b/library/std/src/sys/pal/mod.rs index 93ad4536e18f..88d9d4205990 100644 --- a/library/std/src/sys/pal/mod.rs +++ b/library/std/src/sys/pal/mod.rs @@ -1,29 +1,8 @@ -//! Platform-dependent platform abstraction. -//! -//! The `std::sys` module is the abstracted interface through which -//! `std` talks to the underlying operating system. It has different -//! implementations for different operating system families, today -//! just Unix and Windows, and initial support for Redox. -//! -//! The centralization of platform-specific code in this module is -//! enforced by the "platform abstraction layer" tidy script in -//! `tools/tidy/src/pal.rs`. -//! -//! This module is closely related to the platform-independent system -//! integration code in `std::sys_common`. See that module's -//! documentation for details. -//! -//! In the future it would be desirable for the independent -//! implementations of this module to be extracted to their own crates -//! that `std` can link to, thus enabling their implementation -//! out-of-tree via crate replacement. Though due to the complex -//! inter-dependencies within `std` that will be a challenging goal to -//! achieve. +//! The PAL (platform abstraction layer) contains platform-specific abstractions +//! for implementing the features in the other submodules, such as e.g. bindings. #![allow(missing_debug_implementations)] -pub mod common; - cfg_select! { unix => { mod unix; diff --git a/library/std/src/sys/pal/motor/mod.rs b/library/std/src/sys/pal/motor/mod.rs index 9bca264d78ea..016fbe5c154c 100644 --- a/library/std/src/sys/pal/motor/mod.rs +++ b/library/std/src/sys/pal/motor/mod.rs @@ -5,11 +5,11 @@ pub mod time; pub use moto_rt::futex; -use crate::io as std_io; -use crate::sys::RawOsError; +use crate::io; -pub(crate) fn map_motor_error(err: moto_rt::ErrorCode) -> crate::io::Error { - crate::io::Error::from_raw_os_error(err.into()) +pub(crate) fn map_motor_error(err: moto_rt::Error) -> io::Error { + let error_code: moto_rt::ErrorCode = err.into(); + io::Error::from_raw_os_error(error_code.into()) } #[cfg(not(test))] @@ -36,49 +36,50 @@ pub unsafe fn init(_argc: isize, _argv: *const *const u8, _sigpipe: u8) {} // NOTE: this is not guaranteed to run, for example when the program aborts. pub unsafe fn cleanup() {} -pub fn unsupported() -> std_io::Result { +pub fn unsupported() -> io::Result { Err(unsupported_err()) } -pub fn unsupported_err() -> std_io::Error { - std_io::Error::UNSUPPORTED_PLATFORM +pub fn unsupported_err() -> io::Error { + io::Error::UNSUPPORTED_PLATFORM } -pub fn is_interrupted(_code: RawOsError) -> bool { +pub fn is_interrupted(_code: io::RawOsError) -> bool { false // Motor OS doesn't have signals. } -pub fn decode_error_kind(code: RawOsError) -> crate::io::ErrorKind { +pub fn decode_error_kind(code: io::RawOsError) -> io::ErrorKind { use moto_rt::error::*; - use std_io::ErrorKind; if code < 0 || code > u16::MAX.into() { - return std_io::ErrorKind::Uncategorized; + return io::ErrorKind::Uncategorized; } - match code as moto_rt::ErrorCode /* u16 */ { - E_UNSPECIFIED => ErrorKind::Uncategorized, - E_UNKNOWN => ErrorKind::Uncategorized, - E_NOT_READY => ErrorKind::WouldBlock, - E_NOT_IMPLEMENTED => ErrorKind::Unsupported, - E_VERSION_TOO_HIGH => ErrorKind::Unsupported, - E_VERSION_TOO_LOW => ErrorKind::Unsupported, - E_INVALID_ARGUMENT => ErrorKind::InvalidInput, - E_OUT_OF_MEMORY => ErrorKind::OutOfMemory, - E_NOT_ALLOWED => ErrorKind::PermissionDenied, - E_NOT_FOUND => ErrorKind::NotFound, - E_INTERNAL_ERROR => ErrorKind::Other, - E_TIMED_OUT => ErrorKind::TimedOut, - E_ALREADY_IN_USE => ErrorKind::AlreadyExists, - E_UNEXPECTED_EOF => ErrorKind::UnexpectedEof, - E_INVALID_FILENAME => ErrorKind::InvalidFilename, - E_NOT_A_DIRECTORY => ErrorKind::NotADirectory, - E_BAD_HANDLE => ErrorKind::InvalidInput, - E_FILE_TOO_LARGE => ErrorKind::FileTooLarge, - E_NOT_CONNECTED => ErrorKind::NotConnected, - E_STORAGE_FULL => ErrorKind::StorageFull, - E_INVALID_DATA => ErrorKind::InvalidData, - _ => crate::io::ErrorKind::Uncategorized, + let error = moto_rt::Error::from(code as moto_rt::ErrorCode); + + match error { + moto_rt::Error::Unspecified => io::ErrorKind::Uncategorized, + moto_rt::Error::Unknown => io::ErrorKind::Uncategorized, + moto_rt::Error::NotReady => io::ErrorKind::WouldBlock, + moto_rt::Error::NotImplemented => io::ErrorKind::Unsupported, + moto_rt::Error::VersionTooHigh => io::ErrorKind::Unsupported, + moto_rt::Error::VersionTooLow => io::ErrorKind::Unsupported, + moto_rt::Error::InvalidArgument => io::ErrorKind::InvalidInput, + moto_rt::Error::OutOfMemory => io::ErrorKind::OutOfMemory, + moto_rt::Error::NotAllowed => io::ErrorKind::PermissionDenied, + moto_rt::Error::NotFound => io::ErrorKind::NotFound, + moto_rt::Error::InternalError => io::ErrorKind::Other, + moto_rt::Error::TimedOut => io::ErrorKind::TimedOut, + moto_rt::Error::AlreadyInUse => io::ErrorKind::AlreadyExists, + moto_rt::Error::UnexpectedEof => io::ErrorKind::UnexpectedEof, + moto_rt::Error::InvalidFilename => io::ErrorKind::InvalidFilename, + moto_rt::Error::NotADirectory => io::ErrorKind::NotADirectory, + moto_rt::Error::BadHandle => io::ErrorKind::InvalidInput, + moto_rt::Error::FileTooLarge => io::ErrorKind::FileTooLarge, + moto_rt::Error::NotConnected => io::ErrorKind::NotConnected, + moto_rt::Error::StorageFull => io::ErrorKind::StorageFull, + moto_rt::Error::InvalidData => io::ErrorKind::InvalidData, + _ => io::ErrorKind::Uncategorized, } } diff --git a/library/std/src/sys/pal/motor/os.rs b/library/std/src/sys/pal/motor/os.rs index 052e3b238b6a..0367c905b453 100644 --- a/library/std/src/sys/pal/motor/os.rs +++ b/library/std/src/sys/pal/motor/os.rs @@ -4,7 +4,7 @@ use crate::ffi::{OsStr, OsString}; use crate::marker::PhantomData; use crate::os::motor::ffi::OsStrExt; use crate::path::{self, PathBuf}; -use crate::sys::RawOsError; +use crate::sys::io::RawOsError; use crate::{fmt, io}; pub fn errno() -> RawOsError { @@ -22,16 +22,17 @@ pub fn errno() -> RawOsError { // separate runtime background/I/O thread, so it is really hard // to define what "last system error in the current thread" // actually means. - moto_rt::E_UNKNOWN.into() + let error_code: moto_rt::ErrorCode = moto_rt::Error::Unknown.into(); + error_code.into() } pub fn error_string(errno: RawOsError) -> String { - let error_code: moto_rt::ErrorCode = match errno { - x if x < 0 => moto_rt::E_UNKNOWN, - x if x > u16::MAX.into() => moto_rt::E_UNKNOWN, - x => x as moto_rt::ErrorCode, /* u16 */ + let error: moto_rt::Error = match errno { + x if x < 0 => moto_rt::Error::Unknown, + x if x > u16::MAX.into() => moto_rt::Error::Unknown, + x => (x as moto_rt::ErrorCode).into(), /* u16 */ }; - format!("{}", moto_rt::Error::from(error_code)) + format!("{}", error) } pub fn getcwd() -> io::Result { diff --git a/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs b/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs index 5041770faf66..f49e940c5044 100644 --- a/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs +++ b/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs @@ -1,7 +1,5 @@ use crate::cmp; -use crate::io::{ - BorrowedCursor, Error as IoError, ErrorKind, IoSlice, IoSliceMut, Result as IoResult, -}; +use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut}; use crate::random::random; use crate::time::{Duration, Instant}; @@ -18,7 +16,7 @@ use self::raw::*; /// This will do a single `read` usercall and scatter the read data among /// `bufs`. To read to a single buffer, just pass a slice of length one. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn read(fd: Fd, bufs: &mut [IoSliceMut<'_>]) -> IoResult { +pub fn read(fd: Fd, bufs: &mut [IoSliceMut<'_>]) -> io::Result { unsafe { let total_len = bufs.iter().fold(0usize, |sum, buf| sum.saturating_add(buf.len())); let mut userbuf = alloc::User::<[u8]>::uninitialized(total_len); @@ -41,7 +39,7 @@ pub fn read(fd: Fd, bufs: &mut [IoSliceMut<'_>]) -> IoResult { /// Usercall `read` with an uninitialized buffer. See the ABI documentation for /// more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn read_buf(fd: Fd, mut buf: BorrowedCursor<'_>) -> IoResult<()> { +pub fn read_buf(fd: Fd, mut buf: BorrowedCursor<'_>) -> io::Result<()> { unsafe { let mut userbuf = alloc::User::<[u8]>::uninitialized(buf.capacity()); let len = raw::read(fd, userbuf.as_mut_ptr().cast(), userbuf.len()).from_sgx_result()?; @@ -53,7 +51,7 @@ pub fn read_buf(fd: Fd, mut buf: BorrowedCursor<'_>) -> IoResult<()> { /// Usercall `read_alloc`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn read_alloc(fd: Fd) -> IoResult> { +pub fn read_alloc(fd: Fd) -> io::Result> { unsafe { let userbuf = ByteBuffer { data: crate::ptr::null_mut(), len: 0 }; let mut userbuf = alloc::User::new_from_enclave(&userbuf); @@ -67,7 +65,7 @@ pub fn read_alloc(fd: Fd) -> IoResult> { /// This will do a single `write` usercall and gather the written data from /// `bufs`. To write from a single buffer, just pass a slice of length one. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn write(fd: Fd, bufs: &[IoSlice<'_>]) -> IoResult { +pub fn write(fd: Fd, bufs: &[IoSlice<'_>]) -> io::Result { unsafe { let total_len = bufs.iter().fold(0usize, |sum, buf| sum.saturating_add(buf.len())); let mut userbuf = alloc::User::<[u8]>::uninitialized(total_len); @@ -87,7 +85,7 @@ pub fn write(fd: Fd, bufs: &[IoSlice<'_>]) -> IoResult { /// Usercall `flush`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn flush(fd: Fd) -> IoResult<()> { +pub fn flush(fd: Fd) -> io::Result<()> { unsafe { raw::flush(fd).from_sgx_result() } } @@ -104,7 +102,7 @@ fn string_from_bytebuffer(buf: &alloc::UserRef, usercall: &str, arg: /// Usercall `bind_stream`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn bind_stream(addr: &str) -> IoResult<(Fd, String)> { +pub fn bind_stream(addr: &str) -> io::Result<(Fd, String)> { unsafe { let addr_user = alloc::User::new_from_enclave(addr.as_bytes()); let mut local = alloc::User::::uninitialized(); @@ -117,7 +115,7 @@ pub fn bind_stream(addr: &str) -> IoResult<(Fd, String)> { /// Usercall `accept_stream`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn accept_stream(fd: Fd) -> IoResult<(Fd, String, String)> { +pub fn accept_stream(fd: Fd) -> io::Result<(Fd, String, String)> { unsafe { let mut bufs = alloc::User::<[ByteBuffer; 2]>::uninitialized(); let mut buf_it = alloc::UserRef::iter_mut(&mut *bufs); // FIXME: can this be done @@ -133,7 +131,7 @@ pub fn accept_stream(fd: Fd) -> IoResult<(Fd, String, String)> { /// Usercall `connect_stream`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn connect_stream(addr: &str) -> IoResult<(Fd, String, String)> { +pub fn connect_stream(addr: &str) -> io::Result<(Fd, String, String)> { unsafe { let addr_user = alloc::User::new_from_enclave(addr.as_bytes()); let mut bufs = alloc::User::<[ByteBuffer; 2]>::uninitialized(); @@ -155,7 +153,7 @@ pub fn connect_stream(addr: &str) -> IoResult<(Fd, String, String)> { /// Usercall `launch_thread`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub unsafe fn launch_thread() -> IoResult<()> { +pub unsafe fn launch_thread() -> io::Result<()> { // SAFETY: The caller must uphold the safety contract for `launch_thread`. unsafe { raw::launch_thread().from_sgx_result() } } @@ -168,7 +166,7 @@ pub fn exit(panic: bool) -> ! { /// Usercall `wait`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn wait(event_mask: u64, mut timeout: u64) -> IoResult { +pub fn wait(event_mask: u64, mut timeout: u64) -> io::Result { if timeout != WAIT_NO && timeout != WAIT_INDEFINITE { // We don't want people to rely on accuracy of timeouts to make // security decisions in an SGX enclave. That's why we add a random @@ -216,7 +214,9 @@ where true } Err(e) => { - rtassert!(e.kind() == ErrorKind::TimedOut || e.kind() == ErrorKind::WouldBlock); + rtassert!( + e.kind() == io::ErrorKind::TimedOut || e.kind() == io::ErrorKind::WouldBlock + ); false } } @@ -260,7 +260,7 @@ where /// Usercall `send`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn send(event_set: u64, tcs: Option) -> IoResult<()> { +pub fn send(event_set: u64, tcs: Option) -> io::Result<()> { unsafe { raw::send(event_set, tcs).from_sgx_result() } } @@ -273,7 +273,7 @@ pub fn insecure_time() -> Duration { /// Usercall `alloc`. See the ABI documentation for more information. #[unstable(feature = "sgx_platform", issue = "56975")] -pub fn alloc(size: usize, alignment: usize) -> IoResult<*mut u8> { +pub fn alloc(size: usize, alignment: usize) -> io::Result<*mut u8> { unsafe { raw::alloc(size, alignment).from_sgx_result() } } @@ -316,18 +316,18 @@ pub trait FromSgxResult { type Return; /// Translate the raw result of an SGX usercall. - fn from_sgx_result(self) -> IoResult; + fn from_sgx_result(self) -> io::Result; } #[unstable(feature = "sgx_platform", issue = "56975")] impl FromSgxResult for (Result, T) { type Return = T; - fn from_sgx_result(self) -> IoResult { + fn from_sgx_result(self) -> io::Result { if self.0 == RESULT_SUCCESS { Ok(self.1) } else { - Err(IoError::from_raw_os_error(check_os_error(self.0))) + Err(io::Error::from_raw_os_error(check_os_error(self.0))) } } } @@ -336,11 +336,11 @@ impl FromSgxResult for (Result, T) { impl FromSgxResult for Result { type Return = (); - fn from_sgx_result(self) -> IoResult { + fn from_sgx_result(self) -> io::Result { if self == RESULT_SUCCESS { Ok(()) } else { - Err(IoError::from_raw_os_error(check_os_error(self))) + Err(io::Error::from_raw_os_error(check_os_error(self))) } } } diff --git a/library/std/src/sys/pal/sgx/mod.rs b/library/std/src/sys/pal/sgx/mod.rs index 7a207ceb329e..a067480508c7 100644 --- a/library/std/src/sys/pal/sgx/mod.rs +++ b/library/std/src/sys/pal/sgx/mod.rs @@ -5,7 +5,7 @@ #![deny(unsafe_op_in_unsafe_fn)] #![allow(fuzzy_provenance_casts)] // FIXME: this entire module systematically confuses pointers and integers -use crate::io::ErrorKind; +use crate::io; use crate::sync::atomic::{Atomic, AtomicBool, Ordering}; pub mod abi; @@ -29,12 +29,12 @@ pub unsafe fn cleanup() {} /// This function is used to implement functionality that simply doesn't exist. /// Programs relying on this functionality will need to deal with the error. -pub fn unsupported() -> crate::io::Result { +pub fn unsupported() -> io::Result { Err(unsupported_err()) } -pub fn unsupported_err() -> crate::io::Error { - crate::io::const_error!(ErrorKind::Unsupported, "operation not supported on SGX yet") +pub fn unsupported_err() -> io::Error { + io::const_error!(io::ErrorKind::Unsupported, "operation not supported on SGX yet") } /// This function is used to implement various functions that doesn't exist, @@ -42,11 +42,11 @@ pub fn unsupported_err() -> crate::io::Error { /// returned, the program might very well be able to function normally. This is /// what happens when `SGX_INEFFECTIVE_ERROR` is set to `true`. If it is /// `false`, the behavior is the same as `unsupported`. -pub fn sgx_ineffective(v: T) -> crate::io::Result { +pub fn sgx_ineffective(v: T) -> io::Result { static SGX_INEFFECTIVE_ERROR: Atomic = AtomicBool::new(false); if SGX_INEFFECTIVE_ERROR.load(Ordering::Relaxed) { - Err(crate::io::const_error!( - ErrorKind::Uncategorized, + Err(io::const_error!( + io::ErrorKind::Uncategorized, "operation can't be trusted to have any effect on SGX", )) } else { @@ -59,48 +59,48 @@ pub fn is_interrupted(code: i32) -> bool { code == fortanix_sgx_abi::Error::Interrupted as _ } -pub fn decode_error_kind(code: i32) -> ErrorKind { +pub fn decode_error_kind(code: i32) -> io::ErrorKind { use fortanix_sgx_abi::Error; // FIXME: not sure how to make sure all variants of Error are covered if code == Error::NotFound as _ { - ErrorKind::NotFound + io::ErrorKind::NotFound } else if code == Error::PermissionDenied as _ { - ErrorKind::PermissionDenied + io::ErrorKind::PermissionDenied } else if code == Error::ConnectionRefused as _ { - ErrorKind::ConnectionRefused + io::ErrorKind::ConnectionRefused } else if code == Error::ConnectionReset as _ { - ErrorKind::ConnectionReset + io::ErrorKind::ConnectionReset } else if code == Error::ConnectionAborted as _ { - ErrorKind::ConnectionAborted + io::ErrorKind::ConnectionAborted } else if code == Error::NotConnected as _ { - ErrorKind::NotConnected + io::ErrorKind::NotConnected } else if code == Error::AddrInUse as _ { - ErrorKind::AddrInUse + io::ErrorKind::AddrInUse } else if code == Error::AddrNotAvailable as _ { - ErrorKind::AddrNotAvailable + io::ErrorKind::AddrNotAvailable } else if code == Error::BrokenPipe as _ { - ErrorKind::BrokenPipe + io::ErrorKind::BrokenPipe } else if code == Error::AlreadyExists as _ { - ErrorKind::AlreadyExists + io::ErrorKind::AlreadyExists } else if code == Error::WouldBlock as _ { - ErrorKind::WouldBlock + io::ErrorKind::WouldBlock } else if code == Error::InvalidInput as _ { - ErrorKind::InvalidInput + io::ErrorKind::InvalidInput } else if code == Error::InvalidData as _ { - ErrorKind::InvalidData + io::ErrorKind::InvalidData } else if code == Error::TimedOut as _ { - ErrorKind::TimedOut + io::ErrorKind::TimedOut } else if code == Error::WriteZero as _ { - ErrorKind::WriteZero + io::ErrorKind::WriteZero } else if code == Error::Interrupted as _ { - ErrorKind::Interrupted + io::ErrorKind::Interrupted } else if code == Error::Other as _ { - ErrorKind::Uncategorized + io::ErrorKind::Uncategorized } else if code == Error::UnexpectedEof as _ { - ErrorKind::UnexpectedEof + io::ErrorKind::UnexpectedEof } else { - ErrorKind::Uncategorized + io::ErrorKind::Uncategorized } } diff --git a/library/std/src/sys/pal/sgx/thread_parking.rs b/library/std/src/sys/pal/sgx/thread_parking.rs index 660624ea9c3b..6510a3ab211f 100644 --- a/library/std/src/sys/pal/sgx/thread_parking.rs +++ b/library/std/src/sys/pal/sgx/thread_parking.rs @@ -1,7 +1,7 @@ use fortanix_sgx_abi::{EV_UNPARK, WAIT_INDEFINITE}; use super::abi::usercalls; -use crate::io::ErrorKind; +use crate::io; use crate::time::Duration; pub type ThreadId = fortanix_sgx_abi::Tcs; @@ -15,7 +15,7 @@ pub fn park(_hint: usize) { pub fn park_timeout(dur: Duration, _hint: usize) { let timeout = u128::min(dur.as_nanos(), WAIT_INDEFINITE as u128 - 1) as u64; if let Err(e) = usercalls::wait(EV_UNPARK, timeout) { - assert!(matches!(e.kind(), ErrorKind::TimedOut | ErrorKind::WouldBlock)) + assert!(matches!(e.kind(), io::ErrorKind::TimedOut | io::ErrorKind::WouldBlock)) } } diff --git a/library/std/src/sys/pal/solid/error.rs b/library/std/src/sys/pal/solid/error.rs index b399463c0c28..3e85cdb3c1d9 100644 --- a/library/std/src/sys/pal/solid/error.rs +++ b/library/std/src/sys/pal/solid/error.rs @@ -1,6 +1,6 @@ pub use self::itron::error::{ItronError as SolidError, expect_success}; use super::{abi, itron}; -use crate::io::ErrorKind; +use crate::io; use crate::sys::net; /// Describe the specified SOLID error code. Returns `None` if it's an @@ -31,23 +31,23 @@ pub fn error_name(er: abi::ER) -> Option<&'static str> { } } -pub fn decode_error_kind(er: abi::ER) -> ErrorKind { +pub fn decode_error_kind(er: abi::ER) -> io::ErrorKind { match er { // Success - er if er >= 0 => ErrorKind::Uncategorized, + er if er >= 0 => io::ErrorKind::Uncategorized, er if er < abi::sockets::SOLID_NET_ERR_BASE => net::decode_error_kind(er), - abi::SOLID_ERR_NOTFOUND => ErrorKind::NotFound, - abi::SOLID_ERR_NOTSUPPORTED => ErrorKind::Unsupported, - abi::SOLID_ERR_EBADF => ErrorKind::InvalidInput, - abi::SOLID_ERR_INVALIDCONTENT => ErrorKind::InvalidData, + abi::SOLID_ERR_NOTFOUND => io::ErrorKind::NotFound, + abi::SOLID_ERR_NOTSUPPORTED => io::ErrorKind::Unsupported, + abi::SOLID_ERR_EBADF => io::ErrorKind::InvalidInput, + abi::SOLID_ERR_INVALIDCONTENT => io::ErrorKind::InvalidData, // abi::SOLID_ERR_NOTUSED // abi::SOLID_ERR_ALREADYUSED - abi::SOLID_ERR_OUTOFBOUND => ErrorKind::InvalidInput, + abi::SOLID_ERR_OUTOFBOUND => io::ErrorKind::InvalidInput, // abi::SOLID_ERR_BADSEQUENCE - abi::SOLID_ERR_UNKNOWNDEVICE => ErrorKind::NotFound, + abi::SOLID_ERR_UNKNOWNDEVICE => io::ErrorKind::NotFound, // abi::SOLID_ERR_BUSY - abi::SOLID_ERR_TIMEOUT => ErrorKind::TimedOut, + abi::SOLID_ERR_TIMEOUT => io::ErrorKind::TimedOut, // abi::SOLID_ERR_INVALIDACCESS // abi::SOLID_ERR_NOTREADY _ => itron::error::decode_error_kind(er), diff --git a/library/std/src/sys/pal/solid/mod.rs b/library/std/src/sys/pal/solid/mod.rs index 33df9116f5c2..01477c7dc5e9 100644 --- a/library/std/src/sys/pal/solid/mod.rs +++ b/library/std/src/sys/pal/solid/mod.rs @@ -2,6 +2,8 @@ #![allow(missing_docs, nonstandard_style)] #![forbid(unsafe_op_in_unsafe_fn)] +use crate::io; + pub mod abi; #[path = "../itron"] @@ -28,12 +30,12 @@ pub unsafe fn init(_argc: isize, _argv: *const *const u8, _sigpipe: u8) {} // SAFETY: must be called only once during runtime cleanup. pub unsafe fn cleanup() {} -pub fn unsupported() -> crate::io::Result { +pub fn unsupported() -> io::Result { Err(unsupported_err()) } -pub fn unsupported_err() -> crate::io::Error { - crate::io::Error::UNSUPPORTED_PLATFORM +pub fn unsupported_err() -> io::Error { + io::Error::UNSUPPORTED_PLATFORM } #[inline] @@ -41,7 +43,7 @@ pub fn is_interrupted(code: i32) -> bool { crate::sys::net::is_interrupted(code) } -pub fn decode_error_kind(code: i32) -> crate::io::ErrorKind { +pub fn decode_error_kind(code: i32) -> io::ErrorKind { error::decode_error_kind(code) } diff --git a/library/std/src/sys/pal/teeos/mod.rs b/library/std/src/sys/pal/teeos/mod.rs index fe2dd9c6c493..627096b11c38 100644 --- a/library/std/src/sys/pal/teeos/mod.rs +++ b/library/std/src/sys/pal/teeos/mod.rs @@ -19,7 +19,7 @@ pub mod sync { pub use mutex::Mutex; } -use crate::io::ErrorKind; +use crate::io; pub fn abort_internal() -> ! { unsafe { libc::abort() } @@ -44,8 +44,8 @@ pub(crate) fn is_interrupted(errno: i32) -> bool { } // Note: code below is 1:1 copied from unix/mod.rs -pub fn decode_error_kind(errno: i32) -> ErrorKind { - use ErrorKind::*; +pub fn decode_error_kind(errno: i32) -> io::ErrorKind { + use io::ErrorKind::*; match errno as libc::c_int { libc::E2BIG => ArgumentListTooLong, libc::EADDRINUSE => AddrInUse, @@ -108,32 +108,31 @@ macro_rules! impl_is_minus_one { impl_is_minus_one! { i8 i16 i32 i64 isize } -pub fn cvt(t: T) -> crate::io::Result { - if t.is_minus_one() { Err(crate::io::Error::last_os_error()) } else { Ok(t) } +pub fn cvt(t: T) -> io::Result { + if t.is_minus_one() { Err(io::Error::last_os_error()) } else { Ok(t) } } -pub fn cvt_r(mut f: F) -> crate::io::Result +pub fn cvt_r(mut f: F) -> io::Result where T: IsMinusOne, F: FnMut() -> T, { loop { match cvt(f()) { - Err(ref e) if e.kind() == ErrorKind::Interrupted => {} + Err(ref e) if e.kind() == io::ErrorKind::Interrupted => {} other => return other, } } } -pub fn cvt_nz(error: libc::c_int) -> crate::io::Result<()> { - if error == 0 { Ok(()) } else { Err(crate::io::Error::from_raw_os_error(error)) } +pub fn cvt_nz(error: libc::c_int) -> io::Result<()> { + if error == 0 { Ok(()) } else { Err(io::Error::from_raw_os_error(error)) } } -use crate::io as std_io; -pub fn unsupported() -> std_io::Result { +pub fn unsupported() -> io::Result { Err(unsupported_err()) } -pub fn unsupported_err() -> std_io::Error { - std_io::Error::UNSUPPORTED_PLATFORM +pub fn unsupported_err() -> io::Error { + io::Error::UNSUPPORTED_PLATFORM } diff --git a/library/std/src/sys/pal/uefi/helpers.rs b/library/std/src/sys/pal/uefi/helpers.rs index d059be010e98..9db72db60677 100644 --- a/library/std/src/sys/pal/uefi/helpers.rs +++ b/library/std/src/sys/pal/uefi/helpers.rs @@ -10,7 +10,7 @@ //! - More information about protocols can be found [here](https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/3_foundation/36_protocols_and_handles) use r_efi::efi::{self, Guid}; -use r_efi::protocols::{device_path, device_path_to_text, service_binding, shell}; +use r_efi::protocols::{device_path, device_path_to_text, file, service_binding, shell}; use crate::alloc::Layout; use crate::ffi::{OsStr, OsString}; @@ -24,7 +24,7 @@ use crate::path::Path; use crate::ptr::NonNull; use crate::slice; use crate::sync::atomic::{Atomic, AtomicPtr, Ordering}; -use crate::sys_common::wstr::WStrUnits; +use crate::sys::helpers::WStrUnits; type BootInstallMultipleProtocolInterfaces = unsafe extern "efiapi" fn(_: *mut r_efi::efi::Handle, _: ...) -> r_efi::efi::Status; @@ -651,34 +651,38 @@ pub(crate) fn get_device_path_from_map(map: &Path) -> io::Result, - child_handle: NonNull, } impl ServiceProtocol { - pub(crate) fn open(service_guid: r_efi::efi::Guid) -> io::Result { + /// Open a child handle on a service_binding protocol. + pub(crate) fn open( + service_guid: r_efi::efi::Guid, + ) -> io::Result<(Self, NonNull)> { let handles = locate_handles(service_guid)?; for handle in handles { if let Ok(protocol) = open_protocol::(handle, service_guid) { - let Ok(child_handle) = Self::create_child(protocol) else { - continue; - }; - - return Ok(Self { service_guid, handle, child_handle }); + if let Ok(child_handle) = unsafe { Self::create_child(protocol) } { + return Ok((Self { service_guid, handle }, child_handle)); + } } } Err(io::const_error!(io::ErrorKind::NotFound, "no service binding protocol found")) } - pub(crate) fn child_handle(&self) -> NonNull { - self.child_handle - } - - fn create_child( + // SAFETY: sbp must be a valid service binding protocol pointer + unsafe fn create_child( sbp: NonNull, ) -> io::Result> { let mut child_handle: r_efi::efi::Handle = crate::ptr::null_mut(); @@ -692,17 +696,17 @@ impl ServiceProtocol { .ok_or(const_error!(io::ErrorKind::Other, "null child handle")) } } -} -impl Drop for ServiceProtocol { - fn drop(&mut self) { - if let Ok(sbp) = open_protocol::(self.handle, self.service_guid) - { - // SAFETY: Child handle must be allocated by the current service binding protocol. - let _ = unsafe { - ((*sbp.as_ptr()).destroy_child)(sbp.as_ptr(), self.child_handle.as_ptr()) - }; - } + // SAFETY: Child handle must be allocated by the current service binding protocol and must be + // valid. + pub(crate) unsafe fn destroy_child( + &self, + handle: NonNull, + ) -> io::Result<()> { + let sbp = open_protocol::(self.handle, self.service_guid)?; + + let r = unsafe { ((*sbp.as_ptr()).destroy_child)(sbp.as_ptr(), handle.as_ptr()) }; + if r.is_error() { Err(crate::io::Error::from_raw_os_error(r.as_usize())) } else { Ok(()) } } } @@ -787,7 +791,7 @@ impl UefiBox { match NonNull::new(ptr.cast()) { Some(inner) => Ok(Self { inner, size: len }), - None => Err(io::Error::new(io::ErrorKind::OutOfMemory, "Allocation failed")), + None => Err(const_error!(io::ErrorKind::OutOfMemory, "Allocation failed")), } } @@ -814,3 +818,58 @@ impl Drop for UefiBox { unsafe { crate::alloc::dealloc(self.inner.as_ptr().cast(), layout) }; } } + +impl UefiBox { + fn size(&self) -> u64 { + unsafe { (*self.as_ptr()).size } + } + + fn set_size(&mut self, s: u64) { + unsafe { (*self.as_mut_ptr()).size = s } + } + + // Length of string (including NULL), not number of bytes. + fn file_name_len(&self) -> usize { + (self.size() as usize - size_of::>()) / size_of::() + } + + pub(crate) fn file_name(&self) -> &[u16] { + unsafe { + crate::slice::from_raw_parts((*self.as_ptr()).file_name.as_ptr(), self.file_name_len()) + } + } + + fn file_name_mut(&mut self) -> &mut [u16] { + unsafe { + crate::slice::from_raw_parts_mut( + (*self.as_mut_ptr()).file_name.as_mut_ptr(), + self.file_name_len(), + ) + } + } + + pub(crate) fn with_file_name(mut self, name: &OsStr) -> io::Result { + // os_string_to_raw returns NULL terminated string. So no need to handle it separately. + let fname = os_string_to_raw(name) + .ok_or(const_error!(io::ErrorKind::OutOfMemory, "Allocation failed"))?; + let new_size = size_of::>() + fname.len() * size_of::(); + + // Reuse the current structure if the new name can fit in it. + if self.size() >= new_size as u64 { + self.file_name_mut()[..fname.len()].copy_from_slice(&fname); + self.set_size(new_size as u64); + + return Ok(self); + } + + let mut new_box = UefiBox::new(new_size)?; + + unsafe { + crate::ptr::copy_nonoverlapping(self.as_ptr(), new_box.as_mut_ptr(), 1); + } + new_box.set_size(new_size as u64); + new_box.file_name_mut().copy_from_slice(&fname); + + Ok(new_box) + } +} diff --git a/library/std/src/sys/pal/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs index 61725b2ed048..e2f99d6751f5 100644 --- a/library/std/src/sys/pal/uefi/mod.rs +++ b/library/std/src/sys/pal/uefi/mod.rs @@ -13,8 +13,6 @@ //! [`OsString`]: crate::ffi::OsString #![forbid(unsafe_op_in_unsafe_fn)] -use crate::io::RawOsError; - pub mod helpers; pub mod os; pub mod time; @@ -22,7 +20,7 @@ pub mod time; #[cfg(test)] mod tests; -use crate::io as std_io; +use crate::io; use crate::os::uefi; use crate::ptr::NonNull; use crate::sync::atomic::{Atomic, AtomicPtr, Ordering}; @@ -76,20 +74,18 @@ pub unsafe fn cleanup() { } #[inline] -pub const fn unsupported() -> std_io::Result { +pub const fn unsupported() -> io::Result { Err(unsupported_err()) } #[inline] -pub const fn unsupported_err() -> std_io::Error { - std_io::const_error!(std_io::ErrorKind::Unsupported, "operation not supported on UEFI") +pub const fn unsupported_err() -> io::Error { + io::const_error!(io::ErrorKind::Unsupported, "operation not supported on UEFI") } -pub fn decode_error_kind(code: RawOsError) -> crate::io::ErrorKind { +pub fn decode_error_kind(code: io::RawOsError) -> io::ErrorKind { use r_efi::efi::Status; - use crate::io::ErrorKind; - match r_efi::efi::Status::from_usize(code) { Status::ALREADY_STARTED | Status::COMPROMISED_DATA @@ -108,28 +104,28 @@ pub fn decode_error_kind(code: RawOsError) -> crate::io::ErrorKind { | Status::PROTOCOL_ERROR | Status::PROTOCOL_UNREACHABLE | Status::TFTP_ERROR - | Status::VOLUME_CORRUPTED => ErrorKind::Other, - Status::BAD_BUFFER_SIZE | Status::INVALID_LANGUAGE => ErrorKind::InvalidData, - Status::ABORTED => ErrorKind::ConnectionAborted, - Status::ACCESS_DENIED => ErrorKind::PermissionDenied, - Status::BUFFER_TOO_SMALL => ErrorKind::FileTooLarge, - Status::CONNECTION_REFUSED => ErrorKind::ConnectionRefused, - Status::CONNECTION_RESET => ErrorKind::ConnectionReset, - Status::END_OF_FILE => ErrorKind::UnexpectedEof, - Status::HOST_UNREACHABLE => ErrorKind::HostUnreachable, - Status::INVALID_PARAMETER => ErrorKind::InvalidInput, - Status::IP_ADDRESS_CONFLICT => ErrorKind::AddrInUse, - Status::NETWORK_UNREACHABLE => ErrorKind::NetworkUnreachable, - Status::NO_RESPONSE => ErrorKind::HostUnreachable, - Status::NOT_FOUND => ErrorKind::NotFound, - Status::NOT_READY => ErrorKind::ResourceBusy, - Status::OUT_OF_RESOURCES => ErrorKind::OutOfMemory, - Status::SECURITY_VIOLATION => ErrorKind::PermissionDenied, - Status::TIMEOUT => ErrorKind::TimedOut, - Status::UNSUPPORTED => ErrorKind::Unsupported, - Status::VOLUME_FULL => ErrorKind::StorageFull, - Status::WRITE_PROTECTED => ErrorKind::ReadOnlyFilesystem, - _ => ErrorKind::Uncategorized, + | Status::VOLUME_CORRUPTED => io::ErrorKind::Other, + Status::BAD_BUFFER_SIZE | Status::INVALID_LANGUAGE => io::ErrorKind::InvalidData, + Status::ABORTED => io::ErrorKind::ConnectionAborted, + Status::ACCESS_DENIED => io::ErrorKind::PermissionDenied, + Status::BUFFER_TOO_SMALL => io::ErrorKind::FileTooLarge, + Status::CONNECTION_REFUSED => io::ErrorKind::ConnectionRefused, + Status::CONNECTION_RESET => io::ErrorKind::ConnectionReset, + Status::END_OF_FILE => io::ErrorKind::UnexpectedEof, + Status::HOST_UNREACHABLE => io::ErrorKind::HostUnreachable, + Status::INVALID_PARAMETER => io::ErrorKind::InvalidInput, + Status::IP_ADDRESS_CONFLICT => io::ErrorKind::AddrInUse, + Status::NETWORK_UNREACHABLE => io::ErrorKind::NetworkUnreachable, + Status::NO_RESPONSE => io::ErrorKind::HostUnreachable, + Status::NOT_FOUND => io::ErrorKind::NotFound, + Status::NOT_READY => io::ErrorKind::ResourceBusy, + Status::OUT_OF_RESOURCES => io::ErrorKind::OutOfMemory, + Status::SECURITY_VIOLATION => io::ErrorKind::PermissionDenied, + Status::TIMEOUT => io::ErrorKind::TimedOut, + Status::UNSUPPORTED => io::ErrorKind::Unsupported, + Status::VOLUME_FULL => io::ErrorKind::StorageFull, + Status::WRITE_PROTECTED => io::ErrorKind::ReadOnlyFilesystem, + _ => io::ErrorKind::Uncategorized, } } @@ -163,6 +159,6 @@ extern "efiapi" fn exit_boot_service_handler(_e: r_efi::efi::Event, _ctx: *mut c uefi::env::disable_boot_services(); } -pub fn is_interrupted(_code: RawOsError) -> bool { +pub fn is_interrupted(_code: io::RawOsError) -> bool { false } diff --git a/library/std/src/sys/pal/uefi/os.rs b/library/std/src/sys/pal/uefi/os.rs index aae6cb9e0646..5593e195178d 100644 --- a/library/std/src/sys/pal/uefi/os.rs +++ b/library/std/src/sys/pal/uefi/os.rs @@ -1,7 +1,7 @@ use r_efi::efi::Status; use r_efi::efi::protocols::{device_path, loaded_image_device_path}; -use super::{RawOsError, helpers, unsupported_err}; +use super::{helpers, unsupported_err}; use crate::ffi::{OsStr, OsString}; use crate::marker::PhantomData; use crate::os::uefi; @@ -9,11 +9,11 @@ use crate::path::{self, PathBuf}; use crate::ptr::NonNull; use crate::{fmt, io}; -pub fn errno() -> RawOsError { +pub fn errno() -> io::RawOsError { 0 } -pub fn error_string(errno: RawOsError) -> String { +pub fn error_string(errno: io::RawOsError) -> String { // Keep the List in Alphabetical Order // The Messages are taken from UEFI Specification Appendix D - Status Codes #[rustfmt::skip] diff --git a/library/std/src/sys/pal/uefi/time.rs b/library/std/src/sys/pal/uefi/time.rs index 30df6d93d0ee..3dccd03ff3fc 100644 --- a/library/std/src/sys/pal/uefi/time.rs +++ b/library/std/src/sys/pal/uefi/time.rs @@ -300,7 +300,7 @@ pub(crate) mod instant_internal { use crate::mem::MaybeUninit; use crate::ptr::NonNull; use crate::sync::atomic::{Atomic, AtomicPtr, Ordering}; - use crate::sys_common::mul_div_u64; + use crate::sys::helpers::mul_div_u64; const NS_PER_SEC: u64 = 1_000_000_000; @@ -356,7 +356,7 @@ pub(crate) mod instant_internal { // Inspired by [`edk2/UefiCpuPkg/Library/CpuTimerLib/CpuTimerLib.c`](https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/CpuTimerLib/CpuTimerLib.c) let freq = FREQUENCY .get_or_try_init(|| { - let cpuid = unsafe { crate::arch::x86_64::__cpuid(0x15) }; + let cpuid = crate::arch::x86_64::__cpuid(0x15); if cpuid.eax == 0 || cpuid.ebx == 0 || cpuid.ecx == 0 { return Err(()); } @@ -375,7 +375,7 @@ pub(crate) mod instant_internal { let freq = FREQUENCY .get_or_try_init(|| { - let cpuid = unsafe { crate::arch::x86::__cpuid(0x15) }; + let cpuid = crate::arch::x86::__cpuid(0x15); if cpuid.eax == 0 || cpuid.ebx == 0 || cpuid.ecx == 0 { return Err(()); } diff --git a/library/std/src/sys/pal/unix/linux/pidfd.rs b/library/std/src/sys/pal/unix/linux/pidfd.rs index 7859854e96b4..e9e4831fcc02 100644 --- a/library/std/src/sys/pal/unix/linux/pidfd.rs +++ b/library/std/src/sys/pal/unix/linux/pidfd.rs @@ -1,5 +1,5 @@ use crate::io; -use crate::os::fd::{AsRawFd, FromRawFd, RawFd}; +use crate::os::fd::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; use crate::sys::fd::FileDesc; use crate::sys::process::ExitStatus; use crate::sys::{AsInner, FromInner, IntoInner, cvt}; @@ -15,6 +15,73 @@ impl PidFd { self.send_signal(libc::SIGKILL) } + #[cfg(any(test, target_env = "gnu", target_env = "musl"))] + pub(crate) fn current_process() -> io::Result { + let pid = crate::process::id(); + let pidfd = cvt(unsafe { libc::syscall(libc::SYS_pidfd_open, pid, 0) })?; + Ok(unsafe { PidFd::from_raw_fd(pidfd as RawFd) }) + } + + #[cfg(any(test, target_env = "gnu", target_env = "musl"))] + pub(crate) fn pid(&self) -> io::Result { + use crate::sys::weak::weak; + + // since kernel 6.13 + // https://lore.kernel.org/all/20241010155401.2268522-1-luca.boccassi@gmail.com/ + let mut pidfd_info: libc::pidfd_info = unsafe { crate::mem::zeroed() }; + pidfd_info.mask = libc::PIDFD_INFO_PID as u64; + match cvt(unsafe { libc::ioctl(self.0.as_raw_fd(), libc::PIDFD_GET_INFO, &mut pidfd_info) }) + { + Ok(_) => {} + Err(e) if e.raw_os_error() == Some(libc::EINVAL) => { + // kernel doesn't support that ioctl, try the glibc helper that looks at procfs + weak!( + fn pidfd_getpid(pidfd: RawFd) -> libc::pid_t; + ); + if let Some(pidfd_getpid) = pidfd_getpid.get() { + let pid: libc::c_int = cvt(unsafe { pidfd_getpid(self.0.as_raw_fd()) })?; + return Ok(pid as u32); + } + return Err(e); + } + Err(e) => return Err(e), + } + + Ok(pidfd_info.pid) + } + + fn exit_for_reaped_child(&self) -> io::Result { + // since kernel 6.15 + // https://lore.kernel.org/linux-fsdevel/20250305-work-pidfs-kill_on_last_close-v3-0-c8c3d8361705@kernel.org/T/ + let mut pidfd_info: libc::pidfd_info = unsafe { crate::mem::zeroed() }; + pidfd_info.mask = libc::PIDFD_INFO_EXIT as u64; + cvt(unsafe { libc::ioctl(self.0.as_raw_fd(), libc::PIDFD_GET_INFO, &mut pidfd_info) })?; + Ok(ExitStatus::new(pidfd_info.exit_code)) + } + + fn waitid(&self, options: libc::c_int) -> io::Result> { + let mut siginfo: libc::siginfo_t = unsafe { crate::mem::zeroed() }; + let r = cvt(unsafe { + libc::waitid(libc::P_PIDFD, self.0.as_raw_fd() as u32, &mut siginfo, options) + }); + match r { + Err(waitid_err) if waitid_err.raw_os_error() == Some(libc::ECHILD) => { + // already reaped + match self.exit_for_reaped_child() { + Ok(exit_status) => return Ok(Some(exit_status)), + Err(_) => return Err(waitid_err), + } + } + Err(e) => return Err(e), + Ok(_) => {} + } + if unsafe { siginfo.si_pid() } == 0 { + Ok(None) + } else { + Ok(Some(ExitStatus::from_waitid_siginfo(siginfo))) + } + } + pub(crate) fn send_signal(&self, signal: i32) -> io::Result<()> { cvt(unsafe { libc::syscall( @@ -29,29 +96,15 @@ impl PidFd { } pub fn wait(&self) -> io::Result { - let mut siginfo: libc::siginfo_t = unsafe { crate::mem::zeroed() }; - cvt(unsafe { - libc::waitid(libc::P_PIDFD, self.0.as_raw_fd() as u32, &mut siginfo, libc::WEXITED) - })?; - Ok(ExitStatus::from_waitid_siginfo(siginfo)) + let r = self.waitid(libc::WEXITED)?; + match r { + Some(exit_status) => Ok(exit_status), + None => unreachable!("waitid with WEXITED should not return None"), + } } pub fn try_wait(&self) -> io::Result> { - let mut siginfo: libc::siginfo_t = unsafe { crate::mem::zeroed() }; - - cvt(unsafe { - libc::waitid( - libc::P_PIDFD, - self.0.as_raw_fd() as u32, - &mut siginfo, - libc::WEXITED | libc::WNOHANG, - ) - })?; - if unsafe { siginfo.si_pid() } == 0 { - Ok(None) - } else { - Ok(Some(ExitStatus::from_waitid_siginfo(siginfo))) - } + self.waitid(libc::WEXITED | libc::WNOHANG) } } @@ -78,3 +131,9 @@ impl FromRawFd for PidFd { Self(FileDesc::from_raw_fd(fd)) } } + +impl IntoRawFd for PidFd { + fn into_raw_fd(self) -> RawFd { + self.0.into_raw_fd() + } +} diff --git a/library/std/src/sys/pal/unix/linux/pidfd/tests.rs b/library/std/src/sys/pal/unix/linux/pidfd/tests.rs index 17b06bea9127..a3bb5d5d64ba 100644 --- a/library/std/src/sys/pal/unix/linux/pidfd/tests.rs +++ b/library/std/src/sys/pal/unix/linux/pidfd/tests.rs @@ -1,8 +1,11 @@ +use super::PidFd as InternalPidFd; use crate::assert_matches::assert_matches; -use crate::os::fd::{AsRawFd, RawFd}; +use crate::io::ErrorKind; +use crate::os::fd::AsRawFd; use crate::os::linux::process::{ChildExt, CommandExt as _}; use crate::os::unix::process::{CommandExt as _, ExitStatusExt}; use crate::process::Command; +use crate::sys::AsInner; #[test] fn test_command_pidfd() { @@ -48,11 +51,22 @@ fn test_command_pidfd() { let mut cmd = Command::new("false"); let mut child = unsafe { cmd.pre_exec(|| Ok(())) }.create_pidfd(true).spawn().unwrap(); - assert!(child.id() > 0 && child.id() < -1i32 as u32); + let id = child.id(); + + assert!(id > 0 && id < -1i32 as u32, "spawning with pidfd still returns a sane pid"); if pidfd_open_available { assert!(child.pidfd().is_ok()) } + + if let Ok(pidfd) = child.pidfd() { + match pidfd.as_inner().pid() { + Ok(pid) => assert_eq!(pid, id), + Err(e) if e.kind() == ErrorKind::InvalidInput => { /* older kernel */ } + Err(e) => panic!("unexpected error getting pid from pidfd: {}", e), + } + } + child.wait().expect("error waiting on child"); } @@ -77,9 +91,15 @@ fn test_pidfd() { assert_eq!(status.signal(), Some(libc::SIGKILL)); // Trying to wait again for a reaped child is safe since there's no pid-recycling race. - // But doing so will return an error. + // But doing so may return an error. let res = fd.wait(); - assert_matches!(res, Err(e) if e.raw_os_error() == Some(libc::ECHILD)); + match res { + // older kernels + Err(e) if e.raw_os_error() == Some(libc::ECHILD) => {} + // 6.15+ + Ok(exit) if exit.signal() == Some(libc::SIGKILL) => {} + other => panic!("expected ECHILD error, got {:?}", other), + } // Ditto for additional attempts to kill an already-dead child. let res = fd.kill(); @@ -87,13 +107,5 @@ fn test_pidfd() { } fn probe_pidfd_support() -> bool { - // pidfds require the pidfd_open syscall - let our_pid = crate::process::id(); - let pidfd = unsafe { libc::syscall(libc::SYS_pidfd_open, our_pid, 0) }; - if pidfd >= 0 { - unsafe { libc::close(pidfd as RawFd) }; - true - } else { - false - } + InternalPidFd::current_process().is_ok() } diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs index a6c5decf2d34..f24898671af8 100644 --- a/library/std/src/sys/pal/unix/mod.rs +++ b/library/std/src/sys/pal/unix/mod.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, nonstandard_style)] -use crate::io::ErrorKind; +use crate::io; #[cfg(target_os = "fuchsia")] pub mod fuchsia; @@ -229,8 +229,8 @@ pub(crate) fn is_interrupted(errno: i32) -> bool { errno == libc::EINTR } -pub fn decode_error_kind(errno: i32) -> ErrorKind { - use ErrorKind::*; +pub fn decode_error_kind(errno: i32) -> io::ErrorKind { + use io::ErrorKind::*; match errno as libc::c_int { libc::E2BIG => ArgumentListTooLong, libc::EADDRINUSE => AddrInUse, @@ -298,12 +298,12 @@ impl_is_minus_one! { i8 i16 i32 i64 isize } /// Converts native return values to Result using the *-1 means error is in `errno`* convention. /// Non-error values are `Ok`-wrapped. -pub fn cvt(t: T) -> crate::io::Result { - if t.is_minus_one() { Err(crate::io::Error::last_os_error()) } else { Ok(t) } +pub fn cvt(t: T) -> io::Result { + if t.is_minus_one() { Err(io::Error::last_os_error()) } else { Ok(t) } } /// `-1` → look at `errno` → retry on `EINTR`. Otherwise `Ok()`-wrap the closure return value. -pub fn cvt_r(mut f: F) -> crate::io::Result +pub fn cvt_r(mut f: F) -> io::Result where T: IsMinusOne, F: FnMut() -> T, @@ -318,8 +318,8 @@ where #[allow(dead_code)] // Not used on all platforms. /// Zero means `Ok()`, all other values are treated as raw OS errors. Does not look at `errno`. -pub fn cvt_nz(error: libc::c_int) -> crate::io::Result<()> { - if error == 0 { Ok(()) } else { Err(crate::io::Error::from_raw_os_error(error)) } +pub fn cvt_nz(error: libc::c_int) -> io::Result<()> { + if error == 0 { Ok(()) } else { Err(io::Error::from_raw_os_error(error)) } } // libc::abort() will run the SIGABRT handler. That's fine because anyone who diff --git a/library/std/src/sys/pal/unix/os.rs b/library/std/src/sys/pal/unix/os.rs index 7c9f3b7992f7..ef3b4a02f8ae 100644 --- a/library/std/src/sys/pal/unix/os.rs +++ b/library/std/src/sys/pal/unix/os.rs @@ -10,8 +10,8 @@ use libc::{c_char, c_int, c_void}; use crate::ffi::{CStr, OsStr, OsString}; use crate::os::unix::prelude::*; use crate::path::{self, PathBuf}; -use crate::sys::common::small_c_string::run_path_with_cstr; use crate::sys::cvt; +use crate::sys::helpers::run_path_with_cstr; use crate::{fmt, io, iter, mem, ptr, slice, str}; const TMPBUF_SZ: usize = 128; @@ -244,10 +244,10 @@ pub fn current_exe() -> io::Result { #[cfg(not(test))] use crate::env; - use crate::io::ErrorKind; + use crate::io; let exe_path = env::args().next().ok_or(io::const_error!( - ErrorKind::NotFound, + io::ErrorKind::NotFound, "an executable path was not found because no arguments were provided through argv", ))?; let path = PathBuf::from(exe_path); @@ -272,7 +272,7 @@ pub fn current_exe() -> io::Result { } } } - Err(io::const_error!(ErrorKind::NotFound, "an executable path was not found")) + Err(io::const_error!(io::ErrorKind::NotFound, "an executable path was not found")) } #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] @@ -463,8 +463,7 @@ pub fn current_exe() -> io::Result { name.len(), ); if result != libc::B_OK { - use crate::io::ErrorKind; - Err(io::const_error!(ErrorKind::Uncategorized, "error getting executable path")) + Err(io::const_error!(io::ErrorKind::Uncategorized, "error getting executable path")) } else { // find_path adds the null terminator. let name = CStr::from_ptr(name.as_ptr()).to_bytes(); @@ -485,8 +484,7 @@ pub fn current_exe() -> io::Result { #[cfg(target_os = "l4re")] pub fn current_exe() -> io::Result { - use crate::io::ErrorKind; - Err(io::const_error!(ErrorKind::Unsupported, "not yet implemented!")) + Err(io::const_error!(io::ErrorKind::Unsupported, "not yet implemented!")) } #[cfg(target_os = "vxworks")] @@ -514,10 +512,9 @@ pub fn current_exe() -> io::Result { #[cfg(not(test))] use crate::env; - use crate::io::ErrorKind; let exe_path = env::args().next().ok_or(io::const_error!( - ErrorKind::Uncategorized, + io::ErrorKind::Uncategorized, "an executable path was not found because no arguments were provided through argv", ))?; let path = PathBuf::from(exe_path); diff --git a/library/std/src/sys/pal/unix/thread_parking.rs b/library/std/src/sys/pal/unix/thread_parking.rs index bef8b4fb3639..6c3d04ceab21 100644 --- a/library/std/src/sys/pal/unix/thread_parking.rs +++ b/library/std/src/sys/pal/unix/thread_parking.rs @@ -2,24 +2,11 @@ // separate modules for each platform. #![cfg(target_os = "netbsd")] -use libc::{_lwp_self, CLOCK_MONOTONIC, c_long, clockid_t, lwpid_t, time_t, timespec}; +use libc::{_lwp_park, _lwp_self, _lwp_unpark, CLOCK_MONOTONIC, c_long, lwpid_t, time_t, timespec}; -use crate::ffi::{c_int, c_void}; use crate::ptr; use crate::time::Duration; -unsafe extern "C" { - fn ___lwp_park60( - clock_id: clockid_t, - flags: c_int, - ts: *mut timespec, - unpark: lwpid_t, - hint: *const c_void, - unparkhint: *const c_void, - ) -> c_int; - fn _lwp_unpark(lwp: lwpid_t, hint: *const c_void) -> c_int; -} - pub type ThreadId = lwpid_t; #[inline] @@ -30,7 +17,7 @@ pub fn current() -> ThreadId { #[inline] pub fn park(hint: usize) { unsafe { - ___lwp_park60(0, 0, ptr::null_mut(), 0, ptr::without_provenance(hint), ptr::null()); + _lwp_park(0, 0, ptr::null_mut(), 0, ptr::without_provenance(hint), ptr::null_mut()); } } @@ -45,13 +32,13 @@ pub fn park_timeout(dur: Duration, hint: usize) { // Timeout needs to be mutable since it is modified on NetBSD 9.0 and // above. unsafe { - ___lwp_park60( + _lwp_park( CLOCK_MONOTONIC, 0, &mut timeout, 0, ptr::without_provenance(hint), - ptr::null(), + ptr::null_mut(), ); } } diff --git a/library/std/src/sys/pal/wasi/os.rs b/library/std/src/sys/pal/wasi/os.rs index 367c63dfc59e..fee187a8adf3 100644 --- a/library/std/src/sys/pal/wasi/os.rs +++ b/library/std/src/sys/pal/wasi/os.rs @@ -4,7 +4,7 @@ use crate::ffi::{CStr, OsStr, OsString}; use crate::marker::PhantomData; use crate::os::wasi::prelude::*; use crate::path::{self, PathBuf}; -use crate::sys::common::small_c_string::run_path_with_cstr; +use crate::sys::helpers::run_path_with_cstr; use crate::sys::unsupported; use crate::{fmt, io, str}; @@ -157,7 +157,7 @@ pub fn cvt(t: T) -> io::Result { if t.is_minus_one() { Err(io::Error::last_os_error()) } else { Ok(t) } } -pub fn cvt_r(mut f: F) -> crate::io::Result +pub fn cvt_r(mut f: F) -> io::Result where T: IsMinusOne, F: FnMut() -> T, diff --git a/library/std/src/sys/pal/windows/handle.rs b/library/std/src/sys/pal/windows/handle.rs index 90e243e1aa03..9b92cd79c06f 100644 --- a/library/std/src/sys/pal/windows/handle.rs +++ b/library/std/src/sys/pal/windows/handle.rs @@ -3,7 +3,7 @@ use core::ffi::c_void; use core::{cmp, mem, ptr}; -use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut, Read}; +use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, Read}; use crate::os::windows::io::{ AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle, }; @@ -83,7 +83,7 @@ impl Handle { // pipe semantics, which yields this error when *reading* from // a pipe after the other end has closed; we interpret that as // EOF on the pipe. - Err(ref e) if e.kind() == ErrorKind::BrokenPipe => Ok(0), + Err(ref e) if e.kind() == io::ErrorKind::BrokenPipe => Ok(0), Err(e) => Err(e), } @@ -126,7 +126,7 @@ impl Handle { // pipe semantics, which yields this error when *reading* from // a pipe after the other end has closed; we interpret that as // EOF on the pipe. - Err(ref e) if e.kind() == ErrorKind::BrokenPipe => Ok(()), + Err(ref e) if e.kind() == io::ErrorKind::BrokenPipe => Ok(()), Err(e) => Err(e), } diff --git a/library/std/src/sys/pal/windows/mod.rs b/library/std/src/sys/pal/windows/mod.rs index 32bd6ea3a4f6..19f0259b1bf0 100644 --- a/library/std/src/sys/pal/windows/mod.rs +++ b/library/std/src/sys/pal/windows/mod.rs @@ -2,7 +2,7 @@ #![forbid(unsafe_op_in_unsafe_fn)] use crate::ffi::{OsStr, OsString}; -use crate::io::ErrorKind; +use crate::io; use crate::mem::MaybeUninit; use crate::os::windows::ffi::{OsStrExt, OsStringExt}; use crate::path::PathBuf; @@ -32,13 +32,13 @@ cfg_select! { } pub mod winsock; -/// Map a [`Result`] to [`io::Result`](crate::io::Result). +/// Map a [`Result`] to [`io::Result`]. pub trait IoResult { - fn io_result(self) -> crate::io::Result; + fn io_result(self) -> io::Result; } impl IoResult for Result { - fn io_result(self) -> crate::io::Result { - self.map_err(|e| crate::io::Error::from_raw_os_error(e.code as i32)) + fn io_result(self) -> io::Result { + self.map_err(|e| io::Error::from_raw_os_error(e.code as i32)) } } @@ -65,8 +65,8 @@ pub fn is_interrupted(_errno: i32) -> bool { false } -pub fn decode_error_kind(errno: i32) -> ErrorKind { - use ErrorKind::*; +pub fn decode_error_kind(errno: i32) -> io::ErrorKind { + use io::ErrorKind::*; match errno as u32 { c::ERROR_ACCESS_DENIED => return PermissionDenied, @@ -167,8 +167,8 @@ pub fn unrolled_find_u16s(needle: u16, haystack: &[u16]) -> Option { None } -pub fn to_u16s>(s: S) -> crate::io::Result> { - fn inner(s: &OsStr) -> crate::io::Result> { +pub fn to_u16s>(s: S) -> io::Result> { + fn inner(s: &OsStr) -> io::Result> { // Most paths are ASCII, so reserve capacity for as much as there are bytes // in the OsStr plus one for the null-terminating character. We are not // wasting bytes here as paths created by this function are primarily used @@ -177,8 +177,8 @@ pub fn to_u16s>(s: S) -> crate::io::Result> { maybe_result.extend(s.encode_wide()); if unrolled_find_u16s(0, &maybe_result).is_some() { - return Err(crate::io::const_error!( - ErrorKind::InvalidInput, + return Err(io::const_error!( + io::ErrorKind::InvalidInput, "strings passed to WinAPI cannot contain NULs", )); } @@ -209,7 +209,7 @@ pub fn to_u16s>(s: S) -> crate::io::Result> { // Once the syscall has completed (errors bail out early) the second closure is // passed the data which has been read from the syscall. The return value // from this closure is then the return value of the function. -pub fn fill_utf16_buf(mut f1: F1, f2: F2) -> crate::io::Result +pub fn fill_utf16_buf(mut f1: F1, f2: F2) -> io::Result where F1: FnMut(*mut u16, u32) -> u32, F2: FnOnce(&[u16]) -> T, @@ -251,7 +251,7 @@ where c::SetLastError(0); let k = match f1(buf.as_mut_ptr().cast::(), n as u32) { 0 if api::get_last_error().code == 0 => 0, - 0 => return Err(crate::io::Error::last_os_error()), + 0 => return Err(io::Error::last_os_error()), n => n, } as usize; if k == n && api::get_last_error().code == c::ERROR_INSUFFICIENT_BUFFER { @@ -285,9 +285,9 @@ pub fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] { } } -pub fn ensure_no_nuls>(s: T) -> crate::io::Result { +pub fn ensure_no_nuls>(s: T) -> io::Result { if s.as_ref().encode_wide().any(|b| b == 0) { - Err(crate::io::const_error!(ErrorKind::InvalidInput, "nul byte found in provided data")) + Err(io::const_error!(io::ErrorKind::InvalidInput, "nul byte found in provided data")) } else { Ok(s) } @@ -307,8 +307,8 @@ macro_rules! impl_is_zero { impl_is_zero! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize } -pub fn cvt(i: I) -> crate::io::Result { - if i.is_zero() { Err(crate::io::Error::last_os_error()) } else { Ok(i) } +pub fn cvt(i: I) -> io::Result { + if i.is_zero() { Err(io::Error::last_os_error()) } else { Ok(i) } } pub fn dur2timeout(dur: Duration) -> u32 { @@ -334,7 +334,7 @@ pub fn dur2timeout(dur: Duration) -> u32 { /// this sequence of instructions will be treated as an access violation, which /// will still terminate the process but might run some exception handlers. /// -/// https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail +/// #[cfg(not(miri))] // inline assembly does not work in Miri pub fn abort_internal() -> ! { unsafe { diff --git a/library/std/src/sys/pal/windows/time.rs b/library/std/src/sys/pal/windows/time.rs index ecd46c950b5e..a555b2b54623 100644 --- a/library/std/src/sys/pal/windows/time.rs +++ b/library/std/src/sys/pal/windows/time.rs @@ -179,8 +179,8 @@ fn intervals2dur(intervals: u64) -> Duration { mod perf_counter { use super::NANOS_PER_SEC; use crate::sync::atomic::{Atomic, AtomicU64, Ordering}; + use crate::sys::helpers::mul_div_u64; use crate::sys::{c, cvt}; - use crate::sys_common::mul_div_u64; use crate::time::Duration; pub struct PerformanceCounterInstant { diff --git a/library/std/src/sys/pal/xous/mod.rs b/library/std/src/sys/pal/xous/mod.rs index 077cff1ee0f2..19575220b22e 100644 --- a/library/std/src/sys/pal/xous/mod.rs +++ b/library/std/src/sys/pal/xous/mod.rs @@ -1,14 +1,8 @@ #![forbid(unsafe_op_in_unsafe_fn)] -use crate::os::xous::ffi::exit; - pub mod os; pub mod time; #[path = "../unsupported/common.rs"] mod common; pub use common::*; - -pub fn abort_internal() -> ! { - exit(101); -} diff --git a/library/std/src/sys/pal/xous/os.rs b/library/std/src/sys/pal/xous/os.rs index d9b8418e6c33..2da711f89dfa 100644 --- a/library/std/src/sys/pal/xous/os.rs +++ b/library/std/src/sys/pal/xous/os.rs @@ -11,7 +11,7 @@ pub(crate) mod params; static PARAMS_ADDRESS: Atomic<*mut u8> = AtomicPtr::new(core::ptr::null_mut()); #[cfg(not(test))] -#[cfg(feature = "panic_unwind")] +#[cfg(feature = "panic-unwind")] mod eh_unwinding { pub(crate) struct EhFrameFinder; pub(crate) static mut EH_FRAME_ADDRESS: usize = 0; @@ -45,7 +45,7 @@ mod c_compat { #[unsafe(no_mangle)] pub extern "C" fn _start(eh_frame: usize, params_address: usize) { - #[cfg(feature = "panic_unwind")] + #[cfg(feature = "panic-unwind")] { unsafe { super::eh_unwinding::EH_FRAME_ADDRESS = eh_frame }; unwind::set_custom_eh_frame_finder(&super::eh_unwinding::EH_FRAME_SETTINGS).ok(); diff --git a/library/std/src/sys/path/cygwin.rs b/library/std/src/sys/path/cygwin.rs index 416877a7280d..75f0de6beaeb 100644 --- a/library/std/src/sys/path/cygwin.rs +++ b/library/std/src/sys/path/cygwin.rs @@ -1,8 +1,8 @@ use crate::ffi::OsString; use crate::os::unix::ffi::OsStringExt; use crate::path::{Path, PathBuf}; -use crate::sys::common::small_c_string::run_path_with_cstr; use crate::sys::cvt; +use crate::sys::helpers::run_path_with_cstr; use crate::{io, ptr}; #[inline] diff --git a/library/std/src/sys/path/uefi.rs b/library/std/src/sys/path/uefi.rs index 6b8258685aa0..84d634af93cf 100644 --- a/library/std/src/sys/path/uefi.rs +++ b/library/std/src/sys/path/uefi.rs @@ -2,7 +2,8 @@ use crate::ffi::OsStr; use crate::io; use crate::path::{Path, PathBuf, Prefix}; -use crate::sys::{helpers, unsupported_err}; +use crate::sys::pal::helpers; +use crate::sys::unsupported_err; const FORWARD_SLASH: u8 = b'/'; const COLON: u8 = b':'; diff --git a/library/std/src/sys/platform_version/darwin/core_foundation.rs b/library/std/src/sys/platform_version/darwin/core_foundation.rs index 1e0d15fcf661..de2b57ea755b 100644 --- a/library/std/src/sys/platform_version/darwin/core_foundation.rs +++ b/library/std/src/sys/platform_version/darwin/core_foundation.rs @@ -3,7 +3,7 @@ use super::root_relative; use crate::ffi::{CStr, c_char, c_void}; use crate::ptr::null_mut; -use crate::sys::common::small_c_string::run_path_with_cstr; +use crate::sys::helpers::run_path_with_cstr; // MacTypes.h pub(super) type Boolean = u8; diff --git a/library/std/src/sys/process/motor.rs b/library/std/src/sys/process/motor.rs index 97b5a0fce2e4..a5d018447890 100644 --- a/library/std/src/sys/process/motor.rs +++ b/library/std/src/sys/process/motor.rs @@ -265,10 +265,7 @@ impl Process { } pub fn kill(&mut self) -> io::Result<()> { - match moto_rt::process::kill(self.handle) { - moto_rt::E_OK => Ok(()), - err => Err(map_motor_error(err)), - } + moto_rt::process::kill(self.handle).map_err(map_motor_error) } pub fn wait(&mut self) -> io::Result { @@ -279,7 +276,7 @@ impl Process { match moto_rt::process::try_wait(self.handle) { Ok(s) => Ok(Some(ExitStatus(s))), Err(err) => match err { - moto_rt::E_NOT_READY => Ok(None), + moto_rt::Error::NotReady => Ok(None), err => Err(map_motor_error(err)), }, } diff --git a/library/std/src/sys/process/uefi.rs b/library/std/src/sys/process/uefi.rs index 0e10bc02a0b9..d627a477dc1a 100644 --- a/library/std/src/sys/process/uefi.rs +++ b/library/std/src/sys/process/uefi.rs @@ -377,8 +377,8 @@ mod uefi_command_internal { use crate::os::uefi::ffi::{OsStrExt, OsStringExt}; use crate::ptr::NonNull; use crate::slice; + use crate::sys::helpers::WStrUnits; use crate::sys::pal::helpers::{self, OwnedTable}; - use crate::sys_common::wstr::WStrUnits; pub struct Image { handle: NonNull, diff --git a/library/std/src/sys/process/unix/unix.rs b/library/std/src/sys/process/unix/unix.rs index 5ba57e11679c..df64a1716d52 100644 --- a/library/std/src/sys/process/unix/unix.rs +++ b/library/std/src/sys/process/unix/unix.rs @@ -482,10 +482,6 @@ impl Command { ) -> libc::c_int; ); - weak!( - fn pidfd_getpid(pidfd: libc::c_int) -> libc::c_int; - ); - static PIDFD_SUPPORTED: Atomic = AtomicU8::new(0); const UNKNOWN: u8 = 0; const SPAWN: u8 = 1; @@ -502,24 +498,26 @@ impl Command { } if support == UNKNOWN { support = NO; - let our_pid = crate::process::id(); - let pidfd = cvt(unsafe { libc::syscall(libc::SYS_pidfd_open, our_pid, 0) } as c_int); - match pidfd { + + match PidFd::current_process() { Ok(pidfd) => { + // if pidfd_open works then we at least know the fork path is available. support = FORK_EXEC; - if let Some(Ok(pid)) = pidfd_getpid.get().map(|f| cvt(unsafe { f(pidfd) } as i32)) { - if pidfd_spawnp.get().is_some() && pid as u32 == our_pid { - support = SPAWN - } + // but for the fast path we need both spawnp and the + // pidfd -> pid conversion to work. + if pidfd_spawnp.get().is_some() && let Ok(pid) = pidfd.pid() { + assert_eq!(pid, crate::process::id(), "sanity check"); + support = SPAWN; } - unsafe { libc::close(pidfd) }; } Err(e) if e.raw_os_error() == Some(libc::EMFILE) => { - // We're temporarily(?) out of file descriptors. In this case obtaining a pidfd would also fail + // We're temporarily(?) out of file descriptors. In this case pidfd_spawnp would also fail // Don't update the support flag so we can probe again later. return Err(e) } - _ => {} + _ => { + // pidfd_open not available? likely an old kernel without pidfd support. + } } PIDFD_SUPPORTED.store(support, Ordering::Relaxed); if support == FORK_EXEC { @@ -791,13 +789,17 @@ impl Command { } spawn_res?; - let pid = match cvt(pidfd_getpid.get().unwrap()(pidfd)) { + use crate::os::fd::{FromRawFd, IntoRawFd}; + + let pidfd = PidFd::from_raw_fd(pidfd); + let pid = match pidfd.pid() { Ok(pid) => pid, Err(e) => { // The child has been spawned and we are holding its pidfd. - // But we cannot obtain its pid even though pidfd_getpid support was verified earlier. - // This might happen if libc can't open procfs because the file descriptor limit has been reached. - libc::close(pidfd); + // But we cannot obtain its pid even though pidfd_spawnp and getpid support + // was verified earlier. + // This is quite unlikely, but might happen if the ioctl is not supported, + // glibc tries to use procfs and we're out of file descriptors. return Err(Error::new( e.kind(), "pidfd_spawnp succeeded but the child's PID could not be obtained", @@ -805,7 +807,7 @@ impl Command { } }; - return Ok(Some(Process::new(pid, pidfd))); + return Ok(Some(Process::new(pid as i32, pidfd.into_raw_fd()))); } // Safety: -1 indicates we don't have a pidfd. diff --git a/library/std/src/sys/random/uefi.rs b/library/std/src/sys/random/uefi.rs index 697933f197b7..f7a760083519 100644 --- a/library/std/src/sys/random/uefi.rs +++ b/library/std/src/sys/random/uefi.rs @@ -107,11 +107,11 @@ mod rdrand { { // SAFETY: All Rust x86 targets are new enough to have CPUID, and we // check that leaf 1 is supported before using it. - let cpuid0 = unsafe { arch::__cpuid(0) }; + let cpuid0 = arch::__cpuid(0); if cpuid0.eax < 1 { return false; } - let cpuid1 = unsafe { arch::__cpuid(1) }; + let cpuid1 = arch::__cpuid(1); let vendor_id = [cpuid0.ebx.to_le_bytes(), cpuid0.edx.to_le_bytes(), cpuid0.ecx.to_le_bytes()]; diff --git a/library/std/src/sys/thread/motor.rs b/library/std/src/sys/thread/motor.rs index 4c6d3ccb84ec..3c6df936b0ae 100644 --- a/library/std/src/sys/thread/motor.rs +++ b/library/std/src/sys/thread/motor.rs @@ -36,7 +36,7 @@ impl Thread { } pub fn join(self) { - assert!(moto_rt::thread::join(self.sys_thread) == moto_rt::E_OK) + assert!(moto_rt::thread::join(self.sys_thread).is_ok()) } } diff --git a/library/std/src/sys/thread/xous.rs b/library/std/src/sys/thread/xous.rs index 6c2cdfa4acdd..208d43bb2c06 100644 --- a/library/std/src/sys/thread/xous.rs +++ b/library/std/src/sys/thread/xous.rs @@ -87,7 +87,7 @@ impl Thread { // dealloc calls from being reordered to after the TLS has been destroyed. // See https://github.com/rust-lang/rust/pull/144465#pullrequestreview-3289729950 // for more context. - run_main_thread_not_inlined(init); + rust_main_thread_not_inlined(init); // Destroy TLS, which will free the TLS page and call the destructor for // any thread local storage (if any). diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs deleted file mode 100644 index 015042440b5a..000000000000 --- a/library/std/src/sys_common/mod.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! Platform-independent platform abstraction -//! -//! This is the platform-independent portion of the standard library's -//! platform abstraction layer, whereas `std::sys` is the -//! platform-specific portion. -//! -//! The relationship between `std::sys_common`, `std::sys` and the -//! rest of `std` is complex, with dependencies going in all -//! directions: `std` depending on `sys_common`, `sys_common` -//! depending on `sys`, and `sys` depending on `sys_common` and `std`. -//! This is because `sys_common` not only contains platform-independent code, -//! but also code that is shared between the different platforms in `sys`. -//! Ideally all that shared code should be moved to `sys::common`, -//! and the dependencies between `std`, `sys_common` and `sys` all would form a DAG. -//! Progress on this is tracked in #84187. - -#![allow(missing_docs)] - -#[cfg(test)] -mod tests; - -pub mod wstr; - -// common error constructors - -// Computes (value*numerator)/denom without overflow, as long as both (numerator*denom) and the -// overall result fit into i64 (which is the case for our time conversions). -#[allow(dead_code)] // not used on all platforms -pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 { - let q = value / denom; - let r = value % denom; - // Decompose value as (value/denom*denom + value%denom), - // substitute into (value*numerator)/denom and simplify. - // r < denom, so (denom*numerator) is the upper bound of (r*numerator) - q * numerator + r * numerator / denom -} - -pub fn ignore_notfound(result: crate::io::Result) -> crate::io::Result<()> { - match result { - Err(err) if err.kind() == crate::io::ErrorKind::NotFound => Ok(()), - Ok(_) => Ok(()), - Err(err) => Err(err), - } -} diff --git a/library/std/src/sys_common/tests.rs b/library/std/src/sys_common/tests.rs deleted file mode 100644 index 1b6446db52d4..000000000000 --- a/library/std/src/sys_common/tests.rs +++ /dev/null @@ -1,6 +0,0 @@ -use super::mul_div_u64; - -#[test] -fn test_muldiv() { - assert_eq!(mul_div_u64(1_000_000_000_001, 1_000_000_000, 1_000_000), 1_000_000_000_001_000); -} diff --git a/library/std/src/thread/builder.rs b/library/std/src/thread/builder.rs index f4abe074ab9d..baec8c905d80 100644 --- a/library/std/src/thread/builder.rs +++ b/library/std/src/thread/builder.rs @@ -40,7 +40,6 @@ use crate::io; /// [`name`]: Builder::name /// [`spawn`]: Builder::spawn /// [`thread::spawn`]: super::spawn -/// [`io::Result`]: crate::io::Result /// [`unwrap`]: crate::result::Result::unwrap /// [naming-threads]: ./index.html#naming-threads /// [stack-size]: ./index.html#stack-size @@ -161,8 +160,6 @@ impl Builder { /// [`io::Result`] to capture any failure to create the thread at /// the OS level. /// - /// [`io::Result`]: crate::io::Result - /// /// # Panics /// /// Panics if a thread name was set and it contained null bytes. @@ -250,7 +247,6 @@ impl Builder { /// handler.join().unwrap(); /// ``` /// - /// [`io::Result`]: crate::io::Result /// [`thread::spawn`]: super::spawn /// [`spawn`]: super::spawn #[stable(feature = "thread_spawn_unchecked", since = "1.82.0")] diff --git a/library/std/src/thread/scoped.rs b/library/std/src/thread/scoped.rs index 301f5e949cac..3ac9956336d7 100644 --- a/library/std/src/thread/scoped.rs +++ b/library/std/src/thread/scoped.rs @@ -210,8 +210,6 @@ impl Builder { /// Unlike [`Scope::spawn`], this method yields an [`io::Result`] to /// capture any failure to create the thread at the OS level. /// - /// [`io::Result`]: crate::io::Result - /// /// # Panics /// /// Panics if a thread name was set and it contained null bytes. diff --git a/library/std/tests/sync/lib.rs b/library/std/tests/sync/lib.rs index 7ade9f623147..32a7efde2a25 100644 --- a/library/std/tests/sync/lib.rs +++ b/library/std/tests/sync/lib.rs @@ -1,5 +1,6 @@ #![feature(mapped_lock_guards)] #![feature(mpmc_channel)] +#![feature(oneshot_channel)] #![feature(once_cell_try)] #![feature(lock_value_accessors)] #![feature(reentrant_lock)] @@ -26,6 +27,8 @@ mod mutex; mod once; mod once_lock; #[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] +mod oneshot; +#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] mod reentrant_lock; #[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] mod rwlock; diff --git a/library/std/tests/sync/oneshot.rs b/library/std/tests/sync/oneshot.rs new file mode 100644 index 000000000000..6a87c72b9cb5 --- /dev/null +++ b/library/std/tests/sync/oneshot.rs @@ -0,0 +1,342 @@ +//! Inspired by tests from + +use std::sync::mpsc::RecvError; +use std::sync::oneshot; +use std::sync::oneshot::{RecvTimeoutError, TryRecvError}; +use std::time::{Duration, Instant}; +use std::{mem, thread}; + +#[test] +fn send_before_try_recv() { + let (sender, receiver) = oneshot::channel(); + + assert!(sender.send(19i128).is_ok()); + + match receiver.try_recv() { + Ok(19) => {} + _ => panic!("expected Ok(19)"), + } +} + +#[test] +fn send_before_recv() { + let (sender, receiver) = oneshot::channel::<()>(); + + assert!(sender.send(()).is_ok()); + assert_eq!(receiver.recv(), Ok(())); + + let (sender, receiver) = oneshot::channel::(); + + assert!(sender.send(42).is_ok()); + assert_eq!(receiver.recv(), Ok(42)); + + let (sender, receiver) = oneshot::channel::<[u8; 4096]>(); + + assert!(sender.send([0b10101010; 4096]).is_ok()); + assert!(receiver.recv().unwrap()[..] == [0b10101010; 4096][..]); +} + +#[test] +fn sender_drop() { + { + let (sender, receiver) = oneshot::channel::(); + + mem::drop(sender); + + match receiver.recv() { + Err(RecvError) => {} + _ => panic!("expected recv error"), + } + } + + { + let (sender, receiver) = oneshot::channel::(); + + mem::drop(sender); + + match receiver.try_recv() { + Err(TryRecvError::Disconnected) => {} + _ => panic!("expected disconnected error"), + } + } + { + let (sender, receiver) = oneshot::channel::(); + + mem::drop(sender); + + match receiver.recv_timeout(Duration::from_secs(1)) { + Err(RecvTimeoutError::Disconnected) => {} + _ => panic!("expected disconnected error"), + } + } +} + +#[test] +fn send_never_deadline() { + let (sender, receiver) = oneshot::channel::(); + + mem::drop(sender); + + match receiver.recv_deadline(Instant::now()) { + Err(RecvTimeoutError::Disconnected) => {} + _ => panic!("expected disconnected error"), + } +} + +#[test] +fn send_before_recv_timeout() { + let (sender, receiver) = oneshot::channel(); + + assert!(sender.send(22i128).is_ok()); + + let start = Instant::now(); + + let timeout = Duration::from_secs(1); + match receiver.recv_timeout(timeout) { + Ok(22) => {} + _ => panic!("expected Ok(22)"), + } + + assert!(start.elapsed() < timeout); +} + +#[test] +fn send_error() { + let (sender, receiver) = oneshot::channel(); + + mem::drop(receiver); + + let send_error = sender.send(32u128).unwrap_err(); + assert_eq!(send_error.0, 32); +} + +#[test] +fn recv_before_send() { + let (sender, receiver) = oneshot::channel(); + + let t1 = thread::spawn(move || { + thread::sleep(Duration::from_millis(10)); + sender.send(9u128).unwrap(); + }); + let t2 = thread::spawn(move || { + assert_eq!(receiver.recv(), Ok(9)); + }); + + t1.join().unwrap(); + t2.join().unwrap(); +} + +#[test] +fn recv_timeout_before_send() { + let (sender, receiver) = oneshot::channel(); + + let t = thread::spawn(move || { + thread::sleep(Duration::from_millis(100)); + sender.send(99u128).unwrap(); + }); + + match receiver.recv_timeout(Duration::from_secs(1)) { + Ok(99) => {} + _ => panic!("expected Ok(99)"), + } + + t.join().unwrap(); +} + +#[test] +fn recv_then_drop_sender() { + let (sender, receiver) = oneshot::channel::(); + + let t1 = thread::spawn(move || match receiver.recv() { + Err(RecvError) => {} + _ => panic!("expected recv error"), + }); + + let t2 = thread::spawn(move || { + thread::sleep(Duration::from_millis(10)); + mem::drop(sender); + }); + + t1.join().unwrap(); + t2.join().unwrap(); +} + +#[test] +fn drop_sender_then_recv() { + let (sender, receiver) = oneshot::channel::(); + + let t1 = thread::spawn(move || { + thread::sleep(Duration::from_millis(10)); + mem::drop(sender); + }); + + let t2 = thread::spawn(move || match receiver.recv() { + Err(RecvError) => {} + _ => panic!("expected disconnected error"), + }); + + t1.join().unwrap(); + t2.join().unwrap(); +} + +#[test] +fn try_recv_empty() { + let (sender, receiver) = oneshot::channel::(); + match receiver.try_recv() { + Err(TryRecvError::Empty(_)) => {} + _ => panic!("expected empty error"), + } + mem::drop(sender); +} + +#[test] +fn try_recv_then_drop_receiver() { + let (sender, receiver) = oneshot::channel::(); + + let t1 = thread::spawn(move || { + thread::sleep(Duration::from_millis(100)); + let _ = sender.send(42); + }); + + let t2 = thread::spawn(move || match receiver.try_recv() { + Ok(_) => {} + Err(TryRecvError::Empty(r)) => { + mem::drop(r); + } + Err(TryRecvError::Disconnected) => {} + }); + + t2.join().unwrap(); + t1.join().unwrap(); +} + +#[test] +fn recv_no_time() { + let (_sender, receiver) = oneshot::channel::(); + + let start = Instant::now(); + match receiver.recv_deadline(start) { + Err(RecvTimeoutError::Timeout(_)) => {} + _ => panic!("expected timeout error"), + } + + let (_sender, receiver) = oneshot::channel::(); + match receiver.recv_timeout(Duration::from_millis(0)) { + Err(RecvTimeoutError::Timeout(_)) => {} + _ => panic!("expected timeout error"), + } +} + +#[test] +fn recv_deadline_passed() { + let (_sender, receiver) = oneshot::channel::(); + + let start = Instant::now(); + let timeout = Duration::from_millis(100); + + match receiver.recv_deadline(start + timeout) { + Err(RecvTimeoutError::Timeout(_)) => {} + _ => panic!("expected timeout error"), + } + + assert!(start.elapsed() >= timeout); + assert!(start.elapsed() < timeout * 3); +} + +#[test] +fn recv_time_passed() { + let (_sender, receiver) = oneshot::channel::(); + + let start = Instant::now(); + let timeout = Duration::from_millis(100); + match receiver.recv_timeout(timeout) { + Err(RecvTimeoutError::Timeout(_)) => {} + _ => panic!("expected timeout error"), + } + assert!(start.elapsed() >= timeout); + assert!(start.elapsed() < timeout * 3); +} + +#[test] +fn non_send_type_can_be_used_on_same_thread() { + use std::ptr; + + #[derive(Debug, Eq, PartialEq)] + struct NotSend(*mut ()); + + let (sender, receiver) = oneshot::channel(); + sender.send(NotSend(ptr::null_mut())).unwrap(); + let reply = receiver.try_recv().unwrap(); + assert_eq!(reply, NotSend(ptr::null_mut())); +} + +/// Helper for testing drop behavior (taken directly from the `oneshot` crate). +struct DropCounter { + count: std::rc::Rc>, +} + +impl DropCounter { + fn new() -> (DropTracker, DropCounter) { + let count = std::rc::Rc::new(std::cell::RefCell::new(0)); + (DropTracker { count: count.clone() }, DropCounter { count }) + } + + fn count(&self) -> usize { + *self.count.borrow() + } +} + +struct DropTracker { + count: std::rc::Rc>, +} + +impl Drop for DropTracker { + fn drop(&mut self) { + *self.count.borrow_mut() += 1; + } +} + +#[test] +fn message_in_channel_dropped_on_receiver_drop() { + let (sender, receiver) = oneshot::channel(); + + let (message, counter) = DropCounter::new(); + assert_eq!(counter.count(), 0); + + sender.send(message).unwrap(); + assert_eq!(counter.count(), 0); + + mem::drop(receiver); + assert_eq!(counter.count(), 1); +} + +#[test] +fn send_error_drops_message_correctly() { + let (sender, receiver) = oneshot::channel(); + mem::drop(receiver); + + let (message, counter) = DropCounter::new(); + + let send_error = sender.send(message).unwrap_err(); + assert_eq!(counter.count(), 0); + + mem::drop(send_error); + assert_eq!(counter.count(), 1); +} + +#[test] +fn send_error_drops_message_correctly_on_extract() { + let (sender, receiver) = oneshot::channel(); + mem::drop(receiver); + + let (message, counter) = DropCounter::new(); + + let send_error = sender.send(message).unwrap_err(); + assert_eq!(counter.count(), 0); + + let message = send_error.0; // Access the inner value directly + assert_eq!(counter.count(), 0); + + mem::drop(message); + assert_eq!(counter.count(), 1); +} diff --git a/library/std_detect/src/detect/arch/riscv.rs b/library/std_detect/src/detect/arch/riscv.rs index 846d7f10d68f..ecad1a58d5f2 100644 --- a/library/std_detect/src/detect/arch/riscv.rs +++ b/library/std_detect/src/detect/arch/riscv.rs @@ -196,26 +196,26 @@ features! { @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] unaligned_vector_mem: "unaligned-vector-mem"; /// Has reasonably performant unaligned vector - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zicsr: "zicsr"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zicsr: "zicsr"; /// "Zicsr" Extension for Control and Status Register (CSR) Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zicntr: "zicntr"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zicntr: "zicntr"; /// "Zicntr" Extension for Base Counters and Timers - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zihpm: "zihpm"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zihpm: "zihpm"; /// "Zihpm" Extension for Hardware Performance Counters - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zifencei: "zifencei"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zifencei: "zifencei"; /// "Zifencei" Extension for Instruction-Fetch Fence - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zihintntl: "zihintntl"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zihintntl: "zihintntl"; /// "Zihintntl" Extension for Non-Temporal Locality Hints - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zihintpause: "zihintpause"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zihintpause: "zihintpause"; /// "Zihintpause" Extension for Pause Hint - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zimop: "zimop"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zimop: "zimop"; /// "Zimop" Extension for May-Be-Operations - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zicbom: "zicbom"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zicbom: "zicbom"; /// "Zicbom" Extension for Cache-Block Management Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zicboz: "zicboz"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zicboz: "zicboz"; /// "Zicboz" Extension for Cache-Block Zero Instruction - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zicond: "zicond"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zicond: "zicond"; /// "Zicond" Extension for Integer Conditional Operations @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] m: "m"; @@ -223,20 +223,20 @@ features! { @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] a: "a"; /// "A" Extension for Atomic Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zalrsc: "zalrsc"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zalrsc: "zalrsc"; /// "Zalrsc" Extension for Load-Reserved/Store-Conditional Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zaamo: "zaamo"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zaamo: "zaamo"; /// "Zaamo" Extension for Atomic Memory Operations - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zawrs: "zawrs"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zawrs: "zawrs"; /// "Zawrs" Extension for Wait-on-Reservation-Set Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zabha: "zabha"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zabha: "zabha"; /// "Zabha" Extension for Byte and Halfword Atomic Memory Operations - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zacas: "zacas"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zacas: "zacas"; /// "Zacas" Extension for Atomic Compare-and-Swap (CAS) Instructions @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zam: "zam"; without cfg check: true; /// "Zam" Extension for Misaligned Atomics - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] ztso: "ztso"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] ztso: "ztso"; /// "Ztso" Extension for Total Store Ordering @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] f: "f"; @@ -266,7 +266,7 @@ features! { @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] c: "c"; /// "C" Extension for Compressed Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zca: "zca"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zca: "zca"; /// "Zca" Compressed Instructions excluding Floating-Point Loads/Stores @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zcf: "zcf"; without cfg check: true; @@ -274,12 +274,12 @@ features! { @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zcd: "zcd"; without cfg check: true; /// "Zcd" Compressed Instructions for Double-Precision Floating-Point Loads/Stores - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zcb: "zcb"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zcb: "zcb"; /// "Zcb" Simple Code-size Saving Compressed Instructions - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zcmop: "zcmop"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] zcmop: "zcmop"; /// "Zcmop" Extension for Compressed May-Be-Operations - @FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] b: "b"; + @FEATURE: #[stable(feature = "riscv_ratified_v2", since = "CURRENT_RUSTC_VERSION")] b: "b"; /// "B" Extension for Bit Manipulation @FEATURE: #[stable(feature = "riscv_ratified", since = "1.78.0")] zba: "zba"; /// "Zba" Extension for Address Generation diff --git a/library/std_detect/src/detect/arch/s390x.rs b/library/std_detect/src/detect/arch/s390x.rs index a04283f90a02..63f7390d5ae3 100644 --- a/library/std_detect/src/detect/arch/s390x.rs +++ b/library/std_detect/src/detect/arch/s390x.rs @@ -10,27 +10,27 @@ features! { /// When the feature is known to be enabled at compile time (e.g. via `-Ctarget-feature`) /// the macro expands to `true`. #[stable(feature = "stdarch_s390x_feature_detection", since = "1.93.0")] - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] concurrent_functions: "concurrent-functions"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] concurrent_functions: "concurrent-functions"; /// s390x concurrent-functions facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] deflate_conversion: "deflate-conversion"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] deflate_conversion: "deflate-conversion"; /// s390x deflate-conversion facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] enhanced_sort: "enhanced-sort"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] enhanced_sort: "enhanced-sort"; /// s390x enhanced-sort facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] guarded_storage: "guarded-storage"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] guarded_storage: "guarded-storage"; /// s390x guarded-storage facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] high_word: "high-word"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] high_word: "high-word"; /// s390x high-word facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension3: "message-security-assist-extension3"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] message_security_assist_extension3: "message-security-assist-extension3"; /// s390x message-security-assist-extension3 facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension4: "message-security-assist-extension4"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] message_security_assist_extension4: "message-security-assist-extension4"; /// s390x message-security-assist-extension4 facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension5: "message-security-assist-extension5"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] message_security_assist_extension5: "message-security-assist-extension5"; /// s390x message-security-assist-extension5 facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension8: "message-security-assist-extension8"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] message_security_assist_extension8: "message-security-assist-extension8"; /// s390x message-security-assist-extension8 facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension9: "message-security-assist-extension9"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] message_security_assist_extension9: "message-security-assist-extension9"; /// s390x message-security-assist-extension9 facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension12: "message-security-assist-extension12"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] message_security_assist_extension12: "message-security-assist-extension12"; /// s390x message-security-assist-extension12 facility @FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] miscellaneous_extensions_2: "miscellaneous-extensions-2"; /// s390x miscellaneous-extensions-2 facility @@ -40,7 +40,7 @@ features! { /// s390x miscellaneous-extensions-4 facility @FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] nnp_assist: "nnp-assist"; /// s390x nnp-assist facility - @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] transactional_execution: "transactional-execution"; + @FEATURE: #[unstable(feature = "s390x_target_feature", issue = "150259")] transactional_execution: "transactional-execution"; /// s390x transactional-execution facility @FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector: "vector"; /// s390x vector facility diff --git a/library/std_detect/src/detect/os/x86.rs b/library/std_detect/src/detect/os/x86.rs index 18925da2b275..f2205ba07dd4 100644 --- a/library/std_detect/src/detect/os/x86.rs +++ b/library/std_detect/src/detect/os/x86.rs @@ -40,10 +40,10 @@ pub(crate) fn detect_features() -> cache::Initializer { // leaf value for subsequent calls of `cpuinfo` in range [0, // 0x8000_0000]. - The vendor ID is stored in 12 u8 ascii chars, // returned in EBX, EDX, and ECX (in that order): - let (max_basic_leaf, vendor_id) = unsafe { + let (max_basic_leaf, vendor_id) = { let CpuidResult { eax: max_basic_leaf, ebx, ecx, edx } = __cpuid(0); let vendor_id: [[u8; 4]; 3] = [ebx.to_ne_bytes(), edx.to_ne_bytes(), ecx.to_ne_bytes()]; - let vendor_id: [u8; 12] = mem::transmute(vendor_id); + let vendor_id: [u8; 12] = unsafe { mem::transmute(vendor_id) }; (max_basic_leaf, vendor_id) }; @@ -54,8 +54,7 @@ pub(crate) fn detect_features() -> cache::Initializer { // EAX = 1, ECX = 0: Queries "Processor Info and Feature Bits"; // Contains information about most x86 features. - let CpuidResult { ecx: proc_info_ecx, edx: proc_info_edx, .. } = - unsafe { __cpuid(0x0000_0001_u32) }; + let CpuidResult { ecx: proc_info_ecx, edx: proc_info_edx, .. } = __cpuid(0x0000_0001_u32); // EAX = 7: Queries "Extended Features"; // Contains information about bmi,bmi2, and avx2 support. @@ -66,9 +65,9 @@ pub(crate) fn detect_features() -> cache::Initializer { extended_features_eax_leaf_1, extended_features_edx_leaf_1, ) = if max_basic_leaf >= 7 { - let CpuidResult { ebx, ecx, edx, .. } = unsafe { __cpuid(0x0000_0007_u32) }; + let CpuidResult { ebx, ecx, edx, .. } = __cpuid(0x0000_0007_u32); let CpuidResult { eax: eax_1, edx: edx_1, .. } = - unsafe { __cpuid_count(0x0000_0007_u32, 0x0000_0001_u32) }; + __cpuid_count(0x0000_0007_u32, 0x0000_0001_u32); (ebx, ecx, edx, eax_1, edx_1) } else { (0, 0, 0, 0, 0) // CPUID does not support "Extended Features" @@ -77,12 +76,12 @@ pub(crate) fn detect_features() -> cache::Initializer { // EAX = 0x8000_0000, ECX = 0: Get Highest Extended Function Supported // - EAX returns the max leaf value for extended information, that is, // `cpuid` calls in range [0x8000_0000; u32::MAX]: - let CpuidResult { eax: extended_max_basic_leaf, .. } = unsafe { __cpuid(0x8000_0000_u32) }; + let CpuidResult { eax: extended_max_basic_leaf, .. } = __cpuid(0x8000_0000_u32); // EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature // Bits" let extended_proc_info_ecx = if extended_max_basic_leaf >= 1 { - let CpuidResult { ecx, .. } = unsafe { __cpuid(0x8000_0001_u32) }; + let CpuidResult { ecx, .. } = __cpuid(0x8000_0001_u32); ecx } else { 0 @@ -132,7 +131,7 @@ pub(crate) fn detect_features() -> cache::Initializer { // Detect if CPUID.19h available if bit::test(extended_features_ecx as usize, 23) { - let CpuidResult { ebx, .. } = unsafe { __cpuid(0x19) }; + let CpuidResult { ebx, .. } = __cpuid(0x19); enable(ebx, 0, Feature::kl); enable(ebx, 2, Feature::widekl); } @@ -223,7 +222,7 @@ pub(crate) fn detect_features() -> cache::Initializer { // ECX = 1): if max_basic_leaf >= 0xd { let CpuidResult { eax: proc_extended_state1_eax, .. } = - unsafe { __cpuid_count(0xd_u32, 1) }; + __cpuid_count(0xd_u32, 1); enable(proc_extended_state1_eax, 0, Feature::xsaveopt); enable(proc_extended_state1_eax, 1, Feature::xsavec); enable(proc_extended_state1_eax, 3, Feature::xsaves); @@ -282,7 +281,7 @@ pub(crate) fn detect_features() -> cache::Initializer { if max_basic_leaf >= 0x1e { let CpuidResult { eax: amx_feature_flags_eax, .. } = - unsafe { __cpuid_count(0x1e_u32, 1) }; + __cpuid_count(0x1e_u32, 1); enable(amx_feature_flags_eax, 4, Feature::amx_fp8); enable(amx_feature_flags_eax, 6, Feature::amx_tf32); @@ -297,7 +296,7 @@ pub(crate) fn detect_features() -> cache::Initializer { let avx10_1 = enable(extended_features_edx_leaf_1, 19, Feature::avx10_1); if avx10_1 { - let CpuidResult { ebx, .. } = unsafe { __cpuid(0x24) }; + let CpuidResult { ebx, .. } = __cpuid(0x24); let avx10_version = ebx & 0xff; if avx10_version >= 2 { value.set(Feature::avx10_2 as u32); diff --git a/library/stdarch/.github/workflows/main.yml b/library/stdarch/.github/workflows/main.yml index 28c15cf4734a..6cf0e9f02fe5 100644 --- a/library/stdarch/.github/workflows/main.yml +++ b/library/stdarch/.github/workflows/main.yml @@ -84,6 +84,8 @@ jobs: os: ubuntu-latest - tuple: nvptx64-nvidia-cuda os: ubuntu-latest + - tuple: amdgcn-amd-amdhsa + os: ubuntu-latest - tuple: thumbv6m-none-eabi os: ubuntu-latest - tuple: thumbv7m-none-eabi @@ -201,6 +203,10 @@ jobs: tuple: aarch64-apple-ios-macabi os: macos-15 norun: true # https://github.com/rust-lang/stdarch/issues/1206 + - target: + tuple: amdgcn-amd-amdhsa + os: ubuntu-latest + norun: true steps: - uses: actions/checkout@v4 @@ -212,15 +218,20 @@ jobs: - run: rustup target add ${{ matrix.target.tuple }} shell: bash - if: matrix.build_std == '' + if: matrix.build_std == '' && matrix.target.tuple != 'amdgcn-amd-amdhsa' - run: | rustup component add rust-src echo "CARGO_UNSTABLE_BUILD_STD=std" >> $GITHUB_ENV shell: bash if: matrix.build_std != '' + - run: | + rustup component add rust-src + echo "CARGO_UNSTABLE_BUILD_STD=core,alloc" >> $GITHUB_ENV + shell: bash + if: matrix.target.tuple == 'amdgcn-amd-amdhsa' # Configure some env vars based on matrix configuration - - run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV + - run: echo "PROFILE=${{matrix.profile}}" >> $GITHUB_ENV shell: bash - run: echo "NORUN=1" >> $GITHUB_ENV shell: bash @@ -233,7 +244,7 @@ jobs: if: matrix.disable_assert_instr != '' - run: echo "NOSTD=1" >> $GITHUB_ENV shell: bash - if: startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda' + if: startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda' || matrix.target.tuple == 'amdgcn-amd-amdhsa' # Windows & OSX go straight to `run.sh` ... - run: ./ci/run.sh @@ -280,7 +291,7 @@ jobs: if: ${{ matrix.build_std }} # Configure some env vars based on matrix configuration - - run: echo "PROFILE=--profile=${{ matrix.profile }}" >> $GITHUB_ENV + - run: echo "PROFILE=${{ matrix.profile }}" >> $GITHUB_ENV - run: ./ci/intrinsic-test-docker.sh ${{ matrix.target }} if: ${{ !startsWith(matrix.target, 'thumb') }} env: diff --git a/library/stdarch/ci/docker/amdgcn-amd-amdhsa/Dockerfile b/library/stdarch/ci/docker/amdgcn-amd-amdhsa/Dockerfile new file mode 100644 index 000000000000..65cf281b1477 --- /dev/null +++ b/library/stdarch/ci/docker/amdgcn-amd-amdhsa/Dockerfile @@ -0,0 +1,5 @@ +FROM ubuntu:25.10 +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + ca-certificates diff --git a/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile b/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile index 0527c0df1777..cb4a9b2948cc 100644 --- a/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile +++ b/library/stdarch/ci/docker/wasm32-wasip1/Dockerfile @@ -11,5 +11,3 @@ ENV VERSION=v38.0.3 RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz | tar xJf - ENV PATH=$PATH:/wasmtime-${VERSION}-x86_64-linux - -ENV CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/release/deps::." diff --git a/library/stdarch/ci/dox.sh b/library/stdarch/ci/dox.sh index 94d76d430472..9803f7e37111 100755 --- a/library/stdarch/ci/dox.sh +++ b/library/stdarch/ci/dox.sh @@ -15,6 +15,15 @@ dox() { cargo clean --target "${1}" + if [ "${1}" == "amdgcn-amd-amdhsa" ]; then + if [ "$CI" != "" ]; then + rustup component add rust-src + fi + export CARGO_UNSTABLE_BUILD_STD=core + # amdgpu needs a target-cpu, any is fine + export RUSTFLAGS="${RUSTFLAGS} -Ctarget-cpu=gfx900" + fi + cargo build --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml cargo doc --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml } @@ -33,6 +42,7 @@ if [ -z "$1" ]; then #dox mips64-unknown-linux-gnuabi64 dox wasm32-unknown-unknown dox nvptx64-nvidia-cuda + dox amdgcn-amd-amdhsa else dox "${1}" fi diff --git a/library/stdarch/ci/intrinsic-test-docker.sh b/library/stdarch/ci/intrinsic-test-docker.sh index f62d7e484f5b..beeff42c7621 100755 --- a/library/stdarch/ci/intrinsic-test-docker.sh +++ b/library/stdarch/ci/intrinsic-test-docker.sh @@ -30,6 +30,7 @@ run() { --env CARGO_HOME=/cargo \ --env CARGO_TARGET_DIR=/checkout/target \ --env TARGET="${1}" \ + --env PROFILE \ --env "${HOST_LINKER}"="cc" \ --env STDARCH_DISABLE_ASSERT_INSTR \ --env NOSTD \ diff --git a/library/stdarch/ci/intrinsic-test.sh b/library/stdarch/ci/intrinsic-test.sh index be63f0c0c617..89104e2672ad 100755 --- a/library/stdarch/ci/intrinsic-test.sh +++ b/library/stdarch/ci/intrinsic-test.sh @@ -6,7 +6,7 @@ set -ex export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled -Z verify-llvm-ir" export HOST_RUSTFLAGS="${RUSTFLAGS}" -export PROFILE="${PROFILE:="--profile=release"}" +export PROFILE="${PROFILE:="release"}" case ${TARGET} in # On 32-bit use a static relocation model which avoids some extra @@ -56,7 +56,7 @@ case ${TARGET} in aarch64_be-unknown-linux-gnu*) TEST_CPPFLAGS="-fuse-ld=lld" - TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt + TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64_be.txt TEST_CXX_COMPILER="clang++" TEST_RUNNER="${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER}" : "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=100}" @@ -75,7 +75,7 @@ case ${TARGET} in TEST_CXX_COMPILER="clang++" TEST_RUNNER="${CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER}" TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_x86.txt - : "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=5}" + : "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=20}" ;; *) ;; @@ -85,27 +85,29 @@ esac # Arm specific case "${TARGET}" in aarch64-unknown-linux-gnu*|armv7-unknown-linux-gnueabihf*) - CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=info \ - cargo run "${INTRINSIC_TEST}" "${PROFILE}" \ + CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \ + cargo run "${INTRINSIC_TEST}" --release \ --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \ --runner "${TEST_RUNNER}" \ --cppcompiler "${TEST_CXX_COMPILER}" \ --skip "${TEST_SKIP_INTRINSICS}" \ --target "${TARGET}" \ + --profile "${PROFILE}" \ --sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}" ;; aarch64_be-unknown-linux-gnu*) - CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=info \ - cargo run "${INTRINSIC_TEST}" "${PROFILE}" \ + CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \ + cargo run "${INTRINSIC_TEST}" --release \ --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \ --runner "${TEST_RUNNER}" \ --cppcompiler "${TEST_CXX_COMPILER}" \ --skip "${TEST_SKIP_INTRINSICS}" \ --target "${TARGET}" \ - --sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}" \ + --profile "${PROFILE}" \ --linker "${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER}" \ - --cxx-toolchain-dir "${AARCH64_BE_TOOLCHAIN}" + --cxx-toolchain-dir "${AARCH64_BE_TOOLCHAIN}" \ + --sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}" ;; x86_64-unknown-linux-gnu*) @@ -114,13 +116,14 @@ case "${TARGET}" in # Hence the use of `env -u`. env -u CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER \ CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" \ - RUST_LOG=info RUST_BACKTRACE=1 \ - cargo run "${INTRINSIC_TEST}" "${PROFILE}" \ + RUST_LOG=warn RUST_BACKTRACE=1 \ + cargo run "${INTRINSIC_TEST}" --release \ --bin intrinsic-test -- intrinsics_data/x86-intel.xml \ --runner "${TEST_RUNNER}" \ --skip "${TEST_SKIP_INTRINSICS}" \ --cppcompiler "${TEST_CXX_COMPILER}" \ --target "${TARGET}" \ + --profile "${PROFILE}" \ --sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}" ;; *) diff --git a/library/stdarch/ci/run-docker.sh b/library/stdarch/ci/run-docker.sh index d7aa50a8c96f..28dfd5a24a9f 100755 --- a/library/stdarch/ci/run-docker.sh +++ b/library/stdarch/ci/run-docker.sh @@ -37,6 +37,7 @@ run() { --env NORUN \ --env RUSTFLAGS \ --env CARGO_UNSTABLE_BUILD_STD \ + --env PROFILE \ --volume "${HOME}/.cargo":/cargo \ --volume "$(rustc --print sysroot)":/rust:ro \ --volume "$(pwd)":/checkout:ro \ diff --git a/library/stdarch/ci/run.sh b/library/stdarch/ci/run.sh index 2bb77bae256f..bb3dcf93e75d 100755 --- a/library/stdarch/ci/run.sh +++ b/library/stdarch/ci/run.sh @@ -12,7 +12,7 @@ set -ex export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled -Z verify-llvm-ir" export HOST_RUSTFLAGS="${RUSTFLAGS}" -export PROFILE="${PROFILE:="--profile=release"}" +export PROFILE="${PROFILE:="release"}" case ${TARGET} in # On Windows the linker performs identical COMDAT folding (ICF) by default @@ -42,6 +42,9 @@ case ${TARGET} in armv7-*eabihf | thumbv7-*eabihf) export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon" ;; + amdgcn-*) + export RUSTFLAGS="${RUSTFLAGS} -Ctarget-cpu=gfx1200" + ;; # Some of our test dependencies use the deprecated `gcc` crates which # doesn't detect RISC-V compilers automatically, so do it manually here. riscv*) @@ -63,7 +66,7 @@ cargo_test() { if [ "$NORUN" = "1" ]; then export subcmd="build" fi - cmd="$cmd ${subcmd} --target=$TARGET $1" + cmd="$cmd ${subcmd} --target=$TARGET --profile=$PROFILE $1" cmd="$cmd -- $2" case ${TARGET} in @@ -71,6 +74,12 @@ cargo_test() { # harness isn't trying to capture output, otherwise we won't get any useful # output. wasm32*) + if [ "$PROFILE" = "release" ]; then + dir="release" + else + dir="debug" + fi + export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/deps::." cmd="$cmd --nocapture" ;; esac @@ -80,54 +89,45 @@ cargo_test() { CORE_ARCH="--manifest-path=crates/core_arch/Cargo.toml" STDARCH_EXAMPLES="--manifest-path=examples/Cargo.toml" -cargo_test "${CORE_ARCH} ${PROFILE}" +cargo_test "${CORE_ARCH}" if [ "$NOSTD" != "1" ]; then - cargo_test "${STDARCH_EXAMPLES} ${PROFILE}" + cargo_test "${STDARCH_EXAMPLES}" fi # Test targets compiled with extra features. case ${TARGET} in - x86_64-unknown-linux-gnu) - export STDARCH_DISABLE_ASSERT_INSTR=1 - - export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx" - cargo_test "${PROFILE}" - - export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx512f" - cargo_test "${PROFILE}" - ;; x86_64* | i686*) export STDARCH_DISABLE_ASSERT_INSTR=1 export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx" - cargo_test "${PROFILE}" + cargo_test ;; # FIXME: don't build anymore #mips-*gnu* | mipsel-*gnu*) # export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa,+fp64,+mips32r5" - # cargo_test "${PROFILE}" + # cargo_test # ;; mips64*) export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa" - cargo_test "${PROFILE}" + cargo_test ;; s390x*) export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+vector-enhancements-1" - cargo_test "${PROFILE}" + cargo_test ;; powerpc64*) export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+altivec" - cargo_test "${PROFILE}" + cargo_test export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+vsx" - cargo_test "${PROFILE}" + cargo_test ;; powerpc*) # qemu has a bug in PPC32 which leads to a crash when compiled with `vsx` export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+altivec" - cargo_test "${PROFILE}" + cargo_test ;; *) ;; @@ -138,7 +138,7 @@ if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then # Test examples ( cd examples - cargo test --target "$TARGET" "${PROFILE}" - echo test | cargo run --target "$TARGET" "${PROFILE}" hex + cargo test --target "${TARGET}" --profile "${PROFILE}" + echo test | cargo run --target "${TARGET}" --profile "${PROFILE}" hex ) fi diff --git a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs index 09cf3818040d..7743e52f4fe1 100644 --- a/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs @@ -613,7 +613,7 @@ pub fn vaddvq_f64(a: float64x2_t) -> f64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddv_s32(a: int32x2_t) -> i32 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_s8)"] @@ -622,7 +622,7 @@ pub fn vaddv_s32(a: int32x2_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_s8(a: int8x8_t) -> i8 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s8)"] @@ -631,7 +631,7 @@ pub fn vaddv_s8(a: int8x8_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_s8(a: int8x16_t) -> i8 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_s16)"] @@ -640,7 +640,7 @@ pub fn vaddvq_s8(a: int8x16_t) -> i8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_s16(a: int16x4_t) -> i16 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s16)"] @@ -649,7 +649,7 @@ pub fn vaddv_s16(a: int16x4_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_s16(a: int16x8_t) -> i16 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s32)"] @@ -658,7 +658,7 @@ pub fn vaddvq_s16(a: int16x8_t) -> i16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_s32(a: int32x4_t) -> i32 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_u32)"] @@ -667,7 +667,7 @@ pub fn vaddvq_s32(a: int32x4_t) -> i32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddv_u32(a: uint32x2_t) -> u32 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_u8)"] @@ -676,7 +676,7 @@ pub fn vaddv_u32(a: uint32x2_t) -> u32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_u8(a: uint8x8_t) -> u8 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u8)"] @@ -685,7 +685,7 @@ pub fn vaddv_u8(a: uint8x8_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_u8(a: uint8x16_t) -> u8 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddv_u16)"] @@ -694,7 +694,7 @@ pub fn vaddvq_u8(a: uint8x16_t) -> u8 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddv_u16(a: uint16x4_t) -> u16 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u16)"] @@ -703,7 +703,7 @@ pub fn vaddv_u16(a: uint16x4_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_u16(a: uint16x8_t) -> u16 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u32)"] @@ -712,7 +712,7 @@ pub fn vaddvq_u16(a: uint16x8_t) -> u16 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addv))] pub fn vaddvq_u32(a: uint32x4_t) -> u32 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_s64)"] @@ -721,7 +721,7 @@ pub fn vaddvq_u32(a: uint32x4_t) -> u32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddvq_s64(a: int64x2_t) -> i64 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add across vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaddvq_u64)"] @@ -730,7 +730,7 @@ pub fn vaddvq_s64(a: int64x2_t) -> i64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vaddvq_u64(a: uint64x2_t) -> u64 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Multi-vector floating-point absolute maximum"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vamax_f32)"] @@ -961,7 +961,7 @@ pub fn vbcaxq_u64(a: uint64x2_t, b: uint64x2_t, c: uint64x2_t) -> uint64x2_t { #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fcma"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcadd))] pub fn vcadd_rot270_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -979,7 +979,7 @@ pub fn vcadd_rot270_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fcma"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcadd))] pub fn vcaddq_rot270_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -1045,7 +1045,7 @@ pub fn vcaddq_rot270_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fcma"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcadd))] pub fn vcadd_rot90_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -1063,7 +1063,7 @@ pub fn vcadd_rot90_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fcma"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcadd))] pub fn vcaddq_rot90_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -1501,7 +1501,7 @@ pub fn vceqh_f16(a: f16, b: f16) -> u16 { #[inline] #[cfg_attr(test, assert_instr(fcmeq))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vceqz_f16(a: float16x4_t) -> uint16x4_t { let b: f16x4 = f16x4::new(0.0, 0.0, 0.0, 0.0); @@ -1512,7 +1512,7 @@ pub fn vceqz_f16(a: float16x4_t) -> uint16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcmeq))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vceqzq_f16(a: float16x8_t) -> uint16x8_t { let b: f16x8 = f16x8::new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); @@ -2837,7 +2837,7 @@ pub fn vcltzh_f16(a: f16) -> u16 { #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmla_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { @@ -2855,7 +2855,7 @@ pub fn vcmla_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmlaq_f16(a: float16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { @@ -2923,7 +2923,7 @@ pub fn vcmlaq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_lane_f16( a: float16x4_t, @@ -2952,7 +2952,7 @@ pub fn vcmla_lane_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_lane_f16( a: float16x8_t, @@ -3030,7 +3030,7 @@ pub fn vcmlaq_lane_f32( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_laneq_f16( a: float16x4_t, @@ -3059,7 +3059,7 @@ pub fn vcmla_laneq_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_laneq_f16( a: float16x8_t, @@ -3135,7 +3135,7 @@ pub fn vcmlaq_laneq_f32( #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmla_rot180_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { @@ -3153,7 +3153,7 @@ pub fn vcmla_rot180_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmlaq_rot180_f16(a: float16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { @@ -3221,7 +3221,7 @@ pub fn vcmlaq_rot180_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> floa #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_rot180_lane_f16( a: float16x4_t, @@ -3250,7 +3250,7 @@ pub fn vcmla_rot180_lane_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_rot180_lane_f16( a: float16x8_t, @@ -3328,7 +3328,7 @@ pub fn vcmlaq_rot180_lane_f32( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_rot180_laneq_f16( a: float16x4_t, @@ -3357,7 +3357,7 @@ pub fn vcmla_rot180_laneq_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_rot180_laneq_f16( a: float16x8_t, @@ -3433,7 +3433,7 @@ pub fn vcmlaq_rot180_laneq_f32( #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmla_rot270_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { @@ -3451,7 +3451,7 @@ pub fn vcmla_rot270_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmlaq_rot270_f16(a: float16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { @@ -3519,7 +3519,7 @@ pub fn vcmlaq_rot270_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> floa #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_rot270_lane_f16( a: float16x4_t, @@ -3548,7 +3548,7 @@ pub fn vcmla_rot270_lane_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_rot270_lane_f16( a: float16x8_t, @@ -3626,7 +3626,7 @@ pub fn vcmlaq_rot270_lane_f32( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_rot270_laneq_f16( a: float16x4_t, @@ -3655,7 +3655,7 @@ pub fn vcmla_rot270_laneq_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_rot270_laneq_f16( a: float16x8_t, @@ -3731,7 +3731,7 @@ pub fn vcmlaq_rot270_laneq_f32( #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmla_rot90_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { @@ -3749,7 +3749,7 @@ pub fn vcmla_rot90_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float1 #[inline] #[target_feature(enable = "neon,fcma")] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fcmla))] pub fn vcmlaq_rot90_f16(a: float16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { @@ -3817,7 +3817,7 @@ pub fn vcmlaq_rot90_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_rot90_lane_f16( a: float16x4_t, @@ -3846,7 +3846,7 @@ pub fn vcmla_rot90_lane_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_rot90_lane_f16( a: float16x8_t, @@ -3924,7 +3924,7 @@ pub fn vcmlaq_rot90_lane_f32( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmla_rot90_laneq_f16( a: float16x4_t, @@ -3953,7 +3953,7 @@ pub fn vcmla_rot90_laneq_f16( #[cfg_attr(test, assert_instr(fcmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_neon_fcma", issue = "117222")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcmlaq_rot90_laneq_f16( a: float16x8_t, @@ -7217,9 +7217,9 @@ pub fn vcvtq_f64_u64(a: uint64x2_t) -> float64x2_t { #[doc = "Floating-point convert to lower precision"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvt_high_f16_f32)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(test, assert_instr(fcvtn2))] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_high_f16_f32(a: float16x4_t, b: float32x4_t) -> float16x8_t { vcombine_f16(a, vcvt_f16_f32(b)) @@ -7227,9 +7227,9 @@ pub fn vcvt_high_f16_f32(a: float16x4_t, b: float32x4_t) -> float16x8_t { #[doc = "Floating-point convert to higher precision"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvt_high_f32_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(test, assert_instr(fcvtl2))] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_high_f32_f16(a: float16x8_t) -> float32x4_t { vcvt_f32_f16(vget_high_f16(a)) @@ -7468,7 +7468,7 @@ pub fn vcvtq_u64_f64(a: float64x2_t) -> uint64x2_t { #[inline] #[cfg_attr(test, assert_instr(fcvtas))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvta_s16_f16(a: float16x4_t) -> int16x4_t { unsafe extern "unadjusted" { @@ -7485,7 +7485,7 @@ pub fn vcvta_s16_f16(a: float16x4_t) -> int16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtas))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtaq_s16_f16(a: float16x8_t) -> int16x8_t { unsafe extern "unadjusted" { @@ -7566,7 +7566,7 @@ pub fn vcvtaq_s64_f64(a: float64x2_t) -> int64x2_t { #[inline] #[cfg_attr(test, assert_instr(fcvtau))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvta_u16_f16(a: float16x4_t) -> uint16x4_t { unsafe extern "unadjusted" { @@ -7583,7 +7583,7 @@ pub fn vcvta_u16_f16(a: float16x4_t) -> uint16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtau))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtaq_u16_f16(a: float16x8_t) -> uint16x8_t { unsafe extern "unadjusted" { @@ -8154,7 +8154,7 @@ pub fn vcvth_u64_f16(a: f16) -> u64 { #[inline] #[cfg_attr(test, assert_instr(fcvtms))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtm_s16_f16(a: float16x4_t) -> int16x4_t { unsafe extern "unadjusted" { @@ -8171,7 +8171,7 @@ pub fn vcvtm_s16_f16(a: float16x4_t) -> int16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtms))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtmq_s16_f16(a: float16x8_t) -> int16x8_t { unsafe extern "unadjusted" { @@ -8252,7 +8252,7 @@ pub fn vcvtmq_s64_f64(a: float64x2_t) -> int64x2_t { #[inline] #[cfg_attr(test, assert_instr(fcvtmu))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtm_u16_f16(a: float16x4_t) -> uint16x4_t { unsafe extern "unadjusted" { @@ -8269,7 +8269,7 @@ pub fn vcvtm_u16_f16(a: float16x4_t) -> uint16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtmu))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtmq_u16_f16(a: float16x8_t) -> uint16x8_t { unsafe extern "unadjusted" { @@ -8502,7 +8502,7 @@ pub fn vcvtmd_u64_f64(a: f64) -> u64 { #[inline] #[cfg_attr(test, assert_instr(fcvtns))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtn_s16_f16(a: float16x4_t) -> int16x4_t { unsafe extern "unadjusted" { @@ -8519,7 +8519,7 @@ pub fn vcvtn_s16_f16(a: float16x4_t) -> int16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtns))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtnq_s16_f16(a: float16x8_t) -> int16x8_t { unsafe extern "unadjusted" { @@ -8600,7 +8600,7 @@ pub fn vcvtnq_s64_f64(a: float64x2_t) -> int64x2_t { #[inline] #[cfg_attr(test, assert_instr(fcvtnu))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtn_u16_f16(a: float16x4_t) -> uint16x4_t { unsafe extern "unadjusted" { @@ -8617,7 +8617,7 @@ pub fn vcvtn_u16_f16(a: float16x4_t) -> uint16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtnu))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtnq_u16_f16(a: float16x8_t) -> uint16x8_t { unsafe extern "unadjusted" { @@ -8850,7 +8850,7 @@ pub fn vcvtnd_u64_f64(a: f64) -> u64 { #[inline] #[cfg_attr(test, assert_instr(fcvtps))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtp_s16_f16(a: float16x4_t) -> int16x4_t { unsafe extern "unadjusted" { @@ -8867,7 +8867,7 @@ pub fn vcvtp_s16_f16(a: float16x4_t) -> int16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtps))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtpq_s16_f16(a: float16x8_t) -> int16x8_t { unsafe extern "unadjusted" { @@ -8948,7 +8948,7 @@ pub fn vcvtpq_s64_f64(a: float64x2_t) -> int64x2_t { #[inline] #[cfg_attr(test, assert_instr(fcvtpu))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtp_u16_f16(a: float16x4_t) -> uint16x4_t { unsafe extern "unadjusted" { @@ -8965,7 +8965,7 @@ pub fn vcvtp_u16_f16(a: float16x4_t) -> uint16x4_t { #[inline] #[cfg_attr(test, assert_instr(fcvtpu))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtpq_u16_f16(a: float16x8_t) -> uint16x8_t { unsafe extern "unadjusted" { @@ -9429,7 +9429,7 @@ pub fn vcvtxd_f32_f64(a: f64) -> f32 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdiv_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fdiv))] pub fn vdiv_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -9439,7 +9439,7 @@ pub fn vdiv_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdivq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fdiv))] pub fn vdivq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -9487,7 +9487,7 @@ pub fn vdivq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] -#[cfg_attr(test, assert_instr(nop))] +#[cfg_attr(test, assert_instr(fdiv))] pub fn vdivh_f16(a: f16, b: f16) -> f16 { a / b } @@ -9500,10 +9500,10 @@ pub fn vdivh_f16(a: f16, b: f16) -> f16 { #[unstable(feature = "stdarch_neon_dotprod", issue = "117224")] pub fn vdot_laneq_s32(a: int32x2_t, b: int8x8_t, c: int8x16_t) -> int32x2_t { static_assert_uimm_bits!(LANE, 2); + let c: int32x4_t = vreinterpretq_s32_s8(c); unsafe { - let c: int32x4_t = transmute(c); let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); - vdot_s32(a, b, transmute(c)) + vdot_s32(a, b, vreinterpret_s8_s32(c)) } } #[doc = "Dot product arithmetic (indexed)"] @@ -9515,11 +9515,11 @@ pub fn vdot_laneq_s32(a: int32x2_t, b: int8x8_t, c: int8x16_t) #[unstable(feature = "stdarch_neon_dotprod", issue = "117224")] pub fn vdotq_laneq_s32(a: int32x4_t, b: int8x16_t, c: int8x16_t) -> int32x4_t { static_assert_uimm_bits!(LANE, 2); + let c: int32x4_t = vreinterpretq_s32_s8(c); unsafe { - let c: int32x4_t = transmute(c); let c: int32x4_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); - vdotq_s32(a, b, transmute(c)) + vdotq_s32(a, b, vreinterpretq_s8_s32(c)) } } #[doc = "Dot product arithmetic (indexed)"] @@ -9531,10 +9531,10 @@ pub fn vdotq_laneq_s32(a: int32x4_t, b: int8x16_t, c: int8x16_t #[unstable(feature = "stdarch_neon_dotprod", issue = "117224")] pub fn vdot_laneq_u32(a: uint32x2_t, b: uint8x8_t, c: uint8x16_t) -> uint32x2_t { static_assert_uimm_bits!(LANE, 2); + let c: uint32x4_t = vreinterpretq_u32_u8(c); unsafe { - let c: uint32x4_t = transmute(c); let c: uint32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); - vdot_u32(a, b, transmute(c)) + vdot_u32(a, b, vreinterpret_u8_u32(c)) } } #[doc = "Dot product arithmetic (indexed)"] @@ -9546,11 +9546,11 @@ pub fn vdot_laneq_u32(a: uint32x2_t, b: uint8x8_t, c: uint8x16_ #[unstable(feature = "stdarch_neon_dotprod", issue = "117224")] pub fn vdotq_laneq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t { static_assert_uimm_bits!(LANE, 2); + let c: uint32x4_t = vreinterpretq_u32_u8(c); unsafe { - let c: uint32x4_t = transmute(c); let c: uint32x4_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); - vdotq_u32(a, b, transmute(c)) + vdotq_u32(a, b, vreinterpretq_u8_u32(c)) } } #[doc = "Set all vector lanes to the same value"] @@ -10106,7 +10106,7 @@ pub fn vfma_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t { #[cfg_attr(test, assert_instr(fmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfma_lane_f16( a: float16x4_t, @@ -10122,7 +10122,7 @@ pub fn vfma_lane_f16( #[cfg_attr(test, assert_instr(fmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfma_laneq_f16( a: float16x4_t, @@ -10138,7 +10138,7 @@ pub fn vfma_laneq_f16( #[cfg_attr(test, assert_instr(fmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmaq_lane_f16( a: float16x8_t, @@ -10154,7 +10154,7 @@ pub fn vfmaq_lane_f16( #[cfg_attr(test, assert_instr(fmla, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmaq_laneq_f16( a: float16x8_t, @@ -10432,7 +10432,7 @@ pub fn vfmad_laneq_f64(a: f64, b: f64, c: float64x2_t) -> f64 { #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlal2))] pub fn vfmlal_high_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32x2_t { @@ -10450,7 +10450,7 @@ pub fn vfmlal_high_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float3 #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlal2))] pub fn vfmlalq_high_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float32x4_t { @@ -10470,7 +10470,7 @@ pub fn vfmlalq_high_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlal_lane_high_f16( r: float32x2_t, @@ -10487,7 +10487,7 @@ pub fn vfmlal_lane_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlal_laneq_high_f16( r: float32x2_t, @@ -10504,7 +10504,7 @@ pub fn vfmlal_laneq_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlalq_lane_high_f16( r: float32x4_t, @@ -10521,7 +10521,7 @@ pub fn vfmlalq_lane_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlalq_laneq_high_f16( r: float32x4_t, @@ -10538,7 +10538,7 @@ pub fn vfmlalq_laneq_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlal_lane_low_f16( r: float32x2_t, @@ -10555,7 +10555,7 @@ pub fn vfmlal_lane_low_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlal_laneq_low_f16( r: float32x2_t, @@ -10572,7 +10572,7 @@ pub fn vfmlal_laneq_low_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlalq_lane_low_f16( r: float32x4_t, @@ -10589,7 +10589,7 @@ pub fn vfmlalq_lane_low_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlalq_laneq_low_f16( r: float32x4_t, @@ -10604,7 +10604,7 @@ pub fn vfmlalq_laneq_low_f16( #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlal))] pub fn vfmlal_low_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32x2_t { @@ -10622,7 +10622,7 @@ pub fn vfmlal_low_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32 #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlal))] pub fn vfmlalq_low_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float32x4_t { @@ -10640,7 +10640,7 @@ pub fn vfmlalq_low_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float3 #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlsl2))] pub fn vfmlsl_high_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32x2_t { @@ -10658,7 +10658,7 @@ pub fn vfmlsl_high_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float3 #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlsl2))] pub fn vfmlslq_high_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float32x4_t { @@ -10678,7 +10678,7 @@ pub fn vfmlslq_high_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlsl_lane_high_f16( r: float32x2_t, @@ -10695,7 +10695,7 @@ pub fn vfmlsl_lane_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlsl_laneq_high_f16( r: float32x2_t, @@ -10712,7 +10712,7 @@ pub fn vfmlsl_laneq_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlslq_lane_high_f16( r: float32x4_t, @@ -10729,7 +10729,7 @@ pub fn vfmlslq_lane_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlslq_laneq_high_f16( r: float32x4_t, @@ -10746,7 +10746,7 @@ pub fn vfmlslq_laneq_high_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlsl_lane_low_f16( r: float32x2_t, @@ -10763,7 +10763,7 @@ pub fn vfmlsl_lane_low_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlsl_laneq_low_f16( r: float32x2_t, @@ -10780,7 +10780,7 @@ pub fn vfmlsl_laneq_low_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlslq_lane_low_f16( r: float32x4_t, @@ -10797,7 +10797,7 @@ pub fn vfmlslq_lane_low_f16( #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmlslq_laneq_low_f16( r: float32x4_t, @@ -10812,7 +10812,7 @@ pub fn vfmlslq_laneq_low_f16( #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlsl))] pub fn vfmlsl_low_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32x2_t { @@ -10830,7 +10830,7 @@ pub fn vfmlsl_low_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32 #[inline] #[target_feature(enable = "neon,fp16")] #[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmlsl))] pub fn vfmlslq_low_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float32x4_t { @@ -10861,7 +10861,7 @@ pub fn vfms_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t) -> float64x1_t { #[cfg_attr(test, assert_instr(fmls, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfms_lane_f16( a: float16x4_t, @@ -10877,7 +10877,7 @@ pub fn vfms_lane_f16( #[cfg_attr(test, assert_instr(fmls, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfms_laneq_f16( a: float16x4_t, @@ -10893,7 +10893,7 @@ pub fn vfms_laneq_f16( #[cfg_attr(test, assert_instr(fmls, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmsq_lane_f16( a: float16x8_t, @@ -10909,7 +10909,7 @@ pub fn vfmsq_lane_f16( #[cfg_attr(test, assert_instr(fmls, LANE = 0))] #[rustc_legacy_const_generics(3)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmsq_laneq_f16( a: float16x8_t, @@ -14739,7 +14739,7 @@ pub fn vmul_lane_f64(a: float64x1_t, b: float64x1_t) -> float64 #[cfg_attr(test, assert_instr(fmul, LANE = 0))] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmul_laneq_f16(a: float16x4_t, b: float16x8_t) -> float16x4_t { static_assert_uimm_bits!(LANE, 3); @@ -14756,7 +14756,7 @@ pub fn vmul_laneq_f16(a: float16x4_t, b: float16x8_t) -> float1 #[cfg_attr(test, assert_instr(fmul, LANE = 0))] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulq_laneq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { static_assert_uimm_bits!(LANE, 3); @@ -14829,7 +14829,7 @@ pub fn vmuld_lane_f64(a: f64, b: float64x1_t) -> f64 { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] -#[cfg_attr(test, assert_instr(nop))] +#[cfg_attr(test, assert_instr(fmul))] pub fn vmulh_f16(a: f16, b: f16) -> f16 { a * b } @@ -15263,7 +15263,7 @@ pub fn vmuld_laneq_f64(a: f64, b: float64x2_t) -> f64 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmulx))] pub fn vmulx_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -15280,7 +15280,7 @@ pub fn vmulx_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmulx))] pub fn vmulxq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -15363,7 +15363,7 @@ pub fn vmulxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { #[cfg_attr(test, assert_instr(fmulx, LANE = 0))] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulx_lane_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { static_assert_uimm_bits!(LANE, 2); @@ -15380,7 +15380,7 @@ pub fn vmulx_lane_f16(a: float16x4_t, b: float16x4_t) -> float1 #[cfg_attr(test, assert_instr(fmulx, LANE = 0))] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulx_laneq_f16(a: float16x4_t, b: float16x8_t) -> float16x4_t { static_assert_uimm_bits!(LANE, 3); @@ -15397,7 +15397,7 @@ pub fn vmulx_laneq_f16(a: float16x4_t, b: float16x8_t) -> float #[cfg_attr(test, assert_instr(fmulx, LANE = 0))] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulxq_lane_f16(a: float16x8_t, b: float16x4_t) -> float16x8_t { static_assert_uimm_bits!(LANE, 2); @@ -15427,7 +15427,7 @@ pub fn vmulxq_lane_f16(a: float16x8_t, b: float16x4_t) -> float #[cfg_attr(test, assert_instr(fmulx, LANE = 0))] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulxq_laneq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { static_assert_uimm_bits!(LANE, 3); @@ -15774,7 +15774,7 @@ pub fn vpadds_f32(a: float32x2_t) -> f32 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vpaddd_s64(a: int64x2_t) -> i64 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Add pairwise"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddd_u64)"] @@ -15783,13 +15783,13 @@ pub fn vpaddd_s64(a: int64x2_t) -> i64 { #[stable(feature = "neon_intrinsics", since = "1.59.0")] #[cfg_attr(test, assert_instr(addp))] pub fn vpaddd_u64(a: uint64x2_t) -> u64 { - unsafe { simd_reduce_add_unordered(a) } + unsafe { simd_reduce_add_ordered(a, 0) } } #[doc = "Floating-point add pairwise"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(faddp))] pub fn vpaddq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -16008,7 +16008,7 @@ pub fn vpaddq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpmax_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmaxp))] pub fn vpmax_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -16025,7 +16025,7 @@ pub fn vpmax_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpmaxq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmaxp))] pub fn vpmaxq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -16042,7 +16042,7 @@ pub fn vpmaxq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpmaxnm_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmaxnmp))] pub fn vpmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -16059,7 +16059,7 @@ pub fn vpmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpmaxnmq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fmaxnmp))] pub fn vpmaxnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -16316,7 +16316,7 @@ pub fn vpmaxs_f32(a: float32x2_t) -> f32 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpmin_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fminp))] pub fn vpmin_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -16333,7 +16333,7 @@ pub fn vpmin_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpminq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fminp))] pub fn vpminq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -16350,7 +16350,7 @@ pub fn vpminq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpminnm_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fminnmp))] pub fn vpminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -16367,7 +16367,7 @@ pub fn vpminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpminnmq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(fminnmp))] pub fn vpminnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -21492,8 +21492,8 @@ pub fn vrecpxh_f16(a: f16) -> f16 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpret_f64_f16)"] #[inline] #[cfg(target_endian = "little")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t { @@ -21503,8 +21503,8 @@ pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpret_f64_f16)"] #[inline] #[cfg(target_endian = "big")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t { @@ -21515,8 +21515,8 @@ pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpretq_f64_f16)"] #[inline] #[cfg(target_endian = "little")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t { @@ -21526,8 +21526,8 @@ pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpretq_f64_f16)"] #[inline] #[cfg(target_endian = "big")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t { @@ -21541,8 +21541,8 @@ pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpret_f16_f64)"] #[inline] #[cfg(target_endian = "little")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t { @@ -21552,8 +21552,8 @@ pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpret_f16_f64)"] #[inline] #[cfg(target_endian = "big")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t { @@ -21566,8 +21566,8 @@ pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpretq_f16_f64)"] #[inline] #[cfg(target_endian = "little")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpretq_f16_f64(a: float64x2_t) -> float16x8_t { @@ -21577,8 +21577,8 @@ pub fn vreinterpretq_f16_f64(a: float64x2_t) -> float16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vreinterpretq_f16_f64)"] #[inline] #[cfg(target_endian = "big")] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[target_feature(enable = "neon")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vreinterpretq_f16_f64(a: float64x2_t) -> float16x8_t { @@ -23157,7 +23157,7 @@ pub fn vrnd64z_f64(a: float64x1_t) -> float64x1_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrnd_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintz))] pub fn vrnd_f16(a: float16x4_t) -> float16x4_t { @@ -23167,7 +23167,7 @@ pub fn vrnd_f16(a: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintz))] pub fn vrndq_f16(a: float16x8_t) -> float16x8_t { @@ -23213,7 +23213,7 @@ pub fn vrndq_f64(a: float64x2_t) -> float64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrnda_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frinta))] pub fn vrnda_f16(a: float16x4_t) -> float16x4_t { @@ -23223,7 +23223,7 @@ pub fn vrnda_f16(a: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndaq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frinta))] pub fn vrndaq_f16(a: float16x8_t) -> float16x8_t { @@ -23289,7 +23289,7 @@ pub fn vrndh_f16(a: f16) -> f16 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndi_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frinti))] pub fn vrndi_f16(a: float16x4_t) -> float16x4_t { @@ -23306,7 +23306,7 @@ pub fn vrndi_f16(a: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndiq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frinti))] pub fn vrndiq_f16(a: float16x8_t) -> float16x8_t { @@ -23404,7 +23404,7 @@ pub fn vrndih_f16(a: f16) -> f16 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndm_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintm))] pub fn vrndm_f16(a: float16x4_t) -> float16x4_t { @@ -23414,7 +23414,7 @@ pub fn vrndm_f16(a: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndmq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintm))] pub fn vrndmq_f16(a: float16x8_t) -> float16x8_t { @@ -23535,7 +23535,7 @@ pub fn vrndns_f32(a: f32) -> f32 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndp_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintp))] pub fn vrndp_f16(a: float16x4_t) -> float16x4_t { @@ -23545,7 +23545,7 @@ pub fn vrndp_f16(a: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndpq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintp))] pub fn vrndpq_f16(a: float16x8_t) -> float16x8_t { @@ -23601,7 +23601,7 @@ pub fn vrndph_f16(a: f16) -> f16 { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndx_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintx))] pub fn vrndx_f16(a: float16x4_t) -> float16x4_t { @@ -23611,7 +23611,7 @@ pub fn vrndx_f16(a: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndxq_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(frintx))] pub fn vrndxq_f16(a: float16x8_t) -> float16x8_t { @@ -25034,7 +25034,7 @@ pub fn vsqadds_u32(a: u32, b: i32) -> u32 { #[inline] #[cfg_attr(test, assert_instr(fsqrt))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vsqrt_f16(a: float16x4_t) -> float16x4_t { unsafe { simd_fsqrt(a) } @@ -25044,7 +25044,7 @@ pub fn vsqrt_f16(a: float16x4_t) -> float16x4_t { #[inline] #[cfg_attr(test, assert_instr(fsqrt))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] pub fn vsqrtq_f16(a: float16x8_t) -> float16x8_t { unsafe { simd_fsqrt(a) } @@ -26719,7 +26719,7 @@ pub fn vsubq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(nop))] +#[cfg_attr(test, assert_instr(sub))] pub fn vsubd_s64(a: i64, b: i64) -> i64 { a.wrapping_sub(b) } @@ -26728,7 +26728,7 @@ pub fn vsubd_s64(a: i64, b: i64) -> i64 { #[inline] #[target_feature(enable = "neon")] #[stable(feature = "neon_intrinsics", since = "1.59.0")] -#[cfg_attr(test, assert_instr(nop))] +#[cfg_attr(test, assert_instr(sub))] pub fn vsubd_u64(a: u64, b: u64) -> u64 { a.wrapping_sub(b) } @@ -26738,7 +26738,7 @@ pub fn vsubd_u64(a: u64, b: u64) -> u64 { #[target_feature(enable = "neon,fp16")] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] -#[cfg_attr(test, assert_instr(nop))] +#[cfg_attr(test, assert_instr(fsub))] pub fn vsubh_f16(a: f16, b: f16) -> f16 { a - b } @@ -27532,7 +27532,7 @@ pub fn vtbx4_p8(a: poly8x8_t, b: poly8x8x4_t, c: uint8x8_t) -> poly8x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vtrn1_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(trn1))] pub fn vtrn1_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -27542,7 +27542,7 @@ pub fn vtrn1_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vtrn1q_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(trn1))] pub fn vtrn1q_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -27768,7 +27768,7 @@ pub fn vtrn1q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vtrn2_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(trn2))] pub fn vtrn2_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -27778,7 +27778,7 @@ pub fn vtrn2_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vtrn2q_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(trn2))] pub fn vtrn2q_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -28283,10 +28283,10 @@ pub fn vuqadds_s32(a: i32, b: u32) -> i32 { #[unstable(feature = "stdarch_neon_i8mm", issue = "117223")] pub fn vusdot_laneq_s32(a: int32x2_t, b: uint8x8_t, c: int8x16_t) -> int32x2_t { static_assert_uimm_bits!(LANE, 2); + let c: int32x4_t = vreinterpretq_s32_s8(c); unsafe { - let c: int32x4_t = transmute(c); let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); - vusdot_s32(a, b, transmute(c)) + vusdot_s32(a, b, vreinterpret_s8_s32(c)) } } #[doc = "Dot product index form with unsigned and signed integers"] @@ -28298,18 +28298,18 @@ pub fn vusdot_laneq_s32(a: int32x2_t, b: uint8x8_t, c: int8x16_ #[unstable(feature = "stdarch_neon_i8mm", issue = "117223")] pub fn vusdotq_laneq_s32(a: int32x4_t, b: uint8x16_t, c: int8x16_t) -> int32x4_t { static_assert_uimm_bits!(LANE, 2); + let c: int32x4_t = vreinterpretq_s32_s8(c); unsafe { - let c: int32x4_t = transmute(c); let c: int32x4_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); - vusdotq_s32(a, b, transmute(c)) + vusdotq_s32(a, b, vreinterpretq_s8_s32(c)) } } #[doc = "Unzip vectors"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vuzp1_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uzp1))] pub fn vuzp1_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -28319,7 +28319,7 @@ pub fn vuzp1_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vuzp1q_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uzp1))] pub fn vuzp1q_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -28545,7 +28545,7 @@ pub fn vuzp1q_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vuzp2_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uzp2))] pub fn vuzp2_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -28555,7 +28555,7 @@ pub fn vuzp2_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vuzp2q_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(uzp2))] pub fn vuzp2q_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -28799,7 +28799,7 @@ pub fn vxarq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vzip1_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(zip1))] pub fn vzip1_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -28809,7 +28809,7 @@ pub fn vzip1_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vzip1q_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(zip1))] pub fn vzip1q_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { @@ -29035,7 +29035,7 @@ pub fn vzip1q_p64(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vzip2_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(zip2))] pub fn vzip2_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { @@ -29045,7 +29045,7 @@ pub fn vzip2_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vzip2q_f16)"] #[inline] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(zip2))] pub fn vzip2q_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { diff --git a/library/stdarch/crates/core_arch/src/amdgpu/mod.rs b/library/stdarch/crates/core_arch/src/amdgpu/mod.rs new file mode 100644 index 000000000000..40274e4d794f --- /dev/null +++ b/library/stdarch/crates/core_arch/src/amdgpu/mod.rs @@ -0,0 +1,1053 @@ +//! amdgpu intrinsics +//! +//! The reference is the [LLVM amdgpu guide] and the [LLVM implementation]. +//! The order of intrinsics here follows the order in the [LLVM implementation]. +//! +//! [LLVM amdgpu guide]: https://llvm.org/docs/AMDGPUUsage.html#llvm-ir-intrinsics +//! [LLVM implementation]: https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/IntrinsicsAMDGPU.td + +#[allow(improper_ctypes)] +unsafe extern "unadjusted" { + #[link_name = "llvm.amdgcn.workitem.id.x"] + safe fn llvm_workitem_id_x() -> u32; + #[link_name = "llvm.amdgcn.workitem.id.y"] + safe fn llvm_workitem_id_y() -> u32; + #[link_name = "llvm.amdgcn.workitem.id.z"] + safe fn llvm_workitem_id_z() -> u32; + + #[link_name = "llvm.amdgcn.workgroup.id.x"] + safe fn llvm_workgroup_id_x() -> u32; + #[link_name = "llvm.amdgcn.workgroup.id.y"] + safe fn llvm_workgroup_id_y() -> u32; + #[link_name = "llvm.amdgcn.workgroup.id.z"] + safe fn llvm_workgroup_id_z() -> u32; + + #[link_name = "llvm.amdgcn.groupstaticsize"] + safe fn llvm_groupstaticsize() -> u32; + #[link_name = "llvm.amdgcn.dispatch.id"] + safe fn llvm_dispatch_id() -> u64; + + #[link_name = "llvm.amdgcn.wavefrontsize"] + safe fn llvm_wavefrontsize() -> u32; + + #[link_name = "llvm.amdgcn.s.barrier"] + safe fn llvm_s_barrier(); + #[link_name = "llvm.amdgcn.s.barrier.signal"] + fn llvm_s_barrier_signal(barrier_type: i32); + #[link_name = "llvm.amdgcn.s.barrier.signal.isfirst"] + fn llvm_s_barrier_signal_isfirst(barrier_type: i32) -> bool; + #[link_name = "llvm.amdgcn.s.barrier.wait"] + fn llvm_s_barrier_wait(barrier_type: i16); + #[link_name = "llvm.amdgcn.s.get.barrier.state"] + fn llvm_s_get_barrier_state(barrier_type: i32) -> u32; + #[link_name = "llvm.amdgcn.wave.barrier"] + safe fn llvm_wave_barrier(); + #[link_name = "llvm.amdgcn.sched.barrier"] + fn llvm_sched_barrier(mask: u32); + #[link_name = "llvm.amdgcn.sched.group.barrier"] + fn llvm_sched_group_barrier(mask: u32, size: u32, sync_id: u32); + + #[link_name = "llvm.amdgcn.s.sleep"] + safe fn llvm_s_sleep(count: u32); + + #[link_name = "llvm.amdgcn.s.sethalt"] + safe fn llvm_s_sethalt(value: u32) -> !; + + #[link_name = "llvm.amdgcn.s.getpc"] + safe fn llvm_s_getpc() -> i64; + + #[link_name = "llvm.amdgcn.mbcnt.lo"] + safe fn llvm_mbcnt_lo(value: u32, init: u32) -> u32; + #[link_name = "llvm.amdgcn.mbcnt.hi"] + safe fn llvm_mbcnt_hi(value: u32, init: u32) -> u32; + + #[link_name = "llvm.amdgcn.ballot"] + safe fn llvm_ballot(b: bool) -> u64; + + #[link_name = "llvm.amdgcn.inverse.ballot"] + safe fn llvm_inverse_ballot(value: u64) -> bool; + + #[link_name = "llvm.amdgcn.wave.reduce.umin"] + safe fn llvm_wave_reduce_umin(value: u32, strategy: u32) -> u32; + #[link_name = "llvm.amdgcn.wave.reduce.min"] + safe fn llvm_wave_reduce_min(value: i32, strategy: u32) -> i32; + #[link_name = "llvm.amdgcn.wave.reduce.umax"] + safe fn llvm_wave_reduce_umax(value: u32, strategy: u32) -> u32; + #[link_name = "llvm.amdgcn.wave.reduce.max"] + safe fn llvm_wave_reduce_max(value: i32, strategy: u32) -> i32; + #[link_name = "llvm.amdgcn.wave.reduce.add"] + safe fn llvm_wave_reduce_add(value: u32, strategy: u32) -> u32; + #[link_name = "llvm.amdgcn.wave.reduce.and"] + safe fn llvm_wave_reduce_and(value: u32, strategy: u32) -> u32; + #[link_name = "llvm.amdgcn.wave.reduce.or"] + safe fn llvm_wave_reduce_or(value: u32, strategy: u32) -> u32; + #[link_name = "llvm.amdgcn.wave.reduce.xor"] + safe fn llvm_wave_reduce_xor(value: u32, strategy: u32) -> u32; + + // The following intrinsics can have multiple sizes + + #[link_name = "llvm.amdgcn.readfirstlane.i32"] + safe fn llvm_readfirstlane_u32(value: u32) -> u32; + #[link_name = "llvm.amdgcn.readfirstlane.i64"] + safe fn llvm_readfirstlane_u64(value: u64) -> u64; + #[link_name = "llvm.amdgcn.readlane.i32"] + fn llvm_readlane_u32(value: u32, lane: u32) -> u32; + #[link_name = "llvm.amdgcn.readlane.i64"] + fn llvm_readlane_u64(value: u64, lane: u32) -> u64; + #[link_name = "llvm.amdgcn.writelane.i32"] + fn llvm_writelane_u32(value: u32, lane: u32, default: u32) -> u32; + #[link_name = "llvm.amdgcn.writelane.i64"] + fn llvm_writelane_u64(value: u64, lane: u32, default: u64) -> u64; + + #[link_name = "llvm.amdgcn.endpgm"] + safe fn llvm_endpgm() -> !; + + #[link_name = "llvm.amdgcn.update.dpp.i32"] + fn llvm_update_dpp( + old: u32, + src: u32, + dpp_ctrl: u32, + row_mask: u32, + bank_mask: u32, + bound_control: bool, + ) -> u32; + + #[link_name = "llvm.amdgcn.s.memrealtime"] + safe fn llvm_s_memrealtime() -> u64; + + #[link_name = "llvm.amdgcn.ds.permute"] + fn llvm_ds_permute(lane: u32, value: u32) -> u32; + #[link_name = "llvm.amdgcn.ds.bpermute"] + fn llvm_ds_bpermute(lane: u32, value: u32) -> u32; + #[link_name = "llvm.amdgcn.perm"] + fn llvm_perm(src0: u32, src1: u32, selector: u32) -> u32; + + // gfx10 + #[link_name = "llvm.amdgcn.permlane16.i32"] + fn llvm_permlane16_u32( + old: u32, + src0: u32, + src1: u32, + src2: u32, + fi: bool, + bound_control: bool, + ) -> u32; + + // gfx10 + #[link_name = "llvm.amdgcn.permlanex16.i32"] + fn llvm_permlanex16_u32( + old: u32, + src0: u32, + src1: u32, + src2: u32, + fi: bool, + bound_control: bool, + ) -> u32; + + #[link_name = "llvm.amdgcn.s.get.waveid.in.workgroup"] + safe fn llvm_s_get_waveid_in_workgroup() -> u32; + + // gfx11 + #[link_name = "llvm.amdgcn.permlane64.i32"] + fn llvm_permlane64_u32(value: u32) -> u32; + + // gfx12 + #[link_name = "llvm.amdgcn.permlane16.var"] + fn llvm_permlane16_var(old: u32, src0: u32, src1: u32, fi: bool, bound_control: bool) -> u32; + + // gfx12 + #[link_name = "llvm.amdgcn.permlanex16.var"] + fn llvm_permlanex16_var(old: u32, src0: u32, src1: u32, fi: bool, bound_control: bool) -> u32; + + #[link_name = "llvm.amdgcn.wave.id"] + safe fn llvm_wave_id() -> u32; + + // gfx950 + #[link_name = "llvm.amdgcn.permlane16.swap"] + fn llvm_permlane16_swap( + vdst_old: u32, + vsrc_src0: u32, + fi: bool, + bound_control: bool, + ) -> (u32, u32); + + // gfx950 + #[link_name = "llvm.amdgcn.permlane32.swap"] + fn llvm_permlane32_swap( + vdst_old: u32, + vsrc_src0: u32, + fi: bool, + bound_control: bool, + ) -> (u32, u32); +} + +/// Returns the x coordinate of the workitem index within the workgroup. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn workitem_id_x() -> u32 { + llvm_workitem_id_x() +} +/// Returns the y coordinate of the workitem index within the workgroup. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn workitem_id_y() -> u32 { + llvm_workitem_id_y() +} +/// Returns the z coordinate of the workitem index within the workgroup. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn workitem_id_z() -> u32 { + llvm_workitem_id_z() +} + +/// Returns the x coordinate of the workgroup index within the dispatch. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn workgroup_id_x() -> u32 { + llvm_workgroup_id_x() +} +/// Returns the y coordinate of the workgroup index within the dispatch. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn workgroup_id_y() -> u32 { + llvm_workgroup_id_y() +} +/// Returns the z coordinate of the workgroup index within the dispatch. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn workgroup_id_z() -> u32 { + llvm_workgroup_id_z() +} + +/// Returns the size of statically allocated shared memory for this program in bytes. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn groupstaticsize() -> u32 { + llvm_groupstaticsize() +} +/// Returns the id of the dispatch that is currently executed. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn dispatch_id() -> u64 { + llvm_dispatch_id() +} + +/// Returns the number of threads in a wavefront. +/// +/// Is always a power of 2. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wavefrontsize() -> u32 { + llvm_wavefrontsize() +} + +/// Synchronize all wavefronts in a workgroup. +/// +/// Each wavefronts in a workgroup waits at the barrier until all wavefronts in the workgroup arrive at a barrier. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn s_barrier() { + llvm_s_barrier() +} + +/// Signal a specific barrier type. +/// +/// Only for non-named barriers. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn s_barrier_signal() { + unsafe { llvm_s_barrier_signal(BARRIER_TYPE) } +} + +/// Signal a specific barrier type. +/// +/// Only for non-named barriers. +/// Provides access to the s_barrier_signal_first instruction; +/// additionally ensures that the result value is valid even when +/// the intrinsic is used from a wavefront that is not running in a workgroup. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn s_barrier_signal_isfirst() -> bool { + unsafe { llvm_s_barrier_signal_isfirst(BARRIER_TYPE) } +} + +/// Wait for a specific barrier type. +/// +/// Only for non-named barriers. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn s_barrier_wait() { + unsafe { llvm_s_barrier_wait(BARRIER_TYPE) } +} + +/// Get the state of a specific barrier type. +/// +/// The `barrier_type` argument must be uniform, otherwise behavior is undefined. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn s_get_barrier_state() -> u32 { + unsafe { llvm_s_get_barrier_state(BARRIER_TYPE) } +} + +/// A barrier for only the threads within the current wavefront. +/// +/// Does not result in an instruction but restricts the compiler. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_barrier() { + llvm_wave_barrier() +} + +/// Prevent movement of some instruction types. +/// +/// Controls the types of instructions that may be allowed to cross the intrinsic during instruction scheduling. +/// The parameter is a mask for the instruction types that can cross the intrinsic. +/// +/// - 0x0000: No instructions may be scheduled across `sched_barrier`. +/// - 0x0001: All, non-memory, non-side-effect producing instructions may be scheduled across `sched_barrier`, i.e. allow ALU instructions to pass. +/// - 0x0002: VALU instructions may be scheduled across `sched_barrier`. +/// - 0x0004: SALU instructions may be scheduled across `sched_barrier`. +/// - 0x0008: MFMA/WMMA instructions may be scheduled across `sched_barrier`. +/// - 0x0010: All VMEM instructions may be scheduled across `sched_barrier`. +/// - 0x0020: VMEM read instructions may be scheduled across `sched_barrier`. +/// - 0x0040: VMEM write instructions may be scheduled across `sched_barrier`. +/// - 0x0080: All DS instructions may be scheduled across `sched_barrier`. +/// - 0x0100: All DS read instructions may be scheduled across `sched_barrier`. +/// - 0x0200: All DS write instructions may be scheduled across `sched_barrier`. +/// - 0x0400: All Transcendental (e.g. V_EXP) instructions may be scheduled across `sched_barrier`. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn sched_barrier() { + static_assert_uimm_bits!(MASK, 11); + unsafe { llvm_sched_barrier(MASK) } +} + +/// Creates schedule groups with specific properties to create custom scheduling pipelines. +/// +/// The ordering between groups is enforced by the instruction scheduler. +/// The intrinsic applies to the code that precedes the intrinsic. +/// The intrinsic takes three values that control the behavior of the schedule groups. +/// +/// - `mask`: Classify instruction groups using the [`sched_barrier`] mask values. +/// - `size`: The number of instructions that are in the group. +/// - `sync_id`: Order is enforced between groups with matching values. +/// +/// The mask can include multiple instruction types. It is undefined behavior to set values beyond the range of valid masks. +/// +/// Combining multiple `sched_group_barrier` intrinsics enables an ordering of specific instruction types during instruction scheduling. +/// For example, the following enforces a sequence of 1 VMEM read, followed by 1 VALU instruction, followed by 5 MFMA instructions. +/// +/// ```rust +/// // 1 VMEM read +/// sched_group_barrier::<32, 1, 0>() +/// // 1 VALU +/// sched_group_barrier::<2, 1, 0>() +/// // 5 MFMA +/// sched_group_barrier::<8, 5, 0>() +/// ``` +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn sched_group_barrier() { + static_assert_uimm_bits!(MASK, 11); + unsafe { llvm_sched_group_barrier(MASK, SIZE, SYNC_ID) } +} + +/// Sleeps for approximately `COUNT * 64` cycles. +/// +/// `COUNT` must be a constant. +/// Only the lower 7 bits of `COUNT` are used. +/// If `COUNT == 0x8000`, sleep forever until woken up, or killed. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn s_sleep() { + llvm_s_sleep(COUNT) +} + +/// Stop execution of the kernel. +/// +/// This usually signals an error state. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn s_sethalt() -> ! { + static_assert_uimm_bits!(VALUE, 3); + llvm_s_sethalt(VALUE) +} + +/// Returns the current process counter. +/// +/// Provides access to the s_getpc_b64 instruction, but with the return value sign-extended +/// from the width of the underlying PC hardware register even on processors where the +/// s_getpc_b64 instruction returns a zero-extended value. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn s_getpc() -> i64 { + llvm_s_getpc() +} + +/// Masked bit count, low 32 lanes. +/// +/// Computes the number of bits set in `value`, masked with a thread mask +/// which contains 1 for all active threads less than the current thread within a wavefront. +/// `init` is added to the result. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn mbcnt_lo(value: u32, init: u32) -> u32 { + llvm_mbcnt_lo(value, init) +} +/// Masked bit count, high 32 lanes. +/// +/// Computes the number of bits set in `value`, masked with a thread mask +/// which contains 1 for all active threads less than the current thread within a wavefront. +/// `init` is added to the result. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn mbcnt_hi(value: u32, init: u32) -> u32 { + llvm_mbcnt_hi(value, init) +} + +/// Returns a bitfield (`u32` or `u64`) containing the result of its i1 argument +/// in all active lanes, and zero in all inactive lanes. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn ballot(b: bool) -> u64 { + llvm_ballot(b) +} + +/// Indexes into the `value` with the current lane id and returns for each lane +/// if the corresponding bit is set. +/// +/// While [`ballot`] converts a `bool` to a mask, `inverse_ballot` converts a mask back to a `bool`. +/// This means `inverse_ballot(ballot(b)) == b`. +/// The inverse of `ballot(inverse_ballot(value)) ~= value` is not always true as inactive lanes are set to zero by `ballot`. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn inverse_ballot(value: u64) -> bool { + llvm_inverse_ballot(value) +} + +/// Performs an arithmetic min reduction on the unsigned values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_umin(value: u32) -> u32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_umin(value, STRATEGY) +} +/// Performs an arithmetic min reduction on the signed values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_min(value: i32) -> i32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_min(value, STRATEGY) +} + +/// Performs an arithmetic max reduction on the unsigned values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_umax(value: u32) -> u32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_umax(value, STRATEGY) +} +/// Performs an arithmetic max reduction on the signed values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_max(value: i32) -> i32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_max(value, STRATEGY) +} + +/// Performs an arithmetic add reduction on the values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_add(value: u32) -> u32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_add(value, STRATEGY) +} + +/// Performs a logical and reduction on the unsigned values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_and(value: u32) -> u32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_and(value, STRATEGY) +} +/// Performs a logical or reduction on the unsigned values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_or(value: u32) -> u32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_or(value, STRATEGY) +} +/// Performs a logical xor reduction on the unsigned values provided by each lane in the wavefront. +/// +/// The `STRATEGY` argument is a hint for the reduction strategy. +/// - 0: Target default preference +/// - 1: Iterative strategy +/// - 2: DPP +/// +/// If target does not support the DPP operations (e.g. gfx6/7), reduction will be performed using default iterative strategy. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_reduce_xor(value: u32) -> u32 { + static_assert!(STRATEGY <= 2); + llvm_wave_reduce_xor(value, STRATEGY) +} + +// The following intrinsics can have multiple sizes + +/// Get `value` from the first active lane in the wavefront. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn readfirstlane_u32(value: u32) -> u32 { + llvm_readfirstlane_u32(value) +} +/// Get `value` from the first active lane in the wavefront. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn readfirstlane_u64(value: u64) -> u64 { + llvm_readfirstlane_u64(value) +} +/// Get `value` from the lane at index `lane` in the wavefront. +/// +/// The lane argument must be uniform across the currently active threads +/// of the current wavefront. Otherwise, the result is undefined. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn readlane_u32(value: u32, lane: u32) -> u32 { + unsafe { llvm_readlane_u32(value, lane) } +} +/// Get `value` from the lane at index `lane` in the wavefront. +/// +/// The lane argument must be uniform across the currently active threads +/// of the current wavefront. Otherwise, the result is undefined. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn readlane_u64(value: u64, lane: u32) -> u64 { + unsafe { llvm_readlane_u64(value, lane) } +} +/// Return `value` for the lane at index `lane` in the wavefront. +/// Return `default` for all other lanes. +/// +/// The value to write and lane select arguments must be uniform across the +/// currently active threads of the current wavefront. Otherwise, the result is +/// undefined. +/// +/// `value` is the value returned by `lane`. +/// `default` is the value returned by all lanes other than `lane`. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn writelane_u32(value: u32, lane: u32, default: u32) -> u32 { + unsafe { llvm_writelane_u32(value, lane, default) } +} +/// Return `value` for the lane at index `lane` in the wavefront. +/// Return `default` for all other lanes. +/// +/// The value to write and lane select arguments must be uniform across the +/// currently active threads of the current wavefront. Otherwise, the result is +/// undefined. +/// +/// `value` is the value returned by `lane`. +/// `default` is the value returned by all lanes other than `lane`. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn writelane_u64(value: u64, lane: u32, default: u64) -> u64 { + unsafe { llvm_writelane_u64(value, lane, default) } +} + +/// Stop execution of the wavefront. +/// +/// This usually signals the end of a successful execution. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn endpgm() -> ! { + llvm_endpgm() +} + +/// The `update_dpp` intrinsic represents the `update.dpp` operation in AMDGPU. +/// It takes an old value, a source operand, a DPP control operand, a row mask, a bank mask, and a bound control. +/// This operation is equivalent to a sequence of `v_mov_b32` operations. +/// +/// `llvm.amdgcn.update.dpp.i32 ` +/// Should be equivalent to: +/// ```asm +/// v_mov_b32 +/// v_mov_b32 +/// ``` +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn update_dpp< + const DPP_CTRL: u32, + const ROW_MASK: u32, + const BANK_MASK: u32, + const BOUND_CONTROL: bool, +>( + old: u32, + src: u32, +) -> u32 { + unsafe { llvm_update_dpp(old, src, DPP_CTRL, ROW_MASK, BANK_MASK, BOUND_CONTROL) } +} + +/// Measures time based on a fixed frequency. +/// +/// Provides a real-time clock counter that runs at constant speed (typically 100 MHz) independent of ALU clock speeds. +/// The clock is consistent across the chip, so can be used for measuring between different wavefronts. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn s_memrealtime() -> u64 { + llvm_s_memrealtime() +} + +/// Scatter data across all lanes in a wavefront. +/// +/// Writes `value` to the lane `lane`. +/// +/// Reading from inactive lanes returns `0`. +/// In case multiple values get written to the same `lane`, the value from the source lane with the higher index is taken. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn ds_permute(lane: u32, value: u32) -> u32 { + unsafe { llvm_ds_permute(lane, value) } +} +/// Gather data across all lanes in a wavefront. +/// +/// Returns the `value` given to `ds_permute` by lane `lane`. +/// +/// Reading from inactive lanes returns `0`. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn ds_bpermute(lane: u32, value: u32) -> u32 { + unsafe { llvm_ds_bpermute(lane, value) } +} +/// Permute a 64-bit value. +/// +/// `selector` selects between different patterns in which the 64-bit values represented by `src0` and `src1` are permuted. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn perm(src0: u32, src1: u32, selector: u32) -> u32 { + unsafe { llvm_perm(src0, src1, selector) } +} + +// gfx10 +/// Performs arbitrary gather-style operation within a row (16 contiguous lanes) of the second input operand. +/// +/// The third and fourth inputs must be uniform across the current wavefront. +/// These are combined into a single 64-bit value representing lane selects used to swizzle within each row. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlane16_u32( + old: u32, + src0: u32, + src1: u32, + src2: u32, +) -> u32 { + unsafe { llvm_permlane16_u32(old, src0, src1, src2, FI, BOUND_CONTROL) } +} + +// gfx10 +/// Performs arbitrary gather-style operation across two rows (16 contiguous lanes) of the second input operand. +/// +/// The third and fourth inputs must be uniform across the current wavefront. +/// These are combined into a single 64-bit value representing lane selects used to swizzle within each row. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlanex16_u32( + old: u32, + src0: u32, + src1: u32, + src2: u32, +) -> u32 { + unsafe { llvm_permlanex16_u32(old, src0, src1, src2, FI, BOUND_CONTROL) } +} + +/// Get the index of the current wavefront in the workgroup. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn s_get_waveid_in_workgroup() -> u32 { + llvm_s_get_waveid_in_workgroup() +} + +// gfx11 +/// Swap `value` between upper and lower 32 lanes in a wavefront. +/// +/// Does nothing for wave32. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlane64_u32(value: u32) -> u32 { + unsafe { llvm_permlane64_u32(value) } +} + +// gfx12 +/// Performs arbitrary gather-style operation within a row (16 contiguous lanes) of the second input operand. +/// +/// In contrast to [`permlane16_u32`], allows each lane to specify its own gather lane. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlane16_var( + old: u32, + src0: u32, + src1: u32, +) -> u32 { + unsafe { llvm_permlane16_var(old, src0, src1, FI, BOUND_CONTROL) } +} + +// gfx12 +/// Performs arbitrary gather-style operation across two rows (16 contiguous lanes) of the second input operand. +/// +/// In contrast to [`permlanex16_u32`], allows each lane to specify its own gather lane. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlanex16_var( + old: u32, + src0: u32, + src1: u32, +) -> u32 { + unsafe { llvm_permlanex16_var(old, src0, src1, FI, BOUND_CONTROL) } +} + +/// Get the index of the current wavefront in the workgroup. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub fn wave_id() -> u32 { + llvm_wave_id() +} + +// gfx950 +/// Provide direct access to `v_permlane16_swap_b32` instruction on supported targets. +/// +/// Swaps the values across lanes of first 2 operands. +/// Odd rows of the first operand are swapped with even rows of the second operand (one row is 16 lanes). +/// Returns a pair for the swapped registers. +/// The first element of the return corresponds to the swapped element of the first argument. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlane16_swap( + vdst_old: u32, + vsrc_src0: u32, +) -> (u32, u32) { + unsafe { llvm_permlane16_swap(vdst_old, vsrc_src0, FI, BOUND_CONTROL) } +} + +// gfx950 +/// Provide direct access to `v_permlane32_swap_b32` instruction on supported targets. +/// +/// Swaps the values across lanes of first 2 operands. +/// Rows 2 and 3 of the first operand are swapped with rows 0 and 1 of the second operand (one row is 16 lanes). +/// Returns a pair for the swapped registers. +/// The first element of the return corresponds to the swapped element of the first argument. +#[inline] +#[unstable(feature = "stdarch_amdgpu", issue = "149988")] +pub unsafe fn permlane32_swap( + vdst_old: u32, + vsrc_src0: u32, +) -> (u32, u32) { + unsafe { llvm_permlane32_swap(vdst_old, vsrc_src0, FI, BOUND_CONTROL) } +} + +// Functions to generate code, used to check that the intrinsics build. +// Marked as no_mangle, so the compiler does not remove the functions. +// To test, uncomment the `#[cfg(test)]` line below and run +// NORUN=1 NOSTD=1 TARGET=amdgcn-amd-amdhsa CARGO_UNSTABLE_BUILD_STD=core ci/run.sh +// +// Note that depending on the target-cpu set in run.sh, some of these intrinsics are not available +// and compilation fails with `Cannot select: intrinsic %llvm.amdgcn...`. +// Uncomment these intrinsics to check. +#[cfg(test)] +mod tests { + use super::*; + + #[unsafe(no_mangle)] + fn test_workitem_id_x() -> u32 { + workitem_id_x() + } + #[unsafe(no_mangle)] + fn test_workitem_id_y() -> u32 { + workitem_id_y() + } + #[unsafe(no_mangle)] + fn test_workitem_id_z() -> u32 { + workitem_id_z() + } + + #[unsafe(no_mangle)] + fn test_workgroup_id_x() -> u32 { + workgroup_id_x() + } + #[unsafe(no_mangle)] + fn test_workgroup_id_y() -> u32 { + workgroup_id_y() + } + #[unsafe(no_mangle)] + fn test_workgroup_id_z() -> u32 { + workgroup_id_z() + } + + #[unsafe(no_mangle)] + fn test_groupstaticsize() -> u32 { + groupstaticsize() + } + #[unsafe(no_mangle)] + fn test_dispatch_id() -> u64 { + dispatch_id() + } + + #[unsafe(no_mangle)] + fn test_wavefrontsize() -> u32 { + wavefrontsize() + } + + #[unsafe(no_mangle)] + fn test_s_barrier() { + s_barrier() + } + + #[unsafe(no_mangle)] + fn test_s_barrier_signal() { + unsafe { s_barrier_signal::<-1>() } + } + + #[unsafe(no_mangle)] + fn test_s_barrier_signal_isfirst() -> bool { + unsafe { s_barrier_signal_isfirst::<-1>() } + } + + #[unsafe(no_mangle)] + fn test_s_barrier_wait() { + unsafe { s_barrier_wait::<-1>() } + } + + #[unsafe(no_mangle)] + fn test_s_get_barrier_state() -> u32 { + unsafe { s_get_barrier_state::<-1>() } + } + + #[unsafe(no_mangle)] + fn test_wave_barrier() { + wave_barrier() + } + + #[unsafe(no_mangle)] + fn test_sched_barrier() { + unsafe { sched_barrier::<1>() } + } + + #[unsafe(no_mangle)] + fn test_sched_group_barrier() { + unsafe { sched_group_barrier::<1, 1, 0>() } + } + + #[unsafe(no_mangle)] + fn test_s_sleep() { + s_sleep::<1>() + } + + #[unsafe(no_mangle)] + fn test_s_sethalt() -> ! { + s_sethalt::<1>() + } + + #[unsafe(no_mangle)] + fn test_s_getpc() -> i64 { + s_getpc() + } + + #[unsafe(no_mangle)] + fn test_mbcnt_lo(value: u32, init: u32) -> u32 { + mbcnt_lo(value, init) + } + #[unsafe(no_mangle)] + fn test_mbcnt_hi(value: u32, init: u32) -> u32 { + mbcnt_hi(value, init) + } + + #[unsafe(no_mangle)] + fn test_ballot(b: bool) -> u64 { + ballot(b) + } + + #[unsafe(no_mangle)] + fn test_inverse_ballot(value: u64) -> bool { + inverse_ballot(value) + } + + #[unsafe(no_mangle)] + fn test_wave_reduce_umin(value: u32) -> u32 { + wave_reduce_umin::<0>(value) + } + #[unsafe(no_mangle)] + fn test_wave_reduce_min(value: i32) -> i32 { + wave_reduce_min::<0>(value) + } + + #[unsafe(no_mangle)] + fn test_wave_reduce_umax(value: u32) -> u32 { + wave_reduce_umax::<0>(value) + } + #[unsafe(no_mangle)] + fn test_wave_reduce_max(value: i32) -> i32 { + wave_reduce_max::<0>(value) + } + + #[unsafe(no_mangle)] + fn test_wave_reduce_add(value: u32) -> u32 { + wave_reduce_add::<0>(value) + } + + #[unsafe(no_mangle)] + fn test_wave_reduce_and(value: u32) -> u32 { + wave_reduce_and::<0>(value) + } + #[unsafe(no_mangle)] + fn test_wave_reduce_or(value: u32) -> u32 { + wave_reduce_or::<0>(value) + } + #[unsafe(no_mangle)] + fn test_wave_reduce_xor(value: u32) -> u32 { + wave_reduce_xor::<0>(value) + } + + #[unsafe(no_mangle)] + fn test_readfirstlane_u32(value: u32) -> u32 { + readfirstlane_u32(value) + } + #[unsafe(no_mangle)] + fn test_readfirstlane_u64(value: u64) -> u64 { + readfirstlane_u64(value) + } + #[unsafe(no_mangle)] + fn test_readlane_u32(value: u32, lane: u32) -> u32 { + unsafe { readlane_u32(value, lane) } + } + #[unsafe(no_mangle)] + fn test_readlane_u64(value: u64, lane: u32) -> u64 { + unsafe { readlane_u64(value, lane) } + } + #[unsafe(no_mangle)] + fn test_writelane_u32(value: u32, lane: u32, default: u32) -> u32 { + unsafe { writelane_u32(value, lane, default) } + } + #[unsafe(no_mangle)] + fn test_writelane_u64(value: u64, lane: u32, default: u64) -> u64 { + unsafe { writelane_u64(value, lane, default) } + } + + #[unsafe(no_mangle)] + fn test_endpgm() -> ! { + endpgm() + } + + #[unsafe(no_mangle)] + fn test_update_dpp(old: u32, src: u32) -> u32 { + unsafe { update_dpp::<0, 0, 0, true>(old, src) } + } + + #[unsafe(no_mangle)] + fn test_s_memrealtime() -> u64 { + s_memrealtime() + } + + #[unsafe(no_mangle)] + fn test_ds_permute(lane: u32, value: u32) -> u32 { + unsafe { ds_permute(lane, value) } + } + #[unsafe(no_mangle)] + fn test_ds_bpermute(lane: u32, value: u32) -> u32 { + unsafe { ds_bpermute(lane, value) } + } + #[unsafe(no_mangle)] + fn test_perm(src0: u32, src1: u32, selector: u32) -> u32 { + unsafe { perm(src0, src1, selector) } + } + + #[unsafe(no_mangle)] + fn test_permlane16_u32(old: u32, src0: u32, src1: u32, src2: u32) -> u32 { + unsafe { permlane16_u32::(old, src0, src1, src2) } + } + + #[unsafe(no_mangle)] + fn test_permlanex16_u32(old: u32, src0: u32, src1: u32, src2: u32) -> u32 { + unsafe { permlanex16_u32::(old, src0, src1, src2) } + } + + #[unsafe(no_mangle)] + fn test_s_get_waveid_in_workgroup() -> u32 { + s_get_waveid_in_workgroup() + } + + #[unsafe(no_mangle)] + fn test_permlane64_u32(value: u32) -> u32 { + unsafe { permlane64_u32(value) } + } + + #[unsafe(no_mangle)] + fn test_permlane16_var(old: u32, src0: u32, src1: u32) -> u32 { + unsafe { permlane16_var::(old, src0, src1) } + } + + #[unsafe(no_mangle)] + fn test_permlanex16_var(old: u32, src0: u32, src1: u32) -> u32 { + unsafe { permlanex16_var::(old, src0, src1) } + } + + #[unsafe(no_mangle)] + fn test_wave_id() -> u32 { + wave_id() + } + + #[unsafe(no_mangle)] + fn test_permlane16_swap(vdst_old: u32, vsrc_src0: u32) -> (u32, u32) { + unsafe { permlane16_swap::(vdst_old, vsrc_src0) } + } + + #[unsafe(no_mangle)] + fn test_permlane32_swap(vdst_old: u32, vsrc_src0: u32) -> (u32, u32) { + unsafe { permlane32_swap::(vdst_old, vsrc_src0) } + } +} diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs index b5ba792b18ae..0aeb740efcd0 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs @@ -819,7 +819,14 @@ pub fn vabaq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t { assert_instr(fabd) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vabd_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -842,7 +849,14 @@ pub fn vabd_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fabd) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vabdq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -1406,7 +1420,14 @@ pub fn vabdl_u32(a: uint32x2_t, b: uint32x2_t) -> uint64x2_t { assert_instr(fabs) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vabs_f16(a: float16x4_t) -> float16x4_t { unsafe { simd_fabs(a) } @@ -1421,7 +1442,14 @@ pub fn vabs_f16(a: float16x4_t) -> float16x4_t { assert_instr(fabs) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vabsq_f16(a: float16x8_t) -> float16x8_t { unsafe { simd_fabs(a) } @@ -1643,7 +1671,14 @@ pub fn vabsh_f16(a: f16) -> f16 { assert_instr(fadd) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vadd_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe { simd_add(a, b) } @@ -1658,7 +1693,14 @@ pub fn vadd_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fadd) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vaddq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe { simd_add(a, b) } @@ -3835,7 +3877,14 @@ pub fn vbicq_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(bsl) )] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vbsl_f16(a: uint16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { let not = int16x4_t::splat(-1); @@ -3856,7 +3905,14 @@ pub fn vbsl_f16(a: uint16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(bsl) )] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vbslq_f16(a: uint16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { let not = int16x8_t::splat(-1); @@ -4471,7 +4527,14 @@ pub fn vbslq_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t { assert_instr(facge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcage_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe extern "unadjusted" { @@ -4494,7 +4557,14 @@ pub fn vcage_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(facge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcageq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe extern "unadjusted" { @@ -4575,7 +4645,14 @@ pub fn vcageq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { assert_instr(facgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcagt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe extern "unadjusted" { @@ -4598,7 +4675,14 @@ pub fn vcagt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(facgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcagtq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe extern "unadjusted" { @@ -4679,7 +4763,14 @@ pub fn vcagtq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { assert_instr(facge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcale_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { vcage_f16(b, a) @@ -4694,7 +4785,14 @@ pub fn vcale_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(facge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcaleq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { vcageq_f16(b, a) @@ -4751,7 +4849,14 @@ pub fn vcaleq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { assert_instr(facgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcalt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { vcagt_f16(b, a) @@ -4766,7 +4871,14 @@ pub fn vcalt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(facgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcaltq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { vcagtq_f16(b, a) @@ -4823,7 +4935,14 @@ pub fn vcaltq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t { assert_instr(fcmeq) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vceq_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe { simd_eq(a, b) } @@ -4838,7 +4957,14 @@ pub fn vceq_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(fcmeq) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vceqq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe { simd_eq(a, b) } @@ -5189,7 +5315,14 @@ pub fn vceqq_p8(a: poly8x16_t, b: poly8x16_t) -> uint8x16_t { assert_instr(fcmge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcge_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe { simd_ge(a, b) } @@ -5204,7 +5337,14 @@ pub fn vcge_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(fcmge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgeq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe { simd_ge(a, b) } @@ -5513,7 +5653,14 @@ pub fn vcgeq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(fcmge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgez_f16(a: float16x4_t) -> uint16x4_t { let b: f16x4 = f16x4::new(0.0, 0.0, 0.0, 0.0); @@ -5529,7 +5676,14 @@ pub fn vcgez_f16(a: float16x4_t) -> uint16x4_t { assert_instr(fcmge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgezq_f16(a: float16x8_t) -> uint16x8_t { let b: f16x8 = f16x8::new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); @@ -5545,7 +5699,14 @@ pub fn vcgezq_f16(a: float16x8_t) -> uint16x8_t { assert_instr(fcmgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe { simd_gt(a, b) } @@ -5560,7 +5721,14 @@ pub fn vcgt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(fcmgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgtq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe { simd_gt(a, b) } @@ -5869,7 +6037,14 @@ pub fn vcgtq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(fcmgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgtz_f16(a: float16x4_t) -> uint16x4_t { let b: f16x4 = f16x4::new(0.0, 0.0, 0.0, 0.0); @@ -5885,7 +6060,14 @@ pub fn vcgtz_f16(a: float16x4_t) -> uint16x4_t { assert_instr(fcmgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcgtzq_f16(a: float16x8_t) -> uint16x8_t { let b: f16x8 = f16x8::new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); @@ -5901,7 +6083,14 @@ pub fn vcgtzq_f16(a: float16x8_t) -> uint16x8_t { assert_instr(fcmge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcle_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe { simd_le(a, b) } @@ -5916,7 +6105,14 @@ pub fn vcle_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(fcmge) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcleq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe { simd_le(a, b) } @@ -6225,7 +6421,14 @@ pub fn vcleq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(fcmle) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vclez_f16(a: float16x4_t) -> uint16x4_t { let b: f16x4 = f16x4::new(0.0, 0.0, 0.0, 0.0); @@ -6241,7 +6444,14 @@ pub fn vclez_f16(a: float16x4_t) -> uint16x4_t { assert_instr(fcmle) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vclezq_f16(a: float16x8_t) -> uint16x8_t { let b: f16x8 = f16x8::new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); @@ -6557,7 +6767,14 @@ pub fn vclsq_u32(a: uint32x4_t) -> int32x4_t { assert_instr(fcmgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vclt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { unsafe { simd_lt(a, b) } @@ -6572,7 +6789,14 @@ pub fn vclt_f16(a: float16x4_t, b: float16x4_t) -> uint16x4_t { assert_instr(fcmgt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcltq_f16(a: float16x8_t, b: float16x8_t) -> uint16x8_t { unsafe { simd_lt(a, b) } @@ -6881,7 +7105,14 @@ pub fn vcltq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(fcmlt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcltz_f16(a: float16x4_t) -> uint16x4_t { let b: f16x4 = f16x4::new(0.0, 0.0, 0.0, 0.0); @@ -6897,7 +7128,14 @@ pub fn vcltz_f16(a: float16x4_t) -> uint16x4_t { assert_instr(fcmlt) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcltzq_f16(a: float16x8_t) -> uint16x8_t { let b: f16x8 = f16x8::new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); @@ -7569,9 +7807,17 @@ pub fn vcntq_p8(a: poly8x16_t) -> poly8x16_t { #[doc = "Join two smaller vectors into a single larger vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcombine_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vcombine_f16(a: float16x4_t, b: float16x4_t) -> float16x8_t { @@ -7785,14 +8031,22 @@ pub fn vcombine_p64(a: poly64x1_t, b: poly64x1_t) -> poly64x2_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcreate_f16)"] #[inline] #[cfg(target_endian = "little")] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(nop) )] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcreate_f16(a: u64) -> float16x4_t { unsafe { transmute(a) } @@ -7801,14 +8055,22 @@ pub fn vcreate_f16(a: u64) -> float16x4_t { #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcreate_f16)"] #[inline] #[cfg(target_endian = "big")] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(nop) )] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcreate_f16(a: u64) -> float16x4_t { unsafe { @@ -8305,14 +8567,22 @@ pub fn vcreate_p64(a: u64) -> poly64x1_t { #[doc = "Floating-point convert to lower precision narrow"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvt_f16_f32)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -# [cfg_attr (all (test , target_arch = "arm") , assert_instr (vcvt . f16 . f32))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(fcvtn) )] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_f16_f32(a: float32x4_t) -> float16x4_t { unsafe { simd_cast(a) } @@ -8327,7 +8597,14 @@ pub fn vcvt_f16_f32(a: float32x4_t) -> float16x4_t { assert_instr(scvtf) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_f16_s16(a: int16x4_t) -> float16x4_t { unsafe { simd_cast(a) } @@ -8342,7 +8619,14 @@ pub fn vcvt_f16_s16(a: int16x4_t) -> float16x4_t { assert_instr(scvtf) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_f16_s16(a: int16x8_t) -> float16x8_t { unsafe { simd_cast(a) } @@ -8357,7 +8641,14 @@ pub fn vcvtq_f16_s16(a: int16x8_t) -> float16x8_t { assert_instr(ucvtf) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_f16_u16(a: uint16x4_t) -> float16x4_t { unsafe { simd_cast(a) } @@ -8372,7 +8663,14 @@ pub fn vcvt_f16_u16(a: uint16x4_t) -> float16x4_t { assert_instr(ucvtf) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_f16_u16(a: uint16x8_t) -> float16x8_t { unsafe { simd_cast(a) } @@ -8380,14 +8678,22 @@ pub fn vcvtq_f16_u16(a: uint16x8_t) -> float16x8_t { #[doc = "Floating-point convert to higher precision long"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvt_f32_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vcvt))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(fcvtl) )] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_f32_f16(a: float16x4_t) -> float32x4_t { unsafe { simd_cast(a) } @@ -8487,7 +8793,14 @@ pub fn vcvtq_f32_u32(a: uint32x4_t) -> float32x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_n_f16_s16(a: int16x4_t) -> float16x4_t { static_assert!(N >= 1 && N <= 16); @@ -8515,7 +8828,14 @@ pub fn vcvt_n_f16_s16(a: int16x4_t) -> float16x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_n_f16_s16(a: int16x8_t) -> float16x8_t { static_assert!(N >= 1 && N <= 16); @@ -8543,7 +8863,14 @@ pub fn vcvtq_n_f16_s16(a: int16x8_t) -> float16x8_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_n_f16_u16(a: uint16x4_t) -> float16x4_t { static_assert!(N >= 1 && N <= 16); @@ -8571,7 +8898,14 @@ pub fn vcvt_n_f16_u16(a: uint16x4_t) -> float16x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_n_f16_u16(a: uint16x8_t) -> float16x8_t { static_assert!(N >= 1 && N <= 16); @@ -8751,7 +9085,14 @@ pub fn vcvtq_n_f32_u32(a: uint32x4_t) -> float32x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_n_s16_f16(a: float16x4_t) -> int16x4_t { static_assert!(N >= 1 && N <= 16); @@ -8779,7 +9120,14 @@ pub fn vcvt_n_s16_f16(a: float16x4_t) -> int16x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_n_s16_f16(a: float16x8_t) -> int16x8_t { static_assert!(N >= 1 && N <= 16); @@ -8883,7 +9231,14 @@ pub fn vcvtq_n_s32_f32(a: float32x4_t) -> int32x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_n_u16_f16(a: float16x4_t) -> uint16x4_t { static_assert!(N >= 1 && N <= 16); @@ -8911,7 +9266,14 @@ pub fn vcvt_n_u16_f16(a: float16x4_t) -> uint16x4_t { )] #[rustc_legacy_const_generics(1)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_n_u16_f16(a: float16x8_t) -> uint16x8_t { static_assert!(N >= 1 && N <= 16); @@ -9014,7 +9376,14 @@ pub fn vcvtq_n_u32_f32(a: float32x4_t) -> uint32x4_t { assert_instr(fcvtzs) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_s16_f16(a: float16x4_t) -> int16x4_t { unsafe { simd_cast(a) } @@ -9029,7 +9398,14 @@ pub fn vcvt_s16_f16(a: float16x4_t) -> int16x4_t { assert_instr(fcvtzs) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_s16_f16(a: float16x8_t) -> int16x8_t { unsafe { simd_cast(a) } @@ -9102,7 +9478,14 @@ pub fn vcvtq_s32_f32(a: float32x4_t) -> int32x4_t { assert_instr(fcvtzu) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvt_u16_f16(a: float16x4_t) -> uint16x4_t { unsafe { simd_cast(a) } @@ -9117,7 +9500,14 @@ pub fn vcvt_u16_f16(a: float16x4_t) -> uint16x4_t { assert_instr(fcvtzu) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vcvtq_u16_f16(a: float16x8_t) -> uint16x8_t { unsafe { simd_cast(a) } @@ -9183,6 +9573,7 @@ pub fn vcvtq_u32_f32(a: float32x4_t) -> uint32x4_t { #[doc = "Dot product arithmetic (indexed)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdot_lane_s32)"] #[inline] +#[cfg(target_endian = "little")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[target_feature(enable = "neon,dotprod")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsdot, LANE = 0))] @@ -9208,8 +9599,41 @@ pub fn vdot_lane_s32(a: int32x2_t, b: int8x8_t, c: int8x8_t) -> } } #[doc = "Dot product arithmetic (indexed)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdot_lane_s32)"] +#[inline] +#[cfg(target_endian = "big")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[target_feature(enable = "neon,dotprod")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsdot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(sdot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_dotprod", issue = "117224") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vdot_lane_s32(a: int32x2_t, b: int8x8_t, c: int8x8_t) -> int32x2_t { + static_assert_uimm_bits!(LANE, 1); + let a: int32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; + let b: int8x8_t = unsafe { simd_shuffle!(b, b, [7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: int8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: int32x2_t = transmute(c); + let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); + let ret_val: int32x2_t = vdot_s32(a, b, transmute(c)); + simd_shuffle!(ret_val, ret_val, [1, 0]) + } +} +#[doc = "Dot product arithmetic (indexed)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdotq_lane_s32)"] #[inline] +#[cfg(target_endian = "little")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[target_feature(enable = "neon,dotprod")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsdot, LANE = 0))] @@ -9236,8 +9660,43 @@ pub fn vdotq_lane_s32(a: int32x4_t, b: int8x16_t, c: int8x8_t) } } #[doc = "Dot product arithmetic (indexed)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdotq_lane_s32)"] +#[inline] +#[cfg(target_endian = "big")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[target_feature(enable = "neon,dotprod")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsdot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(sdot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_dotprod", issue = "117224") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vdotq_lane_s32(a: int32x4_t, b: int8x16_t, c: int8x8_t) -> int32x4_t { + static_assert_uimm_bits!(LANE, 1); + let a: int32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; + let b: int8x16_t = + unsafe { simd_shuffle!(b, b, [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: int8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: int32x2_t = transmute(c); + let c: int32x4_t = + simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); + let ret_val: int32x4_t = vdotq_s32(a, b, transmute(c)); + simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + } +} +#[doc = "Dot product arithmetic (indexed)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdot_lane_u32)"] #[inline] +#[cfg(target_endian = "little")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[target_feature(enable = "neon,dotprod")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vudot, LANE = 0))] @@ -9263,8 +9722,41 @@ pub fn vdot_lane_u32(a: uint32x2_t, b: uint8x8_t, c: uint8x8_t) } } #[doc = "Dot product arithmetic (indexed)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdot_lane_u32)"] +#[inline] +#[cfg(target_endian = "big")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[target_feature(enable = "neon,dotprod")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vudot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(udot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_dotprod", issue = "117224") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vdot_lane_u32(a: uint32x2_t, b: uint8x8_t, c: uint8x8_t) -> uint32x2_t { + static_assert_uimm_bits!(LANE, 1); + let a: uint32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; + let b: uint8x8_t = unsafe { simd_shuffle!(b, b, [7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: uint8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: uint32x2_t = transmute(c); + let c: uint32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); + let ret_val: uint32x2_t = vdot_u32(a, b, transmute(c)); + simd_shuffle!(ret_val, ret_val, [1, 0]) + } +} +#[doc = "Dot product arithmetic (indexed)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdotq_lane_u32)"] #[inline] +#[cfg(target_endian = "little")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[target_feature(enable = "neon,dotprod")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vudot, LANE = 0))] @@ -9290,6 +9782,40 @@ pub fn vdotq_lane_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x8_ vdotq_u32(a, b, transmute(c)) } } +#[doc = "Dot product arithmetic (indexed)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdotq_lane_u32)"] +#[inline] +#[cfg(target_endian = "big")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[target_feature(enable = "neon,dotprod")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vudot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(udot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_dotprod", issue = "117224") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vdotq_lane_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x8_t) -> uint32x4_t { + static_assert_uimm_bits!(LANE, 1); + let a: uint32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; + let b: uint8x16_t = + unsafe { simd_shuffle!(b, b, [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: uint8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: uint32x2_t = transmute(c); + let c: uint32x4_t = + simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); + let ret_val: uint32x4_t = vdotq_u32(a, b, transmute(c)); + simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + } +} #[doc = "Dot product arithmetic (vector)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdot_s32)"] #[inline] @@ -9409,6 +9935,7 @@ pub fn vdotq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t { #[doc = "Set all vector lanes to the same value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))] #[cfg_attr( @@ -9416,8 +9943,15 @@ pub fn vdotq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t { assert_instr(dup, N = 2) )] #[rustc_legacy_const_generics(1)] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vdup_lane_f16(a: float16x4_t) -> float16x4_t { static_assert_uimm_bits!(N, 2); @@ -9426,6 +9960,7 @@ pub fn vdup_lane_f16(a: float16x4_t) -> float16x4_t { #[doc = "Set all vector lanes to the same value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 2))] #[cfg_attr( @@ -9433,8 +9968,15 @@ pub fn vdup_lane_f16(a: float16x4_t) -> float16x4_t { assert_instr(dup, N = 2) )] #[rustc_legacy_const_generics(1)] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vdupq_lane_f16(a: float16x4_t) -> float16x8_t { static_assert_uimm_bits!(N, 2); @@ -9972,6 +10514,7 @@ pub fn vdup_lane_u64(a: uint64x1_t) -> uint64x1_t { #[doc = "Set all vector lanes to the same value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))] #[cfg_attr( @@ -9979,8 +10522,15 @@ pub fn vdup_lane_u64(a: uint64x1_t) -> uint64x1_t { assert_instr(dup, N = 4) )] #[rustc_legacy_const_generics(1)] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vdup_laneq_f16(a: float16x8_t) -> float16x4_t { static_assert_uimm_bits!(N, 3); @@ -9989,6 +10539,7 @@ pub fn vdup_laneq_f16(a: float16x8_t) -> float16x4_t { #[doc = "Set all vector lanes to the same value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16", N = 4))] #[cfg_attr( @@ -9996,8 +10547,15 @@ pub fn vdup_laneq_f16(a: float16x8_t) -> float16x4_t { assert_instr(dup, N = 4) )] #[rustc_legacy_const_generics(1)] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vdupq_laneq_f16(a: float16x8_t) -> float16x8_t { static_assert_uimm_bits!(N, 3); @@ -10535,13 +11093,14 @@ pub fn vdup_laneq_u64(a: uint64x2_t) -> uint64x1_t { #[doc = "Create a new vector with all lanes set to a value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_n_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(dup) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub fn vdup_n_f16(a: f16) -> float16x4_t { @@ -10550,13 +11109,14 @@ pub fn vdup_n_f16(a: f16) -> float16x4_t { #[doc = "Create a new vector with all lanes set to a value"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_n_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(dup) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub fn vdupq_n_f16(a: f16) -> float16x8_t { @@ -11505,7 +12065,14 @@ pub fn veorq_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { )] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vext_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { static_assert_uimm_bits!(N, 2); @@ -11877,7 +12444,14 @@ pub fn vextq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t { )] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vextq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { static_assert_uimm_bits!(N, 3); @@ -12458,7 +13032,14 @@ pub fn vextq_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t { assert_instr(fmla) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vfma_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { unsafe { simd_fma(b, c, a) } @@ -12473,7 +13054,14 @@ pub fn vfma_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { assert_instr(fmla) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmaq_f16(a: float16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { unsafe { simd_fma(b, c, a) } @@ -12573,7 +13161,14 @@ pub fn vfmaq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t { assert_instr(fmls) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vfms_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { unsafe { @@ -12592,7 +13187,14 @@ pub fn vfms_f16(a: float16x4_t, b: float16x4_t, c: float16x4_t) -> float16x4_t { assert_instr(fmls) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vfmsq_f16(a: float16x8_t, b: float16x8_t, c: float16x8_t) -> float16x8_t { unsafe { @@ -12693,9 +13295,17 @@ pub fn vfmsq_n_f32(a: float32x4_t, b: float32x4_t, c: f32) -> float32x4_t { #[doc = "Duplicate vector element to vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vget_high_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vget_high_f16(a: float16x8_t) -> float16x4_t { @@ -12704,9 +13314,17 @@ pub fn vget_high_f16(a: float16x8_t) -> float16x4_t { #[doc = "Duplicate vector element to vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vget_low_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(nop))] pub fn vget_low_f16(a: float16x8_t) -> float16x4_t { @@ -12946,14 +13564,15 @@ pub fn vget_high_u64(a: uint64x2_t) -> uint64x1_t { #[doc = "Duplicate vector element to scalar"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vget_lane_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(nop, LANE = 0) )] #[rustc_legacy_const_generics(1)] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub fn vget_lane_f16(a: float16x4_t) -> f16 { @@ -12963,14 +13582,15 @@ pub fn vget_lane_f16(a: float16x4_t) -> f16 { #[doc = "Duplicate vector element to scalar"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vgetq_lane_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(nop, LANE = 0) )] #[rustc_legacy_const_generics(1)] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub fn vgetq_lane_f16(a: float16x8_t) -> f16 { @@ -14321,13 +14941,14 @@ pub fn vhsubq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1r) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1_dup_f16(ptr: *const f16) -> float16x4_t { @@ -14339,13 +14960,14 @@ pub unsafe fn vld1_dup_f16(ptr: *const f16) -> float16x4_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1r) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1q_dup_f16(ptr: *const f16) -> float16x8_t { @@ -14987,13 +15609,14 @@ pub unsafe fn vld1q_f16(ptr: *const f16) -> float16x8_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1_f16_x2(a: *const f16) -> float16x4x2_t { @@ -15012,13 +15635,14 @@ pub unsafe fn vld1_f16_x2(a: *const f16) -> float16x4x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1_f16_x3(a: *const f16) -> float16x4x3_t { @@ -15037,13 +15661,14 @@ pub unsafe fn vld1_f16_x3(a: *const f16) -> float16x4x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1_f16_x4(a: *const f16) -> float16x4x4_t { @@ -15062,13 +15687,14 @@ pub unsafe fn vld1_f16_x4(a: *const f16) -> float16x4x4_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1q_f16_x2(a: *const f16) -> float16x8x2_t { @@ -15087,13 +15713,14 @@ pub unsafe fn vld1q_f16_x2(a: *const f16) -> float16x8x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1q_f16_x3(a: *const f16) -> float16x8x3_t { @@ -15112,13 +15739,14 @@ pub unsafe fn vld1q_f16_x3(a: *const f16) -> float16x8x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld1) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1q_f16_x4(a: *const f16) -> float16x8x4_t { @@ -15137,268 +15765,104 @@ pub unsafe fn vld1q_f16_x4(a: *const f16) -> float16x8x4_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] pub unsafe fn vld1_f32(ptr: *const f32) -> float32x2_t { - transmute(vld1_v2f32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_f32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] -pub unsafe fn vld1_f32(ptr: *const f32) -> float32x2_t { - let ret_val: float32x2_t = transmute(vld1_v2f32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v2f32::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_f32)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))] pub unsafe fn vld1q_f32(ptr: *const f32) -> float32x4_t { - transmute(vld1q_v4f32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_f32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))] -pub unsafe fn vld1q_f32(ptr: *const f32) -> float32x4_t { - let ret_val: float32x4_t = transmute(vld1q_v4f32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v4f32::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u8)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] pub unsafe fn vld1_u8(ptr: *const u8) -> uint8x8_t { - transmute(vld1_v8i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] -pub unsafe fn vld1_u8(ptr: *const u8) -> uint8x8_t { - let ret_val: uint8x8_t = transmute(vld1_v8i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [7, 6, 5, 4, 3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v8i8::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u8)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] pub unsafe fn vld1q_u8(ptr: *const u8) -> uint8x16_t { - transmute(vld1q_v16i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] -pub unsafe fn vld1q_u8(ptr: *const u8) -> uint8x16_t { - let ret_val: uint8x16_t = transmute(vld1q_v16i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!( - ret_val, - ret_val, - [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0] - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v16i8::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u16)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] pub unsafe fn vld1_u16(ptr: *const u16) -> uint16x4_t { - transmute(vld1_v4i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] -pub unsafe fn vld1_u16(ptr: *const u16) -> uint16x4_t { - let ret_val: uint16x4_t = transmute(vld1_v4i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v4i16::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u16)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] pub unsafe fn vld1q_u16(ptr: *const u16) -> uint16x8_t { - transmute(vld1q_v8i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] -pub unsafe fn vld1q_u16(ptr: *const u16) -> uint16x8_t { - let ret_val: uint16x8_t = transmute(vld1q_v8i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [7, 6, 5, 4, 3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v8i16::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u32)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] pub unsafe fn vld1_u32(ptr: *const u32) -> uint32x2_t { - transmute(vld1_v2i32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] -pub unsafe fn vld1_u32(ptr: *const u32) -> uint32x2_t { - let ret_val: uint32x2_t = transmute(vld1_v2i32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v2i32::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u32)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))] pub unsafe fn vld1q_u32(ptr: *const u32) -> uint32x4_t { - transmute(vld1q_v4i32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))] -pub unsafe fn vld1q_u32(ptr: *const u32) -> uint32x4_t { - let ret_val: uint32x4_t = transmute(vld1q_v4i32( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v4i32::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_u64)"] @@ -15410,212 +15874,86 @@ pub unsafe fn vld1q_u32(ptr: *const u32) -> uint32x4_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] pub unsafe fn vld1_u64(ptr: *const u64) -> uint64x1_t { - transmute(vld1_v1i64( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v1i64::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u64)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.64"))] pub unsafe fn vld1q_u64(ptr: *const u64) -> uint64x2_t { - transmute(vld1q_v2i64( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_u64)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.64"))] -pub unsafe fn vld1q_u64(ptr: *const u64) -> uint64x2_t { - let ret_val: uint64x2_t = transmute(vld1q_v2i64( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v2i64::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_p8)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] pub unsafe fn vld1_p8(ptr: *const p8) -> poly8x8_t { - transmute(vld1_v8i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_p8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] -pub unsafe fn vld1_p8(ptr: *const p8) -> poly8x8_t { - let ret_val: poly8x8_t = transmute(vld1_v8i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [7, 6, 5, 4, 3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v8i8::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p8)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] pub unsafe fn vld1q_p8(ptr: *const p8) -> poly8x16_t { - transmute(vld1q_v16i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] -pub unsafe fn vld1q_p8(ptr: *const p8) -> poly8x16_t { - let ret_val: poly8x16_t = transmute(vld1q_v16i8( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!( - ret_val, - ret_val, - [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0] - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v16i8::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_p16)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] pub unsafe fn vld1_p16(ptr: *const p16) -> poly16x4_t { - transmute(vld1_v4i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_p16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] -pub unsafe fn vld1_p16(ptr: *const p16) -> poly16x4_t { - let ret_val: poly16x4_t = transmute(vld1_v4i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1_v4i16::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p16)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t { - transmute(vld1q_v8i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,v7")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] -pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t { - let ret_val: poly16x8_t = transmute(vld1q_v8i16( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [7, 6, 5, 4, 3, 2, 1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v8i16::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p64)"] #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] -#[cfg(target_endian = "little")] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,aes")] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.64"))] pub unsafe fn vld1q_p64(ptr: *const p64) -> poly64x2_t { - transmute(vld1q_v2i64( - ptr as *const i8, - crate::mem::align_of::() as i32, - )) -} -#[doc = "Load multiple single-element structures to one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p64)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] -#[inline] -#[cfg(target_endian = "big")] -#[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,aes")] -#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.64"))] -pub unsafe fn vld1q_p64(ptr: *const p64) -> poly64x2_t { - let ret_val: poly64x2_t = transmute(vld1q_v2i64( - ptr as *const i8, - crate::mem::align_of::() as i32, - )); - simd_shuffle!(ret_val, ret_val, [1, 0]) + const ALIGN: i32 = crate::mem::align_of::() as i32; + transmute(vld1q_v2i64::(ptr as *const i8)) } #[doc = "Load multiple single-element structures to one, two, three, or four registers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_f32_x2)"] @@ -15808,6 +16146,7 @@ pub unsafe fn vld1q_f32_x4(a: *const f32) -> float32x4x4_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1, LANE = 0))] #[cfg_attr( @@ -15815,7 +16154,7 @@ pub unsafe fn vld1q_f32_x4(a: *const f32) -> float32x4x4_t { assert_instr(ld1, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1_lane_f16(ptr: *const f16, src: float16x4_t) -> float16x4_t { @@ -15827,6 +16166,7 @@ pub unsafe fn vld1_lane_f16(ptr: *const f16, src: float16x4_t) #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld1, LANE = 0))] #[cfg_attr( @@ -15834,7 +16174,7 @@ pub unsafe fn vld1_lane_f16(ptr: *const f16, src: float16x4_t) assert_instr(ld1, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld1q_lane_f16(ptr: *const f16, src: float16x8_t) -> float16x8_t { @@ -16694,7 +17034,8 @@ pub unsafe fn vld1q_p64_x4(a: *const p64) -> poly64x2x4_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] pub unsafe fn vld1_s8(ptr: *const i8) -> int8x8_t { - vld1_v8i8(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1_v8i8::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_s8)"] @@ -16706,7 +17047,8 @@ pub unsafe fn vld1_s8(ptr: *const i8) -> int8x8_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8"))] pub unsafe fn vld1q_s8(ptr: *const i8) -> int8x16_t { - vld1q_v16i8(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1q_v16i8::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_s16)"] @@ -16718,7 +17060,8 @@ pub unsafe fn vld1q_s8(ptr: *const i8) -> int8x16_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] pub unsafe fn vld1_s16(ptr: *const i16) -> int16x4_t { - vld1_v4i16(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1_v4i16::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_s16)"] @@ -16730,7 +17073,8 @@ pub unsafe fn vld1_s16(ptr: *const i16) -> int16x4_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.16"))] pub unsafe fn vld1q_s16(ptr: *const i16) -> int16x8_t { - vld1q_v8i16(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1q_v8i16::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_s32)"] @@ -16742,7 +17086,8 @@ pub unsafe fn vld1q_s16(ptr: *const i16) -> int16x8_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] pub unsafe fn vld1_s32(ptr: *const i32) -> int32x2_t { - vld1_v2i32(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1_v2i32::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_s32)"] @@ -16754,7 +17099,8 @@ pub unsafe fn vld1_s32(ptr: *const i32) -> int32x2_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.32"))] pub unsafe fn vld1q_s32(ptr: *const i32) -> int32x4_t { - vld1q_v4i32(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1q_v4i32::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_s64)"] @@ -16766,7 +17112,8 @@ pub unsafe fn vld1q_s32(ptr: *const i32) -> int32x4_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vldr))] pub unsafe fn vld1_s64(ptr: *const i64) -> int64x1_t { - vld1_v1i64(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1_v1i64::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_s64)"] @@ -16778,7 +17125,8 @@ pub unsafe fn vld1_s64(ptr: *const i64) -> int64x1_t { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.64"))] pub unsafe fn vld1q_s64(ptr: *const i64) -> int64x2_t { - vld1q_v2i64(ptr as *const i8, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vld1q_v2i64::(ptr as *const i8) } #[doc = "Load multiple single-element structures to one, two, three, or four registers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_s8_x2)"] @@ -19417,166 +19765,142 @@ pub unsafe fn vld1q_p16_x4(a: *const p16) -> poly16x8x4_t { ret_val.3 = unsafe { simd_shuffle!(ret_val.3, ret_val.3, [7, 6, 5, 4, 3, 2, 1, 0]) }; ret_val } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_v1i64)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1_v1i64(a: *const i8, b: i32) -> int64x1_t { +unsafe fn vld1_v1i64(a: *const i8) -> int64x1_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v1i64")] fn _vld1_v1i64(a: *const i8, b: i32) -> int64x1_t; } - _vld1_v1i64(a, b) + _vld1_v1i64(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_v2f32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1_v2f32(a: *const i8, b: i32) -> float32x2_t { +unsafe fn vld1_v2f32(a: *const i8) -> float32x2_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v2f32")] fn _vld1_v2f32(a: *const i8, b: i32) -> float32x2_t; } - _vld1_v2f32(a, b) + _vld1_v2f32(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_v2i32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1_v2i32(a: *const i8, b: i32) -> int32x2_t { +unsafe fn vld1_v2i32(a: *const i8) -> int32x2_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v2i32")] fn _vld1_v2i32(a: *const i8, b: i32) -> int32x2_t; } - _vld1_v2i32(a, b) + _vld1_v2i32(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_v4i16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1_v4i16(a: *const i8, b: i32) -> int16x4_t { +unsafe fn vld1_v4i16(a: *const i8) -> int16x4_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v4i16")] fn _vld1_v4i16(a: *const i8, b: i32) -> int16x4_t; } - _vld1_v4i16(a, b) + _vld1_v4i16(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_v8i8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1_v8i8(a: *const i8, b: i32) -> int8x8_t { +unsafe fn vld1_v8i8(a: *const i8) -> int8x8_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v8i8")] fn _vld1_v8i8(a: *const i8, b: i32) -> int8x8_t; } - _vld1_v8i8(a, b) + _vld1_v8i8(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_v16i8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1q_v16i8(a: *const i8, b: i32) -> int8x16_t { +unsafe fn vld1q_v16i8(a: *const i8) -> int8x16_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v16i8")] fn _vld1q_v16i8(a: *const i8, b: i32) -> int8x16_t; } - _vld1q_v16i8(a, b) + _vld1q_v16i8(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_v2i64)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1q_v2i64(a: *const i8, b: i32) -> int64x2_t { +unsafe fn vld1q_v2i64(a: *const i8) -> int64x2_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v2i64")] fn _vld1q_v2i64(a: *const i8, b: i32) -> int64x2_t; } - _vld1q_v2i64(a, b) + _vld1q_v2i64(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_v4f32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1q_v4f32(a: *const i8, b: i32) -> float32x4_t { +unsafe fn vld1q_v4f32(a: *const i8) -> float32x4_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v4f32")] fn _vld1q_v4f32(a: *const i8, b: i32) -> float32x4_t; } - _vld1q_v4f32(a, b) + _vld1q_v4f32(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_v4i32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1q_v4i32(a: *const i8, b: i32) -> int32x4_t { +unsafe fn vld1q_v4i32(a: *const i8) -> int32x4_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v4i32")] fn _vld1q_v4i32(a: *const i8, b: i32) -> int32x4_t; } - _vld1q_v4i32(a, b) + _vld1q_v4i32(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_v8i16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] +#[rustc_legacy_const_generics(1)] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vld1.8", ALIGN = 0))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -unsafe fn vld1q_v8i16(a: *const i8, b: i32) -> int16x8_t { +unsafe fn vld1q_v8i16(a: *const i8) -> int16x8_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1.v8i16")] fn _vld1q_v8i16(a: *const i8, b: i32) -> int16x8_t; } - _vld1q_v8i16(a, b) + _vld1q_v8i16(a, ALIGN) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_v4f16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg(not(target_arch = "arm64ec"))] unsafe fn vld1_v4f16(a: *const i8, b: i32) -> float16x4_t { unsafe extern "unadjusted" { @@ -19585,16 +19909,12 @@ unsafe fn vld1_v4f16(a: *const i8, b: i32) -> float16x4_t { } _vld1_v4f16(a, b) } -#[doc = "Load multiple single-element structures to one, two, three, or four registers"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_v8f16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[cfg(target_arch = "arm")] #[target_feature(enable = "neon,v7")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg(not(target_arch = "arm64ec"))] unsafe fn vld1q_v8f16(a: *const i8, b: i32) -> float16x8_t { unsafe extern "unadjusted" { @@ -19632,9 +19952,10 @@ pub unsafe fn vld1q_dup_p64(ptr: *const p64) -> poly64x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] @@ -19650,9 +19971,10 @@ pub unsafe fn vld2_dup_f16(a: *const f16) -> float16x4x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] @@ -19668,12 +19990,13 @@ pub unsafe fn vld2q_dup_f16(a: *const f16) -> float16x8x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld2r) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2_dup_f16(a: *const f16) -> float16x4x2_t { @@ -19691,12 +20014,13 @@ pub unsafe fn vld2_dup_f16(a: *const f16) -> float16x4x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld2r) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2q_dup_f16(a: *const f16) -> float16x8x2_t { @@ -20609,10 +20933,11 @@ pub unsafe fn vld2q_dup_p16(a: *const p16) -> poly16x8x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2_f16(a: *const f16) -> float16x4x2_t { @@ -20627,10 +20952,11 @@ pub unsafe fn vld2_f16(a: *const f16) -> float16x4x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2q_f16(a: *const f16) -> float16x8x2_t { @@ -20645,12 +20971,13 @@ pub unsafe fn vld2q_f16(a: *const f16) -> float16x8x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld2) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2_f16(a: *const f16) -> float16x4x2_t { @@ -20668,12 +20995,13 @@ pub unsafe fn vld2_f16(a: *const f16) -> float16x4x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld2) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2q_f16(a: *const f16) -> float16x8x2_t { @@ -20975,7 +21303,7 @@ pub unsafe fn vld2q_s32(a: *const i32) -> int32x4x2_t { #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2_lane_f16(a: *const f16, b: float16x4x2_t) -> float16x4x2_t { @@ -21001,7 +21329,7 @@ pub unsafe fn vld2_lane_f16(a: *const f16, b: float16x4x2_t) -> #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld2, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2q_lane_f16(a: *const f16, b: float16x8x2_t) -> float16x8x2_t { @@ -21023,13 +21351,14 @@ pub unsafe fn vld2q_lane_f16(a: *const f16, b: float16x8x2_t) - #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld2, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2_lane_f16(a: *const f16, b: float16x4x2_t) -> float16x4x2_t { @@ -21049,13 +21378,14 @@ pub unsafe fn vld2_lane_f16(a: *const f16, b: float16x4x2_t) -> #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld2, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld2q_lane_f16(a: *const f16, b: float16x8x2_t) -> float16x8x2_t { @@ -22205,10 +22535,11 @@ pub unsafe fn vld2q_p16(a: *const p16) -> poly16x8x2_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3_dup_f16(a: *const f16) -> float16x4x3_t { @@ -22223,10 +22554,11 @@ pub unsafe fn vld3_dup_f16(a: *const f16) -> float16x4x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3q_dup_f16(a: *const f16) -> float16x8x3_t { @@ -22241,12 +22573,13 @@ pub unsafe fn vld3q_dup_f16(a: *const f16) -> float16x8x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld3r) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3_dup_f16(a: *const f16) -> float16x4x3_t { @@ -22264,12 +22597,13 @@ pub unsafe fn vld3_dup_f16(a: *const f16) -> float16x4x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld3r) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3q_dup_f16(a: *const f16) -> float16x8x3_t { @@ -23204,10 +23538,11 @@ pub unsafe fn vld3q_dup_p16(a: *const p16) -> poly16x8x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3_f16(a: *const f16) -> float16x4x3_t { @@ -23222,10 +23557,11 @@ pub unsafe fn vld3_f16(a: *const f16) -> float16x4x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3q_f16(a: *const f16) -> float16x8x3_t { @@ -23240,12 +23576,13 @@ pub unsafe fn vld3q_f16(a: *const f16) -> float16x8x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld3) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3_f16(a: *const f16) -> float16x4x3_t { @@ -23263,12 +23600,13 @@ pub unsafe fn vld3_f16(a: *const f16) -> float16x4x3_t { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld3) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3q_f16(a: *const f16) -> float16x8x3_t { @@ -23570,7 +23908,7 @@ pub unsafe fn vld3q_s32(a: *const i32) -> int32x4x3_t { #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3_lane_f16(a: *const f16, b: float16x4x3_t) -> float16x4x3_t { @@ -23597,7 +23935,7 @@ pub unsafe fn vld3_lane_f16(a: *const f16, b: float16x4x3_t) -> #[cfg(target_arch = "arm")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vld3, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3q_lane_f16(a: *const f16, b: float16x8x3_t) -> float16x8x3_t { @@ -23620,13 +23958,14 @@ pub unsafe fn vld3q_lane_f16(a: *const f16, b: float16x8x3_t) - #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld3, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3_lane_f16(a: *const f16, b: float16x4x3_t) -> float16x4x3_t { @@ -23651,13 +23990,14 @@ pub unsafe fn vld3_lane_f16(a: *const f16, b: float16x4x3_t) -> #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(ld3, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vld3q_lane_f16(a: *const f16, b: float16x8x3_t) -> float16x8x3_t { @@ -27651,7 +27991,14 @@ pub unsafe fn vldrq_p128(a: *const p128) -> p128 { assert_instr(fmax) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmax_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -27674,7 +28021,14 @@ pub fn vmax_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fmax) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmaxq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -28043,7 +28397,14 @@ pub fn vmaxq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(fmaxnm) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe { simd_fmax(a, b) } @@ -28058,7 +28419,14 @@ pub fn vmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fmaxnm) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmaxnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe { simd_fmax(a, b) } @@ -28115,7 +28483,14 @@ pub fn vmaxnmq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { assert_instr(fmin) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmin_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -28138,7 +28513,14 @@ pub fn vmin_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fmin) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vminq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -28507,7 +28889,14 @@ pub fn vminq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(fminnm) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe { simd_fmin(a, b) } @@ -28522,7 +28911,14 @@ pub fn vminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fminnm) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vminnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe { simd_fmin(a, b) } @@ -31698,13 +32094,14 @@ pub fn vmmlaq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t { #[doc = "Duplicate element to vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmov_n_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(dup) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmov_n_f16(a: f16) -> float16x4_t { @@ -31713,13 +32110,14 @@ pub fn vmov_n_f16(a: f16) -> float16x4_t { #[doc = "Duplicate element to vector"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmovq_n_f16)"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vdup.16"))] #[cfg_attr( all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(dup) )] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub fn vmovq_n_f16(a: f16) -> float16x8_t { @@ -32449,7 +32847,14 @@ pub fn vmovn_u64(a: uint64x2_t) -> uint32x2_t { assert_instr(fmul) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmul_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe { simd_mul(a, b) } @@ -32464,7 +32869,14 @@ pub fn vmul_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fmul) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe { simd_mul(a, b) } @@ -32522,7 +32934,14 @@ pub fn vmulq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { )] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmul_lane_f16(a: float16x4_t, v: float16x4_t) -> float16x4_t { static_assert_uimm_bits!(LANE, 2); @@ -32544,7 +32963,14 @@ pub fn vmul_lane_f16(a: float16x4_t, v: float16x4_t) -> float16 )] #[rustc_legacy_const_generics(2)] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vmulq_lane_f16(a: float16x8_t, v: float16x4_t) -> float16x8_t { static_assert_uimm_bits!(LANE, 2); @@ -34509,7 +34935,14 @@ pub fn vmvnq_u8(a: uint8x16_t) -> uint8x16_t { assert_instr(fneg) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vneg_f16(a: float16x4_t) -> float16x4_t { unsafe { simd_neg(a) } @@ -34524,7 +34957,14 @@ pub fn vneg_f16(a: float16x4_t) -> float16x4_t { assert_instr(fneg) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vnegq_f16(a: float16x8_t) -> float16x8_t { unsafe { simd_neg(a) } @@ -35755,7 +36195,14 @@ pub fn vpadalq_u32(a: uint64x2_t, b: uint32x4_t) -> uint64x2_t { assert_instr(faddp) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vpadd_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -41830,7 +42277,14 @@ pub fn vraddhn_u64(a: uint64x2_t, b: uint64x2_t) -> uint32x2_t { assert_instr(frecpe) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrecpe_f16(a: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -41853,7 +42307,14 @@ pub fn vrecpe_f16(a: float16x4_t) -> float16x4_t { assert_instr(frecpe) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrecpeq_f16(a: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -41992,7 +42453,14 @@ pub fn vrecpeq_u32(a: uint32x4_t) -> uint32x4_t { assert_instr(frecps) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrecps_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -42015,7 +42483,14 @@ pub fn vrecps_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(frecps) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrecpsq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -42097,7 +42572,14 @@ pub fn vrecpsq_f32(a: float32x4_t, b: float32x4_t) -> float32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f32_f16(a: float16x4_t) -> float32x2_t { unsafe { transmute(a) } @@ -42113,7 +42595,14 @@ pub fn vreinterpret_f32_f16(a: float16x4_t) -> float32x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f32_f16(a: float16x4_t) -> float32x2_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42133,7 +42622,14 @@ pub fn vreinterpret_f32_f16(a: float16x4_t) -> float32x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s8_f16(a: float16x4_t) -> int8x8_t { unsafe { transmute(a) } @@ -42149,7 +42645,14 @@ pub fn vreinterpret_s8_f16(a: float16x4_t) -> int8x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s8_f16(a: float16x4_t) -> int8x8_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42169,7 +42672,14 @@ pub fn vreinterpret_s8_f16(a: float16x4_t) -> int8x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s16_f16(a: float16x4_t) -> int16x4_t { unsafe { transmute(a) } @@ -42185,7 +42695,14 @@ pub fn vreinterpret_s16_f16(a: float16x4_t) -> int16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s16_f16(a: float16x4_t) -> int16x4_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42205,7 +42722,14 @@ pub fn vreinterpret_s16_f16(a: float16x4_t) -> int16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s32_f16(a: float16x4_t) -> int32x2_t { unsafe { transmute(a) } @@ -42221,7 +42745,14 @@ pub fn vreinterpret_s32_f16(a: float16x4_t) -> int32x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s32_f16(a: float16x4_t) -> int32x2_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42241,7 +42772,14 @@ pub fn vreinterpret_s32_f16(a: float16x4_t) -> int32x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s64_f16(a: float16x4_t) -> int64x1_t { unsafe { transmute(a) } @@ -42257,7 +42795,14 @@ pub fn vreinterpret_s64_f16(a: float16x4_t) -> int64x1_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_s64_f16(a: float16x4_t) -> int64x1_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42274,7 +42819,14 @@ pub fn vreinterpret_s64_f16(a: float16x4_t) -> int64x1_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u8_f16(a: float16x4_t) -> uint8x8_t { unsafe { transmute(a) } @@ -42290,7 +42842,14 @@ pub fn vreinterpret_u8_f16(a: float16x4_t) -> uint8x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u8_f16(a: float16x4_t) -> uint8x8_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42310,7 +42869,14 @@ pub fn vreinterpret_u8_f16(a: float16x4_t) -> uint8x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u16_f16(a: float16x4_t) -> uint16x4_t { unsafe { transmute(a) } @@ -42326,7 +42892,14 @@ pub fn vreinterpret_u16_f16(a: float16x4_t) -> uint16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u16_f16(a: float16x4_t) -> uint16x4_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42346,7 +42919,14 @@ pub fn vreinterpret_u16_f16(a: float16x4_t) -> uint16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u32_f16(a: float16x4_t) -> uint32x2_t { unsafe { transmute(a) } @@ -42362,7 +42942,14 @@ pub fn vreinterpret_u32_f16(a: float16x4_t) -> uint32x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u32_f16(a: float16x4_t) -> uint32x2_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42382,7 +42969,14 @@ pub fn vreinterpret_u32_f16(a: float16x4_t) -> uint32x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u64_f16(a: float16x4_t) -> uint64x1_t { unsafe { transmute(a) } @@ -42398,7 +42992,14 @@ pub fn vreinterpret_u64_f16(a: float16x4_t) -> uint64x1_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_u64_f16(a: float16x4_t) -> uint64x1_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42415,7 +43016,14 @@ pub fn vreinterpret_u64_f16(a: float16x4_t) -> uint64x1_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_p8_f16(a: float16x4_t) -> poly8x8_t { unsafe { transmute(a) } @@ -42431,7 +43039,14 @@ pub fn vreinterpret_p8_f16(a: float16x4_t) -> poly8x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_p8_f16(a: float16x4_t) -> poly8x8_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42451,7 +43066,14 @@ pub fn vreinterpret_p8_f16(a: float16x4_t) -> poly8x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_p16_f16(a: float16x4_t) -> poly16x4_t { unsafe { transmute(a) } @@ -42467,7 +43089,14 @@ pub fn vreinterpret_p16_f16(a: float16x4_t) -> poly16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_p16_f16(a: float16x4_t) -> poly16x4_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42487,7 +43116,14 @@ pub fn vreinterpret_p16_f16(a: float16x4_t) -> poly16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f32_f16(a: float16x8_t) -> float32x4_t { unsafe { transmute(a) } @@ -42503,7 +43139,14 @@ pub fn vreinterpretq_f32_f16(a: float16x8_t) -> float32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f32_f16(a: float16x8_t) -> float32x4_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42523,7 +43166,14 @@ pub fn vreinterpretq_f32_f16(a: float16x8_t) -> float32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s8_f16(a: float16x8_t) -> int8x16_t { unsafe { transmute(a) } @@ -42539,7 +43189,14 @@ pub fn vreinterpretq_s8_f16(a: float16x8_t) -> int8x16_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s8_f16(a: float16x8_t) -> int8x16_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42563,7 +43220,14 @@ pub fn vreinterpretq_s8_f16(a: float16x8_t) -> int8x16_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s16_f16(a: float16x8_t) -> int16x8_t { unsafe { transmute(a) } @@ -42579,7 +43243,14 @@ pub fn vreinterpretq_s16_f16(a: float16x8_t) -> int16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s16_f16(a: float16x8_t) -> int16x8_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42599,7 +43270,14 @@ pub fn vreinterpretq_s16_f16(a: float16x8_t) -> int16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s32_f16(a: float16x8_t) -> int32x4_t { unsafe { transmute(a) } @@ -42615,7 +43293,14 @@ pub fn vreinterpretq_s32_f16(a: float16x8_t) -> int32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s32_f16(a: float16x8_t) -> int32x4_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42635,7 +43320,14 @@ pub fn vreinterpretq_s32_f16(a: float16x8_t) -> int32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s64_f16(a: float16x8_t) -> int64x2_t { unsafe { transmute(a) } @@ -42651,7 +43343,14 @@ pub fn vreinterpretq_s64_f16(a: float16x8_t) -> int64x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_s64_f16(a: float16x8_t) -> int64x2_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42671,7 +43370,14 @@ pub fn vreinterpretq_s64_f16(a: float16x8_t) -> int64x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u8_f16(a: float16x8_t) -> uint8x16_t { unsafe { transmute(a) } @@ -42687,7 +43393,14 @@ pub fn vreinterpretq_u8_f16(a: float16x8_t) -> uint8x16_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u8_f16(a: float16x8_t) -> uint8x16_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42711,7 +43424,14 @@ pub fn vreinterpretq_u8_f16(a: float16x8_t) -> uint8x16_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u16_f16(a: float16x8_t) -> uint16x8_t { unsafe { transmute(a) } @@ -42727,7 +43447,14 @@ pub fn vreinterpretq_u16_f16(a: float16x8_t) -> uint16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u16_f16(a: float16x8_t) -> uint16x8_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42747,7 +43474,14 @@ pub fn vreinterpretq_u16_f16(a: float16x8_t) -> uint16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u32_f16(a: float16x8_t) -> uint32x4_t { unsafe { transmute(a) } @@ -42763,7 +43497,14 @@ pub fn vreinterpretq_u32_f16(a: float16x8_t) -> uint32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u32_f16(a: float16x8_t) -> uint32x4_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42783,7 +43524,14 @@ pub fn vreinterpretq_u32_f16(a: float16x8_t) -> uint32x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u64_f16(a: float16x8_t) -> uint64x2_t { unsafe { transmute(a) } @@ -42799,7 +43547,14 @@ pub fn vreinterpretq_u64_f16(a: float16x8_t) -> uint64x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_u64_f16(a: float16x8_t) -> uint64x2_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42819,7 +43574,14 @@ pub fn vreinterpretq_u64_f16(a: float16x8_t) -> uint64x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p8_f16(a: float16x8_t) -> poly8x16_t { unsafe { transmute(a) } @@ -42835,7 +43597,14 @@ pub fn vreinterpretq_p8_f16(a: float16x8_t) -> poly8x16_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p8_f16(a: float16x8_t) -> poly8x16_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42859,7 +43628,14 @@ pub fn vreinterpretq_p8_f16(a: float16x8_t) -> poly8x16_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p16_f16(a: float16x8_t) -> poly16x8_t { unsafe { transmute(a) } @@ -42875,7 +43651,14 @@ pub fn vreinterpretq_p16_f16(a: float16x8_t) -> poly16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p16_f16(a: float16x8_t) -> poly16x8_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -42895,7 +43678,14 @@ pub fn vreinterpretq_p16_f16(a: float16x8_t) -> poly16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_f32(a: float32x2_t) -> float16x4_t { unsafe { transmute(a) } @@ -42911,7 +43701,14 @@ pub fn vreinterpret_f16_f32(a: float32x2_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_f32(a: float32x2_t) -> float16x4_t { let a: float32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; @@ -42931,7 +43728,14 @@ pub fn vreinterpret_f16_f32(a: float32x2_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_f32(a: float32x4_t) -> float16x8_t { unsafe { transmute(a) } @@ -42947,7 +43751,14 @@ pub fn vreinterpretq_f16_f32(a: float32x4_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_f32(a: float32x4_t) -> float16x8_t { let a: float32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -42967,7 +43778,14 @@ pub fn vreinterpretq_f16_f32(a: float32x4_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s8(a: int8x8_t) -> float16x4_t { unsafe { transmute(a) } @@ -42983,7 +43801,14 @@ pub fn vreinterpret_f16_s8(a: int8x8_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s8(a: int8x8_t) -> float16x4_t { let a: int8x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43003,7 +43828,14 @@ pub fn vreinterpret_f16_s8(a: int8x8_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s8(a: int8x16_t) -> float16x8_t { unsafe { transmute(a) } @@ -43019,7 +43851,14 @@ pub fn vreinterpretq_f16_s8(a: int8x16_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s8(a: int8x16_t) -> float16x8_t { let a: int8x16_t = @@ -43040,7 +43879,14 @@ pub fn vreinterpretq_f16_s8(a: int8x16_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s16(a: int16x4_t) -> float16x4_t { unsafe { transmute(a) } @@ -43056,7 +43902,14 @@ pub fn vreinterpret_f16_s16(a: int16x4_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s16(a: int16x4_t) -> float16x4_t { let a: int16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -43076,7 +43929,14 @@ pub fn vreinterpret_f16_s16(a: int16x4_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s16(a: int16x8_t) -> float16x8_t { unsafe { transmute(a) } @@ -43092,7 +43952,14 @@ pub fn vreinterpretq_f16_s16(a: int16x8_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s16(a: int16x8_t) -> float16x8_t { let a: int16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43112,7 +43979,14 @@ pub fn vreinterpretq_f16_s16(a: int16x8_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s32(a: int32x2_t) -> float16x4_t { unsafe { transmute(a) } @@ -43128,7 +44002,14 @@ pub fn vreinterpret_f16_s32(a: int32x2_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s32(a: int32x2_t) -> float16x4_t { let a: int32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; @@ -43148,7 +44029,14 @@ pub fn vreinterpret_f16_s32(a: int32x2_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s32(a: int32x4_t) -> float16x8_t { unsafe { transmute(a) } @@ -43164,7 +44052,14 @@ pub fn vreinterpretq_f16_s32(a: int32x4_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s32(a: int32x4_t) -> float16x8_t { let a: int32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -43184,7 +44079,14 @@ pub fn vreinterpretq_f16_s32(a: int32x4_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s64(a: int64x1_t) -> float16x4_t { unsafe { transmute(a) } @@ -43200,7 +44102,14 @@ pub fn vreinterpret_f16_s64(a: int64x1_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_s64(a: int64x1_t) -> float16x4_t { unsafe { @@ -43219,7 +44128,14 @@ pub fn vreinterpret_f16_s64(a: int64x1_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s64(a: int64x2_t) -> float16x8_t { unsafe { transmute(a) } @@ -43235,7 +44151,14 @@ pub fn vreinterpretq_f16_s64(a: int64x2_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_s64(a: int64x2_t) -> float16x8_t { let a: int64x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; @@ -43255,7 +44178,14 @@ pub fn vreinterpretq_f16_s64(a: int64x2_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u8(a: uint8x8_t) -> float16x4_t { unsafe { transmute(a) } @@ -43271,7 +44201,14 @@ pub fn vreinterpret_f16_u8(a: uint8x8_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u8(a: uint8x8_t) -> float16x4_t { let a: uint8x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43291,7 +44228,14 @@ pub fn vreinterpret_f16_u8(a: uint8x8_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u8(a: uint8x16_t) -> float16x8_t { unsafe { transmute(a) } @@ -43307,7 +44251,14 @@ pub fn vreinterpretq_f16_u8(a: uint8x16_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u8(a: uint8x16_t) -> float16x8_t { let a: uint8x16_t = @@ -43328,7 +44279,14 @@ pub fn vreinterpretq_f16_u8(a: uint8x16_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u16(a: uint16x4_t) -> float16x4_t { unsafe { transmute(a) } @@ -43344,7 +44302,14 @@ pub fn vreinterpret_f16_u16(a: uint16x4_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u16(a: uint16x4_t) -> float16x4_t { let a: uint16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -43364,7 +44329,14 @@ pub fn vreinterpret_f16_u16(a: uint16x4_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u16(a: uint16x8_t) -> float16x8_t { unsafe { transmute(a) } @@ -43380,7 +44352,14 @@ pub fn vreinterpretq_f16_u16(a: uint16x8_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u16(a: uint16x8_t) -> float16x8_t { let a: uint16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43400,7 +44379,14 @@ pub fn vreinterpretq_f16_u16(a: uint16x8_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u32(a: uint32x2_t) -> float16x4_t { unsafe { transmute(a) } @@ -43416,7 +44402,14 @@ pub fn vreinterpret_f16_u32(a: uint32x2_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u32(a: uint32x2_t) -> float16x4_t { let a: uint32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; @@ -43436,7 +44429,14 @@ pub fn vreinterpret_f16_u32(a: uint32x2_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u32(a: uint32x4_t) -> float16x8_t { unsafe { transmute(a) } @@ -43452,7 +44452,14 @@ pub fn vreinterpretq_f16_u32(a: uint32x4_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u32(a: uint32x4_t) -> float16x8_t { let a: uint32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -43472,7 +44479,14 @@ pub fn vreinterpretq_f16_u32(a: uint32x4_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u64(a: uint64x1_t) -> float16x4_t { unsafe { transmute(a) } @@ -43488,7 +44502,14 @@ pub fn vreinterpret_f16_u64(a: uint64x1_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_u64(a: uint64x1_t) -> float16x4_t { unsafe { @@ -43507,7 +44528,14 @@ pub fn vreinterpret_f16_u64(a: uint64x1_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u64(a: uint64x2_t) -> float16x8_t { unsafe { transmute(a) } @@ -43523,7 +44551,14 @@ pub fn vreinterpretq_f16_u64(a: uint64x2_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_u64(a: uint64x2_t) -> float16x8_t { let a: uint64x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; @@ -43543,7 +44578,14 @@ pub fn vreinterpretq_f16_u64(a: uint64x2_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_p8(a: poly8x8_t) -> float16x4_t { unsafe { transmute(a) } @@ -43559,7 +44601,14 @@ pub fn vreinterpret_f16_p8(a: poly8x8_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_p8(a: poly8x8_t) -> float16x4_t { let a: poly8x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43579,7 +44628,14 @@ pub fn vreinterpret_f16_p8(a: poly8x8_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p8(a: poly8x16_t) -> float16x8_t { unsafe { transmute(a) } @@ -43595,7 +44651,14 @@ pub fn vreinterpretq_f16_p8(a: poly8x16_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p8(a: poly8x16_t) -> float16x8_t { let a: poly8x16_t = @@ -43616,7 +44679,14 @@ pub fn vreinterpretq_f16_p8(a: poly8x16_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_p16(a: poly16x4_t) -> float16x4_t { unsafe { transmute(a) } @@ -43632,7 +44702,14 @@ pub fn vreinterpret_f16_p16(a: poly16x4_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_p16(a: poly16x4_t) -> float16x4_t { let a: poly16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -43652,7 +44729,14 @@ pub fn vreinterpret_f16_p16(a: poly16x4_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p16(a: poly16x8_t) -> float16x8_t { unsafe { transmute(a) } @@ -43668,7 +44752,14 @@ pub fn vreinterpretq_f16_p16(a: poly16x8_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p16(a: poly16x8_t) -> float16x8_t { let a: poly16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43688,7 +44779,14 @@ pub fn vreinterpretq_f16_p16(a: poly16x8_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p128(a: p128) -> float16x8_t { unsafe { transmute(a) } @@ -43704,7 +44802,14 @@ pub fn vreinterpretq_f16_p128(a: p128) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p128(a: p128) -> float16x8_t { unsafe { @@ -43723,7 +44828,14 @@ pub fn vreinterpretq_f16_p128(a: p128) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_p64_f16(a: float16x4_t) -> poly64x1_t { unsafe { transmute(a) } @@ -43739,7 +44851,14 @@ pub fn vreinterpret_p64_f16(a: float16x4_t) -> poly64x1_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_p64_f16(a: float16x4_t) -> poly64x1_t { let a: float16x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; @@ -43756,7 +44875,14 @@ pub fn vreinterpret_p64_f16(a: float16x4_t) -> poly64x1_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p128_f16(a: float16x8_t) -> p128 { unsafe { transmute(a) } @@ -43772,7 +44898,14 @@ pub fn vreinterpretq_p128_f16(a: float16x8_t) -> p128 { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p128_f16(a: float16x8_t) -> p128 { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43789,7 +44922,14 @@ pub fn vreinterpretq_p128_f16(a: float16x8_t) -> p128 { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p64_f16(a: float16x8_t) -> poly64x2_t { unsafe { transmute(a) } @@ -43805,7 +44945,14 @@ pub fn vreinterpretq_p64_f16(a: float16x8_t) -> poly64x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_p64_f16(a: float16x8_t) -> poly64x2_t { let a: float16x8_t = unsafe { simd_shuffle!(a, a, [7, 6, 5, 4, 3, 2, 1, 0]) }; @@ -43825,7 +44972,14 @@ pub fn vreinterpretq_p64_f16(a: float16x8_t) -> poly64x2_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_p64(a: poly64x1_t) -> float16x4_t { unsafe { transmute(a) } @@ -43841,7 +44995,14 @@ pub fn vreinterpret_f16_p64(a: poly64x1_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpret_f16_p64(a: poly64x1_t) -> float16x4_t { unsafe { @@ -43860,7 +45021,14 @@ pub fn vreinterpret_f16_p64(a: poly64x1_t) -> float16x4_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p64(a: poly64x2_t) -> float16x8_t { unsafe { transmute(a) } @@ -43876,7 +45044,14 @@ pub fn vreinterpretq_f16_p64(a: poly64x2_t) -> float16x8_t { assert_instr(nop) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vreinterpretq_f16_p64(a: poly64x2_t) -> float16x8_t { let a: poly64x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; @@ -57873,7 +59048,14 @@ pub fn vrev64q_u8(a: uint8x16_t) -> uint8x16_t { assert_instr(rev64) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrev64_f16(a: float16x4_t) -> float16x4_t { unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) } @@ -57888,7 +59070,14 @@ pub fn vrev64_f16(a: float16x4_t) -> float16x4_t { assert_instr(rev64) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrev64q_f16(a: float16x8_t) -> float16x8_t { unsafe { simd_shuffle!(a, a, [3, 2, 1, 0, 7, 6, 5, 4]) } @@ -58251,7 +59440,14 @@ pub fn vrhaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { assert_instr(frintn) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrndn_f16(a: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -58273,7 +59469,14 @@ pub fn vrndn_f16(a: float16x4_t) -> float16x4_t { assert_instr(frintn) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrndnq_f16(a: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -59357,7 +60560,14 @@ pub fn vrshrn_n_u64(a: uint64x2_t) -> uint32x2_t { all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(frsqrte) )] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrsqrte_f16(a: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -59380,7 +60590,14 @@ pub fn vrsqrte_f16(a: float16x4_t) -> float16x4_t { all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(frsqrte) )] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrsqrteq_f16(a: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -59519,7 +60736,14 @@ pub fn vrsqrteq_u32(a: uint32x4_t) -> uint32x4_t { all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(frsqrts) )] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrsqrts_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe extern "unadjusted" { @@ -59542,7 +60766,14 @@ pub fn vrsqrts_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), assert_instr(frsqrts) )] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vrsqrtsq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe extern "unadjusted" { @@ -61060,117 +62291,229 @@ pub fn vsha256su1q_u32(tw0_3: uint32x4_t, w8_11: uint32x4_t, w12_15: uint32x4_t) } unsafe { _vsha256su1q_u32(tw0_3, w8_11, w12_15) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v16i8)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v16i8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v16i8(a: int8x16_t, b: int8x16_t) -> int8x16_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v16i8")] - fn _vshiftins_v16i8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t; + fn _vshiftlins_v16i8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t; } - unsafe { _vshiftins_v16i8(a, b, c) } + unsafe { _vshiftlins_v16i8(a, b, const { int8x16_t([N as i8; 16]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v1i64)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v1i64(a: int64x1_t, b: int64x1_t, c: int64x1_t) -> int64x1_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v1i64(a: int64x1_t, b: int64x1_t) -> int64x1_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v1i64")] - fn _vshiftins_v1i64(a: int64x1_t, b: int64x1_t, c: int64x1_t) -> int64x1_t; + fn _vshiftlins_v1i64(a: int64x1_t, b: int64x1_t, c: int64x1_t) -> int64x1_t; } - unsafe { _vshiftins_v1i64(a, b, c) } + unsafe { _vshiftlins_v1i64(a, b, const { int64x1_t([N as i64; 1]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v2i32)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v2i32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v2i32(a: int32x2_t, b: int32x2_t) -> int32x2_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v2i32")] - fn _vshiftins_v2i32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t; + fn _vshiftlins_v2i32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t; } - unsafe { _vshiftins_v2i32(a, b, c) } + unsafe { _vshiftlins_v2i32(a, b, const { int32x2_t([N; 2]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v2i64)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v2i64(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v2i64(a: int64x2_t, b: int64x2_t) -> int64x2_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v2i64")] - fn _vshiftins_v2i64(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t; + fn _vshiftlins_v2i64(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t; } - unsafe { _vshiftins_v2i64(a, b, c) } + unsafe { _vshiftlins_v2i64(a, b, const { int64x2_t([N as i64; 2]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v4i16)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v4i16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v4i16(a: int16x4_t, b: int16x4_t) -> int16x4_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v4i16")] - fn _vshiftins_v4i16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t; + fn _vshiftlins_v4i16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t; } - unsafe { _vshiftins_v4i16(a, b, c) } + unsafe { _vshiftlins_v4i16(a, b, const { int16x4_t([N as i16; 4]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v4i32)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v4i32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v4i32(a: int32x4_t, b: int32x4_t) -> int32x4_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v4i32")] - fn _vshiftins_v4i32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t; + fn _vshiftlins_v4i32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t; } - unsafe { _vshiftins_v4i32(a, b, c) } + unsafe { _vshiftlins_v4i32(a, b, const { int32x4_t([N; 4]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v8i16)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v8i16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v8i16(a: int16x8_t, b: int16x8_t) -> int16x8_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v8i16")] - fn _vshiftins_v8i16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t; + fn _vshiftlins_v8i16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t; } - unsafe { _vshiftins_v8i16(a, b, c) } + unsafe { _vshiftlins_v8i16(a, b, const { int16x8_t([N as i16; 8]) }) } } -#[doc = "Shift Right and Insert (immediate)"] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftins_v8i8)"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -fn vshiftins_v8i8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t { +#[rustc_legacy_const_generics(2)] +fn vshiftlins_v8i8(a: int8x8_t, b: int8x8_t) -> int8x8_t { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v8i8")] - fn _vshiftins_v8i8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t; + fn _vshiftlins_v8i8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t; } - unsafe { _vshiftins_v8i8(a, b, c) } + unsafe { _vshiftlins_v8i8(a, b, const { int8x8_t([N as i8; 8]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v16i8)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v16i8(a: int8x16_t, b: int8x16_t) -> int8x16_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v16i8")] + fn _vshiftrins_v16i8(a: int8x16_t, b: int8x16_t, c: int8x16_t) -> int8x16_t; + } + unsafe { _vshiftrins_v16i8(a, b, const { int8x16_t([-N as i8; 16]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v1i64)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v1i64(a: int64x1_t, b: int64x1_t) -> int64x1_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v1i64")] + fn _vshiftrins_v1i64(a: int64x1_t, b: int64x1_t, c: int64x1_t) -> int64x1_t; + } + unsafe { _vshiftrins_v1i64(a, b, const { int64x1_t([-N as i64; 1]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v2i32)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v2i32(a: int32x2_t, b: int32x2_t) -> int32x2_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v2i32")] + fn _vshiftrins_v2i32(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t; + } + unsafe { _vshiftrins_v2i32(a, b, const { int32x2_t([-N; 2]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v2i64)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v2i64(a: int64x2_t, b: int64x2_t) -> int64x2_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v2i64")] + fn _vshiftrins_v2i64(a: int64x2_t, b: int64x2_t, c: int64x2_t) -> int64x2_t; + } + unsafe { _vshiftrins_v2i64(a, b, const { int64x2_t([-N as i64; 2]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v4i16)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v4i16(a: int16x4_t, b: int16x4_t) -> int16x4_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v4i16")] + fn _vshiftrins_v4i16(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t; + } + unsafe { _vshiftrins_v4i16(a, b, const { int16x4_t([-N as i16; 4]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v4i32)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v4i32(a: int32x4_t, b: int32x4_t) -> int32x4_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v4i32")] + fn _vshiftrins_v4i32(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t; + } + unsafe { _vshiftrins_v4i32(a, b, const { int32x4_t([-N; 4]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v8i16)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v8i16(a: int16x8_t, b: int16x8_t) -> int16x8_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v8i16")] + fn _vshiftrins_v8i16(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t; + } + unsafe { _vshiftrins_v8i16(a, b, const { int16x8_t([-N as i16; 8]) }) } +} +#[doc = "Shift Right and Insert (immediate)"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshiftrins_v8i8)"] +#[inline] +#[target_feature(enable = "neon")] +#[cfg(target_arch = "arm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] +#[rustc_legacy_const_generics(2)] +fn vshiftrins_v8i8(a: int8x8_t, b: int8x8_t) -> int8x8_t { + unsafe extern "unadjusted" { + #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vshiftins.v8i8")] + fn _vshiftrins_v8i8(a: int8x8_t, b: int8x8_t, c: int8x8_t) -> int8x8_t; + } + unsafe { _vshiftrins_v8i8(a, b, const { int8x8_t([-N as i8; 8]) }) } } #[doc = "Shift left"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vshl_n_s8)"] @@ -62706,7 +64049,7 @@ pub fn vshrn_n_u64(a: uint64x2_t) -> uint32x2_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { static_assert_uimm_bits!(N, 3); - vshiftins_v8i8(a, b, int8x8_t::splat(N as i8)) + vshiftlins_v8i8::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_s8)"] @@ -62718,7 +64061,7 @@ pub fn vsli_n_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { static_assert_uimm_bits!(N, 3); - vshiftins_v16i8(a, b, int8x16_t::splat(N as i8)) + vshiftlins_v16i8::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_s16)"] @@ -62730,7 +64073,7 @@ pub fn vsliq_n_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { static_assert_uimm_bits!(N, 4); - vshiftins_v4i16(a, b, int16x4_t::splat(N as i16)) + vshiftlins_v4i16::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_s16)"] @@ -62742,7 +64085,7 @@ pub fn vsli_n_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { static_assert_uimm_bits!(N, 4); - vshiftins_v8i16(a, b, int16x8_t::splat(N as i16)) + vshiftlins_v8i16::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_s32)"] @@ -62754,7 +64097,7 @@ pub fn vsliq_n_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { static_assert!(N >= 0 && N <= 31); - vshiftins_v2i32(a, b, int32x2_t::splat(N)) + vshiftlins_v2i32::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_s32)"] @@ -62766,7 +64109,7 @@ pub fn vsli_n_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { static_assert!(N >= 0 && N <= 31); - vshiftins_v4i32(a, b, int32x4_t::splat(N)) + vshiftlins_v4i32::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_s64)"] @@ -62778,7 +64121,7 @@ pub fn vsliq_n_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t { static_assert!(N >= 0 && N <= 63); - vshiftins_v1i64(a, b, int64x1_t::splat(N as i64)) + vshiftlins_v1i64::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_s64)"] @@ -62790,7 +64133,7 @@ pub fn vsli_n_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t { static_assert!(N >= 0 && N <= 63); - vshiftins_v2i64(a, b, int64x2_t::splat(N as i64)) + vshiftlins_v2i64::(a, b) } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_u8)"] @@ -62802,13 +64145,7 @@ pub fn vsliq_n_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { static_assert_uimm_bits!(N, 3); - unsafe { - transmute(vshiftins_v8i8( - transmute(a), - transmute(b), - int8x8_t::splat(N as i8), - )) - } + unsafe { transmute(vshiftlins_v8i8::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_u8)"] @@ -62820,13 +64157,7 @@ pub fn vsli_n_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { static_assert_uimm_bits!(N, 3); - unsafe { - transmute(vshiftins_v16i8( - transmute(a), - transmute(b), - int8x16_t::splat(N as i8), - )) - } + unsafe { transmute(vshiftlins_v16i8::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_u16)"] @@ -62838,13 +64169,7 @@ pub fn vsliq_n_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { static_assert_uimm_bits!(N, 4); - unsafe { - transmute(vshiftins_v4i16( - transmute(a), - transmute(b), - int16x4_t::splat(N as i16), - )) - } + unsafe { transmute(vshiftlins_v4i16::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_u16)"] @@ -62856,13 +64181,7 @@ pub fn vsli_n_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { static_assert_uimm_bits!(N, 4); - unsafe { - transmute(vshiftins_v8i16( - transmute(a), - transmute(b), - int16x8_t::splat(N as i16), - )) - } + unsafe { transmute(vshiftlins_v8i16::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_u32)"] @@ -62874,13 +64193,7 @@ pub fn vsliq_n_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { static_assert!(N >= 0 && N <= 31); - unsafe { - transmute(vshiftins_v2i32( - transmute(a), - transmute(b), - int32x2_t::splat(N), - )) - } + unsafe { transmute(vshiftlins_v2i32::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_u32)"] @@ -62892,13 +64205,7 @@ pub fn vsli_n_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { static_assert!(N >= 0 && N <= 31); - unsafe { - transmute(vshiftins_v4i32( - transmute(a), - transmute(b), - int32x4_t::splat(N), - )) - } + unsafe { transmute(vshiftlins_v4i32::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_u64)"] @@ -62910,13 +64217,7 @@ pub fn vsliq_n_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t { static_assert!(N >= 0 && N <= 63); - unsafe { - transmute(vshiftins_v1i64( - transmute(a), - transmute(b), - int64x1_t::splat(N as i64), - )) - } + unsafe { transmute(vshiftlins_v1i64::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_u64)"] @@ -62928,13 +64229,7 @@ pub fn vsli_n_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { static_assert!(N >= 0 && N <= 63); - unsafe { - transmute(vshiftins_v2i64( - transmute(a), - transmute(b), - int64x2_t::splat(N as i64), - )) - } + unsafe { transmute(vshiftlins_v2i64::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_p8)"] @@ -62946,13 +64241,7 @@ pub fn vsliq_n_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t { static_assert_uimm_bits!(N, 3); - unsafe { - transmute(vshiftins_v8i8( - transmute(a), - transmute(b), - int8x8_t::splat(N as i8), - )) - } + unsafe { transmute(vshiftlins_v8i8::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_p8)"] @@ -62964,13 +64253,7 @@ pub fn vsli_n_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t { static_assert_uimm_bits!(N, 3); - unsafe { - transmute(vshiftins_v16i8( - transmute(a), - transmute(b), - int8x16_t::splat(N as i8), - )) - } + unsafe { transmute(vshiftlins_v16i8::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_p16)"] @@ -62982,13 +64265,7 @@ pub fn vsliq_n_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t { #[rustc_legacy_const_generics(2)] pub fn vsli_n_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t { static_assert_uimm_bits!(N, 4); - unsafe { - transmute(vshiftins_v4i16( - transmute(a), - transmute(b), - int16x4_t::splat(N as i16), - )) - } + unsafe { transmute(vshiftlins_v4i16::(transmute(a), transmute(b))) } } #[doc = "Shift Left and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_p16)"] @@ -63000,13 +64277,7 @@ pub fn vsli_n_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t { #[rustc_legacy_const_generics(2)] pub fn vsliq_n_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t { static_assert_uimm_bits!(N, 4); - unsafe { - transmute(vshiftins_v8i16( - transmute(a), - transmute(b), - int16x8_t::splat(N as i16), - )) - } + unsafe { transmute(vshiftlins_v8i16::(transmute(a), transmute(b))) } } #[doc = "Signed shift right and accumulate"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsra_n_s8)"] @@ -63386,7 +64657,7 @@ pub fn vsraq_n_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { static_assert!(1 <= N && N <= 8); - vshiftins_v8i8(a, b, int8x8_t::splat(-N as i8)) + vshiftrins_v8i8::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_s8)"] @@ -63398,7 +64669,7 @@ pub fn vsri_n_s8(a: int8x8_t, b: int8x8_t) -> int8x8_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { static_assert!(1 <= N && N <= 8); - vshiftins_v16i8(a, b, int8x16_t::splat(-N as i8)) + vshiftrins_v16i8::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_s16)"] @@ -63410,7 +64681,7 @@ pub fn vsriq_n_s8(a: int8x16_t, b: int8x16_t) -> int8x16_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { static_assert!(1 <= N && N <= 16); - vshiftins_v4i16(a, b, int16x4_t::splat(-N as i16)) + vshiftrins_v4i16::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_s16)"] @@ -63422,7 +64693,7 @@ pub fn vsri_n_s16(a: int16x4_t, b: int16x4_t) -> int16x4_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { static_assert!(1 <= N && N <= 16); - vshiftins_v8i16(a, b, int16x8_t::splat(-N as i16)) + vshiftrins_v8i16::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_s32)"] @@ -63434,7 +64705,7 @@ pub fn vsriq_n_s16(a: int16x8_t, b: int16x8_t) -> int16x8_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { static_assert!(1 <= N && N <= 32); - vshiftins_v2i32(a, b, int32x2_t::splat(-N)) + vshiftrins_v2i32::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_s32)"] @@ -63446,7 +64717,7 @@ pub fn vsri_n_s32(a: int32x2_t, b: int32x2_t) -> int32x2_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { static_assert!(1 <= N && N <= 32); - vshiftins_v4i32(a, b, int32x4_t::splat(-N)) + vshiftrins_v4i32::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_s64)"] @@ -63458,7 +64729,7 @@ pub fn vsriq_n_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t { static_assert!(1 <= N && N <= 64); - vshiftins_v1i64(a, b, int64x1_t::splat(-N as i64)) + vshiftrins_v1i64::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_s64)"] @@ -63470,7 +64741,7 @@ pub fn vsri_n_s64(a: int64x1_t, b: int64x1_t) -> int64x1_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t { static_assert!(1 <= N && N <= 64); - vshiftins_v2i64(a, b, int64x2_t::splat(-N as i64)) + vshiftrins_v2i64::(a, b) } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_u8)"] @@ -63482,13 +64753,7 @@ pub fn vsriq_n_s64(a: int64x2_t, b: int64x2_t) -> int64x2_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { static_assert!(1 <= N && N <= 8); - unsafe { - transmute(vshiftins_v8i8( - transmute(a), - transmute(b), - int8x8_t::splat(-N as i8), - )) - } + unsafe { transmute(vshiftrins_v8i8::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_u8)"] @@ -63500,13 +64765,7 @@ pub fn vsri_n_u8(a: uint8x8_t, b: uint8x8_t) -> uint8x8_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { static_assert!(1 <= N && N <= 8); - unsafe { - transmute(vshiftins_v16i8( - transmute(a), - transmute(b), - int8x16_t::splat(-N as i8), - )) - } + unsafe { transmute(vshiftrins_v16i8::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_u16)"] @@ -63518,13 +64777,7 @@ pub fn vsriq_n_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { static_assert!(1 <= N && N <= 16); - unsafe { - transmute(vshiftins_v4i16( - transmute(a), - transmute(b), - int16x4_t::splat(-N as i16), - )) - } + unsafe { transmute(vshiftrins_v4i16::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_u16)"] @@ -63536,13 +64789,7 @@ pub fn vsri_n_u16(a: uint16x4_t, b: uint16x4_t) -> uint16x4_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { static_assert!(1 <= N && N <= 16); - unsafe { - transmute(vshiftins_v8i16( - transmute(a), - transmute(b), - int16x8_t::splat(-N as i16), - )) - } + unsafe { transmute(vshiftrins_v8i16::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_u32)"] @@ -63554,13 +64801,7 @@ pub fn vsriq_n_u16(a: uint16x8_t, b: uint16x8_t) -> uint16x8_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { static_assert!(1 <= N && N <= 32); - unsafe { - transmute(vshiftins_v2i32( - transmute(a), - transmute(b), - int32x2_t::splat(-N), - )) - } + unsafe { transmute(vshiftrins_v2i32::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_u32)"] @@ -63572,13 +64813,7 @@ pub fn vsri_n_u32(a: uint32x2_t, b: uint32x2_t) -> uint32x2_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { static_assert!(1 <= N && N <= 32); - unsafe { - transmute(vshiftins_v4i32( - transmute(a), - transmute(b), - int32x4_t::splat(-N), - )) - } + unsafe { transmute(vshiftrins_v4i32::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_u64)"] @@ -63590,13 +64825,7 @@ pub fn vsriq_n_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t { static_assert!(1 <= N && N <= 64); - unsafe { - transmute(vshiftins_v1i64( - transmute(a), - transmute(b), - int64x1_t::splat(-N as i64), - )) - } + unsafe { transmute(vshiftrins_v1i64::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_u64)"] @@ -63608,13 +64837,7 @@ pub fn vsri_n_u64(a: uint64x1_t, b: uint64x1_t) -> uint64x1_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { static_assert!(1 <= N && N <= 64); - unsafe { - transmute(vshiftins_v2i64( - transmute(a), - transmute(b), - int64x2_t::splat(-N as i64), - )) - } + unsafe { transmute(vshiftrins_v2i64::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_p8)"] @@ -63626,13 +64849,7 @@ pub fn vsriq_n_u64(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t { static_assert!(1 <= N && N <= 8); - unsafe { - transmute(vshiftins_v8i8( - transmute(a), - transmute(b), - int8x8_t::splat(-N as i8), - )) - } + unsafe { transmute(vshiftrins_v8i8::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_p8)"] @@ -63644,13 +64861,7 @@ pub fn vsri_n_p8(a: poly8x8_t, b: poly8x8_t) -> poly8x8_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t { static_assert!(1 <= N && N <= 8); - unsafe { - transmute(vshiftins_v16i8( - transmute(a), - transmute(b), - int8x16_t::splat(-N as i8), - )) - } + unsafe { transmute(vshiftrins_v16i8::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_p16)"] @@ -63662,13 +64873,7 @@ pub fn vsriq_n_p8(a: poly8x16_t, b: poly8x16_t) -> poly8x16_t { #[rustc_legacy_const_generics(2)] pub fn vsri_n_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t { static_assert!(1 <= N && N <= 16); - unsafe { - transmute(vshiftins_v4i16( - transmute(a), - transmute(b), - int16x4_t::splat(-N as i16), - )) - } + unsafe { transmute(vshiftrins_v4i16::(transmute(a), transmute(b))) } } #[doc = "Shift Right and Insert (immediate)"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_p16)"] @@ -63680,13 +64885,7 @@ pub fn vsri_n_p16(a: poly16x4_t, b: poly16x4_t) -> poly16x4_t { #[rustc_legacy_const_generics(2)] pub fn vsriq_n_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8_t { static_assert!(1 <= N && N <= 16); - unsafe { - transmute(vshiftins_v8i16( - transmute(a), - transmute(b), - int16x8_t::splat(-N as i16), - )) - } + unsafe { transmute(vshiftrins_v8i16::(transmute(a), transmute(b))) } } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_f16)"] @@ -63881,9 +65080,10 @@ pub unsafe fn vst1q_f16_x3(a: *mut f16, b: float16x8x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst1))] @@ -63905,9 +65105,10 @@ pub unsafe fn vst1_f16_x4(a: *mut f16, b: float16x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst1))] @@ -63987,11 +65188,8 @@ pub unsafe fn vst1q_f16_x4(a: *mut f16, b: float16x8x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] pub unsafe fn vst1_f32(ptr: *mut f32, a: float32x2_t) { - vst1_v2f32( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v2f32::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_f32)"] @@ -64004,11 +65202,8 @@ pub unsafe fn vst1_f32(ptr: *mut f32, a: float32x2_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] pub unsafe fn vst1q_f32(ptr: *mut f32, a: float32x4_t) { - vst1q_v4f32( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v4f32::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_s8)"] @@ -64021,7 +65216,8 @@ pub unsafe fn vst1q_f32(ptr: *mut f32, a: float32x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] pub unsafe fn vst1_s8(ptr: *mut i8, a: int8x8_t) { - vst1_v8i8(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v8i8::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_s8)"] @@ -64034,7 +65230,8 @@ pub unsafe fn vst1_s8(ptr: *mut i8, a: int8x8_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] pub unsafe fn vst1q_s8(ptr: *mut i8, a: int8x16_t) { - vst1q_v16i8(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v16i8::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_s16)"] @@ -64047,7 +65244,8 @@ pub unsafe fn vst1q_s8(ptr: *mut i8, a: int8x16_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] pub unsafe fn vst1_s16(ptr: *mut i16, a: int16x4_t) { - vst1_v4i16(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v4i16::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_s16)"] @@ -64060,7 +65258,8 @@ pub unsafe fn vst1_s16(ptr: *mut i16, a: int16x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] pub unsafe fn vst1q_s16(ptr: *mut i16, a: int16x8_t) { - vst1q_v8i16(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v8i16::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_s32)"] @@ -64073,7 +65272,8 @@ pub unsafe fn vst1q_s16(ptr: *mut i16, a: int16x8_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] pub unsafe fn vst1_s32(ptr: *mut i32, a: int32x2_t) { - vst1_v2i32(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v2i32::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_s32)"] @@ -64086,7 +65286,8 @@ pub unsafe fn vst1_s32(ptr: *mut i32, a: int32x2_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] pub unsafe fn vst1q_s32(ptr: *mut i32, a: int32x4_t) { - vst1q_v4i32(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v4i32::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_s64)"] @@ -64099,7 +65300,8 @@ pub unsafe fn vst1q_s32(ptr: *mut i32, a: int32x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] pub unsafe fn vst1_s64(ptr: *mut i64, a: int64x1_t) { - vst1_v1i64(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v1i64::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_s64)"] @@ -64112,7 +65314,8 @@ pub unsafe fn vst1_s64(ptr: *mut i64, a: int64x1_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] pub unsafe fn vst1q_s64(ptr: *mut i64, a: int64x2_t) { - vst1q_v2i64(ptr as *const i8, a, crate::mem::align_of::() as i32) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v2i64::(ptr as *const i8, a) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_u8)"] @@ -64125,11 +65328,8 @@ pub unsafe fn vst1q_s64(ptr: *mut i64, a: int64x2_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] pub unsafe fn vst1_u8(ptr: *mut u8, a: uint8x8_t) { - vst1_v8i8( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v8i8::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_u8)"] @@ -64142,11 +65342,8 @@ pub unsafe fn vst1_u8(ptr: *mut u8, a: uint8x8_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] pub unsafe fn vst1q_u8(ptr: *mut u8, a: uint8x16_t) { - vst1q_v16i8( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v16i8::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_u16)"] @@ -64159,11 +65356,8 @@ pub unsafe fn vst1q_u8(ptr: *mut u8, a: uint8x16_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] pub unsafe fn vst1_u16(ptr: *mut u16, a: uint16x4_t) { - vst1_v4i16( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v4i16::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_u16)"] @@ -64176,11 +65370,8 @@ pub unsafe fn vst1_u16(ptr: *mut u16, a: uint16x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] pub unsafe fn vst1q_u16(ptr: *mut u16, a: uint16x8_t) { - vst1q_v8i16( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v8i16::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_u32)"] @@ -64193,11 +65384,8 @@ pub unsafe fn vst1q_u16(ptr: *mut u16, a: uint16x8_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] pub unsafe fn vst1_u32(ptr: *mut u32, a: uint32x2_t) { - vst1_v2i32( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v2i32::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_u32)"] @@ -64210,11 +65398,8 @@ pub unsafe fn vst1_u32(ptr: *mut u32, a: uint32x2_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] pub unsafe fn vst1q_u32(ptr: *mut u32, a: uint32x4_t) { - vst1q_v4i32( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v4i32::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_u64)"] @@ -64227,11 +65412,8 @@ pub unsafe fn vst1q_u32(ptr: *mut u32, a: uint32x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] pub unsafe fn vst1_u64(ptr: *mut u64, a: uint64x1_t) { - vst1_v1i64( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v1i64::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_u64)"] @@ -64244,11 +65426,8 @@ pub unsafe fn vst1_u64(ptr: *mut u64, a: uint64x1_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] pub unsafe fn vst1q_u64(ptr: *mut u64, a: uint64x2_t) { - vst1q_v2i64( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v2i64::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_p8)"] @@ -64261,11 +65440,8 @@ pub unsafe fn vst1q_u64(ptr: *mut u64, a: uint64x2_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] pub unsafe fn vst1_p8(ptr: *mut p8, a: poly8x8_t) { - vst1_v8i8( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v8i8::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_p8)"] @@ -64278,11 +65454,8 @@ pub unsafe fn vst1_p8(ptr: *mut p8, a: poly8x8_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] pub unsafe fn vst1q_p8(ptr: *mut p8, a: poly8x16_t) { - vst1q_v16i8( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v16i8::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_p16)"] @@ -64295,11 +65468,8 @@ pub unsafe fn vst1q_p8(ptr: *mut p8, a: poly8x16_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] pub unsafe fn vst1_p16(ptr: *mut p16, a: poly16x4_t) { - vst1_v4i16( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v4i16::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_p16)"] @@ -64312,11 +65482,8 @@ pub unsafe fn vst1_p16(ptr: *mut p16, a: poly16x4_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] pub unsafe fn vst1q_p16(ptr: *mut p16, a: poly16x8_t) { - vst1q_v8i16( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v8i16::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_p64)"] @@ -64329,11 +65496,8 @@ pub unsafe fn vst1q_p16(ptr: *mut p16, a: poly16x8_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] pub unsafe fn vst1_p64(ptr: *mut p64, a: poly64x1_t) { - vst1_v1i64( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1_v1i64::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_p64)"] @@ -64346,11 +65510,8 @@ pub unsafe fn vst1_p64(ptr: *mut p64, a: poly64x1_t) { #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] pub unsafe fn vst1q_p64(ptr: *mut p64, a: poly64x2_t) { - vst1q_v2i64( - ptr as *const i8, - transmute(a), - crate::mem::align_of::() as i32, - ) + const ALIGN: i32 = crate::mem::align_of::() as i32; + vst1q_v2i64::(ptr as *const i8, transmute(a)) } #[doc = "Store multiple single-element structures to one, two, three, or four registers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_f32_x2)"] @@ -64559,6 +65720,7 @@ pub unsafe fn vst1q_f32_x4(a: *mut f32, b: float32x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))] #[cfg_attr( @@ -64566,7 +65728,7 @@ pub unsafe fn vst1q_f32_x4(a: *mut f32, b: float32x4x4_t) { assert_instr(nop, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst1_lane_f16(a: *mut f16, b: float16x4_t) { @@ -64578,6 +65740,7 @@ pub unsafe fn vst1_lane_f16(a: *mut f16, b: float16x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))] #[cfg_attr( @@ -64585,7 +65748,7 @@ pub unsafe fn vst1_lane_f16(a: *mut f16, b: float16x4_t) { assert_instr(nop, LANE = 0) )] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst1q_lane_f16(a: *mut f16, b: float16x8_t) { @@ -66973,175 +68136,145 @@ pub unsafe fn vst1q_p16_x3(a: *mut p16, b: poly16x8x3_t) { pub unsafe fn vst1q_p16_x4(a: *mut p16, b: poly16x8x4_t) { vst1q_s16_x4(transmute(a), transmute(b)) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_v1i64)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] -unsafe fn vst1_v1i64(addr: *const i8, val: int64x1_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1_v1i64(addr: *const i8, val: int64x1_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v1i64.p0")] fn _vst1_v1i64(addr: *const i8, val: int64x1_t, align: i32); } - _vst1_v1i64(addr, val, align) + _vst1_v1i64(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_v2f32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] -unsafe fn vst1_v2f32(addr: *const i8, val: float32x2_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1_v2f32(addr: *const i8, val: float32x2_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v2f32.p0")] fn _vst1_v2f32(addr: *const i8, val: float32x2_t, align: i32); } - _vst1_v2f32(addr, val, align) + _vst1_v2f32(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_v2i32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] -unsafe fn vst1_v2i32(addr: *const i8, val: int32x2_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1_v2i32(addr: *const i8, val: int32x2_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v2i32.p0")] fn _vst1_v2i32(addr: *const i8, val: int32x2_t, align: i32); } - _vst1_v2i32(addr, val, align) + _vst1_v2i32(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_v4i16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] -unsafe fn vst1_v4i16(addr: *const i8, val: int16x4_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1_v4i16(addr: *const i8, val: int16x4_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v4i16.p0")] fn _vst1_v4i16(addr: *const i8, val: int16x4_t, align: i32); } - _vst1_v4i16(addr, val, align) + _vst1_v4i16(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_v8i8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] -unsafe fn vst1_v8i8(addr: *const i8, val: int8x8_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1_v8i8(addr: *const i8, val: int8x8_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v8i8.p0")] fn _vst1_v8i8(addr: *const i8, val: int8x8_t, align: i32); } - _vst1_v8i8(addr, val, align) + _vst1_v8i8(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_v16i8)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8"))] -unsafe fn vst1q_v16i8(addr: *const i8, val: int8x16_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.8", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1q_v16i8(addr: *const i8, val: int8x16_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v16i8.p0")] fn _vst1q_v16i8(addr: *const i8, val: int8x16_t, align: i32); } - _vst1q_v16i8(addr, val, align) + _vst1q_v16i8(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_v2i64)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64"))] -unsafe fn vst1q_v2i64(addr: *const i8, val: int64x2_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.64", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1q_v2i64(addr: *const i8, val: int64x2_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v2i64.p0")] fn _vst1q_v2i64(addr: *const i8, val: int64x2_t, align: i32); } - _vst1q_v2i64(addr, val, align) + _vst1q_v2i64(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_v4f32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] -unsafe fn vst1q_v4f32(addr: *const i8, val: float32x4_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1q_v4f32(addr: *const i8, val: float32x4_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v4f32.p0")] fn _vst1q_v4f32(addr: *const i8, val: float32x4_t, align: i32); } - _vst1q_v4f32(addr, val, align) + _vst1q_v4f32(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_v4i32)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32"))] -unsafe fn vst1q_v4i32(addr: *const i8, val: int32x4_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.32", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1q_v4i32(addr: *const i8, val: int32x4_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v4i32.p0")] fn _vst1q_v4i32(addr: *const i8, val: int32x4_t, align: i32); } - _vst1q_v4i32(addr, val, align) + _vst1q_v4i32(addr, val, ALIGN) } -#[doc = "Store multiple single-element structures from one, two, three, or four registers."] -#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_v8i16)"] -#[doc = "## Safety"] -#[doc = " * Neon instrinsic unsafe"] #[inline] #[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] -#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] -unsafe fn vst1q_v8i16(addr: *const i8, val: int16x8_t, align: i32) { +#[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16", ALIGN = 0))] +#[rustc_legacy_const_generics(2)] +unsafe fn vst1q_v8i16(addr: *const i8, val: int16x8_t) { unsafe extern "unadjusted" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst1.v8i16.p0")] fn _vst1q_v8i16(addr: *const i8, val: int16x8_t, align: i32); } - _vst1q_v8i16(addr, val, align) + _vst1q_v8i16(addr, val, ALIGN) } #[doc = "Store multiple single-element structures from one, two, three, or four registers."] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_v4f16)"] @@ -67151,7 +68284,7 @@ unsafe fn vst1q_v8i16(addr: *const i8, val: int16x8_t, align: i32) { #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] unsafe fn vst1_v4f16(addr: *const i8, val: float16x4_t, align: i32) { @@ -67169,7 +68302,7 @@ unsafe fn vst1_v4f16(addr: *const i8, val: float16x4_t, align: i32) { #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr("vst1.16"))] unsafe fn vst1q_v8f16(addr: *const i8, val: float16x8_t, align: i32) { @@ -67209,8 +68342,9 @@ pub unsafe fn vst1q_lane_p64(a: *mut p64, b: poly64x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(st2))] @@ -67229,8 +68363,9 @@ pub unsafe fn vst2_f16(a: *mut f16, b: float16x4x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(st2))] @@ -67249,9 +68384,10 @@ pub unsafe fn vst2q_f16(a: *mut f16, b: float16x8x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst2))] @@ -67267,9 +68403,10 @@ pub unsafe fn vst2_f16(a: *mut f16, b: float16x4x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst2))] @@ -67565,10 +68702,11 @@ pub unsafe fn vst2q_s32(a: *mut i32, b: int32x4x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(st2, LANE = 0))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst2_lane_f16(a: *mut f16, b: float16x4x2_t) { @@ -67587,10 +68725,11 @@ pub unsafe fn vst2_lane_f16(a: *mut f16, b: float16x4x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(st2, LANE = 0))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst2q_lane_f16(a: *mut f16, b: float16x8x2_t) { @@ -67609,11 +68748,12 @@ pub unsafe fn vst2q_lane_f16(a: *mut f16, b: float16x8x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(test, assert_instr(vst2, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst2_lane_f16(a: *mut f16, b: float16x4x2_t) { @@ -67629,11 +68769,12 @@ pub unsafe fn vst2_lane_f16(a: *mut f16, b: float16x4x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(test, assert_instr(vst2, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst2q_lane_f16(a: *mut f16, b: float16x8x2_t) { @@ -68433,9 +69574,10 @@ pub unsafe fn vst2q_p16(a: *mut p16, b: poly16x8x2_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst3))] @@ -68451,9 +69593,10 @@ pub unsafe fn vst3_f16(a: *mut f16, b: float16x4x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst3))] @@ -68469,8 +69612,9 @@ pub unsafe fn vst3q_f16(a: *mut f16, b: float16x8x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(st3))] @@ -68489,8 +69633,9 @@ pub unsafe fn vst3_f16(a: *mut f16, b: float16x4x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(st3))] @@ -68789,11 +69934,12 @@ pub unsafe fn vst3q_s32(a: *mut i32, b: int32x4x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(test, assert_instr(vst3, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst3_lane_f16(a: *mut f16, b: float16x4x3_t) { @@ -68816,11 +69962,12 @@ pub unsafe fn vst3_lane_f16(a: *mut f16, b: float16x4x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(test, assert_instr(vst3, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst3q_lane_f16(a: *mut f16, b: float16x8x3_t) { @@ -68843,10 +69990,11 @@ pub unsafe fn vst3q_lane_f16(a: *mut f16, b: float16x8x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(st3, LANE = 0))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst3_lane_f16(a: *mut f16, b: float16x4x3_t) { @@ -68865,10 +70013,11 @@ pub unsafe fn vst3_lane_f16(a: *mut f16, b: float16x4x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(st3, LANE = 0))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst3q_lane_f16(a: *mut f16, b: float16x8x3_t) { @@ -69713,9 +70862,10 @@ pub unsafe fn vst3q_p16(a: *mut p16, b: poly16x8x3_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst4))] @@ -69738,9 +70888,10 @@ pub unsafe fn vst4_f16(a: *mut f16, b: float16x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(vst4))] @@ -69763,8 +70914,9 @@ pub unsafe fn vst4q_f16(a: *mut f16, b: float16x8x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(st4))] @@ -69783,8 +70935,9 @@ pub unsafe fn vst4_f16(a: *mut f16, b: float16x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] #[cfg_attr(test, assert_instr(st4))] @@ -70132,11 +71285,12 @@ pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(test, assert_instr(vst4, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst4_lane_f16(a: *mut f16, b: float16x4x4_t) { @@ -70160,11 +71314,12 @@ pub unsafe fn vst4_lane_f16(a: *mut f16, b: float16x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(target_arch = "arm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[cfg_attr(test, assert_instr(vst4, LANE = 0))] #[rustc_legacy_const_generics(2)] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst4q_lane_f16(a: *mut f16, b: float16x8x4_t) { @@ -70188,10 +71343,11 @@ pub unsafe fn vst4q_lane_f16(a: *mut f16, b: float16x8x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(st4, LANE = 0))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst4_lane_f16(a: *mut f16, b: float16x4x4_t) { @@ -70217,10 +71373,11 @@ pub unsafe fn vst4_lane_f16(a: *mut f16, b: float16x4x4_t) { #[doc = "## Safety"] #[doc = " * Neon instrinsic unsafe"] #[inline] +#[target_feature(enable = "neon")] #[cfg(not(target_arch = "arm"))] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(st4, LANE = 0))] -#[target_feature(enable = "neon,fp16")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "fp16"))] #[unstable(feature = "stdarch_neon_f16", issue = "136306")] #[cfg(not(target_arch = "arm64ec"))] pub unsafe fn vst4q_lane_f16(a: *mut f16, b: float16x8x4_t) { @@ -71163,7 +72320,14 @@ pub unsafe fn vstrq_p128(a: *mut p128, b: p128) { assert_instr(fsub) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vsub_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { unsafe { simd_sub(a, b) } @@ -71178,7 +72342,14 @@ pub fn vsub_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t { assert_instr(fsub) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vsubq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t { unsafe { simd_sub(a, b) } @@ -72104,6 +73275,7 @@ pub fn vsubw_u32(a: uint64x2_t, b: uint32x2_t) -> uint64x2_t { #[doc = "Dot product index form with signed and unsigned integers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsudot_lane_s32)"] #[inline] +#[cfg(target_endian = "little")] #[target_feature(enable = "neon,i8mm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsudot, LANE = 0))] @@ -72129,8 +73301,41 @@ pub fn vsudot_lane_s32(a: int32x2_t, b: int8x8_t, c: uint8x8_t) } } #[doc = "Dot product index form with signed and unsigned integers"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsudot_lane_s32)"] +#[inline] +#[cfg(target_endian = "big")] +#[target_feature(enable = "neon,i8mm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsudot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(sudot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_i8mm", issue = "117223") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vsudot_lane_s32(a: int32x2_t, b: int8x8_t, c: uint8x8_t) -> int32x2_t { + static_assert_uimm_bits!(LANE, 1); + let a: int32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; + let b: int8x8_t = unsafe { simd_shuffle!(b, b, [7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: uint8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: uint32x2_t = transmute(c); + let c: uint32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); + let ret_val: int32x2_t = vusdot_s32(a, transmute(c), b); + simd_shuffle!(ret_val, ret_val, [1, 0]) + } +} +#[doc = "Dot product index form with signed and unsigned integers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsudotq_lane_s32)"] #[inline] +#[cfg(target_endian = "little")] #[target_feature(enable = "neon,i8mm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsudot, LANE = 0))] @@ -72156,6 +73361,40 @@ pub fn vsudotq_lane_s32(a: int32x4_t, b: int8x16_t, c: uint8x8_ vusdotq_s32(a, transmute(c), b) } } +#[doc = "Dot product index form with signed and unsigned integers"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsudotq_lane_s32)"] +#[inline] +#[cfg(target_endian = "big")] +#[target_feature(enable = "neon,i8mm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vsudot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(sudot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_i8mm", issue = "117223") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vsudotq_lane_s32(a: int32x4_t, b: int8x16_t, c: uint8x8_t) -> int32x4_t { + static_assert_uimm_bits!(LANE, 1); + let a: int32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; + let b: int8x16_t = + unsafe { simd_shuffle!(b, b, [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: uint8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: uint32x2_t = transmute(c); + let c: uint32x4_t = + simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); + let ret_val: int32x4_t = vusdotq_s32(a, transmute(c), b); + simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + } +} #[doc = "Table look-up"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vtbl1)"] #[inline] @@ -73043,7 +74282,14 @@ pub fn vtbx4_p8(a: poly8x8_t, b: poly8x8x4_t, c: uint8x8_t) -> poly8x8_t { assert_instr(trn2) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vtrn_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { unsafe { @@ -73066,7 +74312,14 @@ pub fn vtrn_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { assert_instr(trn2) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vtrnq_f16(a: float16x8_t, b: float16x8_t) -> float16x8x2_t { unsafe { @@ -74024,6 +75277,7 @@ pub fn vtstq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t { #[doc = "Dot product index form with unsigned and signed integers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vusdot_lane_s32)"] #[inline] +#[cfg(target_endian = "little")] #[target_feature(enable = "neon,i8mm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vusdot, LANE = 0))] @@ -74049,8 +75303,41 @@ pub fn vusdot_lane_s32(a: int32x2_t, b: uint8x8_t, c: int8x8_t) } } #[doc = "Dot product index form with unsigned and signed integers"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vusdot_lane_s32)"] +#[inline] +#[cfg(target_endian = "big")] +#[target_feature(enable = "neon,i8mm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vusdot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(usdot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_i8mm", issue = "117223") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vusdot_lane_s32(a: int32x2_t, b: uint8x8_t, c: int8x8_t) -> int32x2_t { + static_assert_uimm_bits!(LANE, 1); + let a: int32x2_t = unsafe { simd_shuffle!(a, a, [1, 0]) }; + let b: uint8x8_t = unsafe { simd_shuffle!(b, b, [7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: int8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: int32x2_t = transmute(c); + let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); + let ret_val: int32x2_t = vusdot_s32(a, b, transmute(c)); + simd_shuffle!(ret_val, ret_val, [1, 0]) + } +} +#[doc = "Dot product index form with unsigned and signed integers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vusdotq_lane_s32)"] #[inline] +#[cfg(target_endian = "little")] #[target_feature(enable = "neon,i8mm")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] #[cfg_attr(all(test, target_arch = "arm"), assert_instr(vusdot, LANE = 0))] @@ -74076,6 +75363,40 @@ pub fn vusdotq_lane_s32(a: int32x4_t, b: uint8x16_t, c: int8x8_ vusdotq_s32(a, b, transmute(c)) } } +#[doc = "Dot product index form with unsigned and signed integers"] +#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vusdotq_lane_s32)"] +#[inline] +#[cfg(target_endian = "big")] +#[target_feature(enable = "neon,i8mm")] +#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))] +#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vusdot, LANE = 0))] +#[cfg_attr( + all(test, any(target_arch = "aarch64", target_arch = "arm64ec")), + assert_instr(usdot, LANE = 0) +)] +#[rustc_legacy_const_generics(3)] +#[cfg_attr( + not(target_arch = "arm"), + unstable(feature = "stdarch_neon_i8mm", issue = "117223") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] +pub fn vusdotq_lane_s32(a: int32x4_t, b: uint8x16_t, c: int8x8_t) -> int32x4_t { + static_assert_uimm_bits!(LANE, 1); + let a: int32x4_t = unsafe { simd_shuffle!(a, a, [3, 2, 1, 0]) }; + let b: uint8x16_t = + unsafe { simd_shuffle!(b, b, [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) }; + let c: int8x8_t = unsafe { simd_shuffle!(c, c, [7, 6, 5, 4, 3, 2, 1, 0]) }; + unsafe { + let c: int32x2_t = transmute(c); + let c: int32x4_t = + simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); + let ret_val: int32x4_t = vusdotq_s32(a, b, transmute(c)); + simd_shuffle!(ret_val, ret_val, [3, 2, 1, 0]) + } +} #[doc = "Dot product vector form with unsigned and signed integers"] #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vusdot_s32)"] #[inline] @@ -74177,7 +75498,14 @@ pub fn vusmmlaq_s32(a: int32x4_t, b: uint8x16_t, c: int8x16_t) -> int32x4_t { assert_instr(uzp2) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vuzp_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { unsafe { @@ -74200,7 +75528,14 @@ pub fn vuzp_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { assert_instr(uzp2) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vuzpq_f16(a: float16x8_t, b: float16x8_t) -> float16x8x2_t { unsafe { @@ -74769,7 +76104,14 @@ pub fn vuzpq_p16(a: poly16x8_t, b: poly16x8_t) -> poly16x8x2_t { assert_instr(zip2) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vzip_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { unsafe { @@ -74792,7 +76134,14 @@ pub fn vzip_f16(a: float16x4_t, b: float16x4_t) -> float16x4x2_t { assert_instr(zip2) )] #[target_feature(enable = "neon,fp16")] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] #[cfg(not(target_arch = "arm64ec"))] pub fn vzipq_f16(a: float16x8_t, b: float16x8_t) -> float16x8x2_t { unsafe { diff --git a/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs b/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs index fbd1967c544a..809892e0bfd4 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/neon/mod.rs @@ -104,7 +104,8 @@ types! { } types! { - #![unstable(feature = "stdarch_neon_f16", issue = "136306")] + #![cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION"))] + #![cfg_attr(target_arch = "arm", unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800"))] /// Arm-specific 64-bit wide vector of four packed `f16`. pub struct float16x4_t(4 x pub(crate) f16); @@ -747,19 +748,40 @@ pub struct uint32x4x4_t( /// Arm-specific type containing two `float16x4_t` vectors. #[repr(C)] #[derive(Copy, Clone, Debug)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] pub struct float16x4x2_t(pub float16x4_t, pub float16x4_t); /// Arm-specific type containing three `float16x4_t` vectors. #[repr(C)] #[derive(Copy, Clone, Debug)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] pub struct float16x4x3_t(pub float16x4_t, pub float16x4_t, pub float16x4_t); /// Arm-specific type containing four `float16x4_t` vectors. #[repr(C)] #[derive(Copy, Clone, Debug)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] pub struct float16x4x4_t( pub float16x4_t, pub float16x4_t, @@ -770,19 +792,40 @@ pub struct float16x4x4_t( /// Arm-specific type containing two `float16x8_t` vectors. #[repr(C)] #[derive(Copy, Clone, Debug)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] pub struct float16x8x2_t(pub float16x8_t, pub float16x8_t); /// Arm-specific type containing three `float16x8_t` vectors. #[repr(C)] #[derive(Copy, Clone, Debug)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] pub struct float16x8x3_t(pub float16x8_t, pub float16x8_t, pub float16x8_t); /// Arm-specific type containing four `float16x8_t` vectors. #[repr(C)] #[derive(Copy, Clone, Debug)] -#[unstable(feature = "stdarch_neon_f16", issue = "136306")] +#[cfg_attr( + not(target_arch = "arm"), + stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION") +)] +#[cfg_attr( + target_arch = "arm", + unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800") +)] pub struct float16x8x4_t( pub float16x8_t, pub float16x8_t, diff --git a/library/stdarch/crates/core_arch/src/core_arch_docs.md b/library/stdarch/crates/core_arch/src/core_arch_docs.md index 6aea2b461846..707594575497 100644 --- a/library/stdarch/crates/core_arch/src/core_arch_docs.md +++ b/library/stdarch/crates/core_arch/src/core_arch_docs.md @@ -185,6 +185,7 @@ others at: * [`x86_64`] * [`arm`] * [`aarch64`] +* [`amdgpu`] * [`riscv32`] * [`riscv64`] * [`mips`] @@ -201,6 +202,7 @@ others at: [`x86_64`]: ../../core/arch/x86_64/index.html [`arm`]: ../../core/arch/arm/index.html [`aarch64`]: ../../core/arch/aarch64/index.html +[`amdgpu`]: ../../core/arch/amdgpu/index.html [`riscv32`]: ../../core/arch/riscv32/index.html [`riscv64`]: ../../core/arch/riscv64/index.html [`mips`]: ../../core/arch/mips/index.html diff --git a/library/stdarch/crates/core_arch/src/lib.rs b/library/stdarch/crates/core_arch/src/lib.rs index a059a9c22570..5bedefe42d6e 100644 --- a/library/stdarch/crates/core_arch/src/lib.rs +++ b/library/stdarch/crates/core_arch/src/lib.rs @@ -34,7 +34,10 @@ aarch64_unstable_target_feature, bigint_helper_methods, funnel_shifts, - avx10_target_feature + avx10_target_feature, + const_trait_impl, + const_cmp, + const_eval_select )] #![cfg_attr(test, feature(test, abi_vectorcall, stdarch_internal))] #![deny(clippy::missing_inline_in_public_items)] diff --git a/library/stdarch/crates/core_arch/src/mod.rs b/library/stdarch/crates/core_arch/src/mod.rs index 2105cca1b438..3577175ae31c 100644 --- a/library/stdarch/crates/core_arch/src/mod.rs +++ b/library/stdarch/crates/core_arch/src/mod.rs @@ -5,6 +5,11 @@ #[macro_use] mod macros; +#[cfg(test)] +mod test; +#[cfg(test)] +use test::assert_eq_const; + #[cfg(any(target_arch = "riscv32", target_arch = "riscv64", doc))] mod riscv_shared; @@ -274,6 +279,16 @@ pub mod arch { pub use crate::core_arch::nvptx::*; } + /// Platform-specific intrinsics for the `amdgpu` platform. + /// + /// See the [module documentation](../index.html) for more details. + #[cfg(any(target_arch = "amdgpu", doc))] + #[doc(cfg(target_arch = "amdgpu"))] + #[unstable(feature = "stdarch_amdgpu", issue = "149988")] + pub mod amdgpu { + pub use crate::core_arch::amdgpu::*; + } + /// Platform-specific intrinsics for the `loongarch32` platform. /// /// See the [module documentation](../index.html) for more details. @@ -349,6 +364,10 @@ mod powerpc64; #[doc(cfg(target_arch = "nvptx64"))] mod nvptx; +#[cfg(any(target_arch = "amdgpu", doc))] +#[doc(cfg(target_arch = "amdgpu"))] +mod amdgpu; + #[cfg(any(target_arch = "loongarch32", doc))] #[doc(cfg(target_arch = "loongarch32"))] mod loongarch32; diff --git a/library/stdarch/crates/core_arch/src/riscv64/zk.rs b/library/stdarch/crates/core_arch/src/riscv64/zk.rs index a30653cbe088..3aa1ca39b3c9 100644 --- a/library/stdarch/crates/core_arch/src/riscv64/zk.rs +++ b/library/stdarch/crates/core_arch/src/riscv64/zk.rs @@ -1,6 +1,8 @@ #[cfg(test)] use stdarch_test::assert_instr; +use crate::arch::asm; + unsafe extern "unadjusted" { #[link_name = "llvm.riscv.aes64es"] fn _aes64es(rs1: i64, rs2: i64) -> i64; @@ -14,12 +16,6 @@ unsafe extern "unadjusted" { #[link_name = "llvm.riscv.aes64dsm"] fn _aes64dsm(rs1: i64, rs2: i64) -> i64; - #[link_name = "llvm.riscv.aes64ks1i"] - fn _aes64ks1i(rs1: i64, rnum: i32) -> i64; - - #[link_name = "llvm.riscv.aes64ks2"] - fn _aes64ks2(rs1: i64, rs2: i64) -> i64; - #[link_name = "llvm.riscv.aes64im"] fn _aes64im(rs1: i64) -> i64; @@ -133,15 +129,26 @@ pub fn aes64dsm(rs1: u64, rs2: u64) -> u64 { /// # Note /// /// The `RNUM` parameter is expected to be a constant value inside the range of `0..=10`. -#[target_feature(enable = "zkne", enable = "zknd")] +#[target_feature(enable = "zkne_or_zknd")] #[rustc_legacy_const_generics(1)] -#[cfg_attr(test, assert_instr(aes64ks1i, RNUM = 0))] #[inline] #[unstable(feature = "riscv_ext_intrinsics", issue = "114544")] pub fn aes64ks1i(rs1: u64) -> u64 { static_assert!(RNUM <= 10); - - unsafe { _aes64ks1i(rs1 as i64, RNUM as i32) as u64 } + unsafe { + let rd: u64; + asm!( + ".option push", + ".option arch, +zkne", + "aes64ks1i {}, {}, {}", + ".option pop", + lateout(reg) rd, + in(reg) rs1, + const RNUM, + options(pure, nomem, nostack, preserves_flags) + ); + rd + } } /// This instruction implements part of the KeySchedule operation for the AES Block cipher. @@ -155,12 +162,24 @@ pub fn aes64ks1i(rs1: u64) -> u64 { /// Version: v1.0.1 /// /// Section: 3.11 -#[target_feature(enable = "zkne", enable = "zknd")] -#[cfg_attr(test, assert_instr(aes64ks2))] +#[target_feature(enable = "zkne_or_zknd")] #[inline] #[unstable(feature = "riscv_ext_intrinsics", issue = "114544")] pub fn aes64ks2(rs1: u64, rs2: u64) -> u64 { - unsafe { _aes64ks2(rs1 as i64, rs2 as i64) as u64 } + unsafe { + let rd: u64; + asm!( + ".option push", + ".option arch, +zkne", + "aes64ks2 {}, {}, {}", + ".option pop", + lateout(reg) rd, + in(reg) rs1, + in(reg) rs2, + options(pure, nomem, nostack, preserves_flags) + ); + rd + } } /// This instruction accelerates the inverse MixColumns step of the AES Block Cipher, and is used to aid creation of diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index 7208105fb872..1366b5c78273 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -896,7 +896,7 @@ mod sealed { #[cfg_attr(test, assert_instr(vrepb, IMM2 = 1))] unsafe fn vrepb(a: vector_signed_char) -> vector_signed_char { static_assert_uimm_bits!(IMM2, 4); - simd_shuffle(a, a, const { u32x16::from_array([IMM2; 16]) }) + simd_shuffle!(a, a, [IMM2; 16]) } #[inline] @@ -904,7 +904,7 @@ mod sealed { #[cfg_attr(test, assert_instr(vreph, IMM2 = 1))] unsafe fn vreph(a: vector_signed_short) -> vector_signed_short { static_assert_uimm_bits!(IMM2, 3); - simd_shuffle(a, a, const { u32x8::from_array([IMM2; 8]) }) + simd_shuffle!(a, a, [IMM2; 8]) } #[inline] @@ -912,7 +912,7 @@ mod sealed { #[cfg_attr(test, assert_instr(vrepf, IMM2 = 1))] unsafe fn vrepf(a: vector_signed_int) -> vector_signed_int { static_assert_uimm_bits!(IMM2, 2); - simd_shuffle(a, a, const { u32x4::from_array([IMM2; 4]) }) + simd_shuffle!(a, a, [IMM2; 4]) } #[inline] @@ -920,7 +920,7 @@ mod sealed { #[cfg_attr(test, assert_instr(vrepg, IMM2 = 1))] unsafe fn vrepg(a: vector_signed_long_long) -> vector_signed_long_long { static_assert_uimm_bits!(IMM2, 1); - simd_shuffle(a, a, const { u32x2::from_array([IMM2; 2]) }) + simd_shuffle!(a, a, [IMM2; 2]) } macro_rules! impl_vec_splat { @@ -5307,11 +5307,13 @@ pub unsafe fn vec_search_string_until_zero_cc( #[inline] #[target_feature(enable = "vector-enhancements-1")] #[unstable(feature = "stdarch_s390x", issue = "135681")] -// FIXME: this emits `vflls` where `vldeb` is expected -// #[cfg_attr(all(test, target_feature = "vector-enhancements-1"), assert_instr(vldeb))] +// NOTE: `vflls` and `vldeb` are equivalent; our disassmbler prefers vflls. +#[cfg_attr( + all(test, target_feature = "vector-enhancements-1"), + assert_instr(vflls) +)] pub unsafe fn vec_doublee(a: vector_float) -> vector_double { - let even = simd_shuffle::<_, _, f32x2>(a, a, const { u32x2::from_array([0, 2]) }); - simd_as(even) + simd_as::(simd_shuffle!(a, a, [0, 2])) } /// Vector Convert from double to float (even elements) @@ -5322,11 +5324,7 @@ pub unsafe fn vec_doublee(a: vector_float) -> vector_double { // #[cfg_attr(all(test, target_feature = "vector-enhancements-1"), assert_instr(vledb))] pub unsafe fn vec_floate(a: vector_double) -> vector_float { let truncated: f32x2 = simd_as(a); - simd_shuffle( - truncated, - truncated, - const { u32x4::from_array([0, 0, 1, 1]) }, - ) + simd_shuffle!(truncated, truncated, [0, 0, 1, 1]) } /// Vector Convert from int to float diff --git a/library/stdarch/crates/core_arch/src/simd.rs b/library/stdarch/crates/core_arch/src/simd.rs index 25834943f009..b9dbde75971d 100644 --- a/library/stdarch/crates/core_arch/src/simd.rs +++ b/library/stdarch/crates/core_arch/src/simd.rs @@ -2,6 +2,20 @@ #![allow(non_camel_case_types)] +#[inline(always)] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const unsafe fn simd_imax(a: T, b: T) -> T { + let mask: T = crate::intrinsics::simd::simd_gt(a, b); + crate::intrinsics::simd::simd_select(mask, a, b) +} + +#[inline(always)] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const unsafe fn simd_imin(a: T, b: T) -> T { + let mask: T = crate::intrinsics::simd::simd_lt(a, b); + crate::intrinsics::simd::simd_select(mask, a, b) +} + macro_rules! simd_ty { ($id:ident [$elem_type:ty ; $len:literal]: $($param_name:ident),*) => { #[repr(simd)] @@ -23,7 +37,8 @@ macro_rules! simd_ty { } // FIXME: Workaround rust@60637 #[inline(always)] - pub(crate) fn splat(value: $elem_type) -> Self { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + pub(crate) const fn splat(value: $elem_type) -> Self { #[derive(Copy, Clone)] #[repr(simd)] struct JustOne([$elem_type; 1]); @@ -38,12 +53,12 @@ macro_rules! simd_ty { /// Use for testing only. // FIXME: Workaround rust@60637 #[inline(always)] - pub(crate) fn extract(&self, index: usize) -> $elem_type { + pub(crate) const fn extract(&self, index: usize) -> $elem_type { self.as_array()[index] } #[inline] - pub(crate) fn as_array(&self) -> &[$elem_type; $len] { + pub(crate) const fn as_array(&self) -> &[$elem_type; $len] { let simd_ptr: *const Self = self; let array_ptr: *const [$elem_type; $len] = simd_ptr.cast(); // SAFETY: We can always read the prefix of a simd type as an array. @@ -53,7 +68,8 @@ macro_rules! simd_ty { } } - impl core::cmp::PartialEq for $id { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + const impl core::cmp::PartialEq for $id { #[inline] fn eq(&self, other: &Self) -> bool { self.as_array() == other.as_array() @@ -89,7 +105,8 @@ macro_rules! simd_m_ty { // FIXME: Workaround rust@60637 #[inline(always)] - pub(crate) fn splat(value: bool) -> Self { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + pub(crate) const fn splat(value: bool) -> Self { #[derive(Copy, Clone)] #[repr(simd)] struct JustOne([$elem_type; 1]); @@ -100,7 +117,7 @@ macro_rules! simd_m_ty { } #[inline] - pub(crate) fn as_array(&self) -> &[$elem_type; $len] { + pub(crate) const fn as_array(&self) -> &[$elem_type; $len] { let simd_ptr: *const Self = self; let array_ptr: *const [$elem_type; $len] = simd_ptr.cast(); // SAFETY: We can always read the prefix of a simd type as an array. @@ -110,7 +127,8 @@ macro_rules! simd_m_ty { } } - impl core::cmp::PartialEq for $id { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + const impl core::cmp::PartialEq for $id { #[inline] fn eq(&self, other: &Self) -> bool { self.as_array() == other.as_array() diff --git a/library/stdarch/crates/core_arch/src/test.rs b/library/stdarch/crates/core_arch/src/test.rs new file mode 100644 index 000000000000..976d4ac1b023 --- /dev/null +++ b/library/stdarch/crates/core_arch/src/test.rs @@ -0,0 +1,25 @@ +use crate::fmt::Debug; + +#[track_caller] +#[allow(unused)] +pub(crate) fn assert_eq_rt(a: &T, b: &T) { + std::assert_eq!(a, b) +} + +#[allow(unused)] +macro_rules! assert_eq_const { + ($a:expr, $b:expr $(,)?) => {{ + #[inline(always)] + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + const fn assert_eq_ct(a: &T, b: &T) { + assert!(a == b, concat!("`", stringify!($a), "` != `", stringify!($b), "`")); + } + + $crate::intrinsics::const_eval_select((&$a, &$b), assert_eq_ct, $crate::core_arch::test::assert_eq_rt); + }}; + ($a:expr, $b:expr, $($t:tt)+) => { + ::std::assert_eq!($a, $b, $($t)+) + }; +} + +pub(crate) use assert_eq_const; diff --git a/library/stdarch/crates/core_arch/src/wasm32/relaxed_simd.rs b/library/stdarch/crates/core_arch/src/wasm32/relaxed_simd.rs index a9b7e9c04d11..8a9d46984dbb 100644 --- a/library/stdarch/crates/core_arch/src/wasm32/relaxed_simd.rs +++ b/library/stdarch/crates/core_arch/src/wasm32/relaxed_simd.rs @@ -248,8 +248,10 @@ pub fn i64x2_relaxed_laneselect(a: v128, b: v128, m: v128) -> v128 { #[stable(feature = "stdarch_wasm_relaxed_simd", since = "1.82.0")] pub use i64x2_relaxed_laneselect as u64x2_relaxed_laneselect; -/// A relaxed version of `f32x4_min` which is either `f32x4_min` or -/// `f32x4_pmin`. +/// A relaxed version of `f32x4_min` which has implementation-specific behavior +/// when its operands are NaN or signed zeroes. For more information, see [the +/// WebAssembly +/// specification](https://webassembly.github.io/spec/core/exec/numerics.html#op-frelaxed-min). #[inline] #[cfg_attr(test, assert_instr(f32x4.relaxed_min))] #[target_feature(enable = "relaxed-simd")] @@ -259,8 +261,10 @@ pub fn f32x4_relaxed_min(a: v128, b: v128) -> v128 { unsafe { llvm_f32x4_relaxed_min(a.as_f32x4(), b.as_f32x4()).v128() } } -/// A relaxed version of `f32x4_max` which is either `f32x4_max` or -/// `f32x4_pmax`. +/// A relaxed version of `f32x4_max` which has implementation-specific behavior +/// when its operands are NaN or signed zeroes. For more information, see [the +/// WebAssembly +/// specification](https://webassembly.github.io/spec/core/exec/numerics.html#op-frelaxed-max). #[inline] #[cfg_attr(test, assert_instr(f32x4.relaxed_max))] #[target_feature(enable = "relaxed-simd")] @@ -270,8 +274,10 @@ pub fn f32x4_relaxed_max(a: v128, b: v128) -> v128 { unsafe { llvm_f32x4_relaxed_max(a.as_f32x4(), b.as_f32x4()).v128() } } -/// A relaxed version of `f64x2_min` which is either `f64x2_min` or -/// `f64x2_pmin`. +/// A relaxed version of `f64x2_min` which has implementation-specific behavior +/// when its operands are NaN or signed zeroes. For more information, see [the +/// WebAssembly +/// specification](https://webassembly.github.io/spec/core/exec/numerics.html#op-frelaxed-min). #[inline] #[cfg_attr(test, assert_instr(f64x2.relaxed_min))] #[target_feature(enable = "relaxed-simd")] @@ -281,8 +287,10 @@ pub fn f64x2_relaxed_min(a: v128, b: v128) -> v128 { unsafe { llvm_f64x2_relaxed_min(a.as_f64x2(), b.as_f64x2()).v128() } } -/// A relaxed version of `f64x2_max` which is either `f64x2_max` or -/// `f64x2_pmax`. +/// A relaxed version of `f64x2_max` which has implementation-specific behavior +/// when its operands are NaN or signed zeroes. For more information, see [the +/// WebAssembly +/// specification](https://webassembly.github.io/spec/core/exec/numerics.html#op-frelaxed-max). #[inline] #[cfg_attr(test, assert_instr(f64x2.relaxed_max))] #[target_feature(enable = "relaxed-simd")] diff --git a/library/stdarch/crates/core_arch/src/x86/abm.rs b/library/stdarch/crates/core_arch/src/x86/abm.rs index e6d551760043..078c0c5980e4 100644 --- a/library/stdarch/crates/core_arch/src/x86/abm.rs +++ b/library/stdarch/crates/core_arch/src/x86/abm.rs @@ -12,8 +12,8 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions //! available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wikipedia_bmi]: //! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 @@ -29,7 +29,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "lzcnt")] #[cfg_attr(test, assert_instr(lzcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _lzcnt_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _lzcnt_u32(x: u32) -> u32 { x.leading_zeros() } @@ -40,23 +41,25 @@ pub fn _lzcnt_u32(x: u32) -> u32 { #[target_feature(enable = "popcnt")] #[cfg_attr(test, assert_instr(popcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _popcnt32(x: i32) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _popcnt32(x: i32) -> i32 { x.count_ones() as i32 } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "lzcnt")] - unsafe fn test_lzcnt_u32() { + const fn test_lzcnt_u32() { assert_eq!(_lzcnt_u32(0b0101_1010), 25); } #[simd_test(enable = "popcnt")] - unsafe fn test_popcnt32() { + const fn test_popcnt32() { assert_eq!(_popcnt32(0b0101_1010), 4); } } diff --git a/library/stdarch/crates/core_arch/src/x86/aes.rs b/library/stdarch/crates/core_arch/src/x86/aes.rs index 7db743b2ccd3..d07ab4dc2a01 100644 --- a/library/stdarch/crates/core_arch/src/x86/aes.rs +++ b/library/stdarch/crates/core_arch/src/x86/aes.rs @@ -5,7 +5,7 @@ //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref]. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf use crate::core_arch::x86::__m128i; @@ -112,7 +112,7 @@ mod tests { use crate::core_arch::x86::*; #[simd_test(enable = "aes")] - unsafe fn test_mm_aesdec_si128() { + fn test_mm_aesdec_si128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee); @@ -122,7 +122,7 @@ mod tests { } #[simd_test(enable = "aes")] - unsafe fn test_mm_aesdeclast_si128() { + fn test_mm_aesdeclast_si128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714178.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee); @@ -132,7 +132,7 @@ mod tests { } #[simd_test(enable = "aes")] - unsafe fn test_mm_aesenc_si128() { + fn test_mm_aesenc_si128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664810.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee); @@ -142,7 +142,7 @@ mod tests { } #[simd_test(enable = "aes")] - unsafe fn test_mm_aesenclast_si128() { + fn test_mm_aesenclast_si128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714136.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee); @@ -152,7 +152,7 @@ mod tests { } #[simd_test(enable = "aes")] - unsafe fn test_mm_aesimc_si128() { + fn test_mm_aesimc_si128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714195.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let e = _mm_set_epi64x(0xc66c82284ee40aa0, 0x6633441122770055); @@ -161,7 +161,7 @@ mod tests { } #[simd_test(enable = "aes")] - unsafe fn test_mm_aeskeygenassist_si128() { + fn test_mm_aeskeygenassist_si128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714138.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let e = _mm_set_epi64x(0x857c266b7c266e85, 0xeac4eea9c4eeacea); diff --git a/library/stdarch/crates/core_arch/src/x86/avx.rs b/library/stdarch/crates/core_arch/src/x86/avx.rs index c50c83fcaa8f..e0e01ae6d034 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx.rs @@ -9,8 +9,8 @@ //! //! [Wikipedia][wiki] provides a quick overview of the instructions available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wiki]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions use crate::{ @@ -30,7 +30,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vaddpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_add_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { simd_add(a, b) } } @@ -42,7 +43,8 @@ pub fn _mm256_add_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vaddps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_add_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_ps(a: __m256, b: __m256) -> __m256 { unsafe { simd_add(a, b) } } @@ -55,7 +57,8 @@ pub fn _mm256_add_ps(a: __m256, b: __m256) -> __m256 { // See https://github.com/rust-lang/stdarch/issues/71 #[cfg_attr(test, assert_instr(vandp))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_and_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_and_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let a: u64x4 = transmute(a); let b: u64x4 = transmute(b); @@ -71,7 +74,8 @@ pub fn _mm256_and_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_and_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_and_ps(a: __m256, b: __m256) -> __m256 { unsafe { let a: u32x8 = transmute(a); let b: u32x8 = transmute(b); @@ -88,7 +92,8 @@ pub fn _mm256_and_ps(a: __m256, b: __m256) -> __m256 { // See . #[cfg_attr(test, assert_instr(vorp))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_or_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_or_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let a: u64x4 = transmute(a); let b: u64x4 = transmute(b); @@ -104,7 +109,8 @@ pub fn _mm256_or_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_or_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_or_ps(a: __m256, b: __m256) -> __m256 { unsafe { let a: u32x8 = transmute(a); let b: u32x8 = transmute(b); @@ -121,7 +127,8 @@ pub fn _mm256_or_ps(a: __m256, b: __m256) -> __m256 { #[cfg_attr(test, assert_instr(vshufpd, MASK = 3))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_shuffle_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_pd(a: __m256d, b: __m256d) -> __m256d { static_assert_uimm_bits!(MASK, 8); unsafe { simd_shuffle!( @@ -146,7 +153,8 @@ pub fn _mm256_shuffle_pd(a: __m256d, b: __m256d) -> __m256d { #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_shuffle_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_ps(a: __m256, b: __m256) -> __m256 { static_assert_uimm_bits!(MASK, 8); unsafe { simd_shuffle!( @@ -174,7 +182,8 @@ pub fn _mm256_shuffle_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vandnp))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_andnot_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_andnot_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let a: u64x4 = transmute(a); let b: u64x4 = transmute(b); @@ -191,7 +200,8 @@ pub fn _mm256_andnot_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_andnot_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_andnot_ps(a: __m256, b: __m256) -> __m256 { unsafe { let a: u32x8 = transmute(a); let b: u32x8 = transmute(b); @@ -255,7 +265,8 @@ pub fn _mm256_min_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmulpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mul_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mul_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { simd_mul(a, b) } } @@ -267,7 +278,8 @@ pub fn _mm256_mul_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmulps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mul_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mul_ps(a: __m256, b: __m256) -> __m256 { unsafe { simd_mul(a, b) } } @@ -279,7 +291,8 @@ pub fn _mm256_mul_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vaddsubpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_addsub_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_addsub_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let a = a.as_f64x4(); let b = b.as_f64x4(); @@ -297,7 +310,8 @@ pub fn _mm256_addsub_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vaddsubps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_addsub_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_addsub_ps(a: __m256, b: __m256) -> __m256 { unsafe { let a = a.as_f32x8(); let b = b.as_f32x8(); @@ -315,7 +329,8 @@ pub fn _mm256_addsub_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vsubpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sub_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { simd_sub(a, b) } } @@ -327,7 +342,8 @@ pub fn _mm256_sub_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vsubps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sub_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_ps(a: __m256, b: __m256) -> __m256 { unsafe { simd_sub(a, b) } } @@ -339,7 +355,8 @@ pub fn _mm256_sub_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vdivps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_div_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_div_ps(a: __m256, b: __m256) -> __m256 { unsafe { simd_div(a, b) } } @@ -351,7 +368,8 @@ pub fn _mm256_div_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vdivpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_div_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_div_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { simd_div(a, b) } } @@ -386,7 +404,8 @@ pub fn _mm256_round_pd(a: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vroundpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_ceil_pd(a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_ceil_pd(a: __m256d) -> __m256d { unsafe { simd_ceil(a) } } @@ -398,7 +417,8 @@ pub fn _mm256_ceil_pd(a: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vroundpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_floor_pd(a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_floor_pd(a: __m256d) -> __m256d { unsafe { simd_floor(a) } } @@ -433,7 +453,8 @@ pub fn _mm256_round_ps(a: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vroundps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_ceil_ps(a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_ceil_ps(a: __m256) -> __m256 { unsafe { simd_ceil(a) } } @@ -445,7 +466,8 @@ pub fn _mm256_ceil_ps(a: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vroundps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_floor_ps(a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_floor_ps(a: __m256) -> __m256 { unsafe { simd_floor(a) } } @@ -485,7 +507,8 @@ pub fn _mm256_sqrt_pd(a: __m256d) -> __m256d { #[cfg_attr(test, assert_instr(vblendps, IMM4 = 9))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blend_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blend_pd(a: __m256d, b: __m256d) -> __m256d { static_assert_uimm_bits!(IMM4, 4); unsafe { simd_shuffle!( @@ -510,7 +533,8 @@ pub fn _mm256_blend_pd(a: __m256d, b: __m256d) -> __m256d { #[cfg_attr(test, assert_instr(vblendps, IMM8 = 9))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blend_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blend_ps(a: __m256, b: __m256) -> __m256 { static_assert_uimm_bits!(IMM8, 8); unsafe { simd_shuffle!( @@ -538,7 +562,8 @@ pub fn _mm256_blend_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vblendvpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blendv_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blendv_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { let mask: i64x4 = simd_lt(transmute::<_, i64x4>(c), i64x4::ZERO); transmute(simd_select(mask, b.as_f64x4(), a.as_f64x4())) @@ -553,7 +578,8 @@ pub fn _mm256_blendv_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vblendvps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blendv_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blendv_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { let mask: i32x8 = simd_lt(transmute::<_, i32x8>(c), i32x8::ZERO); transmute(simd_select(mask, b.as_f32x8(), a.as_f32x8())) @@ -586,7 +612,8 @@ pub fn _mm256_dp_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vhaddpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hadd_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hadd_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let even = simd_shuffle!(a, b, [0, 4, 2, 6]); let odd = simd_shuffle!(a, b, [1, 5, 3, 7]); @@ -605,7 +632,8 @@ pub fn _mm256_hadd_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vhaddps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hadd_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hadd_ps(a: __m256, b: __m256) -> __m256 { unsafe { let even = simd_shuffle!(a, b, [0, 2, 8, 10, 4, 6, 12, 14]); let odd = simd_shuffle!(a, b, [1, 3, 9, 11, 5, 7, 13, 15]); @@ -623,7 +651,8 @@ pub fn _mm256_hadd_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vhsubpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hsub_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hsub_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let even = simd_shuffle!(a, b, [0, 4, 2, 6]); let odd = simd_shuffle!(a, b, [1, 5, 3, 7]); @@ -642,7 +671,8 @@ pub fn _mm256_hsub_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vhsubps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hsub_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hsub_ps(a: __m256, b: __m256) -> __m256 { unsafe { let even = simd_shuffle!(a, b, [0, 2, 8, 10, 4, 6, 12, 14]); let odd = simd_shuffle!(a, b, [1, 3, 9, 11, 5, 7, 13, 15]); @@ -658,7 +688,8 @@ pub fn _mm256_hsub_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vxorp))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_xor_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_xor_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { let a: u64x4 = transmute(a); let b: u64x4 = transmute(b); @@ -674,7 +705,8 @@ pub fn _mm256_xor_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_xor_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_xor_ps(a: __m256, b: __m256) -> __m256 { unsafe { let a: u32x8 = transmute(a); let b: u32x8 = transmute(b); @@ -881,7 +913,8 @@ pub fn _mm_cmp_ss(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi32_pd(a: __m128i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi32_pd(a: __m128i) -> __m256d { unsafe { simd_cast(a.as_i32x4()) } } @@ -893,7 +926,8 @@ pub fn _mm256_cvtepi32_pd(a: __m128i) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi32_ps(a: __m256i) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi32_ps(a: __m256i) -> __m256 { unsafe { simd_cast(a.as_i32x8()) } } @@ -905,7 +939,8 @@ pub fn _mm256_cvtepi32_ps(a: __m256i) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vcvtpd2ps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtpd_ps(a: __m256d) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtpd_ps(a: __m256d) -> __m128 { unsafe { simd_cast(a) } } @@ -929,7 +964,8 @@ pub fn _mm256_cvtps_epi32(a: __m256) -> __m256i { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vcvtps2pd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtps_pd(a: __m128) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtps_pd(a: __m128) -> __m256d { unsafe { simd_cast(a) } } @@ -940,7 +976,8 @@ pub fn _mm256_cvtps_pd(a: __m128) -> __m256d { #[target_feature(enable = "avx")] //#[cfg_attr(test, assert_instr(movsd))] FIXME #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtsd_f64(a: __m256d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtsd_f64(a: __m256d) -> f64 { unsafe { simd_extract!(a, 0) } } @@ -989,7 +1026,8 @@ pub fn _mm256_cvttps_epi32(a: __m256) -> __m256i { #[cfg_attr(test, assert_instr(vextractf128, IMM1 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extractf128_ps(a: __m256) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extractf128_ps(a: __m256) -> __m128 { static_assert_uimm_bits!(IMM1, 1); unsafe { simd_shuffle!( @@ -1009,7 +1047,8 @@ pub fn _mm256_extractf128_ps(a: __m256) -> __m128 { #[cfg_attr(test, assert_instr(vextractf128, IMM1 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extractf128_pd(a: __m256d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extractf128_pd(a: __m256d) -> __m128d { static_assert_uimm_bits!(IMM1, 1); unsafe { simd_shuffle!(a, _mm256_undefined_pd(), [[0, 1], [2, 3]][IMM1 as usize]) } } @@ -1022,7 +1061,8 @@ pub fn _mm256_extractf128_pd(a: __m256d) -> __m128d { #[cfg_attr(test, assert_instr(vextractf128, IMM1 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extractf128_si256(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extractf128_si256(a: __m256i) -> __m128i { static_assert_uimm_bits!(IMM1, 1); unsafe { let dst: i64x2 = simd_shuffle!(a.as_i64x4(), i64x4::ZERO, [[0, 1], [2, 3]][IMM1 as usize],); @@ -1038,7 +1078,8 @@ pub fn _mm256_extractf128_si256(a: __m256i) -> __m128i { // This intrinsic has no corresponding instruction. #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extract_epi32(a: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extract_epi32(a: __m256i) -> i32 { static_assert_uimm_bits!(INDEX, 3); unsafe { simd_extract!(a.as_i32x8(), INDEX as u32) } } @@ -1049,7 +1090,8 @@ pub fn _mm256_extract_epi32(a: __m256i) -> i32 { #[inline] #[target_feature(enable = "avx")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtsi256_si32(a: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtsi256_si32(a: __m256i) -> i32 { unsafe { simd_extract!(a.as_i32x8(), 0) } } @@ -1109,7 +1151,8 @@ pub fn _mm_permutevar_ps(a: __m128, b: __m128i) -> __m128 { #[cfg_attr(test, assert_instr(vshufps, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute_ps(a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute_ps(a: __m256) -> __m256 { static_assert_uimm_bits!(IMM8, 8); unsafe { simd_shuffle!( @@ -1138,7 +1181,8 @@ pub fn _mm256_permute_ps(a: __m256) -> __m256 { #[cfg_attr(test, assert_instr(vshufps, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_permute_ps(a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_permute_ps(a: __m128) -> __m128 { static_assert_uimm_bits!(IMM8, 8); unsafe { simd_shuffle!( @@ -1187,7 +1231,8 @@ pub fn _mm_permutevar_pd(a: __m128d, b: __m128i) -> __m128d { #[cfg_attr(test, assert_instr(vshufpd, IMM4 = 0x1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute_pd(a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute_pd(a: __m256d) -> __m256d { static_assert_uimm_bits!(IMM4, 4); unsafe { simd_shuffle!( @@ -1212,7 +1257,8 @@ pub fn _mm256_permute_pd(a: __m256d) -> __m256d { #[cfg_attr(test, assert_instr(vshufpd, IMM2 = 0x1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_permute_pd(a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_permute_pd(a: __m128d) -> __m128d { static_assert_uimm_bits!(IMM2, 2); unsafe { simd_shuffle!( @@ -1232,7 +1278,8 @@ pub fn _mm_permute_pd(a: __m128d) -> __m128d { #[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 0x5))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute2f128_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute2f128_ps(a: __m256, b: __m256) -> __m256 { static_assert_uimm_bits!(IMM8, 8); _mm256_castsi256_ps(_mm256_permute2f128_si256::( _mm256_castps_si256(a), @@ -1249,7 +1296,8 @@ pub fn _mm256_permute2f128_ps(a: __m256, b: __m256) -> __m256 { #[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 0x31))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute2f128_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute2f128_pd(a: __m256d, b: __m256d) -> __m256d { static_assert_uimm_bits!(IMM8, 8); _mm256_castsi256_pd(_mm256_permute2f128_si256::( _mm256_castpd_si256(a), @@ -1266,7 +1314,8 @@ pub fn _mm256_permute2f128_pd(a: __m256d, b: __m256d) -> __m256 #[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 0x31))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute2f128_si256(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute2f128_si256(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); const fn idx(imm8: i32, pos: u32) -> u32 { let part = if pos < 2 { @@ -1308,7 +1357,8 @@ pub fn _mm256_permute2f128_si256(a: __m256i, b: __m256i) -> __m #[cfg_attr(test, assert_instr(vbroadcastss))] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::trivially_copy_pass_by_ref)] -pub fn _mm256_broadcast_ss(f: &f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_ss(f: &f32) -> __m256 { _mm256_set1_ps(*f) } @@ -1321,7 +1371,8 @@ pub fn _mm256_broadcast_ss(f: &f32) -> __m256 { #[cfg_attr(test, assert_instr(vbroadcastss))] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::trivially_copy_pass_by_ref)] -pub fn _mm_broadcast_ss(f: &f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcast_ss(f: &f32) -> __m128 { _mm_set1_ps(*f) } @@ -1334,7 +1385,8 @@ pub fn _mm_broadcast_ss(f: &f32) -> __m128 { #[cfg_attr(test, assert_instr(vbroadcastsd))] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::trivially_copy_pass_by_ref)] -pub fn _mm256_broadcast_sd(f: &f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_sd(f: &f64) -> __m256d { _mm256_set1_pd(*f) } @@ -1346,7 +1398,8 @@ pub fn _mm256_broadcast_sd(f: &f64) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vbroadcastf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcast_ps(a: &__m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_ps(a: &__m128) -> __m256 { unsafe { simd_shuffle!(*a, _mm_setzero_ps(), [0, 1, 2, 3, 0, 1, 2, 3]) } } @@ -1358,7 +1411,8 @@ pub fn _mm256_broadcast_ps(a: &__m128) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vbroadcastf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcast_pd(a: &__m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_pd(a: &__m128d) -> __m256d { unsafe { simd_shuffle!(*a, _mm_setzero_pd(), [0, 1, 0, 1]) } } @@ -1372,7 +1426,8 @@ pub fn _mm256_broadcast_pd(a: &__m128d) -> __m256d { #[cfg_attr(test, assert_instr(vinsertf128, IMM1 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insertf128_ps(a: __m256, b: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insertf128_ps(a: __m256, b: __m128) -> __m256 { static_assert_uimm_bits!(IMM1, 1); unsafe { simd_shuffle!( @@ -1393,7 +1448,8 @@ pub fn _mm256_insertf128_ps(a: __m256, b: __m128) -> __m256 { #[cfg_attr(test, assert_instr(vinsertf128, IMM1 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insertf128_pd(a: __m256d, b: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insertf128_pd(a: __m256d, b: __m128d) -> __m256d { static_assert_uimm_bits!(IMM1, 1); unsafe { simd_shuffle!( @@ -1413,7 +1469,8 @@ pub fn _mm256_insertf128_pd(a: __m256d, b: __m128d) -> __m256d #[cfg_attr(test, assert_instr(vinsertf128, IMM1 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insertf128_si256(a: __m256i, b: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insertf128_si256(a: __m256i, b: __m128i) -> __m256i { static_assert_uimm_bits!(IMM1, 1); unsafe { let dst: i64x4 = simd_shuffle!( @@ -1434,7 +1491,8 @@ pub fn _mm256_insertf128_si256(a: __m256i, b: __m128i) -> __m25 // This intrinsic has no corresponding instruction. #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insert_epi8(a: __m256i, i: i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insert_epi8(a: __m256i, i: i8) -> __m256i { static_assert_uimm_bits!(INDEX, 5); unsafe { transmute(simd_insert!(a.as_i8x32(), INDEX as u32, i)) } } @@ -1448,7 +1506,8 @@ pub fn _mm256_insert_epi8(a: __m256i, i: i8) -> __m256i { // This intrinsic has no corresponding instruction. #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insert_epi16(a: __m256i, i: i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insert_epi16(a: __m256i, i: i16) -> __m256i { static_assert_uimm_bits!(INDEX, 4); unsafe { transmute(simd_insert!(a.as_i16x16(), INDEX as u32, i)) } } @@ -1462,7 +1521,8 @@ pub fn _mm256_insert_epi16(a: __m256i, i: i16) -> __m256i { // This intrinsic has no corresponding instruction. #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insert_epi32(a: __m256i, i: i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insert_epi32(a: __m256i, i: i32) -> __m256i { static_assert_uimm_bits!(INDEX, 3); unsafe { transmute(simd_insert!(a.as_i32x8(), INDEX as u32, i)) } } @@ -1481,7 +1541,8 @@ pub fn _mm256_insert_epi32(a: __m256i, i: i32) -> __m256i { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm256_load_pd(mem_addr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_load_pd(mem_addr: *const f64) -> __m256d { *(mem_addr as *const __m256d) } @@ -1499,7 +1560,8 @@ pub unsafe fn _mm256_load_pd(mem_addr: *const f64) -> __m256d { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm256_store_pd(mem_addr: *mut f64, a: __m256d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_store_pd(mem_addr: *mut f64, a: __m256d) { *(mem_addr as *mut __m256d) = a; } @@ -1517,7 +1579,8 @@ pub unsafe fn _mm256_store_pd(mem_addr: *mut f64, a: __m256d) { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm256_load_ps(mem_addr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_load_ps(mem_addr: *const f32) -> __m256 { *(mem_addr as *const __m256) } @@ -1535,7 +1598,8 @@ pub unsafe fn _mm256_load_ps(mem_addr: *const f32) -> __m256 { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm256_store_ps(mem_addr: *mut f32, a: __m256) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_store_ps(mem_addr: *mut f32, a: __m256) { *(mem_addr as *mut __m256) = a; } @@ -1548,7 +1612,8 @@ pub unsafe fn _mm256_store_ps(mem_addr: *mut f32, a: __m256) { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_loadu_pd(mem_addr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_pd(mem_addr: *const f64) -> __m256d { let mut dst = _mm256_undefined_pd(); ptr::copy_nonoverlapping( mem_addr as *const u8, @@ -1567,7 +1632,8 @@ pub unsafe fn _mm256_loadu_pd(mem_addr: *const f64) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_storeu_pd(mem_addr: *mut f64, a: __m256d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_pd(mem_addr: *mut f64, a: __m256d) { mem_addr.cast::<__m256d>().write_unaligned(a); } @@ -1580,7 +1646,8 @@ pub unsafe fn _mm256_storeu_pd(mem_addr: *mut f64, a: __m256d) { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_loadu_ps(mem_addr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_ps(mem_addr: *const f32) -> __m256 { let mut dst = _mm256_undefined_ps(); ptr::copy_nonoverlapping( mem_addr as *const u8, @@ -1599,7 +1666,8 @@ pub unsafe fn _mm256_loadu_ps(mem_addr: *const f32) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_storeu_ps(mem_addr: *mut f32, a: __m256) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_ps(mem_addr: *mut f32, a: __m256) { mem_addr.cast::<__m256>().write_unaligned(a); } @@ -1615,7 +1683,8 @@ pub unsafe fn _mm256_storeu_ps(mem_addr: *mut f32, a: __m256) { assert_instr(vmovaps) )] // FIXME vmovdqa expected #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_load_si256(mem_addr: *const __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_load_si256(mem_addr: *const __m256i) -> __m256i { *mem_addr } @@ -1631,7 +1700,8 @@ pub unsafe fn _mm256_load_si256(mem_addr: *const __m256i) -> __m256i { assert_instr(vmovaps) )] // FIXME vmovdqa expected #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_store_si256(mem_addr: *mut __m256i, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_store_si256(mem_addr: *mut __m256i, a: __m256i) { *mem_addr = a; } @@ -1643,7 +1713,8 @@ pub unsafe fn _mm256_store_si256(mem_addr: *mut __m256i, a: __m256i) { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovups))] // FIXME vmovdqu expected #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_loadu_si256(mem_addr: *const __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_si256(mem_addr: *const __m256i) -> __m256i { let mut dst = _mm256_undefined_si256(); ptr::copy_nonoverlapping( mem_addr as *const u8, @@ -1661,7 +1732,8 @@ pub unsafe fn _mm256_loadu_si256(mem_addr: *const __m256i) -> __m256i { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovups))] // FIXME vmovdqu expected #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_storeu_si256(mem_addr: *mut __m256i, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_si256(mem_addr: *mut __m256i, a: __m256i) { mem_addr.write_unaligned(a); } @@ -1674,7 +1746,8 @@ pub unsafe fn _mm256_storeu_si256(mem_addr: *mut __m256i, a: __m256i) { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskload_pd(mem_addr: *const f64, mask: __m256i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskload_pd(mem_addr: *const f64, mask: __m256i) -> __m256d { let mask = simd_shr(mask.as_i64x4(), i64x4::splat(63)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, _mm256_setzero_pd()) } @@ -1687,7 +1760,8 @@ pub unsafe fn _mm256_maskload_pd(mem_addr: *const f64, mask: __m256i) -> __m256d #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskstore_pd(mem_addr: *mut f64, mask: __m256i, a: __m256d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskstore_pd(mem_addr: *mut f64, mask: __m256i, a: __m256d) { let mask = simd_shr(mask.as_i64x4(), i64x4::splat(63)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a) } @@ -1701,7 +1775,8 @@ pub unsafe fn _mm256_maskstore_pd(mem_addr: *mut f64, mask: __m256i, a: __m256d) #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskload_pd(mem_addr: *const f64, mask: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskload_pd(mem_addr: *const f64, mask: __m128i) -> __m128d { let mask = simd_shr(mask.as_i64x2(), i64x2::splat(63)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, _mm_setzero_pd()) } @@ -1714,7 +1789,8 @@ pub unsafe fn _mm_maskload_pd(mem_addr: *const f64, mask: __m128i) -> __m128d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskstore_pd(mem_addr: *mut f64, mask: __m128i, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskstore_pd(mem_addr: *mut f64, mask: __m128i, a: __m128d) { let mask = simd_shr(mask.as_i64x2(), i64x2::splat(63)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a) } @@ -1728,7 +1804,8 @@ pub unsafe fn _mm_maskstore_pd(mem_addr: *mut f64, mask: __m128i, a: __m128d) { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskload_ps(mem_addr: *const f32, mask: __m256i) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskload_ps(mem_addr: *const f32, mask: __m256i) -> __m256 { let mask = simd_shr(mask.as_i32x8(), i32x8::splat(31)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, _mm256_setzero_ps()) } @@ -1741,7 +1818,8 @@ pub unsafe fn _mm256_maskload_ps(mem_addr: *const f32, mask: __m256i) -> __m256 #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskstore_ps(mem_addr: *mut f32, mask: __m256i, a: __m256) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskstore_ps(mem_addr: *mut f32, mask: __m256i, a: __m256) { let mask = simd_shr(mask.as_i32x8(), i32x8::splat(31)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a) } @@ -1755,7 +1833,8 @@ pub unsafe fn _mm256_maskstore_ps(mem_addr: *mut f32, mask: __m256i, a: __m256) #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskload_ps(mem_addr: *const f32, mask: __m128i) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskload_ps(mem_addr: *const f32, mask: __m128i) -> __m128 { let mask = simd_shr(mask.as_i32x4(), i32x4::splat(31)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, _mm_setzero_ps()) } @@ -1768,7 +1847,8 @@ pub unsafe fn _mm_maskload_ps(mem_addr: *const f32, mask: __m128i) -> __m128 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmaskmovps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskstore_ps(mem_addr: *mut f32, mask: __m128i, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskstore_ps(mem_addr: *mut f32, mask: __m128i, a: __m128) { let mask = simd_shr(mask.as_i32x4(), i32x4::splat(31)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a) } @@ -1781,7 +1861,8 @@ pub unsafe fn _mm_maskstore_ps(mem_addr: *mut f32, mask: __m128i, a: __m128) { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovshdup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_movehdup_ps(a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movehdup_ps(a: __m256) -> __m256 { unsafe { simd_shuffle!(a, a, [1, 1, 3, 3, 5, 5, 7, 7]) } } @@ -1793,7 +1874,8 @@ pub fn _mm256_movehdup_ps(a: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovsldup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_moveldup_ps(a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_moveldup_ps(a: __m256) -> __m256 { unsafe { simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]) } } @@ -1805,7 +1887,8 @@ pub fn _mm256_moveldup_ps(a: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovddup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_movedup_pd(a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movedup_pd(a: __m256d) -> __m256d { unsafe { simd_shuffle!(a, a, [0, 0, 2, 2]) } } @@ -1943,7 +2026,8 @@ pub fn _mm256_rsqrt_ps(a: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vunpckhpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpackhi_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpackhi_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { simd_shuffle!(a, b, [1, 5, 3, 7]) } } @@ -1955,7 +2039,8 @@ pub fn _mm256_unpackhi_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vunpckhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpackhi_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpackhi_ps(a: __m256, b: __m256) -> __m256 { unsafe { simd_shuffle!(a, b, [2, 10, 3, 11, 6, 14, 7, 15]) } } @@ -1967,7 +2052,8 @@ pub fn _mm256_unpackhi_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vunpcklpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpacklo_pd(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpacklo_pd(a: __m256d, b: __m256d) -> __m256d { unsafe { simd_shuffle!(a, b, [0, 4, 2, 6]) } } @@ -1979,7 +2065,8 @@ pub fn _mm256_unpacklo_pd(a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vunpcklps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpacklo_ps(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpacklo_ps(a: __m256, b: __m256) -> __m256 { unsafe { simd_shuffle!(a, b, [0, 8, 1, 9, 4, 12, 5, 13]) } } @@ -1993,7 +2080,8 @@ pub fn _mm256_unpacklo_ps(a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vptest))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_testz_si256(a: __m256i, b: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_testz_si256(a: __m256i, b: __m256i) -> i32 { unsafe { let r = simd_and(a.as_i64x4(), b.as_i64x4()); (0i64 == simd_reduce_or(r)) as i32 @@ -2010,7 +2098,8 @@ pub fn _mm256_testz_si256(a: __m256i, b: __m256i) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vptest))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_testc_si256(a: __m256i, b: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_testc_si256(a: __m256i, b: __m256i) -> i32 { unsafe { let r = simd_and(simd_xor(a.as_i64x4(), i64x4::splat(!0)), b.as_i64x4()); (0i64 == simd_reduce_or(r)) as i32 @@ -2097,7 +2186,8 @@ pub fn _mm256_testnzc_pd(a: __m256d, b: __m256d) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vtestpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_testz_pd(a: __m128d, b: __m128d) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testz_pd(a: __m128d, b: __m128d) -> i32 { unsafe { let r: i64x2 = simd_lt(transmute(_mm_and_pd(a, b)), i64x2::ZERO); (0i64 == simd_reduce_or(r)) as i32 @@ -2117,7 +2207,8 @@ pub fn _mm_testz_pd(a: __m128d, b: __m128d) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vtestpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_testc_pd(a: __m128d, b: __m128d) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testc_pd(a: __m128d, b: __m128d) -> i32 { unsafe { let r: i64x2 = simd_lt(transmute(_mm_andnot_pd(a, b)), i64x2::ZERO); (0i64 == simd_reduce_or(r)) as i32 @@ -2207,7 +2298,8 @@ pub fn _mm256_testnzc_ps(a: __m256, b: __m256) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vtestps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_testz_ps(a: __m128, b: __m128) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testz_ps(a: __m128, b: __m128) -> i32 { unsafe { let r: i32x4 = simd_lt(transmute(_mm_and_ps(a, b)), i32x4::ZERO); (0i32 == simd_reduce_or(r)) as i32 @@ -2227,7 +2319,8 @@ pub fn _mm_testz_ps(a: __m128, b: __m128) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vtestps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_testc_ps(a: __m128, b: __m128) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testc_ps(a: __m128, b: __m128) -> i32 { unsafe { let r: i32x4 = simd_lt(transmute(_mm_andnot_ps(a, b)), i32x4::ZERO); (0i32 == simd_reduce_or(r)) as i32 @@ -2261,12 +2354,13 @@ pub fn _mm_testnzc_ps(a: __m128, b: __m128) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovmskpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_movemask_pd(a: __m256d) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movemask_pd(a: __m256d) -> i32 { // Propagate the highest bit to the rest, because simd_bitmask // requires all-1 or all-0. unsafe { let mask: i64x4 = simd_lt(transmute(a), i64x4::ZERO); - simd_bitmask::(mask).into() + simd_bitmask::(mask) as i32 } } @@ -2279,12 +2373,13 @@ pub fn _mm256_movemask_pd(a: __m256d) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vmovmskps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_movemask_ps(a: __m256) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movemask_ps(a: __m256) -> i32 { // Propagate the highest bit to the rest, because simd_bitmask // requires all-1 or all-0. unsafe { let mask: i32x8 = simd_lt(transmute(a), i32x8::ZERO); - simd_bitmask::(mask).into() + simd_bitmask::(mask) as i32 } } @@ -2295,7 +2390,8 @@ pub fn _mm256_movemask_ps(a: __m256) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vxorp))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setzero_pd() -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setzero_pd() -> __m256d { const { unsafe { mem::zeroed() } } } @@ -2306,7 +2402,8 @@ pub fn _mm256_setzero_pd() -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setzero_ps() -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setzero_ps() -> __m256 { const { unsafe { mem::zeroed() } } } @@ -2317,7 +2414,8 @@ pub fn _mm256_setzero_ps() -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vxor))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setzero_si256() -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setzero_si256() -> __m256i { const { unsafe { mem::zeroed() } } } @@ -2330,7 +2428,8 @@ pub fn _mm256_setzero_si256() -> __m256i { // This intrinsic has no corresponding instruction. #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d { _mm256_setr_pd(d, c, b, a) } @@ -2342,7 +2441,17 @@ pub fn _mm256_set_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_ps(a: f32, b: f32, c: f32, d: f32, e: f32, f: f32, g: f32, h: f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_ps( + a: f32, + b: f32, + c: f32, + d: f32, + e: f32, + f: f32, + g: f32, + h: f32, +) -> __m256 { _mm256_setr_ps(h, g, f, e, d, c, b, a) } @@ -2353,7 +2462,8 @@ pub fn _mm256_set_ps(a: f32, b: f32, c: f32, d: f32, e: f32, f: f32, g: f32, h: #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_epi8( e00: i8, e01: i8, e02: i8, @@ -2403,7 +2513,8 @@ pub fn _mm256_set_epi8( #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_epi16( e00: i16, e01: i16, e02: i16, @@ -2437,7 +2548,8 @@ pub fn _mm256_set_epi16( #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_epi32( e0: i32, e1: i32, e2: i32, @@ -2457,7 +2569,8 @@ pub fn _mm256_set_epi32( #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i { _mm256_setr_epi64x(d, c, b, a) } @@ -2469,7 +2582,8 @@ pub fn _mm256_set_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d { __m256d([a, b, c, d]) } @@ -2481,7 +2595,17 @@ pub fn _mm256_setr_pd(a: f64, b: f64, c: f64, d: f64) -> __m256d { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_ps(a: f32, b: f32, c: f32, d: f32, e: f32, f: f32, g: f32, h: f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_ps( + a: f32, + b: f32, + c: f32, + d: f32, + e: f32, + f: f32, + g: f32, + h: f32, +) -> __m256 { __m256([a, b, c, d, e, f, g, h]) } @@ -2493,7 +2617,8 @@ pub fn _mm256_setr_ps(a: f32, b: f32, c: f32, d: f32, e: f32, f: f32, g: f32, h: #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_epi8( e00: i8, e01: i8, e02: i8, @@ -2546,7 +2671,8 @@ pub fn _mm256_setr_epi8( #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_epi16( e00: i16, e01: i16, e02: i16, @@ -2583,7 +2709,8 @@ pub fn _mm256_setr_epi16( #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_epi32( e0: i32, e1: i32, e2: i32, @@ -2604,7 +2731,8 @@ pub fn _mm256_setr_epi32( #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i { unsafe { transmute(i64x4::new(a, b, c, d)) } } @@ -2616,7 +2744,8 @@ pub fn _mm256_setr_epi64x(a: i64, b: i64, c: i64, d: i64) -> __m256i { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set1_pd(a: f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_pd(a: f64) -> __m256d { _mm256_setr_pd(a, a, a, a) } @@ -2628,7 +2757,8 @@ pub fn _mm256_set1_pd(a: f64) -> __m256d { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set1_ps(a: f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_ps(a: f32) -> __m256 { _mm256_setr_ps(a, a, a, a, a, a, a, a) } @@ -2640,7 +2770,8 @@ pub fn _mm256_set1_ps(a: f32) -> __m256 { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set1_epi8(a: i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_epi8(a: i8) -> __m256i { #[rustfmt::skip] _mm256_setr_epi8( a, a, a, a, a, a, a, a, @@ -2660,7 +2791,8 @@ pub fn _mm256_set1_epi8(a: i8) -> __m256i { #[cfg_attr(test, assert_instr(vinsertf128))] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set1_epi16(a: i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_epi16(a: i16) -> __m256i { _mm256_setr_epi16(a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) } @@ -2672,7 +2804,8 @@ pub fn _mm256_set1_epi16(a: i16) -> __m256i { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set1_epi32(a: i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_epi32(a: i32) -> __m256i { _mm256_setr_epi32(a, a, a, a, a, a, a, a) } @@ -2686,7 +2819,8 @@ pub fn _mm256_set1_epi32(a: i32) -> __m256i { #[cfg_attr(all(test, target_arch = "x86"), assert_instr(vbroadcastsd))] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set1_epi64x(a: i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_epi64x(a: i64) -> __m256i { _mm256_setr_epi64x(a, a, a, a) } @@ -2698,7 +2832,8 @@ pub fn _mm256_set1_epi64x(a: i64) -> __m256i { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castpd_ps(a: __m256d) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castpd_ps(a: __m256d) -> __m256 { unsafe { transmute(a) } } @@ -2710,7 +2845,8 @@ pub fn _mm256_castpd_ps(a: __m256d) -> __m256 { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castps_pd(a: __m256) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castps_pd(a: __m256) -> __m256d { unsafe { transmute(a) } } @@ -2722,7 +2858,8 @@ pub fn _mm256_castps_pd(a: __m256) -> __m256d { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castps_si256(a: __m256) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castps_si256(a: __m256) -> __m256i { unsafe { transmute(a) } } @@ -2734,7 +2871,8 @@ pub fn _mm256_castps_si256(a: __m256) -> __m256i { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castsi256_ps(a: __m256i) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castsi256_ps(a: __m256i) -> __m256 { unsafe { transmute(a) } } @@ -2746,7 +2884,8 @@ pub fn _mm256_castsi256_ps(a: __m256i) -> __m256 { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castpd_si256(a: __m256d) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castpd_si256(a: __m256d) -> __m256i { unsafe { transmute(a) } } @@ -2758,7 +2897,8 @@ pub fn _mm256_castpd_si256(a: __m256d) -> __m256i { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castsi256_pd(a: __m256i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castsi256_pd(a: __m256i) -> __m256d { unsafe { transmute(a) } } @@ -2770,7 +2910,8 @@ pub fn _mm256_castsi256_pd(a: __m256i) -> __m256d { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castps256_ps128(a: __m256) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castps256_ps128(a: __m256) -> __m128 { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3]) } } @@ -2782,7 +2923,8 @@ pub fn _mm256_castps256_ps128(a: __m256) -> __m128 { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castpd256_pd128(a: __m256d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castpd256_pd128(a: __m256d) -> __m128d { unsafe { simd_shuffle!(a, a, [0, 1]) } } @@ -2794,7 +2936,8 @@ pub fn _mm256_castpd256_pd128(a: __m256d) -> __m128d { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castsi256_si128(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castsi256_si128(a: __m256i) -> __m128i { unsafe { let a = a.as_i64x4(); let dst: i64x2 = simd_shuffle!(a, a, [0, 1]); @@ -2803,7 +2946,11 @@ pub fn _mm256_castsi256_si128(a: __m256i) -> __m128i { } /// Casts vector of type __m128 to type __m256; -/// the upper 128 bits of the result are undefined. +/// the upper 128 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_castps128_ps256) #[inline] @@ -2811,12 +2958,17 @@ pub fn _mm256_castsi256_si128(a: __m256i) -> __m128i { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castps128_ps256(a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castps128_ps256(a: __m128) -> __m256 { unsafe { simd_shuffle!(a, _mm_undefined_ps(), [0, 1, 2, 3, 4, 4, 4, 4]) } } /// Casts vector of type __m128d to type __m256d; -/// the upper 128 bits of the result are undefined. +/// the upper 128 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_castpd128_pd256) #[inline] @@ -2824,12 +2976,17 @@ pub fn _mm256_castps128_ps256(a: __m128) -> __m256 { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castpd128_pd256(a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castpd128_pd256(a: __m128d) -> __m256d { unsafe { simd_shuffle!(a, _mm_undefined_pd(), [0, 1, 2, 2]) } } /// Casts vector of type __m128i to type __m256i; -/// the upper 128 bits of the result are undefined. +/// the upper 128 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_castsi128_si256) #[inline] @@ -2837,7 +2994,8 @@ pub fn _mm256_castpd128_pd256(a: __m128d) -> __m256d { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_castsi128_si256(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castsi128_si256(a: __m128i) -> __m256i { unsafe { let a = a.as_i64x2(); let undefined = i64x2::ZERO; @@ -2856,7 +3014,8 @@ pub fn _mm256_castsi128_si256(a: __m128i) -> __m256i { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_zextps128_ps256(a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_zextps128_ps256(a: __m128) -> __m256 { unsafe { simd_shuffle!(a, _mm_setzero_ps(), [0, 1, 2, 3, 4, 5, 6, 7]) } } @@ -2870,7 +3029,8 @@ pub fn _mm256_zextps128_ps256(a: __m128) -> __m256 { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_zextsi128_si256(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_zextsi128_si256(a: __m128i) -> __m256i { unsafe { let b = i64x2::ZERO; let dst: i64x4 = simd_shuffle!(a.as_i64x2(), b, [0, 1, 2, 3]); @@ -2889,7 +3049,8 @@ pub fn _mm256_zextsi128_si256(a: __m128i) -> __m256i { // This intrinsic is only used for compilation and does not generate any // instructions, thus it has zero latency. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_zextpd128_pd256(a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_zextpd128_pd256(a: __m128d) -> __m256d { unsafe { simd_shuffle!(a, _mm_setzero_pd(), [0, 1, 2, 3]) } } @@ -2903,7 +3064,8 @@ pub fn _mm256_zextpd128_pd256(a: __m128d) -> __m256d { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_undefined_ps() -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_undefined_ps() -> __m256 { const { unsafe { mem::zeroed() } } } @@ -2917,7 +3079,8 @@ pub fn _mm256_undefined_ps() -> __m256 { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_undefined_pd() -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_undefined_pd() -> __m256d { const { unsafe { mem::zeroed() } } } @@ -2931,7 +3094,8 @@ pub fn _mm256_undefined_pd() -> __m256d { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_undefined_si256() -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_undefined_si256() -> __m256i { const { unsafe { mem::zeroed() } } } @@ -2942,7 +3106,8 @@ pub fn _mm256_undefined_si256() -> __m256i { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_m128(hi: __m128, lo: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_m128(hi: __m128, lo: __m128) -> __m256 { unsafe { simd_shuffle!(lo, hi, [0, 1, 2, 3, 4, 5, 6, 7]) } } @@ -2953,7 +3118,8 @@ pub fn _mm256_set_m128(hi: __m128, lo: __m128) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_m128d(hi: __m128d, lo: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_m128d(hi: __m128d, lo: __m128d) -> __m256d { unsafe { let hi: __m128 = transmute(hi); let lo: __m128 = transmute(lo); @@ -2968,7 +3134,8 @@ pub fn _mm256_set_m128d(hi: __m128d, lo: __m128d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_set_m128i(hi: __m128i, lo: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_m128i(hi: __m128i, lo: __m128i) -> __m256i { unsafe { let hi: __m128 = transmute(hi); let lo: __m128 = transmute(lo); @@ -2983,7 +3150,8 @@ pub fn _mm256_set_m128i(hi: __m128i, lo: __m128i) -> __m256i { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_m128(lo: __m128, hi: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_m128(lo: __m128, hi: __m128) -> __m256 { _mm256_set_m128(hi, lo) } @@ -2994,7 +3162,8 @@ pub fn _mm256_setr_m128(lo: __m128, hi: __m128) -> __m256 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_m128d(lo: __m128d, hi: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_m128d(lo: __m128d, hi: __m128d) -> __m256d { _mm256_set_m128d(hi, lo) } @@ -3005,7 +3174,8 @@ pub fn _mm256_setr_m128d(lo: __m128d, hi: __m128d) -> __m256d { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vinsertf128))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_setr_m128i(lo: __m128i, hi: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_m128i(lo: __m128i, hi: __m128i) -> __m256i { _mm256_set_m128i(hi, lo) } @@ -3019,7 +3189,8 @@ pub fn _mm256_setr_m128i(lo: __m128i, hi: __m128i) -> __m256i { #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_loadu2_m128(hiaddr: *const f32, loaddr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu2_m128(hiaddr: *const f32, loaddr: *const f32) -> __m256 { let a = _mm256_castps128_ps256(_mm_loadu_ps(loaddr)); _mm256_insertf128_ps::<1>(a, _mm_loadu_ps(hiaddr)) } @@ -3034,7 +3205,8 @@ pub unsafe fn _mm256_loadu2_m128(hiaddr: *const f32, loaddr: *const f32) -> __m2 #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_loadu2_m128d(hiaddr: *const f64, loaddr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu2_m128d(hiaddr: *const f64, loaddr: *const f64) -> __m256d { let a = _mm256_castpd128_pd256(_mm_loadu_pd(loaddr)); _mm256_insertf128_pd::<1>(a, _mm_loadu_pd(hiaddr)) } @@ -3048,7 +3220,8 @@ pub unsafe fn _mm256_loadu2_m128d(hiaddr: *const f64, loaddr: *const f64) -> __m #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_loadu2_m128i(hiaddr: *const __m128i, loaddr: *const __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu2_m128i(hiaddr: *const __m128i, loaddr: *const __m128i) -> __m256i { let a = _mm256_castsi128_si256(_mm_loadu_si128(loaddr)); _mm256_insertf128_si256::<1>(a, _mm_loadu_si128(hiaddr)) } @@ -3063,7 +3236,8 @@ pub unsafe fn _mm256_loadu2_m128i(hiaddr: *const __m128i, loaddr: *const __m128i #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_storeu2_m128(hiaddr: *mut f32, loaddr: *mut f32, a: __m256) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu2_m128(hiaddr: *mut f32, loaddr: *mut f32, a: __m256) { let lo = _mm256_castps256_ps128(a); _mm_storeu_ps(loaddr, lo); let hi = _mm256_extractf128_ps::<1>(a); @@ -3080,7 +3254,8 @@ pub unsafe fn _mm256_storeu2_m128(hiaddr: *mut f32, loaddr: *mut f32, a: __m256) #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_storeu2_m128d(hiaddr: *mut f64, loaddr: *mut f64, a: __m256d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu2_m128d(hiaddr: *mut f64, loaddr: *mut f64, a: __m256d) { let lo = _mm256_castpd256_pd128(a); _mm_storeu_pd(loaddr, lo); let hi = _mm256_extractf128_pd::<1>(a); @@ -3096,7 +3271,8 @@ pub unsafe fn _mm256_storeu2_m128d(hiaddr: *mut f64, loaddr: *mut f64, a: __m256 #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_storeu2_m128i(hiaddr: *mut __m128i, loaddr: *mut __m128i, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu2_m128i(hiaddr: *mut __m128i, loaddr: *mut __m128i, a: __m256i) { let lo = _mm256_castsi256_si128(a); _mm_storeu_si128(loaddr, lo); let hi = _mm256_extractf128_si256::<1>(a); @@ -3110,7 +3286,8 @@ pub unsafe fn _mm256_storeu2_m128i(hiaddr: *mut __m128i, loaddr: *mut __m128i, a #[target_feature(enable = "avx")] //#[cfg_attr(test, assert_instr(movss))] FIXME #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtss_f32(a: __m256) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtss_f32(a: __m256) -> f32 { unsafe { simd_extract!(a, 0) } } @@ -3191,6 +3368,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::hint::black_box; use crate::ptr; use stdarch_test::simd_test; @@ -3198,7 +3376,7 @@ mod tests { use crate::core_arch::x86::*; #[simd_test(enable = "avx")] - unsafe fn test_mm256_add_pd() { + const fn test_mm256_add_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_add_pd(a, b); @@ -3207,7 +3385,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_add_ps() { + const fn test_mm256_add_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm256_add_ps(a, b); @@ -3216,7 +3394,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_and_pd() { + const fn test_mm256_and_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set1_pd(0.6); let r = _mm256_and_pd(a, b); @@ -3225,7 +3403,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_and_ps() { + const fn test_mm256_and_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set1_ps(0.6); let r = _mm256_and_ps(a, b); @@ -3234,7 +3412,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_or_pd() { + const fn test_mm256_or_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set1_pd(0.6); let r = _mm256_or_pd(a, b); @@ -3243,7 +3421,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_or_ps() { + const fn test_mm256_or_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set1_ps(0.6); let r = _mm256_or_ps(a, b); @@ -3252,7 +3430,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_shuffle_pd() { + const fn test_mm256_shuffle_pd() { let a = _mm256_setr_pd(1., 4., 5., 8.); let b = _mm256_setr_pd(2., 3., 6., 7.); let r = _mm256_shuffle_pd::<0b11_11_11_11>(a, b); @@ -3261,7 +3439,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_shuffle_ps() { + const fn test_mm256_shuffle_ps() { let a = _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_setr_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_shuffle_ps::<0b00_00_11_11>(a, b); @@ -3270,7 +3448,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_andnot_pd() { + const fn test_mm256_andnot_pd() { let a = _mm256_set1_pd(0.); let b = _mm256_set1_pd(0.6); let r = _mm256_andnot_pd(a, b); @@ -3278,7 +3456,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_andnot_ps() { + const fn test_mm256_andnot_ps() { let a = _mm256_set1_ps(0.); let b = _mm256_set1_ps(0.6); let r = _mm256_andnot_ps(a, b); @@ -3390,7 +3568,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_mul_pd() { + const fn test_mm256_mul_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_mul_pd(a, b); @@ -3399,7 +3577,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_mul_ps() { + const fn test_mm256_mul_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm256_mul_ps(a, b); @@ -3408,7 +3586,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_addsub_pd() { + const fn test_mm256_addsub_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_addsub_pd(a, b); @@ -3417,7 +3595,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_addsub_ps() { + const fn test_mm256_addsub_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.); let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.); let r = _mm256_addsub_ps(a, b); @@ -3426,7 +3604,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_sub_pd() { + const fn test_mm256_sub_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_sub_pd(a, b); @@ -3435,7 +3613,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_sub_ps() { + const fn test_mm256_sub_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., -1., -2., -3., -4.); let b = _mm256_setr_ps(5., 6., 7., 8., 3., 2., 1., 0.); let r = _mm256_sub_ps(a, b); @@ -3444,7 +3622,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_round_pd() { + fn test_mm256_round_pd() { let a = _mm256_setr_pd(1.55, 2.2, 3.99, -1.2); let result_closest = _mm256_round_pd::<0b0000>(a); let result_down = _mm256_round_pd::<0b0001>(a); @@ -3458,7 +3636,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_floor_pd() { + const fn test_mm256_floor_pd() { let a = _mm256_setr_pd(1.55, 2.2, 3.99, -1.2); let result_down = _mm256_floor_pd(a); let expected_down = _mm256_setr_pd(1., 2., 3., -2.); @@ -3466,7 +3644,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_ceil_pd() { + const fn test_mm256_ceil_pd() { let a = _mm256_setr_pd(1.55, 2.2, 3.99, -1.2); let result_up = _mm256_ceil_pd(a); let expected_up = _mm256_setr_pd(2., 3., 4., -1.); @@ -3474,7 +3652,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_round_ps() { + fn test_mm256_round_ps() { let a = _mm256_setr_ps(1.55, 2.2, 3.99, -1.2, 1.55, 2.2, 3.99, -1.2); let result_closest = _mm256_round_ps::<0b0000>(a); let result_down = _mm256_round_ps::<0b0001>(a); @@ -3488,7 +3666,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_floor_ps() { + const fn test_mm256_floor_ps() { let a = _mm256_setr_ps(1.55, 2.2, 3.99, -1.2, 1.55, 2.2, 3.99, -1.2); let result_down = _mm256_floor_ps(a); let expected_down = _mm256_setr_ps(1., 2., 3., -2., 1., 2., 3., -2.); @@ -3496,7 +3674,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_ceil_ps() { + const fn test_mm256_ceil_ps() { let a = _mm256_setr_ps(1.55, 2.2, 3.99, -1.2, 1.55, 2.2, 3.99, -1.2); let result_up = _mm256_ceil_ps(a); let expected_up = _mm256_setr_ps(2., 3., 4., -1., 2., 3., 4., -1.); @@ -3504,7 +3682,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_sqrt_pd() { + fn test_mm256_sqrt_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let r = _mm256_sqrt_pd(a); let e = _mm256_setr_pd(2., 3., 4., 5.); @@ -3512,7 +3690,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_sqrt_ps() { + fn test_mm256_sqrt_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let r = _mm256_sqrt_ps(a); let e = _mm256_setr_ps(2., 3., 4., 5., 2., 3., 4., 5.); @@ -3520,7 +3698,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_div_ps() { + const fn test_mm256_div_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let r = _mm256_div_ps(a, b); @@ -3529,7 +3707,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_div_pd() { + const fn test_mm256_div_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let b = _mm256_setr_pd(4., 3., 2., 5.); let r = _mm256_div_pd(a, b); @@ -3538,7 +3716,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_blend_pd() { + const fn test_mm256_blend_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let b = _mm256_setr_pd(4., 3., 2., 5.); let r = _mm256_blend_pd::<0x0>(a, b); @@ -3550,7 +3728,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_blend_ps() { + const fn test_mm256_blend_ps() { let a = _mm256_setr_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_setr_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_blend_ps::<0x0>(a, b); @@ -3562,7 +3740,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_blendv_pd() { + const fn test_mm256_blendv_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let b = _mm256_setr_pd(4., 3., 2., 5.); let c = _mm256_setr_pd(0., 0., !0 as f64, !0 as f64); @@ -3572,7 +3750,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_blendv_ps() { + const fn test_mm256_blendv_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); #[rustfmt::skip] @@ -3585,7 +3763,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_dp_ps() { + fn test_mm256_dp_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let r = _mm256_dp_ps::<0xFF>(a, b); @@ -3594,7 +3772,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_hadd_pd() { + const fn test_mm256_hadd_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let b = _mm256_setr_pd(4., 3., 2., 5.); let r = _mm256_hadd_pd(a, b); @@ -3609,7 +3787,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_hadd_ps() { + const fn test_mm256_hadd_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let r = _mm256_hadd_ps(a, b); @@ -3624,7 +3802,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_hsub_pd() { + const fn test_mm256_hsub_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let b = _mm256_setr_pd(4., 3., 2., 5.); let r = _mm256_hsub_pd(a, b); @@ -3639,7 +3817,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_hsub_ps() { + const fn test_mm256_hsub_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let b = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let r = _mm256_hsub_ps(a, b); @@ -3654,7 +3832,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_xor_pd() { + const fn test_mm256_xor_pd() { let a = _mm256_setr_pd(4., 9., 16., 25.); let b = _mm256_set1_pd(0.); let r = _mm256_xor_pd(a, b); @@ -3662,7 +3840,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_xor_ps() { + const fn test_mm256_xor_ps() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let b = _mm256_set1_ps(0.); let r = _mm256_xor_ps(a, b); @@ -3670,7 +3848,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_cmp_pd() { + fn test_mm_cmp_pd() { let a = _mm_setr_pd(4., 9.); let b = _mm_setr_pd(4., 3.); let r = _mm_cmp_pd::<_CMP_GE_OS>(a, b); @@ -3679,7 +3857,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cmp_pd() { + fn test_mm256_cmp_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_cmp_pd::<_CMP_GE_OS>(a, b); @@ -3688,7 +3866,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_cmp_ps() { + fn test_mm_cmp_ps() { let a = _mm_setr_ps(4., 3., 2., 5.); let b = _mm_setr_ps(4., 9., 16., 25.); let r = _mm_cmp_ps::<_CMP_GE_OS>(a, b); @@ -3699,7 +3877,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cmp_ps() { + fn test_mm256_cmp_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 1., 2., 3., 4.); let b = _mm256_setr_ps(5., 6., 7., 8., 5., 6., 7., 8.); let r = _mm256_cmp_ps::<_CMP_GE_OS>(a, b); @@ -3708,7 +3886,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_cmp_sd() { + fn test_mm_cmp_sd() { let a = _mm_setr_pd(4., 9.); let b = _mm_setr_pd(4., 3.); let r = _mm_cmp_sd::<_CMP_GE_OS>(a, b); @@ -3717,7 +3895,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_cmp_ss() { + fn test_mm_cmp_ss() { let a = _mm_setr_ps(4., 3., 2., 5.); let b = _mm_setr_ps(4., 9., 16., 25.); let r = _mm_cmp_ss::<_CMP_GE_OS>(a, b); @@ -3728,7 +3906,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtepi32_pd() { + const fn test_mm256_cvtepi32_pd() { let a = _mm_setr_epi32(4, 9, 16, 25); let r = _mm256_cvtepi32_pd(a); let e = _mm256_setr_pd(4., 9., 16., 25.); @@ -3736,7 +3914,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtepi32_ps() { + const fn test_mm256_cvtepi32_ps() { let a = _mm256_setr_epi32(4, 9, 16, 25, 4, 9, 16, 25); let r = _mm256_cvtepi32_ps(a); let e = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); @@ -3744,7 +3922,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtpd_ps() { + const fn test_mm256_cvtpd_ps() { let a = _mm256_setr_pd(4., 9., 16., 25.); let r = _mm256_cvtpd_ps(a); let e = _mm_setr_ps(4., 9., 16., 25.); @@ -3752,7 +3930,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtps_epi32() { + fn test_mm256_cvtps_epi32() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let r = _mm256_cvtps_epi32(a); let e = _mm256_setr_epi32(4, 9, 16, 25, 4, 9, 16, 25); @@ -3760,7 +3938,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtps_pd() { + const fn test_mm256_cvtps_pd() { let a = _mm_setr_ps(4., 9., 16., 25.); let r = _mm256_cvtps_pd(a); let e = _mm256_setr_pd(4., 9., 16., 25.); @@ -3768,14 +3946,14 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtsd_f64() { + const fn test_mm256_cvtsd_f64() { let a = _mm256_setr_pd(1., 2., 3., 4.); let r = _mm256_cvtsd_f64(a); assert_eq!(r, 1.); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvttpd_epi32() { + fn test_mm256_cvttpd_epi32() { let a = _mm256_setr_pd(4., 9., 16., 25.); let r = _mm256_cvttpd_epi32(a); let e = _mm_setr_epi32(4, 9, 16, 25); @@ -3783,7 +3961,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtpd_epi32() { + fn test_mm256_cvtpd_epi32() { let a = _mm256_setr_pd(4., 9., 16., 25.); let r = _mm256_cvtpd_epi32(a); let e = _mm_setr_epi32(4, 9, 16, 25); @@ -3791,7 +3969,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvttps_epi32() { + fn test_mm256_cvttps_epi32() { let a = _mm256_setr_ps(4., 9., 16., 25., 4., 9., 16., 25.); let r = _mm256_cvttps_epi32(a); let e = _mm256_setr_epi32(4, 9, 16, 25, 4, 9, 16, 25); @@ -3799,7 +3977,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_extractf128_ps() { + const fn test_mm256_extractf128_ps() { let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let r = _mm256_extractf128_ps::<0>(a); let e = _mm_setr_ps(4., 3., 2., 5.); @@ -3807,7 +3985,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_extractf128_pd() { + const fn test_mm256_extractf128_pd() { let a = _mm256_setr_pd(4., 3., 2., 5.); let r = _mm256_extractf128_pd::<0>(a); let e = _mm_setr_pd(4., 3.); @@ -3815,7 +3993,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_extractf128_si256() { + const fn test_mm256_extractf128_si256() { let a = _mm256_setr_epi64x(4, 3, 2, 5); let r = _mm256_extractf128_si256::<0>(a); let e = _mm_setr_epi64x(4, 3); @@ -3823,7 +4001,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_extract_epi32() { + const fn test_mm256_extract_epi32() { let a = _mm256_setr_epi32(-1, 1, 2, 3, 4, 5, 6, 7); let r1 = _mm256_extract_epi32::<0>(a); let r2 = _mm256_extract_epi32::<3>(a); @@ -3832,7 +4010,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtsi256_si32() { + const fn test_mm256_cvtsi256_si32() { let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_cvtsi256_si32(a); assert_eq!(r, 1); @@ -3840,18 +4018,18 @@ mod tests { #[simd_test(enable = "avx")] #[cfg_attr(miri, ignore)] // Register-level operation not supported by Miri - unsafe fn test_mm256_zeroall() { + fn test_mm256_zeroall() { _mm256_zeroall(); } #[simd_test(enable = "avx")] #[cfg_attr(miri, ignore)] // Register-level operation not supported by Miri - unsafe fn test_mm256_zeroupper() { + fn test_mm256_zeroupper() { _mm256_zeroupper(); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permutevar_ps() { + fn test_mm256_permutevar_ps() { let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_permutevar_ps(a, b); @@ -3860,7 +4038,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_permutevar_ps() { + fn test_mm_permutevar_ps() { let a = _mm_setr_ps(4., 3., 2., 5.); let b = _mm_setr_epi32(1, 2, 3, 4); let r = _mm_permutevar_ps(a, b); @@ -3869,7 +4047,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permute_ps() { + const fn test_mm256_permute_ps() { let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let r = _mm256_permute_ps::<0x1b>(a); let e = _mm256_setr_ps(5., 2., 3., 4., 50., 64., 9., 8.); @@ -3877,7 +4055,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_permute_ps() { + const fn test_mm_permute_ps() { let a = _mm_setr_ps(4., 3., 2., 5.); let r = _mm_permute_ps::<0x1b>(a); let e = _mm_setr_ps(5., 2., 3., 4.); @@ -3885,7 +4063,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permutevar_pd() { + fn test_mm256_permutevar_pd() { let a = _mm256_setr_pd(4., 3., 2., 5.); let b = _mm256_setr_epi64x(1, 2, 3, 4); let r = _mm256_permutevar_pd(a, b); @@ -3894,7 +4072,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_permutevar_pd() { + fn test_mm_permutevar_pd() { let a = _mm_setr_pd(4., 3.); let b = _mm_setr_epi64x(3, 0); let r = _mm_permutevar_pd(a, b); @@ -3903,7 +4081,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permute_pd() { + const fn test_mm256_permute_pd() { let a = _mm256_setr_pd(4., 3., 2., 5.); let r = _mm256_permute_pd::<5>(a); let e = _mm256_setr_pd(3., 4., 5., 2.); @@ -3911,7 +4089,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_permute_pd() { + const fn test_mm_permute_pd() { let a = _mm_setr_pd(4., 3.); let r = _mm_permute_pd::<1>(a); let e = _mm_setr_pd(3., 4.); @@ -3919,7 +4097,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permute2f128_ps() { + const fn test_mm256_permute2f128_ps() { let a = _mm256_setr_ps(11., 12., 13., 14., 15., 16., 17., 18.); let b = _mm256_setr_ps(21., 22., 23., 24., 25., 26., 27., 28.); let r = _mm256_permute2f128_ps::<0b0001_0011>(a, b); @@ -3933,7 +4111,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permute2f128_pd() { + const fn test_mm256_permute2f128_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_permute2f128_pd::<0b0011_0001>(a, b); @@ -3947,7 +4125,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_permute2f128_si256() { + const fn test_mm256_permute2f128_si256() { let a = _mm256_setr_epi32(11, 12, 13, 14, 15, 16, 17, 18); let b = _mm256_setr_epi32(21, 22, 23, 24, 25, 26, 27, 28); let r = _mm256_permute2f128_si256::<0b0010_0000>(a, b); @@ -3961,28 +4139,28 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_broadcast_ss() { + const fn test_mm256_broadcast_ss() { let r = _mm256_broadcast_ss(&3.); let e = _mm256_set1_ps(3.); assert_eq_m256(r, e); } #[simd_test(enable = "avx")] - unsafe fn test_mm_broadcast_ss() { + const fn test_mm_broadcast_ss() { let r = _mm_broadcast_ss(&3.); let e = _mm_set1_ps(3.); assert_eq_m128(r, e); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_broadcast_sd() { + const fn test_mm256_broadcast_sd() { let r = _mm256_broadcast_sd(&3.); let e = _mm256_set1_pd(3.); assert_eq_m256d(r, e); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_broadcast_ps() { + const fn test_mm256_broadcast_ps() { let a = _mm_setr_ps(4., 3., 2., 5.); let r = _mm256_broadcast_ps(&a); let e = _mm256_setr_ps(4., 3., 2., 5., 4., 3., 2., 5.); @@ -3990,7 +4168,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_broadcast_pd() { + const fn test_mm256_broadcast_pd() { let a = _mm_setr_pd(4., 3.); let r = _mm256_broadcast_pd(&a); let e = _mm256_setr_pd(4., 3., 4., 3.); @@ -3998,7 +4176,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_insertf128_ps() { + const fn test_mm256_insertf128_ps() { let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let b = _mm_setr_ps(4., 9., 16., 25.); let r = _mm256_insertf128_ps::<0>(a, b); @@ -4007,7 +4185,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_insertf128_pd() { + const fn test_mm256_insertf128_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm_setr_pd(5., 6.); let r = _mm256_insertf128_pd::<0>(a, b); @@ -4016,7 +4194,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_insertf128_si256() { + const fn test_mm256_insertf128_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let b = _mm_setr_epi64x(5, 6); let r = _mm256_insertf128_si256::<0>(a, b); @@ -4025,7 +4203,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_insert_epi8() { + const fn test_mm256_insert_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -4045,7 +4223,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_insert_epi16() { + const fn test_mm256_insert_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4061,7 +4239,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_insert_epi32() { + const fn test_mm256_insert_epi32() { let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_insert_epi32::<7>(a, 0); let e = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 0); @@ -4069,7 +4247,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_load_pd() { + const unsafe fn test_mm256_load_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let p = ptr::addr_of!(a) as *const f64; let r = _mm256_load_pd(p); @@ -4078,7 +4256,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_store_pd() { + const unsafe fn test_mm256_store_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let mut r = _mm256_undefined_pd(); _mm256_store_pd(ptr::addr_of_mut!(r) as *mut f64, a); @@ -4086,7 +4264,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_load_ps() { + const unsafe fn test_mm256_load_ps() { let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let p = ptr::addr_of!(a) as *const f32; let r = _mm256_load_ps(p); @@ -4095,7 +4273,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_store_ps() { + const unsafe fn test_mm256_store_ps() { let a = _mm256_setr_ps(4., 3., 2., 5., 8., 9., 64., 50.); let mut r = _mm256_undefined_ps(); _mm256_store_ps(ptr::addr_of_mut!(r) as *mut f32, a); @@ -4103,7 +4281,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_loadu_pd() { + const unsafe fn test_mm256_loadu_pd() { let a = &[1.0f64, 2., 3., 4.]; let p = a.as_ptr(); let r = _mm256_loadu_pd(black_box(p)); @@ -4112,7 +4290,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_storeu_pd() { + const unsafe fn test_mm256_storeu_pd() { let a = _mm256_set1_pd(9.); let mut r = _mm256_undefined_pd(); _mm256_storeu_pd(ptr::addr_of_mut!(r) as *mut f64, a); @@ -4120,7 +4298,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_loadu_ps() { + const unsafe fn test_mm256_loadu_ps() { let a = &[4., 3., 2., 5., 8., 9., 64., 50.]; let p = a.as_ptr(); let r = _mm256_loadu_ps(black_box(p)); @@ -4129,7 +4307,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_storeu_ps() { + const unsafe fn test_mm256_storeu_ps() { let a = _mm256_set1_ps(9.); let mut r = _mm256_undefined_ps(); _mm256_storeu_ps(ptr::addr_of_mut!(r) as *mut f32, a); @@ -4137,7 +4315,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_load_si256() { + const unsafe fn test_mm256_load_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let p = ptr::addr_of!(a); let r = _mm256_load_si256(p); @@ -4146,7 +4324,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_store_si256() { + const unsafe fn test_mm256_store_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let mut r = _mm256_undefined_si256(); _mm256_store_si256(ptr::addr_of_mut!(r), a); @@ -4154,7 +4332,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_loadu_si256() { + const unsafe fn test_mm256_loadu_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let p = ptr::addr_of!(a); let r = _mm256_loadu_si256(black_box(p)); @@ -4163,7 +4341,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_storeu_si256() { + const unsafe fn test_mm256_storeu_si256() { let a = _mm256_set1_epi8(9); let mut r = _mm256_undefined_si256(); _mm256_storeu_si256(ptr::addr_of_mut!(r), a); @@ -4171,7 +4349,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_maskload_pd() { + const unsafe fn test_mm256_maskload_pd() { let a = &[1.0f64, 2., 3., 4.]; let p = a.as_ptr(); let mask = _mm256_setr_epi64x(0, !0, 0, !0); @@ -4181,7 +4359,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_maskstore_pd() { + const unsafe fn test_mm256_maskstore_pd() { let mut r = _mm256_set1_pd(0.); let mask = _mm256_setr_epi64x(0, !0, 0, !0); let a = _mm256_setr_pd(1., 2., 3., 4.); @@ -4191,7 +4369,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_maskload_pd() { + const unsafe fn test_mm_maskload_pd() { let a = &[1.0f64, 2.]; let p = a.as_ptr(); let mask = _mm_setr_epi64x(0, !0); @@ -4201,7 +4379,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_maskstore_pd() { + const unsafe fn test_mm_maskstore_pd() { let mut r = _mm_set1_pd(0.); let mask = _mm_setr_epi64x(0, !0); let a = _mm_setr_pd(1., 2.); @@ -4211,7 +4389,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_maskload_ps() { + const unsafe fn test_mm256_maskload_ps() { let a = &[1.0f32, 2., 3., 4., 5., 6., 7., 8.]; let p = a.as_ptr(); let mask = _mm256_setr_epi32(0, !0, 0, !0, 0, !0, 0, !0); @@ -4221,7 +4399,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_maskstore_ps() { + const unsafe fn test_mm256_maskstore_ps() { let mut r = _mm256_set1_ps(0.); let mask = _mm256_setr_epi32(0, !0, 0, !0, 0, !0, 0, !0); let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -4231,7 +4409,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_maskload_ps() { + const unsafe fn test_mm_maskload_ps() { let a = &[1.0f32, 2., 3., 4.]; let p = a.as_ptr(); let mask = _mm_setr_epi32(0, !0, 0, !0); @@ -4241,7 +4419,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_maskstore_ps() { + const unsafe fn test_mm_maskstore_ps() { let mut r = _mm_set1_ps(0.); let mask = _mm_setr_epi32(0, !0, 0, !0); let a = _mm_setr_ps(1., 2., 3., 4.); @@ -4251,7 +4429,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_movehdup_ps() { + const fn test_mm256_movehdup_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_movehdup_ps(a); let e = _mm256_setr_ps(2., 2., 4., 4., 6., 6., 8., 8.); @@ -4259,7 +4437,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_moveldup_ps() { + const fn test_mm256_moveldup_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_moveldup_ps(a); let e = _mm256_setr_ps(1., 1., 3., 3., 5., 5., 7., 7.); @@ -4267,7 +4445,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_movedup_pd() { + const fn test_mm256_movedup_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let r = _mm256_movedup_pd(a); let e = _mm256_setr_pd(1., 1., 3., 3.); @@ -4340,7 +4518,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_rcp_ps() { + fn test_mm256_rcp_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_rcp_ps(a); #[rustfmt::skip] @@ -4355,7 +4533,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_rsqrt_ps() { + fn test_mm256_rsqrt_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_rsqrt_ps(a); #[rustfmt::skip] @@ -4370,7 +4548,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_unpackhi_pd() { + const fn test_mm256_unpackhi_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_unpackhi_pd(a, b); @@ -4379,7 +4557,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_unpackhi_ps() { + const fn test_mm256_unpackhi_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm256_unpackhi_ps(a, b); @@ -4388,7 +4566,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_unpacklo_pd() { + const fn test_mm256_unpacklo_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_unpacklo_pd(a, b); @@ -4397,7 +4575,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_unpacklo_ps() { + const fn test_mm256_unpacklo_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm256_unpacklo_ps(a, b); @@ -4406,7 +4584,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testz_si256() { + const fn test_mm256_testz_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let b = _mm256_setr_epi64x(5, 6, 7, 8); let r = _mm256_testz_si256(a, b); @@ -4417,7 +4595,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testc_si256() { + const fn test_mm256_testc_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let b = _mm256_setr_epi64x(5, 6, 7, 8); let r = _mm256_testc_si256(a, b); @@ -4428,7 +4606,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testnzc_si256() { + fn test_mm256_testnzc_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let b = _mm256_setr_epi64x(5, 6, 7, 8); let r = _mm256_testnzc_si256(a, b); @@ -4440,7 +4618,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testz_pd() { + fn test_mm256_testz_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_testz_pd(a, b); @@ -4451,7 +4629,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testc_pd() { + fn test_mm256_testc_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_testc_pd(a, b); @@ -4463,7 +4641,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testnzc_pd() { + fn test_mm256_testnzc_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 6., 7., 8.); let r = _mm256_testnzc_pd(a, b); @@ -4475,7 +4653,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_testz_pd() { + const fn test_mm_testz_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 6.); let r = _mm_testz_pd(a, b); @@ -4486,7 +4664,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_testc_pd() { + const fn test_mm_testc_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 6.); let r = _mm_testc_pd(a, b); @@ -4498,7 +4676,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_testnzc_pd() { + fn test_mm_testnzc_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 6.); let r = _mm_testnzc_pd(a, b); @@ -4510,7 +4688,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testz_ps() { + fn test_mm256_testz_ps() { let a = _mm256_set1_ps(1.); let r = _mm256_testz_ps(a, a); assert_eq!(r, 1); @@ -4520,7 +4698,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testc_ps() { + fn test_mm256_testc_ps() { let a = _mm256_set1_ps(1.); let r = _mm256_testc_ps(a, a); assert_eq!(r, 1); @@ -4530,7 +4708,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_testnzc_ps() { + fn test_mm256_testnzc_ps() { let a = _mm256_set1_ps(1.); let r = _mm256_testnzc_ps(a, a); assert_eq!(r, 0); @@ -4541,7 +4719,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_testz_ps() { + const fn test_mm_testz_ps() { let a = _mm_set1_ps(1.); let r = _mm_testz_ps(a, a); assert_eq!(r, 1); @@ -4551,7 +4729,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_testc_ps() { + const fn test_mm_testc_ps() { let a = _mm_set1_ps(1.); let r = _mm_testc_ps(a, a); assert_eq!(r, 1); @@ -4561,7 +4739,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm_testnzc_ps() { + fn test_mm_testnzc_ps() { let a = _mm_set1_ps(1.); let r = _mm_testnzc_ps(a, a); assert_eq!(r, 0); @@ -4572,51 +4750,51 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_movemask_pd() { + const fn test_mm256_movemask_pd() { let a = _mm256_setr_pd(1., -2., 3., -4.); let r = _mm256_movemask_pd(a); assert_eq!(r, 0xA); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_movemask_ps() { + const fn test_mm256_movemask_ps() { let a = _mm256_setr_ps(1., -2., 3., -4., 1., -2., 3., -4.); let r = _mm256_movemask_ps(a); assert_eq!(r, 0xAA); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setzero_pd() { + const fn test_mm256_setzero_pd() { let r = _mm256_setzero_pd(); assert_eq_m256d(r, _mm256_set1_pd(0.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setzero_ps() { + const fn test_mm256_setzero_ps() { let r = _mm256_setzero_ps(); assert_eq_m256(r, _mm256_set1_ps(0.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setzero_si256() { + const fn test_mm256_setzero_si256() { let r = _mm256_setzero_si256(); assert_eq_m256i(r, _mm256_set1_epi8(0)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_pd() { + const fn test_mm256_set_pd() { let r = _mm256_set_pd(1., 2., 3., 4.); assert_eq_m256d(r, _mm256_setr_pd(4., 3., 2., 1.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_ps() { + const fn test_mm256_set_ps() { let r = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); assert_eq_m256(r, _mm256_setr_ps(8., 7., 6., 5., 4., 3., 2., 1.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_epi8() { + const fn test_mm256_set_epi8() { #[rustfmt::skip] let r = _mm256_set_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -4635,7 +4813,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_epi16() { + const fn test_mm256_set_epi16() { #[rustfmt::skip] let r = _mm256_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, @@ -4650,31 +4828,31 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_epi32() { + const fn test_mm256_set_epi32() { let r = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); assert_eq_m256i(r, _mm256_setr_epi32(8, 7, 6, 5, 4, 3, 2, 1)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_epi64x() { + const fn test_mm256_set_epi64x() { let r = _mm256_set_epi64x(1, 2, 3, 4); assert_eq_m256i(r, _mm256_setr_epi64x(4, 3, 2, 1)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_pd() { + const fn test_mm256_setr_pd() { let r = _mm256_setr_pd(1., 2., 3., 4.); assert_eq_m256d(r, _mm256_setr_pd(1., 2., 3., 4.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_ps() { + const fn test_mm256_setr_ps() { let r = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); assert_eq_m256(r, _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_epi8() { + const fn test_mm256_setr_epi8() { #[rustfmt::skip] let r = _mm256_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -4694,7 +4872,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_epi16() { + const fn test_mm256_setr_epi16() { #[rustfmt::skip] let r = _mm256_setr_epi16( 1, 2, 3, 4, 5, 6, 7, 8, @@ -4709,55 +4887,55 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_epi32() { + const fn test_mm256_setr_epi32() { let r = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); assert_eq_m256i(r, _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_epi64x() { + const fn test_mm256_setr_epi64x() { let r = _mm256_setr_epi64x(1, 2, 3, 4); assert_eq_m256i(r, _mm256_setr_epi64x(1, 2, 3, 4)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set1_pd() { + const fn test_mm256_set1_pd() { let r = _mm256_set1_pd(1.); assert_eq_m256d(r, _mm256_set1_pd(1.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set1_ps() { + const fn test_mm256_set1_ps() { let r = _mm256_set1_ps(1.); assert_eq_m256(r, _mm256_set1_ps(1.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set1_epi8() { + const fn test_mm256_set1_epi8() { let r = _mm256_set1_epi8(1); assert_eq_m256i(r, _mm256_set1_epi8(1)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set1_epi16() { + const fn test_mm256_set1_epi16() { let r = _mm256_set1_epi16(1); assert_eq_m256i(r, _mm256_set1_epi16(1)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set1_epi32() { + const fn test_mm256_set1_epi32() { let r = _mm256_set1_epi32(1); assert_eq_m256i(r, _mm256_set1_epi32(1)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set1_epi64x() { + const fn test_mm256_set1_epi64x() { let r = _mm256_set1_epi64x(1); assert_eq_m256i(r, _mm256_set1_epi64x(1)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castpd_ps() { + const fn test_mm256_castpd_ps() { let a = _mm256_setr_pd(1., 2., 3., 4.); let r = _mm256_castpd_ps(a); let e = _mm256_setr_ps(0., 1.875, 0., 2., 0., 2.125, 0., 2.25); @@ -4765,7 +4943,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castps_pd() { + const fn test_mm256_castps_pd() { let a = _mm256_setr_ps(0., 1.875, 0., 2., 0., 2.125, 0., 2.25); let r = _mm256_castps_pd(a); let e = _mm256_setr_pd(1., 2., 3., 4.); @@ -4773,7 +4951,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castps_si256() { + const fn test_mm256_castps_si256() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_castps_si256(a); #[rustfmt::skip] @@ -4787,7 +4965,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castsi256_ps() { + const fn test_mm256_castsi256_ps() { #[rustfmt::skip] let a = _mm256_setr_epi8( 0, 0, -128, 63, 0, 0, 0, 64, @@ -4801,63 +4979,63 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castpd_si256() { + const fn test_mm256_castpd_si256() { let a = _mm256_setr_pd(1., 2., 3., 4.); let r = _mm256_castpd_si256(a); - assert_eq_m256d(transmute(r), a); + assert_eq_m256d(unsafe { transmute(r) }, a); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castsi256_pd() { + const fn test_mm256_castsi256_pd() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let r = _mm256_castsi256_pd(a); - assert_eq_m256d(r, transmute(a)); + assert_eq_m256d(r, unsafe { transmute(a) }); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castps256_ps128() { + const fn test_mm256_castps256_ps128() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_castps256_ps128(a); assert_eq_m128(r, _mm_setr_ps(1., 2., 3., 4.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castpd256_pd128() { + const fn test_mm256_castpd256_pd128() { let a = _mm256_setr_pd(1., 2., 3., 4.); let r = _mm256_castpd256_pd128(a); assert_eq_m128d(r, _mm_setr_pd(1., 2.)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castsi256_si128() { + const fn test_mm256_castsi256_si128() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let r = _mm256_castsi256_si128(a); assert_eq_m128i(r, _mm_setr_epi64x(1, 2)); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castps128_ps256() { + const fn test_mm256_castps128_ps256() { let a = _mm_setr_ps(1., 2., 3., 4.); let r = _mm256_castps128_ps256(a); assert_eq_m128(_mm256_castps256_ps128(r), a); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castpd128_pd256() { + const fn test_mm256_castpd128_pd256() { let a = _mm_setr_pd(1., 2.); let r = _mm256_castpd128_pd256(a); assert_eq_m128d(_mm256_castpd256_pd128(r), a); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_castsi128_si256() { + const fn test_mm256_castsi128_si256() { let a = _mm_setr_epi32(1, 2, 3, 4); let r = _mm256_castsi128_si256(a); assert_eq_m128i(_mm256_castsi256_si128(r), a); } #[simd_test(enable = "avx")] - unsafe fn test_mm256_zextps128_ps256() { + const fn test_mm256_zextps128_ps256() { let a = _mm_setr_ps(1., 2., 3., 4.); let r = _mm256_zextps128_ps256(a); let e = _mm256_setr_ps(1., 2., 3., 4., 0., 0., 0., 0.); @@ -4865,7 +5043,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_zextsi128_si256() { + const fn test_mm256_zextsi128_si256() { let a = _mm_setr_epi64x(1, 2); let r = _mm256_zextsi128_si256(a); let e = _mm256_setr_epi64x(1, 2, 0, 0); @@ -4873,7 +5051,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_zextpd128_pd256() { + const fn test_mm256_zextpd128_pd256() { let a = _mm_setr_pd(1., 2.); let r = _mm256_zextpd128_pd256(a); let e = _mm256_setr_pd(1., 2., 0., 0.); @@ -4881,7 +5059,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_m128() { + const fn test_mm256_set_m128() { let hi = _mm_setr_ps(5., 6., 7., 8.); let lo = _mm_setr_ps(1., 2., 3., 4.); let r = _mm256_set_m128(hi, lo); @@ -4890,7 +5068,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_m128d() { + const fn test_mm256_set_m128d() { let hi = _mm_setr_pd(3., 4.); let lo = _mm_setr_pd(1., 2.); let r = _mm256_set_m128d(hi, lo); @@ -4899,7 +5077,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_set_m128i() { + const fn test_mm256_set_m128i() { #[rustfmt::skip] let hi = _mm_setr_epi8( 17, 18, 19, 20, @@ -4926,7 +5104,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_m128() { + const fn test_mm256_setr_m128() { let lo = _mm_setr_ps(1., 2., 3., 4.); let hi = _mm_setr_ps(5., 6., 7., 8.); let r = _mm256_setr_m128(lo, hi); @@ -4935,7 +5113,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_m128d() { + const fn test_mm256_setr_m128d() { let lo = _mm_setr_pd(1., 2.); let hi = _mm_setr_pd(3., 4.); let r = _mm256_setr_m128d(lo, hi); @@ -4944,7 +5122,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_setr_m128i() { + const fn test_mm256_setr_m128i() { #[rustfmt::skip] let lo = _mm_setr_epi8( 1, 2, 3, 4, @@ -4969,7 +5147,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_loadu2_m128() { + const unsafe fn test_mm256_loadu2_m128() { let hi = &[5., 6., 7., 8.]; let hiaddr = hi.as_ptr(); let lo = &[1., 2., 3., 4.]; @@ -4980,7 +5158,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_loadu2_m128d() { + const unsafe fn test_mm256_loadu2_m128d() { let hi = &[3., 4.]; let hiaddr = hi.as_ptr(); let lo = &[1., 2.]; @@ -4991,7 +5169,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_loadu2_m128i() { + const unsafe fn test_mm256_loadu2_m128i() { #[rustfmt::skip] let hi = _mm_setr_epi8( 17, 18, 19, 20, 21, 22, 23, 24, @@ -5014,7 +5192,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_storeu2_m128() { + const unsafe fn test_mm256_storeu2_m128() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let mut hi = _mm_undefined_ps(); let mut lo = _mm_undefined_ps(); @@ -5028,7 +5206,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_storeu2_m128d() { + const unsafe fn test_mm256_storeu2_m128d() { let a = _mm256_setr_pd(1., 2., 3., 4.); let mut hi = _mm_undefined_pd(); let mut lo = _mm_undefined_pd(); @@ -5042,7 +5220,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_storeu2_m128i() { + const unsafe fn test_mm256_storeu2_m128i() { #[rustfmt::skip] let a = _mm256_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -5069,7 +5247,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_cvtss_f32() { + const fn test_mm256_cvtss_f32() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_cvtss_f32(a); assert_eq!(r, 1.); diff --git a/library/stdarch/crates/core_arch/src/x86/avx2.rs b/library/stdarch/crates/core_arch/src/x86/avx2.rs index 8be302cabc77..6f56e937c6db 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx2.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx2.rs @@ -13,8 +13,8 @@ //! Wikipedia's [AVX][wiki_avx] and [FMA][wiki_fma] pages provide a quick //! overview of the instructions available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wiki_avx]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions //! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate @@ -31,7 +31,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpabsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_abs_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_abs_epi32(a: __m256i) -> __m256i { unsafe { let a = a.as_i32x8(); let r = simd_select::(simd_lt(a, i32x8::ZERO), simd_neg(a), a); @@ -46,7 +47,8 @@ pub fn _mm256_abs_epi32(a: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpabsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_abs_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_abs_epi16(a: __m256i) -> __m256i { unsafe { let a = a.as_i16x16(); let r = simd_select::(simd_lt(a, i16x16::ZERO), simd_neg(a), a); @@ -61,7 +63,8 @@ pub fn _mm256_abs_epi16(a: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpabsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_abs_epi8(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_abs_epi8(a: __m256i) -> __m256i { unsafe { let a = a.as_i8x32(); let r = simd_select::(simd_lt(a, i8x32::ZERO), simd_neg(a), a); @@ -76,7 +79,8 @@ pub fn _mm256_abs_epi8(a: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_add_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_add(a.as_i64x4(), b.as_i64x4())) } } @@ -87,7 +91,8 @@ pub fn _mm256_add_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_add_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_add(a.as_i32x8(), b.as_i32x8())) } } @@ -98,7 +103,8 @@ pub fn _mm256_add_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_add_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_add(a.as_i16x16(), b.as_i16x16())) } } @@ -109,7 +115,8 @@ pub fn _mm256_add_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_add_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_add(a.as_i8x32(), b.as_i8x32())) } } @@ -120,7 +127,8 @@ pub fn _mm256_add_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_adds_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_adds_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_add(a.as_i8x32(), b.as_i8x32())) } } @@ -131,7 +139,8 @@ pub fn _mm256_adds_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_adds_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_adds_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_add(a.as_i16x16(), b.as_i16x16())) } } @@ -142,7 +151,8 @@ pub fn _mm256_adds_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddusb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_adds_epu8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_adds_epu8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_add(a.as_u8x32(), b.as_u8x32())) } } @@ -153,7 +163,8 @@ pub fn _mm256_adds_epu8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpaddusw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_adds_epu16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_adds_epu16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_add(a.as_u16x16(), b.as_u16x16())) } } @@ -166,7 +177,8 @@ pub fn _mm256_adds_epu16(a: __m256i, b: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 7))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_alignr_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_alignr_epi8(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); // If palignr is shifting the pair of vectors more than the size of two @@ -247,7 +259,8 @@ pub fn _mm256_alignr_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_and_si256(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_and_si256(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_and(a.as_i64x4(), b.as_i64x4())) } } @@ -259,7 +272,8 @@ pub fn _mm256_and_si256(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_andnot_si256(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_andnot_si256(a: __m256i, b: __m256i) -> __m256i { unsafe { let all_ones = _mm256_set1_epi8(-1); transmute(simd_and( @@ -276,7 +290,8 @@ pub fn _mm256_andnot_si256(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpavgw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_avg_epu16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_avg_epu16(a: __m256i, b: __m256i) -> __m256i { unsafe { let a = simd_cast::<_, u32x16>(a.as_u16x16()); let b = simd_cast::<_, u32x16>(b.as_u16x16()); @@ -292,7 +307,8 @@ pub fn _mm256_avg_epu16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpavgb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_avg_epu8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_avg_epu8(a: __m256i, b: __m256i) -> __m256i { unsafe { let a = simd_cast::<_, u16x32>(a.as_u8x32()); let b = simd_cast::<_, u16x32>(b.as_u8x32()); @@ -309,7 +325,8 @@ pub fn _mm256_avg_epu8(a: __m256i, b: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vblendps, IMM4 = 9))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blend_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blend_epi32(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM4, 4); unsafe { let a = a.as_i32x4(); @@ -336,7 +353,8 @@ pub fn _mm_blend_epi32(a: __m128i, b: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(vblendps, IMM8 = 9))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blend_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blend_epi32(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i32x8(); @@ -367,7 +385,8 @@ pub fn _mm256_blend_epi32(a: __m256i, b: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpblendw, IMM8 = 9))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blend_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blend_epi16(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i16x16(); @@ -406,7 +425,8 @@ pub fn _mm256_blend_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpblendvb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_blendv_epi8(a: __m256i, b: __m256i, mask: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_blendv_epi8(a: __m256i, b: __m256i, mask: __m256i) -> __m256i { unsafe { let mask: i8x32 = simd_lt(mask.as_i8x32(), i8x32::ZERO); transmute(simd_select(mask, b.as_i8x32(), a.as_i8x32())) @@ -421,7 +441,8 @@ pub fn _mm256_blendv_epi8(a: __m256i, b: __m256i, mask: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpbroadcastb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_broadcastb_epi8(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastb_epi8(a: __m128i) -> __m128i { unsafe { let ret = simd_shuffle!(a.as_i8x16(), i8x16::ZERO, [0_u32; 16]); transmute::(ret) @@ -436,7 +457,8 @@ pub fn _mm_broadcastb_epi8(a: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpbroadcastb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastb_epi8(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastb_epi8(a: __m128i) -> __m256i { unsafe { let ret = simd_shuffle!(a.as_i8x16(), i8x16::ZERO, [0_u32; 32]); transmute::(ret) @@ -453,7 +475,8 @@ pub fn _mm256_broadcastb_epi8(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vbroadcastss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_broadcastd_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastd_epi32(a: __m128i) -> __m128i { unsafe { let ret = simd_shuffle!(a.as_i32x4(), i32x4::ZERO, [0_u32; 4]); transmute::(ret) @@ -470,7 +493,8 @@ pub fn _mm_broadcastd_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vbroadcastss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastd_epi32(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastd_epi32(a: __m128i) -> __m256i { unsafe { let ret = simd_shuffle!(a.as_i32x4(), i32x4::ZERO, [0_u32; 8]); transmute::(ret) @@ -487,7 +511,8 @@ pub fn _mm256_broadcastd_epi32(a: __m128i) -> __m256i { // See https://github.com/rust-lang/stdarch/issues/791 #[cfg_attr(test, assert_instr(vmovddup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_broadcastq_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastq_epi64(a: __m128i) -> __m128i { unsafe { let ret = simd_shuffle!(a.as_i64x2(), a.as_i64x2(), [0_u32; 2]); transmute::(ret) @@ -502,7 +527,8 @@ pub fn _mm_broadcastq_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vbroadcastsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastq_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastq_epi64(a: __m128i) -> __m256i { unsafe { let ret = simd_shuffle!(a.as_i64x2(), a.as_i64x2(), [0_u32; 4]); transmute::(ret) @@ -517,7 +543,8 @@ pub fn _mm256_broadcastq_epi64(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vmovddup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_broadcastsd_pd(a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastsd_pd(a: __m128d) -> __m128d { unsafe { simd_shuffle!(a, _mm_setzero_pd(), [0_u32; 2]) } } @@ -529,7 +556,8 @@ pub fn _mm_broadcastsd_pd(a: __m128d) -> __m128d { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vbroadcastsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastsd_pd(a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastsd_pd(a: __m128d) -> __m256d { unsafe { simd_shuffle!(a, _mm_setzero_pd(), [0_u32; 4]) } } @@ -540,7 +568,8 @@ pub fn _mm256_broadcastsd_pd(a: __m128d) -> __m256d { #[inline] #[target_feature(enable = "avx2")] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub fn _mm_broadcastsi128_si256(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastsi128_si256(a: __m128i) -> __m256i { unsafe { let ret = simd_shuffle!(a.as_i64x2(), i64x2::ZERO, [0, 1, 0, 1]); transmute::(ret) @@ -556,7 +585,8 @@ pub fn _mm_broadcastsi128_si256(a: __m128i) -> __m256i { #[inline] #[target_feature(enable = "avx2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastsi128_si256(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastsi128_si256(a: __m128i) -> __m256i { unsafe { let ret = simd_shuffle!(a.as_i64x2(), i64x2::ZERO, [0, 1, 0, 1]); transmute::(ret) @@ -571,7 +601,8 @@ pub fn _mm256_broadcastsi128_si256(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vbroadcastss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_broadcastss_ps(a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastss_ps(a: __m128) -> __m128 { unsafe { simd_shuffle!(a, _mm_setzero_ps(), [0_u32; 4]) } } @@ -583,7 +614,8 @@ pub fn _mm_broadcastss_ps(a: __m128) -> __m128 { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vbroadcastss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastss_ps(a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastss_ps(a: __m128) -> __m256 { unsafe { simd_shuffle!(a, _mm_setzero_ps(), [0_u32; 8]) } } @@ -595,7 +627,8 @@ pub fn _mm256_broadcastss_ps(a: __m128) -> __m256 { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpbroadcastw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_broadcastw_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastw_epi16(a: __m128i) -> __m128i { unsafe { let ret = simd_shuffle!(a.as_i16x8(), i16x8::ZERO, [0_u32; 8]); transmute::(ret) @@ -610,7 +643,8 @@ pub fn _mm_broadcastw_epi16(a: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpbroadcastw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_broadcastw_epi16(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastw_epi16(a: __m128i) -> __m256i { unsafe { let ret = simd_shuffle!(a.as_i16x8(), i16x8::ZERO, [0_u32; 16]); transmute::(ret) @@ -624,7 +658,8 @@ pub fn _mm256_broadcastw_epi16(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpeqq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpeq_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_eq(a.as_i64x4(), b.as_i64x4())) } } @@ -635,7 +670,8 @@ pub fn _mm256_cmpeq_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpeqd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpeq_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_eq(a.as_i32x8(), b.as_i32x8())) } } @@ -646,7 +682,8 @@ pub fn _mm256_cmpeq_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpeqw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpeq_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_eq(a.as_i16x16(), b.as_i16x16())) } } @@ -657,7 +694,8 @@ pub fn _mm256_cmpeq_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpeqb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpeq_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_eq(a.as_i8x32(), b.as_i8x32())) } } @@ -668,7 +706,8 @@ pub fn _mm256_cmpeq_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpgtq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpgt_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_gt(a.as_i64x4(), b.as_i64x4())) } } @@ -679,7 +718,8 @@ pub fn _mm256_cmpgt_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpgtd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpgt_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_gt(a.as_i32x8(), b.as_i32x8())) } } @@ -690,7 +730,8 @@ pub fn _mm256_cmpgt_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpgtw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpgt_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_gt(a.as_i16x16(), b.as_i16x16())) } } @@ -701,7 +742,8 @@ pub fn _mm256_cmpgt_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpcmpgtb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cmpgt_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute::(simd_gt(a.as_i8x32(), b.as_i8x32())) } } @@ -712,7 +754,8 @@ pub fn _mm256_cmpgt_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovsxwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi16_epi32(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi16_epi32(a: __m128i) -> __m256i { unsafe { transmute::(simd_cast(a.as_i16x8())) } } @@ -723,7 +766,8 @@ pub fn _mm256_cvtepi16_epi32(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovsxwq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi16_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi16_epi64(a: __m128i) -> __m256i { unsafe { let a = a.as_i16x8(); let v64: i16x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -738,7 +782,8 @@ pub fn _mm256_cvtepi16_epi64(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovsxdq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi32_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi32_epi64(a: __m128i) -> __m256i { unsafe { transmute::(simd_cast(a.as_i32x4())) } } @@ -749,7 +794,8 @@ pub fn _mm256_cvtepi32_epi64(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovsxbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi8_epi16(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi8_epi16(a: __m128i) -> __m256i { unsafe { transmute::(simd_cast(a.as_i8x16())) } } @@ -760,7 +806,8 @@ pub fn _mm256_cvtepi8_epi16(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovsxbd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi8_epi32(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi8_epi32(a: __m128i) -> __m256i { unsafe { let a = a.as_i8x16(); let v64: i8x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -775,7 +822,8 @@ pub fn _mm256_cvtepi8_epi32(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovsxbq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepi8_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi8_epi64(a: __m128i) -> __m256i { unsafe { let a = a.as_i8x16(); let v32: i8x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -791,7 +839,8 @@ pub fn _mm256_cvtepi8_epi64(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovzxwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepu16_epi32(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu16_epi32(a: __m128i) -> __m256i { unsafe { transmute::(simd_cast(a.as_u16x8())) } } @@ -803,7 +852,8 @@ pub fn _mm256_cvtepu16_epi32(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovzxwq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepu16_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu16_epi64(a: __m128i) -> __m256i { unsafe { let a = a.as_u16x8(); let v64: u16x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -818,7 +868,8 @@ pub fn _mm256_cvtepu16_epi64(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovzxdq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepu32_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu32_epi64(a: __m128i) -> __m256i { unsafe { transmute::(simd_cast(a.as_u32x4())) } } @@ -829,7 +880,8 @@ pub fn _mm256_cvtepu32_epi64(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovzxbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepu8_epi16(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu8_epi16(a: __m128i) -> __m256i { unsafe { transmute::(simd_cast(a.as_u8x16())) } } @@ -841,7 +893,8 @@ pub fn _mm256_cvtepu8_epi16(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovzxbd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepu8_epi32(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu8_epi32(a: __m128i) -> __m256i { unsafe { let a = a.as_u8x16(); let v64: u8x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -857,7 +910,8 @@ pub fn _mm256_cvtepu8_epi32(a: __m128i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovzxbq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_cvtepu8_epi64(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu8_epi64(a: __m128i) -> __m256i { unsafe { let a = a.as_u8x16(); let v32: u8x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -873,7 +927,8 @@ pub fn _mm256_cvtepu8_epi64(a: __m128i) -> __m256i { #[cfg_attr(test, assert_instr(vextractf128, IMM1 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extracti128_si256(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extracti128_si256(a: __m256i) -> __m128i { static_assert_uimm_bits!(IMM1, 1); unsafe { let a = a.as_i64x4(); @@ -890,7 +945,8 @@ pub fn _mm256_extracti128_si256(a: __m256i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vphaddw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hadd_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hadd_epi16(a: __m256i, b: __m256i) -> __m256i { let a = a.as_i16x16(); let b = b.as_i16x16(); unsafe { @@ -915,7 +971,8 @@ pub fn _mm256_hadd_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vphaddd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hadd_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hadd_epi32(a: __m256i, b: __m256i) -> __m256i { let a = a.as_i32x8(); let b = b.as_i32x8(); unsafe { @@ -944,7 +1001,8 @@ pub fn _mm256_hadds_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vphsubw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hsub_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hsub_epi16(a: __m256i, b: __m256i) -> __m256i { let a = a.as_i16x16(); let b = b.as_i16x16(); unsafe { @@ -969,7 +1027,8 @@ pub fn _mm256_hsub_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vphsubd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_hsub_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_hsub_epi32(a: __m256i, b: __m256i) -> __m256i { let a = a.as_i32x8(); let b = b.as_i32x8(); unsafe { @@ -1734,7 +1793,8 @@ pub unsafe fn _mm256_mask_i64gather_pd( #[cfg_attr(test, assert_instr(vinsertf128, IMM1 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_inserti128_si256(a: __m256i, b: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_inserti128_si256(a: __m256i, b: __m128i) -> __m256i { static_assert_uimm_bits!(IMM1, 1); unsafe { let a = a.as_i64x4(); @@ -1754,12 +1814,19 @@ pub fn _mm256_inserti128_si256(a: __m256i, b: __m128i) -> __m25 #[cfg_attr(test, assert_instr(vpmaddwd))] #[stable(feature = "simd_x86", since = "1.27.0")] pub fn _mm256_madd_epi16(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let r: i32x16 = simd_mul(simd_cast(a.as_i16x16()), simd_cast(b.as_i16x16())); - let even: i32x8 = simd_shuffle!(r, r, [0, 2, 4, 6, 8, 10, 12, 14]); - let odd: i32x8 = simd_shuffle!(r, r, [1, 3, 5, 7, 9, 11, 13, 15]); - simd_add(even, odd).as_m256i() - } + // It's a trick used in the Adler-32 algorithm to perform a widening addition. + // + // ```rust + // #[target_feature(enable = "avx2")] + // unsafe fn widening_add(mad: __m256i) -> __m256i { + // _mm256_madd_epi16(mad, _mm256_set1_epi16(1)) + // } + // ``` + // + // If we implement this using generic vector intrinsics, the optimizer + // will eliminate this pattern, and `vpmaddwd` will no longer be emitted. + // For this reason, we use x86 intrinsics. + unsafe { transmute(pmaddwd(a.as_i16x16(), b.as_i16x16())) } } /// Vertically multiplies each unsigned 8-bit integer from `a` with the @@ -1785,7 +1852,8 @@ pub fn _mm256_maddubs_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskload_epi32(mem_addr: *const i32, mask: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskload_epi32(mem_addr: *const i32, mask: __m128i) -> __m128i { let mask = simd_shr(mask.as_i32x4(), i32x4::splat(31)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, i32x4::ZERO).as_m128i() } @@ -1799,7 +1867,8 @@ pub unsafe fn _mm_maskload_epi32(mem_addr: *const i32, mask: __m128i) -> __m128i #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskload_epi32(mem_addr: *const i32, mask: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskload_epi32(mem_addr: *const i32, mask: __m256i) -> __m256i { let mask = simd_shr(mask.as_i32x8(), i32x8::splat(31)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, i32x8::ZERO).as_m256i() } @@ -1813,7 +1882,8 @@ pub unsafe fn _mm256_maskload_epi32(mem_addr: *const i32, mask: __m256i) -> __m2 #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskload_epi64(mem_addr: *const i64, mask: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskload_epi64(mem_addr: *const i64, mask: __m128i) -> __m128i { let mask = simd_shr(mask.as_i64x2(), i64x2::splat(63)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, i64x2::ZERO).as_m128i() } @@ -1827,7 +1897,8 @@ pub unsafe fn _mm_maskload_epi64(mem_addr: *const i64, mask: __m128i) -> __m128i #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskload_epi64(mem_addr: *const i64, mask: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskload_epi64(mem_addr: *const i64, mask: __m256i) -> __m256i { let mask = simd_shr(mask.as_i64x4(), i64x4::splat(63)); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, i64x4::ZERO).as_m256i() } @@ -1841,7 +1912,8 @@ pub unsafe fn _mm256_maskload_epi64(mem_addr: *const i64, mask: __m256i) -> __m2 #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskstore_epi32(mem_addr: *mut i32, mask: __m128i, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskstore_epi32(mem_addr: *mut i32, mask: __m128i, a: __m128i) { let mask = simd_shr(mask.as_i32x4(), i32x4::splat(31)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i32x4()) } @@ -1855,7 +1927,8 @@ pub unsafe fn _mm_maskstore_epi32(mem_addr: *mut i32, mask: __m128i, a: __m128i) #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskstore_epi32(mem_addr: *mut i32, mask: __m256i, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskstore_epi32(mem_addr: *mut i32, mask: __m256i, a: __m256i) { let mask = simd_shr(mask.as_i32x8(), i32x8::splat(31)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i32x8()) } @@ -1869,7 +1942,8 @@ pub unsafe fn _mm256_maskstore_epi32(mem_addr: *mut i32, mask: __m256i, a: __m25 #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_maskstore_epi64(mem_addr: *mut i64, mask: __m128i, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskstore_epi64(mem_addr: *mut i64, mask: __m128i, a: __m128i) { let mask = simd_shr(mask.as_i64x2(), i64x2::splat(63)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i64x2()) } @@ -1883,7 +1957,8 @@ pub unsafe fn _mm_maskstore_epi64(mem_addr: *mut i64, mask: __m128i, a: __m128i) #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaskmovq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_maskstore_epi64(mem_addr: *mut i64, mask: __m256i, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskstore_epi64(mem_addr: *mut i64, mask: __m256i, a: __m256i) { let mask = simd_shr(mask.as_i64x4(), i64x4::splat(63)); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i64x4()) } @@ -1896,12 +1971,9 @@ pub unsafe fn _mm256_maskstore_epi64(mem_addr: *mut i64, mask: __m256i, a: __m25 #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaxsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_max_epi16(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i16x16(); - let b = b.as_i16x16(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epi16(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_i16x16(), b.as_i16x16()).as_m256i() } } /// Compares packed 32-bit integers in `a` and `b`, and returns the packed @@ -1912,12 +1984,9 @@ pub fn _mm256_max_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaxsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_max_epi32(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i32x8(); - let b = b.as_i32x8(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epi32(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_i32x8(), b.as_i32x8()).as_m256i() } } /// Compares packed 8-bit integers in `a` and `b`, and returns the packed @@ -1928,12 +1997,9 @@ pub fn _mm256_max_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaxsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_max_epi8(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i8x32(); - let b = b.as_i8x32(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epi8(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_i8x32(), b.as_i8x32()).as_m256i() } } /// Compares packed unsigned 16-bit integers in `a` and `b`, and returns @@ -1944,12 +2010,9 @@ pub fn _mm256_max_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaxuw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_max_epu16(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u16x16(); - let b = b.as_u16x16(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epu16(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_u16x16(), b.as_u16x16()).as_m256i() } } /// Compares packed unsigned 32-bit integers in `a` and `b`, and returns @@ -1960,12 +2023,9 @@ pub fn _mm256_max_epu16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaxud))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_max_epu32(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u32x8(); - let b = b.as_u32x8(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epu32(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_u32x8(), b.as_u32x8()).as_m256i() } } /// Compares packed unsigned 8-bit integers in `a` and `b`, and returns @@ -1976,12 +2036,9 @@ pub fn _mm256_max_epu32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmaxub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_max_epu8(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u8x32(); - let b = b.as_u8x32(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epu8(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_u8x32(), b.as_u8x32()).as_m256i() } } /// Compares packed 16-bit integers in `a` and `b`, and returns the packed @@ -1992,12 +2049,9 @@ pub fn _mm256_max_epu8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpminsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_min_epi16(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i16x16(); - let b = b.as_i16x16(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epi16(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_i16x16(), b.as_i16x16()).as_m256i() } } /// Compares packed 32-bit integers in `a` and `b`, and returns the packed @@ -2008,12 +2062,9 @@ pub fn _mm256_min_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpminsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_min_epi32(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i32x8(); - let b = b.as_i32x8(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epi32(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_i32x8(), b.as_i32x8()).as_m256i() } } /// Compares packed 8-bit integers in `a` and `b`, and returns the packed @@ -2024,12 +2075,9 @@ pub fn _mm256_min_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpminsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_min_epi8(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i8x32(); - let b = b.as_i8x32(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epi8(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_i8x32(), b.as_i8x32()).as_m256i() } } /// Compares packed unsigned 16-bit integers in `a` and `b`, and returns @@ -2040,12 +2088,9 @@ pub fn _mm256_min_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpminuw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_min_epu16(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u16x16(); - let b = b.as_u16x16(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epu16(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_u16x16(), b.as_u16x16()).as_m256i() } } /// Compares packed unsigned 32-bit integers in `a` and `b`, and returns @@ -2056,12 +2101,9 @@ pub fn _mm256_min_epu16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpminud))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_min_epu32(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u32x8(); - let b = b.as_u32x8(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epu32(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_u32x8(), b.as_u32x8()).as_m256i() } } /// Compares packed unsigned 8-bit integers in `a` and `b`, and returns @@ -2072,12 +2114,9 @@ pub fn _mm256_min_epu32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpminub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_min_epu8(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u8x32(); - let b = b.as_u8x32(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epu8(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_u8x32(), b.as_u8x32()).as_m256i() } } /// Creates mask from the most significant bit of each 8-bit element in `a`, @@ -2088,7 +2127,8 @@ pub fn _mm256_min_epu8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmovmskb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_movemask_epi8(a: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movemask_epi8(a: __m256i) -> i32 { unsafe { let z = i8x32::ZERO; let m: i8x32 = simd_lt(a.as_i8x32(), z); @@ -2125,7 +2165,8 @@ pub fn _mm256_mpsadbw_epu8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmuldq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mul_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mul_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { let a = simd_cast::<_, i64x4>(simd_cast::<_, i32x4>(a.as_i64x4())); let b = simd_cast::<_, i64x4>(simd_cast::<_, i32x4>(b.as_i64x4())); @@ -2143,11 +2184,12 @@ pub fn _mm256_mul_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmuludq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mul_epu32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mul_epu32(a: __m256i, b: __m256i) -> __m256i { unsafe { let a = a.as_u64x4(); let b = b.as_u64x4(); - let mask = u64x4::splat(u32::MAX.into()); + let mask = u64x4::splat(u32::MAX as u64); transmute(simd_mul(simd_and(a, mask), simd_and(b, mask))) } } @@ -2161,7 +2203,8 @@ pub fn _mm256_mul_epu32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmulhw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mulhi_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mulhi_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { let a = simd_cast::<_, i32x16>(a.as_i16x16()); let b = simd_cast::<_, i32x16>(b.as_i16x16()); @@ -2179,7 +2222,8 @@ pub fn _mm256_mulhi_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmulhuw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mulhi_epu16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mulhi_epu16(a: __m256i, b: __m256i) -> __m256i { unsafe { let a = simd_cast::<_, u32x16>(a.as_u16x16()); let b = simd_cast::<_, u32x16>(b.as_u16x16()); @@ -2197,7 +2241,8 @@ pub fn _mm256_mulhi_epu16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmullw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mullo_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mullo_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_mul(a.as_i16x16(), b.as_i16x16())) } } @@ -2210,7 +2255,8 @@ pub fn _mm256_mullo_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpmulld))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_mullo_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mullo_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_mul(a.as_i32x8(), b.as_i32x8())) } } @@ -2236,7 +2282,8 @@ pub fn _mm256_mulhrs_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_or(a.as_i32x8(), b.as_i32x8())) } } @@ -2310,7 +2357,8 @@ pub fn _mm256_permutevar8x32_epi32(a: __m256i, b: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpermpd, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute4x64_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute4x64_epi64(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { let zero = i64x4::ZERO; @@ -2336,7 +2384,8 @@ pub fn _mm256_permute4x64_epi64(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vperm2f128, IMM8 = 9))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute2x128_si256(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute2x128_si256(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_permute2f128_si256::(a, b) } @@ -2350,7 +2399,8 @@ pub fn _mm256_permute2x128_si256(a: __m256i, b: __m256i) -> __m #[cfg_attr(test, assert_instr(vpermpd, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_permute4x64_pd(a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permute4x64_pd(a: __m256d) -> __m256d { static_assert_uimm_bits!(IMM8, 8); unsafe { simd_shuffle!( @@ -2465,7 +2515,8 @@ pub fn _mm256_shuffle_epi8(a: __m256i, b: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vshufps, MASK = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_shuffle_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_epi32(a: __m256i) -> __m256i { static_assert_uimm_bits!(MASK, 8); unsafe { let r: i32x8 = simd_shuffle!( @@ -2496,7 +2547,8 @@ pub fn _mm256_shuffle_epi32(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_shufflehi_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shufflehi_epi16(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i16x16(); @@ -2536,7 +2588,8 @@ pub fn _mm256_shufflehi_epi16(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_shufflelo_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shufflelo_epi16(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i16x16(); @@ -2650,7 +2703,8 @@ pub fn _mm256_sll_epi64(a: __m256i, count: __m128i) -> __m256i { #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_slli_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_slli_epi16(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 16 { @@ -2670,7 +2724,8 @@ pub fn _mm256_slli_epi16(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpslld, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_slli_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_slli_epi32(a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -2690,7 +2745,8 @@ pub fn _mm256_slli_epi32(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_slli_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_slli_epi64(a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -2709,7 +2765,8 @@ pub fn _mm256_slli_epi64(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_slli_si256(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_slli_si256(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_bslli_epi128::(a) } @@ -2722,7 +2779,8 @@ pub fn _mm256_slli_si256(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_bslli_epi128(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_bslli_epi128(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); const fn mask(shift: i32, i: u32) -> u32 { let shift = shift as u32 & 0xff; @@ -2785,7 +2843,8 @@ pub fn _mm256_bslli_epi128(a: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsllvd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sllv_epi32(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sllv_epi32(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u32x4(); let no_overflow: u32x4 = simd_lt(count, u32x4::splat(u32::BITS)); @@ -2803,7 +2862,8 @@ pub fn _mm_sllv_epi32(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsllvd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sllv_epi32(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sllv_epi32(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u32x8(); let no_overflow: u32x8 = simd_lt(count, u32x8::splat(u32::BITS)); @@ -2821,7 +2881,8 @@ pub fn _mm256_sllv_epi32(a: __m256i, count: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsllvq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sllv_epi64(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sllv_epi64(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u64x2(); let no_overflow: u64x2 = simd_lt(count, u64x2::splat(u64::BITS as u64)); @@ -2839,7 +2900,8 @@ pub fn _mm_sllv_epi64(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsllvq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sllv_epi64(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sllv_epi64(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u64x4(); let no_overflow: u64x4 = simd_lt(count, u64x4::splat(u64::BITS as u64)); @@ -2881,7 +2943,8 @@ pub fn _mm256_sra_epi32(a: __m256i, count: __m128i) -> __m256i { #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srai_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srai_epi16(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { transmute(simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16))) } } @@ -2895,7 +2958,8 @@ pub fn _mm256_srai_epi16(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srai_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srai_epi32(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { transmute(simd_shr(a.as_i32x8(), i32x8::splat(IMM8.min(31)))) } } @@ -2908,7 +2972,8 @@ pub fn _mm256_srai_epi32(a: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsravd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srav_epi32(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srav_epi32(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u32x4(); let no_overflow: u32x4 = simd_lt(count, u32x4::splat(u32::BITS)); @@ -2925,7 +2990,8 @@ pub fn _mm_srav_epi32(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsravd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srav_epi32(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srav_epi32(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u32x8(); let no_overflow: u32x8 = simd_lt(count, u32x8::splat(u32::BITS)); @@ -2942,7 +3008,8 @@ pub fn _mm256_srav_epi32(a: __m256i, count: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srli_si256(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srli_si256(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_bsrli_epi128::(a) } @@ -2955,7 +3022,8 @@ pub fn _mm256_srli_si256(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_bsrli_epi128(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_bsrli_epi128(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); const fn mask(shift: i32, i: u32) -> u32 { let shift = shift as u32 & 0xff; @@ -3054,7 +3122,8 @@ pub fn _mm256_srl_epi64(a: __m256i, count: __m128i) -> __m256i { #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srli_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srli_epi16(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 16 { @@ -3074,7 +3143,8 @@ pub fn _mm256_srli_epi16(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srli_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srli_epi32(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 32 { @@ -3094,7 +3164,8 @@ pub fn _mm256_srli_epi32(a: __m256i) -> __m256i { #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srli_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srli_epi64(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 64 { @@ -3113,7 +3184,8 @@ pub fn _mm256_srli_epi64(a: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsrlvd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srlv_epi32(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srlv_epi32(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u32x4(); let no_overflow: u32x4 = simd_lt(count, u32x4::splat(u32::BITS)); @@ -3130,7 +3202,8 @@ pub fn _mm_srlv_epi32(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsrlvd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srlv_epi32(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srlv_epi32(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u32x8(); let no_overflow: u32x8 = simd_lt(count, u32x8::splat(u32::BITS)); @@ -3147,7 +3220,8 @@ pub fn _mm256_srlv_epi32(a: __m256i, count: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsrlvq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srlv_epi64(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srlv_epi64(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u64x2(); let no_overflow: u64x2 = simd_lt(count, u64x2::splat(u64::BITS as u64)); @@ -3164,7 +3238,8 @@ pub fn _mm_srlv_epi64(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsrlvq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_srlv_epi64(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srlv_epi64(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u64x4(); let no_overflow: u64x4 = simd_lt(count, u64x4::splat(u64::BITS as u64)); @@ -3200,7 +3275,8 @@ pub unsafe fn _mm256_stream_load_si256(mem_addr: *const __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sub_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_sub(a.as_i16x16(), b.as_i16x16())) } } @@ -3211,7 +3287,8 @@ pub fn _mm256_sub_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sub_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_sub(a.as_i32x8(), b.as_i32x8())) } } @@ -3222,7 +3299,8 @@ pub fn _mm256_sub_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sub_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_sub(a.as_i64x4(), b.as_i64x4())) } } @@ -3233,7 +3311,8 @@ pub fn _mm256_sub_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_sub_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_sub(a.as_i8x32(), b.as_i8x32())) } } @@ -3245,7 +3324,8 @@ pub fn _mm256_sub_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_subs_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_subs_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_sub(a.as_i16x16(), b.as_i16x16())) } } @@ -3257,7 +3337,8 @@ pub fn _mm256_subs_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_subs_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_subs_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_sub(a.as_i8x32(), b.as_i8x32())) } } @@ -3269,7 +3350,8 @@ pub fn _mm256_subs_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubusw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_subs_epu16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_subs_epu16(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_sub(a.as_u16x16(), b.as_u16x16())) } } @@ -3281,7 +3363,8 @@ pub fn _mm256_subs_epu16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpsubusb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_subs_epu8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_subs_epu8(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_saturating_sub(a.as_u8x32(), b.as_u8x32())) } } @@ -3328,7 +3411,8 @@ pub fn _mm256_subs_epu8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpunpckhbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpackhi_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpackhi_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { #[rustfmt::skip] let r: i8x32 = simd_shuffle!(a.as_i8x32(), b.as_i8x32(), [ @@ -3383,7 +3467,8 @@ pub fn _mm256_unpackhi_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpunpcklbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpacklo_epi8(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpacklo_epi8(a: __m256i, b: __m256i) -> __m256i { unsafe { #[rustfmt::skip] let r: i8x32 = simd_shuffle!(a.as_i8x32(), b.as_i8x32(), [ @@ -3434,7 +3519,8 @@ pub fn _mm256_unpacklo_epi8(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpunpckhwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpackhi_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpackhi_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { let r: i16x16 = simd_shuffle!( a.as_i16x16(), @@ -3484,7 +3570,8 @@ pub fn _mm256_unpackhi_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vpunpcklwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpacklo_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpacklo_epi16(a: __m256i, b: __m256i) -> __m256i { unsafe { let r: i16x16 = simd_shuffle!( a.as_i16x16(), @@ -3527,7 +3614,8 @@ pub fn _mm256_unpacklo_epi16(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vunpckhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpackhi_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpackhi_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { let r: i32x8 = simd_shuffle!(a.as_i32x8(), b.as_i32x8(), [2, 10, 3, 11, 6, 14, 7, 15]); transmute(r) @@ -3566,7 +3654,8 @@ pub fn _mm256_unpackhi_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vunpcklps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpacklo_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpacklo_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { let r: i32x8 = simd_shuffle!(a.as_i32x8(), b.as_i32x8(), [0, 8, 1, 9, 4, 12, 5, 13]); transmute(r) @@ -3605,7 +3694,8 @@ pub fn _mm256_unpacklo_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vunpckhpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpackhi_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpackhi_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { let r: i64x4 = simd_shuffle!(a.as_i64x4(), b.as_i64x4(), [1, 5, 3, 7]); transmute(r) @@ -3644,7 +3734,8 @@ pub fn _mm256_unpackhi_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vunpcklpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_unpacklo_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_unpacklo_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { let r: i64x4 = simd_shuffle!(a.as_i64x4(), b.as_i64x4(), [0, 4, 2, 6]); transmute(r) @@ -3659,7 +3750,8 @@ pub fn _mm256_unpacklo_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx2")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_xor_si256(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_xor_si256(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_xor(a.as_i64x4(), b.as_i64x4())) } } @@ -3674,7 +3766,8 @@ pub fn _mm256_xor_si256(a: __m256i, b: __m256i) -> __m256i { // This intrinsic has no corresponding instruction. #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extract_epi8(a: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extract_epi8(a: __m256i) -> i32 { static_assert_uimm_bits!(INDEX, 5); unsafe { simd_extract!(a.as_u8x32(), INDEX as u32, u8) as i32 } } @@ -3690,7 +3783,8 @@ pub fn _mm256_extract_epi8(a: __m256i) -> i32 { // This intrinsic has no corresponding instruction. #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extract_epi16(a: __m256i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extract_epi16(a: __m256i) -> i32 { static_assert_uimm_bits!(INDEX, 4); unsafe { simd_extract!(a.as_u16x16(), INDEX as u32, u16) as i32 } } @@ -3701,6 +3795,8 @@ unsafe extern "C" { fn phaddsw(a: i16x16, b: i16x16) -> i16x16; #[link_name = "llvm.x86.avx2.phsub.sw"] fn phsubsw(a: i16x16, b: i16x16) -> i16x16; + #[link_name = "llvm.x86.avx2.pmadd.wd"] + fn pmaddwd(a: i16x16, b: i16x16) -> i32x8; #[link_name = "llvm.x86.avx2.pmadd.ub.sw"] fn pmaddubsw(a: u8x32, b: i8x32) -> i16x16; #[link_name = "llvm.x86.avx2.mpsadbw"] @@ -3819,13 +3915,14 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "avx2")] - unsafe fn test_mm256_abs_epi32() { + const fn test_mm256_abs_epi32() { #[rustfmt::skip] let a = _mm256_setr_epi32( 0, 1, -1, i32::MAX, @@ -3841,7 +3938,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_abs_epi16() { + const fn test_mm256_abs_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, -1, 2, -2, 3, -3, 4, @@ -3857,7 +3954,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_abs_epi8() { + const fn test_mm256_abs_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 0, 1, -1, 2, -2, 3, -3, 4, @@ -3877,7 +3974,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_add_epi64() { + const fn test_mm256_add_epi64() { let a = _mm256_setr_epi64x(-10, 0, 100, 1_000_000_000); let b = _mm256_setr_epi64x(-1, 0, 1, 2); let r = _mm256_add_epi64(a, b); @@ -3886,7 +3983,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_add_epi32() { + const fn test_mm256_add_epi32() { let a = _mm256_setr_epi32(-1, 0, 1, 2, 3, 4, 5, 6); let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_add_epi32(a, b); @@ -3895,7 +3992,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_add_epi16() { + const fn test_mm256_add_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, 2, 3, 4, 5, 6, 7, @@ -3916,7 +4013,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_add_epi8() { + const fn test_mm256_add_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -3943,7 +4040,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epi8() { + const fn test_mm256_adds_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -3970,7 +4067,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epi8_saturate_positive() { + fn test_mm256_adds_epi8_saturate_positive() { let a = _mm256_set1_epi8(0x7F); let b = _mm256_set1_epi8(1); let r = _mm256_adds_epi8(a, b); @@ -3978,7 +4075,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epi8_saturate_negative() { + fn test_mm256_adds_epi8_saturate_negative() { let a = _mm256_set1_epi8(-0x80); let b = _mm256_set1_epi8(-1); let r = _mm256_adds_epi8(a, b); @@ -3986,7 +4083,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epi16() { + const fn test_mm256_adds_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4008,7 +4105,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epi16_saturate_positive() { + fn test_mm256_adds_epi16_saturate_positive() { let a = _mm256_set1_epi16(0x7FFF); let b = _mm256_set1_epi16(1); let r = _mm256_adds_epi16(a, b); @@ -4016,7 +4113,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epi16_saturate_negative() { + fn test_mm256_adds_epi16_saturate_negative() { let a = _mm256_set1_epi16(-0x8000); let b = _mm256_set1_epi16(-1); let r = _mm256_adds_epi16(a, b); @@ -4024,7 +4121,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epu8() { + const fn test_mm256_adds_epu8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4051,7 +4148,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epu8_saturate() { + fn test_mm256_adds_epu8_saturate() { let a = _mm256_set1_epi8(!0); let b = _mm256_set1_epi8(1); let r = _mm256_adds_epu8(a, b); @@ -4059,7 +4156,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epu16() { + const fn test_mm256_adds_epu16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4081,7 +4178,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_adds_epu16_saturate() { + fn test_mm256_adds_epu16_saturate() { let a = _mm256_set1_epi16(!0); let b = _mm256_set1_epi16(1); let r = _mm256_adds_epu16(a, b); @@ -4089,7 +4186,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_and_si256() { + const fn test_mm256_and_si256() { let a = _mm256_set1_epi8(5); let b = _mm256_set1_epi8(3); let got = _mm256_and_si256(a, b); @@ -4097,7 +4194,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_andnot_si256() { + const fn test_mm256_andnot_si256() { let a = _mm256_set1_epi8(5); let b = _mm256_set1_epi8(3); let got = _mm256_andnot_si256(a, b); @@ -4105,21 +4202,21 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_avg_epu8() { + const fn test_mm256_avg_epu8() { let (a, b) = (_mm256_set1_epi8(3), _mm256_set1_epi8(9)); let r = _mm256_avg_epu8(a, b); assert_eq_m256i(r, _mm256_set1_epi8(6)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_avg_epu16() { + const fn test_mm256_avg_epu16() { let (a, b) = (_mm256_set1_epi16(3), _mm256_set1_epi16(9)); let r = _mm256_avg_epu16(a, b); assert_eq_m256i(r, _mm256_set1_epi16(6)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_blend_epi32() { + const fn test_mm_blend_epi32() { let (a, b) = (_mm_set1_epi32(3), _mm_set1_epi32(9)); let e = _mm_setr_epi32(9, 3, 3, 3); let r = _mm_blend_epi32::<0x01>(a, b); @@ -4130,7 +4227,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_blend_epi32() { + const fn test_mm256_blend_epi32() { let (a, b) = (_mm256_set1_epi32(3), _mm256_set1_epi32(9)); let e = _mm256_setr_epi32(9, 3, 3, 3, 3, 3, 3, 3); let r = _mm256_blend_epi32::<0x01>(a, b); @@ -4146,7 +4243,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_blend_epi16() { + const fn test_mm256_blend_epi16() { let (a, b) = (_mm256_set1_epi16(3), _mm256_set1_epi16(9)); let e = _mm256_setr_epi16(9, 3, 3, 3, 3, 3, 3, 3, 9, 3, 3, 3, 3, 3, 3, 3); let r = _mm256_blend_epi16::<0x01>(a, b); @@ -4157,7 +4254,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_blendv_epi8() { + const fn test_mm256_blendv_epi8() { let (a, b) = (_mm256_set1_epi8(4), _mm256_set1_epi8(2)); let mask = _mm256_insert_epi8::<2>(_mm256_set1_epi8(0), -1); let e = _mm256_insert_epi8::<2>(_mm256_set1_epi8(4), 2); @@ -4166,63 +4263,63 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastb_epi8() { + const fn test_mm_broadcastb_epi8() { let a = _mm_insert_epi8::<0>(_mm_set1_epi8(0x00), 0x2a); let res = _mm_broadcastb_epi8(a); assert_eq_m128i(res, _mm_set1_epi8(0x2a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastb_epi8() { + const fn test_mm256_broadcastb_epi8() { let a = _mm_insert_epi8::<0>(_mm_set1_epi8(0x00), 0x2a); let res = _mm256_broadcastb_epi8(a); assert_eq_m256i(res, _mm256_set1_epi8(0x2a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastd_epi32() { + const fn test_mm_broadcastd_epi32() { let a = _mm_setr_epi32(0x2a, 0x8000000, 0, 0); let res = _mm_broadcastd_epi32(a); assert_eq_m128i(res, _mm_set1_epi32(0x2a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastd_epi32() { + const fn test_mm256_broadcastd_epi32() { let a = _mm_setr_epi32(0x2a, 0x8000000, 0, 0); let res = _mm256_broadcastd_epi32(a); assert_eq_m256i(res, _mm256_set1_epi32(0x2a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastq_epi64() { + const fn test_mm_broadcastq_epi64() { let a = _mm_setr_epi64x(0x1ffffffff, 0); let res = _mm_broadcastq_epi64(a); assert_eq_m128i(res, _mm_set1_epi64x(0x1ffffffff)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastq_epi64() { + const fn test_mm256_broadcastq_epi64() { let a = _mm_setr_epi64x(0x1ffffffff, 0); let res = _mm256_broadcastq_epi64(a); assert_eq_m256i(res, _mm256_set1_epi64x(0x1ffffffff)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastsd_pd() { + const fn test_mm_broadcastsd_pd() { let a = _mm_setr_pd(6.88, 3.44); let res = _mm_broadcastsd_pd(a); assert_eq_m128d(res, _mm_set1_pd(6.88)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastsd_pd() { + const fn test_mm256_broadcastsd_pd() { let a = _mm_setr_pd(6.88, 3.44); let res = _mm256_broadcastsd_pd(a); assert_eq_m256d(res, _mm256_set1_pd(6.88f64)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastsi128_si256() { + const fn test_mm_broadcastsi128_si256() { let a = _mm_setr_epi64x(0x0987654321012334, 0x5678909876543210); let res = _mm_broadcastsi128_si256(a); let retval = _mm256_setr_epi64x( @@ -4235,7 +4332,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastsi128_si256() { + const fn test_mm256_broadcastsi128_si256() { let a = _mm_setr_epi64x(0x0987654321012334, 0x5678909876543210); let res = _mm256_broadcastsi128_si256(a); let retval = _mm256_setr_epi64x( @@ -4248,35 +4345,35 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastss_ps() { + const fn test_mm_broadcastss_ps() { let a = _mm_setr_ps(6.88, 3.44, 0.0, 0.0); let res = _mm_broadcastss_ps(a); assert_eq_m128(res, _mm_set1_ps(6.88)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastss_ps() { + const fn test_mm256_broadcastss_ps() { let a = _mm_setr_ps(6.88, 3.44, 0.0, 0.0); let res = _mm256_broadcastss_ps(a); assert_eq_m256(res, _mm256_set1_ps(6.88)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_broadcastw_epi16() { + const fn test_mm_broadcastw_epi16() { let a = _mm_insert_epi16::<0>(_mm_set1_epi16(0x2a), 0x22b); let res = _mm_broadcastw_epi16(a); assert_eq_m128i(res, _mm_set1_epi16(0x22b)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_broadcastw_epi16() { + const fn test_mm256_broadcastw_epi16() { let a = _mm_insert_epi16::<0>(_mm_set1_epi16(0x2a), 0x22b); let res = _mm256_broadcastw_epi16(a); assert_eq_m256i(res, _mm256_set1_epi16(0x22b)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpeq_epi8() { + const fn test_mm256_cmpeq_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4296,7 +4393,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpeq_epi16() { + const fn test_mm256_cmpeq_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4312,7 +4409,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpeq_epi32() { + const fn test_mm256_cmpeq_epi32() { let a = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_setr_epi32(7, 6, 2, 4, 3, 2, 1, 0); let r = _mm256_cmpeq_epi32(a, b); @@ -4322,7 +4419,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpeq_epi64() { + const fn test_mm256_cmpeq_epi64() { let a = _mm256_setr_epi64x(0, 1, 2, 3); let b = _mm256_setr_epi64x(3, 2, 2, 0); let r = _mm256_cmpeq_epi64(a, b); @@ -4330,7 +4427,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpgt_epi8() { + const fn test_mm256_cmpgt_epi8() { let a = _mm256_insert_epi8::<0>(_mm256_set1_epi8(0), 5); let b = _mm256_set1_epi8(0); let r = _mm256_cmpgt_epi8(a, b); @@ -4338,7 +4435,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpgt_epi16() { + const fn test_mm256_cmpgt_epi16() { let a = _mm256_insert_epi16::<0>(_mm256_set1_epi16(0), 5); let b = _mm256_set1_epi16(0); let r = _mm256_cmpgt_epi16(a, b); @@ -4346,7 +4443,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpgt_epi32() { + const fn test_mm256_cmpgt_epi32() { let a = _mm256_insert_epi32::<0>(_mm256_set1_epi32(0), 5); let b = _mm256_set1_epi32(0); let r = _mm256_cmpgt_epi32(a, b); @@ -4354,7 +4451,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cmpgt_epi64() { + const fn test_mm256_cmpgt_epi64() { let a = _mm256_insert_epi64::<0>(_mm256_set1_epi64x(0), 5); let b = _mm256_set1_epi64x(0); let r = _mm256_cmpgt_epi64(a, b); @@ -4362,7 +4459,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepi8_epi16() { + const fn test_mm256_cvtepi8_epi16() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 0, -1, 1, -2, 2, -3, 3, @@ -4377,7 +4474,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepi8_epi32() { + const fn test_mm256_cvtepi8_epi32() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 0, -1, 1, -2, 2, -3, 3, @@ -4388,7 +4485,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepi8_epi64() { + const fn test_mm256_cvtepi8_epi64() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 0, -1, 1, -2, 2, -3, 3, @@ -4399,49 +4496,49 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepi16_epi32() { + const fn test_mm256_cvtepi16_epi32() { let a = _mm_setr_epi16(0, 0, -1, 1, -2, 2, -3, 3); let r = _mm256_setr_epi32(0, 0, -1, 1, -2, 2, -3, 3); assert_eq_m256i(r, _mm256_cvtepi16_epi32(a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepi16_epi64() { + const fn test_mm256_cvtepi16_epi64() { let a = _mm_setr_epi16(0, 0, -1, 1, -2, 2, -3, 3); let r = _mm256_setr_epi64x(0, 0, -1, 1); assert_eq_m256i(r, _mm256_cvtepi16_epi64(a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepi32_epi64() { + const fn test_mm256_cvtepi32_epi64() { let a = _mm_setr_epi32(0, 0, -1, 1); let r = _mm256_setr_epi64x(0, 0, -1, 1); assert_eq_m256i(r, _mm256_cvtepi32_epi64(a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepu16_epi32() { + const fn test_mm256_cvtepu16_epi32() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7); assert_eq_m256i(r, _mm256_cvtepu16_epi32(a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepu16_epi64() { + const fn test_mm256_cvtepu16_epi64() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_setr_epi64x(0, 1, 2, 3); assert_eq_m256i(r, _mm256_cvtepu16_epi64(a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepu32_epi64() { + const fn test_mm256_cvtepu32_epi64() { let a = _mm_setr_epi32(0, 1, 2, 3); let r = _mm256_setr_epi64x(0, 1, 2, 3); assert_eq_m256i(r, _mm256_cvtepu32_epi64(a)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepu8_epi16() { + const fn test_mm256_cvtepu8_epi16() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4456,7 +4553,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepu8_epi32() { + const fn test_mm256_cvtepu8_epi32() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4467,7 +4564,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_cvtepu8_epi64() { + const fn test_mm256_cvtepu8_epi64() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4478,7 +4575,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_extracti128_si256() { + const fn test_mm256_extracti128_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let r = _mm256_extracti128_si256::<1>(a); let e = _mm_setr_epi64x(3, 4); @@ -4486,7 +4583,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_hadd_epi16() { + const fn test_mm256_hadd_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_hadd_epi16(a, b); @@ -4495,7 +4592,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_hadd_epi32() { + const fn test_mm256_hadd_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_hadd_epi32(a, b); @@ -4504,7 +4601,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_hadds_epi16() { + fn test_mm256_hadds_epi16() { let a = _mm256_set1_epi16(2); let a = _mm256_insert_epi16::<0>(a, 0x7fff); let a = _mm256_insert_epi16::<1>(a, 1); @@ -4519,7 +4616,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_hsub_epi16() { + const fn test_mm256_hsub_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_hsub_epi16(a, b); @@ -4528,7 +4625,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_hsub_epi32() { + const fn test_mm256_hsub_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_hsub_epi32(a, b); @@ -4537,7 +4634,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_hsubs_epi16() { + fn test_mm256_hsubs_epi16() { let a = _mm256_set1_epi16(2); let a = _mm256_insert_epi16::<0>(a, 0x7fff); let a = _mm256_insert_epi16::<1>(a, -1); @@ -4548,7 +4645,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_madd_epi16() { + fn test_mm256_madd_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_madd_epi16(a, b); @@ -4557,7 +4654,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_inserti128_si256() { + const fn test_mm256_inserti128_si256() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let b = _mm_setr_epi64x(7, 8); let r = _mm256_inserti128_si256::<1>(a, b); @@ -4566,7 +4663,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_maddubs_epi16() { + fn test_mm256_maddubs_epi16() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_maddubs_epi16(a, b); @@ -4575,7 +4672,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_maskload_epi32() { + const unsafe fn test_mm_maskload_epi32() { let nums = [1, 2, 3, 4]; let a = &nums as *const i32; let mask = _mm_setr_epi32(-1, 0, 0, -1); @@ -4585,7 +4682,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_maskload_epi32() { + const unsafe fn test_mm256_maskload_epi32() { let nums = [1, 2, 3, 4, 5, 6, 7, 8]; let a = &nums as *const i32; let mask = _mm256_setr_epi32(-1, 0, 0, -1, 0, -1, -1, 0); @@ -4595,7 +4692,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_maskload_epi64() { + const unsafe fn test_mm_maskload_epi64() { let nums = [1_i64, 2_i64]; let a = &nums as *const i64; let mask = _mm_setr_epi64x(0, -1); @@ -4605,7 +4702,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_maskload_epi64() { + const unsafe fn test_mm256_maskload_epi64() { let nums = [1_i64, 2_i64, 3_i64, 4_i64]; let a = &nums as *const i64; let mask = _mm256_setr_epi64x(0, -1, -1, 0); @@ -4615,7 +4712,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_maskstore_epi32() { + const unsafe fn test_mm_maskstore_epi32() { let a = _mm_setr_epi32(1, 2, 3, 4); let mut arr = [-1, -1, -1, -1]; let mask = _mm_setr_epi32(-1, 0, 0, -1); @@ -4625,7 +4722,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_maskstore_epi32() { + const unsafe fn test_mm256_maskstore_epi32() { let a = _mm256_setr_epi32(1, 0x6d726f, 3, 42, 0x777161, 6, 7, 8); let mut arr = [-1, -1, -1, 0x776173, -1, 0x68657265, -1, -1]; let mask = _mm256_setr_epi32(-1, 0, 0, -1, 0, -1, -1, 0); @@ -4635,7 +4732,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_maskstore_epi64() { + const unsafe fn test_mm_maskstore_epi64() { let a = _mm_setr_epi64x(1_i64, 2_i64); let mut arr = [-1_i64, -1_i64]; let mask = _mm_setr_epi64x(0, -1); @@ -4645,7 +4742,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_maskstore_epi64() { + const unsafe fn test_mm256_maskstore_epi64() { let a = _mm256_setr_epi64x(1_i64, 2_i64, 3_i64, 4_i64); let mut arr = [-1_i64, -1_i64, -1_i64, -1_i64]; let mask = _mm256_setr_epi64x(0, -1, -1, 0); @@ -4655,7 +4752,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_max_epi16() { + const fn test_mm256_max_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_max_epi16(a, b); @@ -4663,7 +4760,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_max_epi32() { + const fn test_mm256_max_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_max_epi32(a, b); @@ -4671,7 +4768,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_max_epi8() { + const fn test_mm256_max_epi8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_max_epi8(a, b); @@ -4679,7 +4776,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_max_epu16() { + const fn test_mm256_max_epu16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_max_epu16(a, b); @@ -4687,7 +4784,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_max_epu32() { + const fn test_mm256_max_epu32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_max_epu32(a, b); @@ -4695,7 +4792,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_max_epu8() { + const fn test_mm256_max_epu8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_max_epu8(a, b); @@ -4703,7 +4800,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_min_epi16() { + const fn test_mm256_min_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_min_epi16(a, b); @@ -4711,7 +4808,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_min_epi32() { + const fn test_mm256_min_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_min_epi32(a, b); @@ -4719,7 +4816,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_min_epi8() { + const fn test_mm256_min_epi8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_min_epi8(a, b); @@ -4727,7 +4824,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_min_epu16() { + const fn test_mm256_min_epu16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_min_epu16(a, b); @@ -4735,7 +4832,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_min_epu32() { + const fn test_mm256_min_epu32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_min_epu32(a, b); @@ -4743,7 +4840,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_min_epu8() { + const fn test_mm256_min_epu8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_min_epu8(a, b); @@ -4751,7 +4848,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_movemask_epi8() { + const fn test_mm256_movemask_epi8() { let a = _mm256_set1_epi8(-1); let r = _mm256_movemask_epi8(a); let e = -1; @@ -4759,7 +4856,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mpsadbw_epu8() { + fn test_mm256_mpsadbw_epu8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_mpsadbw_epu8::<0>(a, b); @@ -4768,7 +4865,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mul_epi32() { + const fn test_mm256_mul_epi32() { let a = _mm256_setr_epi32(0, 0, 0, 0, 2, 2, 2, 2); let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_mul_epi32(a, b); @@ -4777,7 +4874,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mul_epu32() { + const fn test_mm256_mul_epu32() { let a = _mm256_setr_epi32(0, 0, 0, 0, 2, 2, 2, 2); let b = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_mul_epu32(a, b); @@ -4786,7 +4883,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mulhi_epi16() { + const fn test_mm256_mulhi_epi16() { let a = _mm256_set1_epi16(6535); let b = _mm256_set1_epi16(6535); let r = _mm256_mulhi_epi16(a, b); @@ -4795,7 +4892,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mulhi_epu16() { + const fn test_mm256_mulhi_epu16() { let a = _mm256_set1_epi16(6535); let b = _mm256_set1_epi16(6535); let r = _mm256_mulhi_epu16(a, b); @@ -4804,7 +4901,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mullo_epi16() { + const fn test_mm256_mullo_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_mullo_epi16(a, b); @@ -4813,7 +4910,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mullo_epi32() { + const fn test_mm256_mullo_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_mullo_epi32(a, b); @@ -4822,7 +4919,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_mulhrs_epi16() { + fn test_mm256_mulhrs_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_mullo_epi16(a, b); @@ -4831,7 +4928,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_or_si256() { + const fn test_mm256_or_si256() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(0); let r = _mm256_or_si256(a, b); @@ -4839,7 +4936,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_packs_epi16() { + fn test_mm256_packs_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_packs_epi16(a, b); @@ -4855,7 +4952,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_packs_epi32() { + fn test_mm256_packs_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_packs_epi32(a, b); @@ -4865,7 +4962,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_packus_epi16() { + fn test_mm256_packus_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(4); let r = _mm256_packus_epi16(a, b); @@ -4881,7 +4978,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_packus_epi32() { + fn test_mm256_packus_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(4); let r = _mm256_packus_epi32(a, b); @@ -4891,7 +4988,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sad_epu8() { + fn test_mm256_sad_epu8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_sad_epu8(a, b); @@ -4900,7 +4997,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_shufflehi_epi16() { + const fn test_mm256_shufflehi_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 0, 1, 2, 3, 11, 22, 33, 44, @@ -4916,7 +5013,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_shufflelo_epi16() { + const fn test_mm256_shufflelo_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( 11, 22, 33, 44, 0, 1, 2, 3, @@ -4932,7 +5029,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sign_epi16() { + fn test_mm256_sign_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(-1); let r = _mm256_sign_epi16(a, b); @@ -4941,7 +5038,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sign_epi32() { + fn test_mm256_sign_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(-1); let r = _mm256_sign_epi32(a, b); @@ -4950,7 +5047,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sign_epi8() { + fn test_mm256_sign_epi8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(-1); let r = _mm256_sign_epi8(a, b); @@ -4959,7 +5056,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sll_epi16() { + fn test_mm256_sll_epi16() { let a = _mm256_set1_epi16(0xFF); let b = _mm_insert_epi16::<0>(_mm_set1_epi16(0), 4); let r = _mm256_sll_epi16(a, b); @@ -4967,7 +5064,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sll_epi32() { + fn test_mm256_sll_epi32() { let a = _mm256_set1_epi32(0xFFFF); let b = _mm_insert_epi32::<0>(_mm_set1_epi32(0), 4); let r = _mm256_sll_epi32(a, b); @@ -4975,7 +5072,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sll_epi64() { + fn test_mm256_sll_epi64() { let a = _mm256_set1_epi64x(0xFFFFFFFF); let b = _mm_insert_epi64::<0>(_mm_set1_epi64x(0), 4); let r = _mm256_sll_epi64(a, b); @@ -4983,7 +5080,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_slli_epi16() { + const fn test_mm256_slli_epi16() { assert_eq_m256i( _mm256_slli_epi16::<4>(_mm256_set1_epi16(0xFF)), _mm256_set1_epi16(0xFF0), @@ -4991,7 +5088,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_slli_epi32() { + const fn test_mm256_slli_epi32() { assert_eq_m256i( _mm256_slli_epi32::<4>(_mm256_set1_epi32(0xFFFF)), _mm256_set1_epi32(0xFFFF0), @@ -4999,7 +5096,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_slli_epi64() { + const fn test_mm256_slli_epi64() { assert_eq_m256i( _mm256_slli_epi64::<4>(_mm256_set1_epi64x(0xFFFFFFFF)), _mm256_set1_epi64x(0xFFFFFFFF0), @@ -5007,14 +5104,14 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_slli_si256() { + const fn test_mm256_slli_si256() { let a = _mm256_set1_epi64x(0xFFFFFFFF); let r = _mm256_slli_si256::<3>(a); assert_eq_m256i(r, _mm256_set1_epi64x(0xFFFFFFFF000000)); } #[simd_test(enable = "avx2")] - unsafe fn test_mm_sllv_epi32() { + const fn test_mm_sllv_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(1); let r = _mm_sllv_epi32(a, b); @@ -5023,7 +5120,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sllv_epi32() { + const fn test_mm256_sllv_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(1); let r = _mm256_sllv_epi32(a, b); @@ -5032,7 +5129,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_sllv_epi64() { + const fn test_mm_sllv_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(1); let r = _mm_sllv_epi64(a, b); @@ -5041,7 +5138,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sllv_epi64() { + const fn test_mm256_sllv_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(1); let r = _mm256_sllv_epi64(a, b); @@ -5050,7 +5147,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sra_epi16() { + fn test_mm256_sra_epi16() { let a = _mm256_set1_epi16(-1); let b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0); let r = _mm256_sra_epi16(a, b); @@ -5058,7 +5155,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sra_epi32() { + fn test_mm256_sra_epi32() { let a = _mm256_set1_epi32(-1); let b = _mm_insert_epi32::<0>(_mm_set1_epi32(0), 1); let r = _mm256_sra_epi32(a, b); @@ -5066,7 +5163,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srai_epi16() { + const fn test_mm256_srai_epi16() { assert_eq_m256i( _mm256_srai_epi16::<1>(_mm256_set1_epi16(-1)), _mm256_set1_epi16(-1), @@ -5074,7 +5171,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srai_epi32() { + const fn test_mm256_srai_epi32() { assert_eq_m256i( _mm256_srai_epi32::<1>(_mm256_set1_epi32(-1)), _mm256_set1_epi32(-1), @@ -5082,7 +5179,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_srav_epi32() { + const fn test_mm_srav_epi32() { let a = _mm_set1_epi32(4); let count = _mm_set1_epi32(1); let r = _mm_srav_epi32(a, count); @@ -5091,7 +5188,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srav_epi32() { + const fn test_mm256_srav_epi32() { let a = _mm256_set1_epi32(4); let count = _mm256_set1_epi32(1); let r = _mm256_srav_epi32(a, count); @@ -5100,7 +5197,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srli_si256() { + const fn test_mm256_srli_si256() { #[rustfmt::skip] let a = _mm256_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -5120,7 +5217,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srl_epi16() { + fn test_mm256_srl_epi16() { let a = _mm256_set1_epi16(0xFF); let b = _mm_insert_epi16::<0>(_mm_set1_epi16(0), 4); let r = _mm256_srl_epi16(a, b); @@ -5128,7 +5225,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srl_epi32() { + fn test_mm256_srl_epi32() { let a = _mm256_set1_epi32(0xFFFF); let b = _mm_insert_epi32::<0>(_mm_set1_epi32(0), 4); let r = _mm256_srl_epi32(a, b); @@ -5136,7 +5233,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srl_epi64() { + fn test_mm256_srl_epi64() { let a = _mm256_set1_epi64x(0xFFFFFFFF); let b = _mm_setr_epi64x(4, 0); let r = _mm256_srl_epi64(a, b); @@ -5144,7 +5241,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srli_epi16() { + const fn test_mm256_srli_epi16() { assert_eq_m256i( _mm256_srli_epi16::<4>(_mm256_set1_epi16(0xFF)), _mm256_set1_epi16(0xF), @@ -5152,7 +5249,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srli_epi32() { + const fn test_mm256_srli_epi32() { assert_eq_m256i( _mm256_srli_epi32::<4>(_mm256_set1_epi32(0xFFFF)), _mm256_set1_epi32(0xFFF), @@ -5160,7 +5257,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srli_epi64() { + const fn test_mm256_srli_epi64() { assert_eq_m256i( _mm256_srli_epi64::<4>(_mm256_set1_epi64x(0xFFFFFFFF)), _mm256_set1_epi64x(0xFFFFFFF), @@ -5168,7 +5265,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_srlv_epi32() { + const fn test_mm_srlv_epi32() { let a = _mm_set1_epi32(2); let count = _mm_set1_epi32(1); let r = _mm_srlv_epi32(a, count); @@ -5177,7 +5274,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srlv_epi32() { + const fn test_mm256_srlv_epi32() { let a = _mm256_set1_epi32(2); let count = _mm256_set1_epi32(1); let r = _mm256_srlv_epi32(a, count); @@ -5186,7 +5283,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm_srlv_epi64() { + const fn test_mm_srlv_epi64() { let a = _mm_set1_epi64x(2); let count = _mm_set1_epi64x(1); let r = _mm_srlv_epi64(a, count); @@ -5195,7 +5292,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_srlv_epi64() { + const fn test_mm256_srlv_epi64() { let a = _mm256_set1_epi64x(2); let count = _mm256_set1_epi64x(1); let r = _mm256_srlv_epi64(a, count); @@ -5211,7 +5308,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sub_epi16() { + const fn test_mm256_sub_epi16() { let a = _mm256_set1_epi16(4); let b = _mm256_set1_epi16(2); let r = _mm256_sub_epi16(a, b); @@ -5219,7 +5316,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sub_epi32() { + const fn test_mm256_sub_epi32() { let a = _mm256_set1_epi32(4); let b = _mm256_set1_epi32(2); let r = _mm256_sub_epi32(a, b); @@ -5227,7 +5324,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sub_epi64() { + const fn test_mm256_sub_epi64() { let a = _mm256_set1_epi64x(4); let b = _mm256_set1_epi64x(2); let r = _mm256_sub_epi64(a, b); @@ -5235,7 +5332,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_sub_epi8() { + const fn test_mm256_sub_epi8() { let a = _mm256_set1_epi8(4); let b = _mm256_set1_epi8(2); let r = _mm256_sub_epi8(a, b); @@ -5243,7 +5340,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_subs_epi16() { + const fn test_mm256_subs_epi16() { let a = _mm256_set1_epi16(4); let b = _mm256_set1_epi16(2); let r = _mm256_subs_epi16(a, b); @@ -5251,7 +5348,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_subs_epi8() { + const fn test_mm256_subs_epi8() { let a = _mm256_set1_epi8(4); let b = _mm256_set1_epi8(2); let r = _mm256_subs_epi8(a, b); @@ -5259,7 +5356,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_subs_epu16() { + const fn test_mm256_subs_epu16() { let a = _mm256_set1_epi16(4); let b = _mm256_set1_epi16(2); let r = _mm256_subs_epu16(a, b); @@ -5267,7 +5364,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_subs_epu8() { + const fn test_mm256_subs_epu8() { let a = _mm256_set1_epi8(4); let b = _mm256_set1_epi8(2); let r = _mm256_subs_epu8(a, b); @@ -5275,7 +5372,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_xor_si256() { + const fn test_mm256_xor_si256() { let a = _mm256_set1_epi8(5); let b = _mm256_set1_epi8(3); let r = _mm256_xor_si256(a, b); @@ -5283,7 +5380,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_alignr_epi8() { + const fn test_mm256_alignr_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -5339,7 +5436,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_shuffle_epi8() { + fn test_mm256_shuffle_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -5366,7 +5463,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_permutevar8x32_epi32() { + fn test_mm256_permutevar8x32_epi32() { let a = _mm256_setr_epi32(100, 200, 300, 400, 500, 600, 700, 800); let b = _mm256_setr_epi32(5, 0, 5, 1, 7, 6, 3, 4); let expected = _mm256_setr_epi32(600, 100, 600, 200, 800, 700, 400, 500); @@ -5375,7 +5472,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_permute4x64_epi64() { + const fn test_mm256_permute4x64_epi64() { let a = _mm256_setr_epi64x(100, 200, 300, 400); let expected = _mm256_setr_epi64x(400, 100, 200, 100); let r = _mm256_permute4x64_epi64::<0b00010011>(a); @@ -5383,7 +5480,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_permute2x128_si256() { + const fn test_mm256_permute2x128_si256() { let a = _mm256_setr_epi64x(100, 200, 500, 600); let b = _mm256_setr_epi64x(300, 400, 700, 800); let r = _mm256_permute2x128_si256::<0b00_01_00_11>(a, b); @@ -5392,7 +5489,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_permute4x64_pd() { + const fn test_mm256_permute4x64_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let r = _mm256_permute4x64_pd::<0b00_01_00_11>(a); let e = _mm256_setr_pd(4., 1., 2., 1.); @@ -5400,7 +5497,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_permutevar8x32_ps() { + fn test_mm256_permutevar8x32_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_epi32(5, 0, 5, 1, 7, 6, 3, 4); let r = _mm256_permutevar8x32_ps(a, b); @@ -5750,7 +5847,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_extract_epi8() { + const fn test_mm256_extract_epi8() { #[rustfmt::skip] let a = _mm256_setr_epi8( -1, 1, 2, 3, 4, 5, 6, 7, @@ -5765,7 +5862,7 @@ mod tests { } #[simd_test(enable = "avx2")] - unsafe fn test_mm256_extract_epi16() { + const fn test_mm256_extract_epi16() { #[rustfmt::skip] let a = _mm256_setr_epi16( -1, 1, 2, 3, 4, 5, 6, 7, diff --git a/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs b/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs index 85afd91fba7b..83dbc540a0c8 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512bf16.rs @@ -1833,7 +1833,7 @@ mod tests { const BF16_EIGHT: u16 = 0b0_10000010_0000000; #[simd_test(enable = "avx512bf16")] - unsafe fn test_mm512_cvtpbh_ps() { + fn test_mm512_cvtpbh_ps() { let a = __m256bh([ BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, @@ -1846,7 +1846,7 @@ mod tests { } #[simd_test(enable = "avx512bf16")] - unsafe fn test_mm512_mask_cvtpbh_ps() { + fn test_mm512_mask_cvtpbh_ps() { let a = __m256bh([ BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, @@ -1863,7 +1863,7 @@ mod tests { } #[simd_test(enable = "avx512bf16")] - unsafe fn test_mm512_maskz_cvtpbh_ps() { + fn test_mm512_maskz_cvtpbh_ps() { let a = __m256bh([ BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, @@ -1877,7 +1877,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm256_cvtpbh_ps() { + fn test_mm256_cvtpbh_ps() { let a = __m128bh([ BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, ]); @@ -1887,7 +1887,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm256_mask_cvtpbh_ps() { + fn test_mm256_mask_cvtpbh_ps() { let a = __m128bh([ BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, ]); @@ -1899,7 +1899,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm256_maskz_cvtpbh_ps() { + fn test_mm256_maskz_cvtpbh_ps() { let a = __m128bh([ BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, BF16_FIVE, BF16_SIX, BF16_SEVEN, BF16_EIGHT, ]); @@ -1910,7 +1910,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm_cvtpbh_ps() { + fn test_mm_cvtpbh_ps() { let a = __m128bh([BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, 0, 0, 0, 0]); let r = _mm_cvtpbh_ps(a); let e = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); @@ -1918,7 +1918,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm_mask_cvtpbh_ps() { + fn test_mm_mask_cvtpbh_ps() { let a = __m128bh([BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, 0, 0, 0, 0]); let src = _mm_setr_ps(9., 10., 11., 12.); let k = 0b1010; @@ -1928,7 +1928,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm_maskz_cvtpbh_ps() { + fn test_mm_maskz_cvtpbh_ps() { let a = __m128bh([BF16_ONE, BF16_TWO, BF16_THREE, BF16_FOUR, 0, 0, 0, 0]); let k = 0b1010; let r = _mm_maskz_cvtpbh_ps(k, a); @@ -1937,7 +1937,7 @@ mod tests { } #[simd_test(enable = "avx512bf16")] - unsafe fn test_mm_cvtsbh_ss() { + fn test_mm_cvtsbh_ss() { let r = _mm_cvtsbh_ss(bf16::from_bits(BF16_ONE)); assert_eq!(r, 1.); } @@ -1970,7 +1970,7 @@ mod tests { } #[simd_test(enable = "avx512bf16,avx512vl")] - unsafe fn test_mm_cvtness_sbh() { + fn test_mm_cvtness_sbh() { let r = _mm_cvtness_sbh(1.); assert_eq!(r.to_bits(), BF16_ONE); } diff --git a/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs b/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs index 1cbf0faea09f..6dd4e6b33a3b 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512bitalg.rs @@ -5,7 +5,7 @@ //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref]. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf use crate::core_arch::simd::i8x16; use crate::core_arch::simd::i8x32; @@ -43,7 +43,8 @@ unsafe extern "C" { #[target_feature(enable = "avx512bitalg")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm512_popcnt_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_popcnt_epi16(a: __m512i) -> __m512i { unsafe { transmute(simd_ctpop(a.as_i16x32())) } } @@ -57,7 +58,8 @@ pub fn _mm512_popcnt_epi16(a: __m512i) -> __m512i { #[target_feature(enable = "avx512bitalg")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm512_maskz_popcnt_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_popcnt_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -77,7 +79,8 @@ pub fn _mm512_maskz_popcnt_epi16(k: __mmask32, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bitalg")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm512_mask_popcnt_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_popcnt_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -94,7 +97,8 @@ pub fn _mm512_mask_popcnt_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m51 #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm256_popcnt_epi16(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_popcnt_epi16(a: __m256i) -> __m256i { unsafe { transmute(simd_ctpop(a.as_i16x16())) } } @@ -108,7 +112,8 @@ pub fn _mm256_popcnt_epi16(a: __m256i) -> __m256i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm256_maskz_popcnt_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_popcnt_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -128,7 +133,8 @@ pub fn _mm256_maskz_popcnt_epi16(k: __mmask16, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm256_mask_popcnt_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_popcnt_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -145,7 +151,8 @@ pub fn _mm256_mask_popcnt_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m25 #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm_popcnt_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_popcnt_epi16(a: __m128i) -> __m128i { unsafe { transmute(simd_ctpop(a.as_i16x8())) } } @@ -159,7 +166,8 @@ pub fn _mm_popcnt_epi16(a: __m128i) -> __m128i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm_maskz_popcnt_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_popcnt_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -179,7 +187,8 @@ pub fn _mm_maskz_popcnt_epi16(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntw))] -pub fn _mm_mask_popcnt_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_popcnt_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -196,7 +205,8 @@ pub fn _mm_mask_popcnt_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bitalg")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm512_popcnt_epi8(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_popcnt_epi8(a: __m512i) -> __m512i { unsafe { transmute(simd_ctpop(a.as_i8x64())) } } @@ -210,7 +220,8 @@ pub fn _mm512_popcnt_epi8(a: __m512i) -> __m512i { #[target_feature(enable = "avx512bitalg")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm512_maskz_popcnt_epi8(k: __mmask64, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_popcnt_epi8(k: __mmask64, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -230,7 +241,8 @@ pub fn _mm512_maskz_popcnt_epi8(k: __mmask64, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bitalg")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm512_mask_popcnt_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_popcnt_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -247,7 +259,8 @@ pub fn _mm512_mask_popcnt_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512 #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm256_popcnt_epi8(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_popcnt_epi8(a: __m256i) -> __m256i { unsafe { transmute(simd_ctpop(a.as_i8x32())) } } @@ -261,7 +274,8 @@ pub fn _mm256_popcnt_epi8(a: __m256i) -> __m256i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm256_maskz_popcnt_epi8(k: __mmask32, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_popcnt_epi8(k: __mmask32, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -281,7 +295,8 @@ pub fn _mm256_maskz_popcnt_epi8(k: __mmask32, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm256_mask_popcnt_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_popcnt_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -298,7 +313,8 @@ pub fn _mm256_mask_popcnt_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256 #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm_popcnt_epi8(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_popcnt_epi8(a: __m128i) -> __m128i { unsafe { transmute(simd_ctpop(a.as_i8x16())) } } @@ -312,7 +328,8 @@ pub fn _mm_popcnt_epi8(a: __m128i) -> __m128i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm_maskz_popcnt_epi8(k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_popcnt_epi8(k: __mmask16, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -332,7 +349,8 @@ pub fn _mm_maskz_popcnt_epi8(k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bitalg,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntb))] -pub fn _mm_mask_popcnt_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_popcnt_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -436,12 +454,13 @@ mod tests { // __mXXXi happens to be defined in terms of signed integers. #![allow(overflowing_literals)] + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_popcnt_epi16() { + const fn test_mm512_popcnt_epi16() { let test_data = _mm512_set_epi16( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF, 0xFF_FF, -1, -100, 255, 256, 2, 4, 8, 16, 32, 64, 128, 256, 512, @@ -456,7 +475,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_maskz_popcnt_epi16() { + const fn test_mm512_maskz_popcnt_epi16() { let test_data = _mm512_set_epi16( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF, 0xFF_FF, -1, -100, 255, 256, 2, 4, 8, 16, 32, 64, 128, 256, 512, @@ -472,7 +491,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_mask_popcnt_epi16() { + const fn test_mm512_mask_popcnt_epi16() { let test_data = _mm512_set_epi16( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF, 0xFF_FF, -1, -100, 255, 256, 2, 4, 8, 16, 32, 64, 128, 256, 512, @@ -488,7 +507,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_popcnt_epi16() { + const fn test_mm256_popcnt_epi16() { let test_data = _mm256_set_epi16( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF, @@ -500,7 +519,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_maskz_popcnt_epi16() { + const fn test_mm256_maskz_popcnt_epi16() { let test_data = _mm256_set_epi16( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF, @@ -512,7 +531,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_mask_popcnt_epi16() { + const fn test_mm256_mask_popcnt_epi16() { let test_data = _mm256_set_epi16( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1_FF, 0x3_FF, 0x7_FF, 0xF_FF, 0x1F_FF, 0x3F_FF, 0x7F_FF, @@ -526,7 +545,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_popcnt_epi16() { + const fn test_mm_popcnt_epi16() { let test_data = _mm_set_epi16(0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F); let actual_result = _mm_popcnt_epi16(test_data); let reference_result = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); @@ -534,7 +553,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_maskz_popcnt_epi16() { + const fn test_mm_maskz_popcnt_epi16() { let test_data = _mm_set_epi16(0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F); let mask = 0xF0; let actual_result = _mm_maskz_popcnt_epi16(mask, test_data); @@ -543,7 +562,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_mask_popcnt_epi16() { + const fn test_mm_mask_popcnt_epi16() { let test_data = _mm_set_epi16(0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F); let mask = 0xF0; let actual_result = _mm_mask_popcnt_epi16(test_data, mask, test_data); @@ -552,7 +571,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_popcnt_epi8() { + const fn test_mm512_popcnt_epi8() { let test_data = _mm512_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100, 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, 183, 154, 84, 56, 227, 189, @@ -569,7 +588,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_maskz_popcnt_epi8() { + const fn test_mm512_maskz_popcnt_epi8() { let test_data = _mm512_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100, 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, 183, 154, 84, 56, 227, 189, @@ -587,7 +606,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_mask_popcnt_epi8() { + const fn test_mm512_mask_popcnt_epi8() { let test_data = _mm512_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100, 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, 183, 154, 84, 56, 227, 189, @@ -605,7 +624,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_popcnt_epi8() { + const fn test_mm256_popcnt_epi8() { let test_data = _mm256_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 128, 171, 206, 100, 217, 109, 253, 190, 177, 254, 179, 215, 230, 68, 201, 172, @@ -619,7 +638,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_maskz_popcnt_epi8() { + const fn test_mm256_maskz_popcnt_epi8() { let test_data = _mm256_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 251, 73, 121, 143, 145, 85, 91, 137, 90, 225, 21, 249, 211, 155, 228, 70, @@ -634,7 +653,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_mask_popcnt_epi8() { + const fn test_mm256_mask_popcnt_epi8() { let test_data = _mm256_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, 251, 73, 121, 143, 145, 85, 91, 137, 90, 225, 21, 249, 211, 155, 228, 70, @@ -649,7 +668,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_popcnt_epi8() { + const fn test_mm_popcnt_epi8() { let test_data = _mm_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, -1, 2, 4, 8, 16, 32, 64, ); @@ -659,7 +678,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_maskz_popcnt_epi8() { + const fn test_mm_maskz_popcnt_epi8() { let test_data = _mm_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 90, 225, 21, 249, 211, 155, 228, 70, ); @@ -670,7 +689,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_mask_popcnt_epi8() { + const fn test_mm_mask_popcnt_epi8() { let test_data = _mm_set_epi8( 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 90, 225, 21, 249, 211, 155, 228, 70, ); @@ -682,7 +701,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_bitshuffle_epi64_mask() { + fn test_mm512_bitshuffle_epi64_mask() { let test_indices = _mm512_set_epi8( 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0, 8, 8, 56, 48, 40, 32, 24, 16, 8, 0, 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, @@ -712,7 +731,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f")] - unsafe fn test_mm512_mask_bitshuffle_epi64_mask() { + fn test_mm512_mask_bitshuffle_epi64_mask() { let test_indices = _mm512_set_epi8( 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0, 8, 8, 56, 48, 40, 32, 24, 16, 8, 0, 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, @@ -743,7 +762,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_bitshuffle_epi64_mask() { + fn test_mm256_bitshuffle_epi64_mask() { let test_indices = _mm256_set_epi8( 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0, 8, 8, 56, 48, 40, 32, 24, 16, 8, 0, @@ -761,7 +780,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm256_mask_bitshuffle_epi64_mask() { + fn test_mm256_mask_bitshuffle_epi64_mask() { let test_indices = _mm256_set_epi8( 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, 32, 32, 16, 16, 0, 0, 8, 8, 56, 48, 40, 32, 24, 16, 8, 0, @@ -780,7 +799,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_bitshuffle_epi64_mask() { + fn test_mm_bitshuffle_epi64_mask() { let test_indices = _mm_set_epi8( 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, ); @@ -792,7 +811,7 @@ mod tests { } #[simd_test(enable = "avx512bitalg,avx512f,avx512vl")] - unsafe fn test_mm_mask_bitshuffle_epi64_mask() { + fn test_mm_mask_bitshuffle_epi64_mask() { let test_indices = _mm_set_epi8( 63, 62, 61, 60, 59, 58, 57, 56, 63, 62, 61, 60, 59, 58, 57, 56, ); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512bw.rs b/library/stdarch/crates/core_arch/src/x86/avx512bw.rs index 0e2dd3ad4068..6b4b88621efd 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512bw.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512bw.rs @@ -14,7 +14,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm512_abs_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_epi16(a: __m512i) -> __m512i { unsafe { let a = a.as_i16x32(); let cmp: i16x32 = simd_gt(a, i16x32::ZERO); @@ -29,7 +30,8 @@ pub fn _mm512_abs_epi16(a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm512_mask_abs_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_abs_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, abs, src.as_i16x32())) @@ -43,7 +45,8 @@ pub fn _mm512_mask_abs_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm512_maskz_abs_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_abs_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, abs, i16x32::ZERO)) @@ -57,7 +60,8 @@ pub fn _mm512_maskz_abs_epi16(k: __mmask32, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm256_mask_abs_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_abs_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, abs, src.as_i16x16())) @@ -71,7 +75,8 @@ pub fn _mm256_mask_abs_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm256_maskz_abs_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_abs_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, abs, i16x16::ZERO)) @@ -85,7 +90,8 @@ pub fn _mm256_maskz_abs_epi16(k: __mmask16, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm_mask_abs_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_abs_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, abs, src.as_i16x8())) @@ -99,7 +105,8 @@ pub fn _mm_mask_abs_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsw))] -pub fn _mm_maskz_abs_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_abs_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, abs, i16x8::ZERO)) @@ -113,7 +120,8 @@ pub fn _mm_maskz_abs_epi16(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm512_abs_epi8(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_epi8(a: __m512i) -> __m512i { unsafe { let a = a.as_i8x64(); let cmp: i8x64 = simd_gt(a, i8x64::ZERO); @@ -128,7 +136,8 @@ pub fn _mm512_abs_epi8(a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm512_mask_abs_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_abs_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi8(a).as_i8x64(); transmute(simd_select_bitmask(k, abs, src.as_i8x64())) @@ -142,7 +151,8 @@ pub fn _mm512_mask_abs_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm512_maskz_abs_epi8(k: __mmask64, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_abs_epi8(k: __mmask64, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi8(a).as_i8x64(); transmute(simd_select_bitmask(k, abs, i8x64::ZERO)) @@ -156,7 +166,8 @@ pub fn _mm512_maskz_abs_epi8(k: __mmask64, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm256_mask_abs_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_abs_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, abs, src.as_i8x32())) @@ -170,7 +181,8 @@ pub fn _mm256_mask_abs_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm256_maskz_abs_epi8(k: __mmask32, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_abs_epi8(k: __mmask32, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, abs, i8x32::ZERO)) @@ -184,7 +196,8 @@ pub fn _mm256_maskz_abs_epi8(k: __mmask32, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm_mask_abs_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_abs_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, abs, src.as_i8x16())) @@ -198,7 +211,8 @@ pub fn _mm_mask_abs_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsb))] -pub fn _mm_maskz_abs_epi8(k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_abs_epi8(k: __mmask16, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, abs, i8x16::ZERO)) @@ -212,7 +226,8 @@ pub fn _mm_maskz_abs_epi8(k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm512_add_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_add(a.as_i16x32(), b.as_i16x32())) } } @@ -223,7 +238,8 @@ pub fn _mm512_add_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm512_mask_add_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, add, src.as_i16x32())) @@ -237,7 +253,8 @@ pub fn _mm512_mask_add_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm512_maskz_add_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, add, i16x32::ZERO)) @@ -251,7 +268,8 @@ pub fn _mm512_maskz_add_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm256_mask_add_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, add, src.as_i16x16())) @@ -265,7 +283,8 @@ pub fn _mm256_mask_add_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm256_maskz_add_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, add, i16x16::ZERO)) @@ -279,7 +298,8 @@ pub fn _mm256_maskz_add_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm_mask_add_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, add, src.as_i16x8())) @@ -293,7 +313,8 @@ pub fn _mm_mask_add_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddw))] -pub fn _mm_maskz_add_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, add, i16x8::ZERO)) @@ -307,7 +328,8 @@ pub fn _mm_maskz_add_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm512_add_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_epi8(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_add(a.as_i8x64(), b.as_i8x64())) } } @@ -318,7 +340,8 @@ pub fn _mm512_add_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm512_mask_add_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, add, src.as_i8x64())) @@ -332,7 +355,8 @@ pub fn _mm512_mask_add_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm512_maskz_add_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, add, i8x64::ZERO)) @@ -346,7 +370,8 @@ pub fn _mm512_maskz_add_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm256_mask_add_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, add, src.as_i8x32())) @@ -360,7 +385,8 @@ pub fn _mm256_mask_add_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm256_maskz_add_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, add, i8x32::ZERO)) @@ -374,7 +400,8 @@ pub fn _mm256_maskz_add_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm_mask_add_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, add, src.as_i8x16())) @@ -388,7 +415,8 @@ pub fn _mm_mask_add_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddb))] -pub fn _mm_maskz_add_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, add, i8x16::ZERO)) @@ -402,7 +430,8 @@ pub fn _mm_maskz_add_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm512_adds_epu16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_adds_epu16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_add(a.as_u16x32(), b.as_u16x32())) } } @@ -413,7 +442,8 @@ pub fn _mm512_adds_epu16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm512_mask_adds_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_adds_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, add, src.as_u16x32())) @@ -427,7 +457,8 @@ pub fn _mm512_mask_adds_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm512_maskz_adds_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_adds_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, add, u16x32::ZERO)) @@ -441,7 +472,8 @@ pub fn _mm512_maskz_adds_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm256_mask_adds_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_adds_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, add, src.as_u16x16())) @@ -455,7 +487,8 @@ pub fn _mm256_mask_adds_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm256_maskz_adds_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_adds_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, add, u16x16::ZERO)) @@ -469,7 +502,8 @@ pub fn _mm256_maskz_adds_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm_mask_adds_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_adds_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, add, src.as_u16x8())) @@ -483,7 +517,8 @@ pub fn _mm_mask_adds_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusw))] -pub fn _mm_maskz_adds_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_adds_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, add, u16x8::ZERO)) @@ -497,7 +532,8 @@ pub fn _mm_maskz_adds_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm512_adds_epu8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_adds_epu8(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_add(a.as_u8x64(), b.as_u8x64())) } } @@ -508,7 +544,8 @@ pub fn _mm512_adds_epu8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm512_mask_adds_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_adds_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, add, src.as_u8x64())) @@ -522,7 +559,8 @@ pub fn _mm512_mask_adds_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm512_maskz_adds_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_adds_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, add, u8x64::ZERO)) @@ -536,7 +574,8 @@ pub fn _mm512_maskz_adds_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm256_mask_adds_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_adds_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, add, src.as_u8x32())) @@ -550,7 +589,8 @@ pub fn _mm256_mask_adds_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm256_maskz_adds_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_adds_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, add, u8x32::ZERO)) @@ -564,7 +604,8 @@ pub fn _mm256_maskz_adds_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm_mask_adds_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_adds_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, add, src.as_u8x16())) @@ -578,7 +619,8 @@ pub fn _mm_mask_adds_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddusb))] -pub fn _mm_maskz_adds_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_adds_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, add, u8x16::ZERO)) @@ -592,7 +634,8 @@ pub fn _mm_maskz_adds_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm512_adds_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_adds_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_add(a.as_i16x32(), b.as_i16x32())) } } @@ -603,7 +646,8 @@ pub fn _mm512_adds_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm512_mask_adds_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_adds_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, add, src.as_i16x32())) @@ -617,7 +661,8 @@ pub fn _mm512_mask_adds_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm512_maskz_adds_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_adds_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, add, i16x32::ZERO)) @@ -631,7 +676,8 @@ pub fn _mm512_maskz_adds_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm256_mask_adds_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_adds_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, add, src.as_i16x16())) @@ -645,7 +691,8 @@ pub fn _mm256_mask_adds_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm256_maskz_adds_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_adds_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, add, i16x16::ZERO)) @@ -659,7 +706,8 @@ pub fn _mm256_maskz_adds_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm_mask_adds_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_adds_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, add, src.as_i16x8())) @@ -673,7 +721,8 @@ pub fn _mm_mask_adds_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsw))] -pub fn _mm_maskz_adds_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_adds_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, add, i16x8::ZERO)) @@ -687,7 +736,8 @@ pub fn _mm_maskz_adds_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm512_adds_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_adds_epi8(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_add(a.as_i8x64(), b.as_i8x64())) } } @@ -698,7 +748,8 @@ pub fn _mm512_adds_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm512_mask_adds_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_adds_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, add, src.as_i8x64())) @@ -712,7 +763,8 @@ pub fn _mm512_mask_adds_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm512_maskz_adds_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_adds_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_adds_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, add, i8x64::ZERO)) @@ -726,7 +778,8 @@ pub fn _mm512_maskz_adds_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm256_mask_adds_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_adds_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, add, src.as_i8x32())) @@ -740,7 +793,8 @@ pub fn _mm256_mask_adds_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm256_maskz_adds_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_adds_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_adds_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, add, i8x32::ZERO)) @@ -754,7 +808,8 @@ pub fn _mm256_maskz_adds_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm_mask_adds_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_adds_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, add, src.as_i8x16())) @@ -768,7 +823,8 @@ pub fn _mm_mask_adds_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddsb))] -pub fn _mm_maskz_adds_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_adds_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_adds_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, add, i8x16::ZERO)) @@ -782,7 +838,8 @@ pub fn _mm_maskz_adds_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm512_sub_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_sub(a.as_i16x32(), b.as_i16x32())) } } @@ -793,7 +850,8 @@ pub fn _mm512_sub_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm512_mask_sub_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, sub, src.as_i16x32())) @@ -807,7 +865,8 @@ pub fn _mm512_mask_sub_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm512_maskz_sub_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, sub, i16x32::ZERO)) @@ -821,7 +880,8 @@ pub fn _mm512_maskz_sub_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm256_mask_sub_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, sub, src.as_i16x16())) @@ -835,7 +895,8 @@ pub fn _mm256_mask_sub_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm256_maskz_sub_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, sub, i16x16::ZERO)) @@ -849,7 +910,8 @@ pub fn _mm256_maskz_sub_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm_mask_sub_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, sub, src.as_i16x8())) @@ -863,7 +925,8 @@ pub fn _mm_mask_sub_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubw))] -pub fn _mm_maskz_sub_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, sub, i16x8::ZERO)) @@ -877,7 +940,8 @@ pub fn _mm_maskz_sub_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm512_sub_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_epi8(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_sub(a.as_i8x64(), b.as_i8x64())) } } @@ -888,7 +952,8 @@ pub fn _mm512_sub_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm512_mask_sub_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, sub, src.as_i8x64())) @@ -902,7 +967,8 @@ pub fn _mm512_mask_sub_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm512_maskz_sub_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, sub, i8x64::ZERO)) @@ -916,7 +982,8 @@ pub fn _mm512_maskz_sub_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm256_mask_sub_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, sub, src.as_i8x32())) @@ -930,7 +997,8 @@ pub fn _mm256_mask_sub_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm256_maskz_sub_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, sub, i8x32::ZERO)) @@ -944,7 +1012,8 @@ pub fn _mm256_maskz_sub_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm_mask_sub_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, sub, src.as_i8x16())) @@ -958,7 +1027,8 @@ pub fn _mm_mask_sub_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubb))] -pub fn _mm_maskz_sub_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, sub, i8x16::ZERO)) @@ -972,7 +1042,8 @@ pub fn _mm_maskz_sub_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm512_subs_epu16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_subs_epu16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_sub(a.as_u16x32(), b.as_u16x32())) } } @@ -983,7 +1054,8 @@ pub fn _mm512_subs_epu16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm512_mask_subs_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_subs_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, sub, src.as_u16x32())) @@ -997,7 +1069,8 @@ pub fn _mm512_mask_subs_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm512_maskz_subs_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_subs_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, sub, u16x32::ZERO)) @@ -1011,7 +1084,8 @@ pub fn _mm512_maskz_subs_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm256_mask_subs_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_subs_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, sub, src.as_u16x16())) @@ -1025,7 +1099,8 @@ pub fn _mm256_mask_subs_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm256_maskz_subs_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_subs_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, sub, u16x16::ZERO)) @@ -1039,7 +1114,8 @@ pub fn _mm256_maskz_subs_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm_mask_subs_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_subs_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, sub, src.as_u16x8())) @@ -1053,7 +1129,8 @@ pub fn _mm_mask_subs_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusw))] -pub fn _mm_maskz_subs_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_subs_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, sub, u16x8::ZERO)) @@ -1067,7 +1144,8 @@ pub fn _mm_maskz_subs_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm512_subs_epu8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_subs_epu8(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_sub(a.as_u8x64(), b.as_u8x64())) } } @@ -1078,7 +1156,8 @@ pub fn _mm512_subs_epu8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm512_mask_subs_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_subs_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, sub, src.as_u8x64())) @@ -1092,7 +1171,8 @@ pub fn _mm512_mask_subs_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm512_maskz_subs_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_subs_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, sub, u8x64::ZERO)) @@ -1106,7 +1186,8 @@ pub fn _mm512_maskz_subs_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm256_mask_subs_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_subs_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, sub, src.as_u8x32())) @@ -1120,7 +1201,8 @@ pub fn _mm256_mask_subs_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm256_maskz_subs_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_subs_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, sub, u8x32::ZERO)) @@ -1134,7 +1216,8 @@ pub fn _mm256_maskz_subs_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm_mask_subs_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_subs_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, sub, src.as_u8x16())) @@ -1148,7 +1231,8 @@ pub fn _mm_mask_subs_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubusb))] -pub fn _mm_maskz_subs_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_subs_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, sub, u8x16::ZERO)) @@ -1162,7 +1246,8 @@ pub fn _mm_maskz_subs_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm512_subs_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_subs_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_sub(a.as_i16x32(), b.as_i16x32())) } } @@ -1173,7 +1258,8 @@ pub fn _mm512_subs_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm512_mask_subs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_subs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, sub, src.as_i16x32())) @@ -1187,7 +1273,8 @@ pub fn _mm512_mask_subs_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm512_maskz_subs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_subs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, sub, i16x32::ZERO)) @@ -1201,7 +1288,8 @@ pub fn _mm512_maskz_subs_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm256_mask_subs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_subs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, sub, src.as_i16x16())) @@ -1215,7 +1303,8 @@ pub fn _mm256_mask_subs_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm256_maskz_subs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_subs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, sub, i16x16::ZERO)) @@ -1229,7 +1318,8 @@ pub fn _mm256_maskz_subs_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm_mask_subs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_subs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, sub, src.as_i16x8())) @@ -1243,7 +1333,8 @@ pub fn _mm_mask_subs_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsw))] -pub fn _mm_maskz_subs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_subs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, sub, i16x8::ZERO)) @@ -1257,7 +1348,8 @@ pub fn _mm_maskz_subs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm512_subs_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_subs_epi8(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_saturating_sub(a.as_i8x64(), b.as_i8x64())) } } @@ -1268,7 +1360,8 @@ pub fn _mm512_subs_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm512_mask_subs_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_subs_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, sub, src.as_i8x64())) @@ -1282,7 +1375,8 @@ pub fn _mm512_mask_subs_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm512_maskz_subs_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_subs_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_subs_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, sub, i8x64::ZERO)) @@ -1296,7 +1390,8 @@ pub fn _mm512_maskz_subs_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm256_mask_subs_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_subs_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, sub, src.as_i8x32())) @@ -1310,7 +1405,8 @@ pub fn _mm256_mask_subs_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm256_maskz_subs_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_subs_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_subs_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, sub, i8x32::ZERO)) @@ -1324,7 +1420,8 @@ pub fn _mm256_maskz_subs_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm_mask_subs_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_subs_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, sub, src.as_i8x16())) @@ -1338,7 +1435,8 @@ pub fn _mm_mask_subs_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubsb))] -pub fn _mm_maskz_subs_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_subs_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_subs_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, sub, i8x16::ZERO)) @@ -1352,7 +1450,8 @@ pub fn _mm_maskz_subs_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = simd_cast::<_, u32x32>(a.as_u16x32()); let b = simd_cast::<_, u32x32>(b.as_u16x32()); @@ -1368,7 +1467,13 @@ pub fn _mm512_mulhi_epu16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm512_mask_mulhi_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mulhi_epu16( + src: __m512i, + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let mul = _mm512_mulhi_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, mul, src.as_u16x32())) @@ -1382,7 +1487,8 @@ pub fn _mm512_mask_mulhi_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm512_maskz_mulhi_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mulhi_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mulhi_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, mul, u16x32::ZERO)) @@ -1396,7 +1502,13 @@ pub fn _mm512_maskz_mulhi_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm256_mask_mulhi_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mulhi_epu16( + src: __m256i, + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let mul = _mm256_mulhi_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, mul, src.as_u16x16())) @@ -1410,7 +1522,8 @@ pub fn _mm256_mask_mulhi_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm256_maskz_mulhi_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mulhi_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mulhi_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, mul, u16x16::ZERO)) @@ -1424,7 +1537,8 @@ pub fn _mm256_maskz_mulhi_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm_mask_mulhi_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mulhi_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mulhi_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, mul, src.as_u16x8())) @@ -1438,7 +1552,8 @@ pub fn _mm_mask_mulhi_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhuw))] -pub fn _mm_maskz_mulhi_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mulhi_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mulhi_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, mul, u16x8::ZERO)) @@ -1452,7 +1567,8 @@ pub fn _mm_maskz_mulhi_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = simd_cast::<_, i32x32>(a.as_i16x32()); let b = simd_cast::<_, i32x32>(b.as_i16x32()); @@ -1468,7 +1584,13 @@ pub fn _mm512_mulhi_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm512_mask_mulhi_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mulhi_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let mul = _mm512_mulhi_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, mul, src.as_i16x32())) @@ -1482,7 +1604,8 @@ pub fn _mm512_mask_mulhi_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm512_maskz_mulhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mulhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mulhi_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, mul, i16x32::ZERO)) @@ -1496,7 +1619,13 @@ pub fn _mm512_maskz_mulhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm256_mask_mulhi_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mulhi_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let mul = _mm256_mulhi_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, mul, src.as_i16x16())) @@ -1510,7 +1639,8 @@ pub fn _mm256_mask_mulhi_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm256_maskz_mulhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mulhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mulhi_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, mul, i16x16::ZERO)) @@ -1524,7 +1654,8 @@ pub fn _mm256_maskz_mulhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm_mask_mulhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mulhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mulhi_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, mul, src.as_i16x8())) @@ -1538,7 +1669,8 @@ pub fn _mm_mask_mulhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulhw))] -pub fn _mm_maskz_mulhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mulhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mulhi_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, mul, i16x8::ZERO)) @@ -1647,7 +1779,8 @@ pub fn _mm_maskz_mulhrs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm512_mullo_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mullo_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_mul(a.as_i16x32(), b.as_i16x32())) } } @@ -1658,7 +1791,13 @@ pub fn _mm512_mullo_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm512_mask_mullo_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mullo_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let mul = _mm512_mullo_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, mul, src.as_i16x32())) @@ -1672,7 +1811,8 @@ pub fn _mm512_mask_mullo_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm512_maskz_mullo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mullo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mullo_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, mul, i16x32::ZERO)) @@ -1686,7 +1826,13 @@ pub fn _mm512_maskz_mullo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm256_mask_mullo_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mullo_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let mul = _mm256_mullo_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, mul, src.as_i16x16())) @@ -1700,7 +1846,8 @@ pub fn _mm256_mask_mullo_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm256_maskz_mullo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mullo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mullo_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, mul, i16x16::ZERO)) @@ -1714,7 +1861,8 @@ pub fn _mm256_maskz_mullo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm_mask_mullo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mullo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mullo_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, mul, src.as_i16x8())) @@ -1728,7 +1876,8 @@ pub fn _mm_mask_mullo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmullw))] -pub fn _mm_maskz_mullo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mullo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mullo_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, mul, i16x8::ZERO)) @@ -1742,12 +1891,9 @@ pub fn _mm_maskz_mullo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u16x32(); - let b = b.as_u16x32(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_u16x32(), b.as_u16x32()).as_m512i() } } /// Compare packed unsigned 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -1757,7 +1903,8 @@ pub fn _mm512_max_epu16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm512_mask_max_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, max, src.as_u16x32())) @@ -1771,7 +1918,8 @@ pub fn _mm512_mask_max_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm512_maskz_max_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, max, u16x32::ZERO)) @@ -1785,7 +1933,8 @@ pub fn _mm512_maskz_max_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm256_mask_max_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, max, src.as_u16x16())) @@ -1799,7 +1948,8 @@ pub fn _mm256_mask_max_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm256_maskz_max_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, max, u16x16::ZERO)) @@ -1813,7 +1963,8 @@ pub fn _mm256_maskz_max_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm_mask_max_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, max, src.as_u16x8())) @@ -1827,7 +1978,8 @@ pub fn _mm_mask_max_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuw))] -pub fn _mm_maskz_max_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, max, u16x8::ZERO)) @@ -1841,12 +1993,9 @@ pub fn _mm_maskz_max_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u8x64(); - let b = b.as_u8x64(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_u8x64(), b.as_u8x64()).as_m512i() } } /// Compare packed unsigned 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -1856,7 +2005,8 @@ pub fn _mm512_max_epu8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm512_mask_max_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, max, src.as_u8x64())) @@ -1870,7 +2020,8 @@ pub fn _mm512_mask_max_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm512_maskz_max_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, max, u8x64::ZERO)) @@ -1884,7 +2035,8 @@ pub fn _mm512_maskz_max_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm256_mask_max_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, max, src.as_u8x32())) @@ -1898,7 +2050,8 @@ pub fn _mm256_mask_max_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm256_maskz_max_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, max, u8x32::ZERO)) @@ -1912,7 +2065,8 @@ pub fn _mm256_maskz_max_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm_mask_max_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, max, src.as_u8x16())) @@ -1926,7 +2080,8 @@ pub fn _mm_mask_max_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxub))] -pub fn _mm_maskz_max_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, max, u8x16::ZERO)) @@ -1940,12 +2095,9 @@ pub fn _mm_maskz_max_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i16x32(); - let b = b.as_i16x32(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_i16x32(), b.as_i16x32()).as_m512i() } } /// Compare packed signed 16-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -1955,7 +2107,8 @@ pub fn _mm512_max_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm512_mask_max_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, max, src.as_i16x32())) @@ -1969,7 +2122,8 @@ pub fn _mm512_mask_max_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm512_maskz_max_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, max, i16x32::ZERO)) @@ -1983,7 +2137,8 @@ pub fn _mm512_maskz_max_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm256_mask_max_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, max, src.as_i16x16())) @@ -1997,7 +2152,8 @@ pub fn _mm256_mask_max_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm256_maskz_max_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, max, i16x16::ZERO)) @@ -2011,7 +2167,8 @@ pub fn _mm256_maskz_max_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm_mask_max_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, max, src.as_i16x8())) @@ -2025,7 +2182,8 @@ pub fn _mm_mask_max_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsw))] -pub fn _mm_maskz_max_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, max, i16x8::ZERO)) @@ -2039,12 +2197,9 @@ pub fn _mm_maskz_max_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i8x64(); - let b = b.as_i8x64(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_i8x64(), b.as_i8x64()).as_m512i() } } /// Compare packed signed 8-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2054,7 +2209,8 @@ pub fn _mm512_max_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm512_mask_max_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, max, src.as_i8x64())) @@ -2068,7 +2224,8 @@ pub fn _mm512_mask_max_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm512_maskz_max_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, max, i8x64::ZERO)) @@ -2082,7 +2239,8 @@ pub fn _mm512_maskz_max_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm256_mask_max_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, max, src.as_i8x32())) @@ -2096,7 +2254,8 @@ pub fn _mm256_mask_max_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm256_maskz_max_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, max, i8x32::ZERO)) @@ -2110,7 +2269,8 @@ pub fn _mm256_maskz_max_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm_mask_max_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, max, src.as_i8x16())) @@ -2124,7 +2284,8 @@ pub fn _mm_mask_max_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsb))] -pub fn _mm_maskz_max_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, max, i8x16::ZERO)) @@ -2138,12 +2299,9 @@ pub fn _mm_maskz_max_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u16x32(); - let b = b.as_u16x32(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_u16x32(), b.as_u16x32()).as_m512i() } } /// Compare packed unsigned 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2153,7 +2311,8 @@ pub fn _mm512_min_epu16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm512_mask_min_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, min, src.as_u16x32())) @@ -2167,7 +2326,8 @@ pub fn _mm512_mask_min_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm512_maskz_min_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, min, u16x32::ZERO)) @@ -2181,7 +2341,8 @@ pub fn _mm512_maskz_min_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm256_mask_min_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, min, src.as_u16x16())) @@ -2195,7 +2356,8 @@ pub fn _mm256_mask_min_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm256_maskz_min_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, min, u16x16::ZERO)) @@ -2209,7 +2371,8 @@ pub fn _mm256_maskz_min_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm_mask_min_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, min, src.as_u16x8())) @@ -2223,7 +2386,8 @@ pub fn _mm_mask_min_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuw))] -pub fn _mm_maskz_min_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, min, u16x8::ZERO)) @@ -2237,12 +2401,9 @@ pub fn _mm_maskz_min_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u8x64(); - let b = b.as_u8x64(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_u8x64(), b.as_u8x64()).as_m512i() } } /// Compare packed unsigned 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2252,7 +2413,8 @@ pub fn _mm512_min_epu8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm512_mask_min_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, min, src.as_u8x64())) @@ -2266,7 +2428,8 @@ pub fn _mm512_mask_min_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm512_maskz_min_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, min, u8x64::ZERO)) @@ -2280,7 +2443,8 @@ pub fn _mm512_maskz_min_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm256_mask_min_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, min, src.as_u8x32())) @@ -2294,7 +2458,8 @@ pub fn _mm256_mask_min_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm256_maskz_min_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, min, u8x32::ZERO)) @@ -2308,7 +2473,8 @@ pub fn _mm256_maskz_min_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm_mask_min_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, min, src.as_u8x16())) @@ -2322,7 +2488,8 @@ pub fn _mm_mask_min_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminub))] -pub fn _mm_maskz_min_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, min, u8x16::ZERO)) @@ -2336,12 +2503,9 @@ pub fn _mm_maskz_min_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i16x32(); - let b = b.as_i16x32(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_i16x32(), b.as_i16x32()).as_m512i() } } /// Compare packed signed 16-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2351,7 +2515,8 @@ pub fn _mm512_min_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm512_mask_min_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, min, src.as_i16x32())) @@ -2365,7 +2530,8 @@ pub fn _mm512_mask_min_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm512_maskz_min_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, min, i16x32::ZERO)) @@ -2379,7 +2545,8 @@ pub fn _mm512_maskz_min_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm256_mask_min_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, min, src.as_i16x16())) @@ -2393,7 +2560,8 @@ pub fn _mm256_mask_min_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm256_maskz_min_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, min, i16x16::ZERO)) @@ -2407,7 +2575,8 @@ pub fn _mm256_maskz_min_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm_mask_min_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, min, src.as_i16x8())) @@ -2421,7 +2590,8 @@ pub fn _mm_mask_min_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsw))] -pub fn _mm_maskz_min_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, min, i16x8::ZERO)) @@ -2435,12 +2605,9 @@ pub fn _mm_maskz_min_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i8x64(); - let b = b.as_i8x64(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_i8x64(), b.as_i8x64()).as_m512i() } } /// Compare packed signed 8-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2450,7 +2617,8 @@ pub fn _mm512_min_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm512_mask_min_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, min, src.as_i8x64())) @@ -2464,7 +2632,8 @@ pub fn _mm512_mask_min_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm512_maskz_min_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, min, i8x64::ZERO)) @@ -2478,7 +2647,8 @@ pub fn _mm512_maskz_min_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm256_mask_min_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, min, src.as_i8x32())) @@ -2492,7 +2662,8 @@ pub fn _mm256_mask_min_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm256_maskz_min_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, min, i8x32::ZERO)) @@ -2506,7 +2677,8 @@ pub fn _mm256_maskz_min_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm_mask_min_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, min, src.as_i8x16())) @@ -2520,7 +2692,8 @@ pub fn _mm_mask_min_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsb))] -pub fn _mm_maskz_min_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, min, i8x16::ZERO)) @@ -2534,7 +2707,8 @@ pub fn _mm_maskz_min_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmplt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_lt(a.as_u16x32(), b.as_u16x32())) } } @@ -2545,7 +2719,8 @@ pub fn _mm512_cmplt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2556,7 +2731,8 @@ pub fn _mm512_mask_cmplt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmplt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_lt(a.as_u16x16(), b.as_u16x16())) } } @@ -2567,7 +2743,8 @@ pub fn _mm256_cmplt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2578,7 +2755,8 @@ pub fn _mm256_mask_cmplt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmplt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_lt(a.as_u16x8(), b.as_u16x8())) } } @@ -2589,7 +2767,8 @@ pub fn _mm_cmplt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2600,7 +2779,8 @@ pub fn _mm_mask_cmplt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmplt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_lt(a.as_u8x64(), b.as_u8x64())) } } @@ -2611,7 +2791,8 @@ pub fn _mm512_cmplt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2622,7 +2803,8 @@ pub fn _mm512_mask_cmplt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmplt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_lt(a.as_u8x32(), b.as_u8x32())) } } @@ -2633,7 +2815,8 @@ pub fn _mm256_cmplt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2644,7 +2827,8 @@ pub fn _mm256_mask_cmplt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmplt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_lt(a.as_u8x16(), b.as_u8x16())) } } @@ -2655,7 +2839,8 @@ pub fn _mm_cmplt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2666,7 +2851,8 @@ pub fn _mm_mask_cmplt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmplt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_lt(a.as_i16x32(), b.as_i16x32())) } } @@ -2677,7 +2863,8 @@ pub fn _mm512_cmplt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2688,7 +2875,8 @@ pub fn _mm512_mask_cmplt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmplt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_lt(a.as_i16x16(), b.as_i16x16())) } } @@ -2699,7 +2887,8 @@ pub fn _mm256_cmplt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2710,7 +2899,8 @@ pub fn _mm256_mask_cmplt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmplt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_lt(a.as_i16x8(), b.as_i16x8())) } } @@ -2721,7 +2911,8 @@ pub fn _mm_cmplt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2732,7 +2923,8 @@ pub fn _mm_mask_cmplt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmplt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_lt(a.as_i8x64(), b.as_i8x64())) } } @@ -2743,7 +2935,8 @@ pub fn _mm512_cmplt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2754,7 +2947,8 @@ pub fn _mm512_mask_cmplt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmplt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_lt(a.as_i8x32(), b.as_i8x32())) } } @@ -2765,7 +2959,8 @@ pub fn _mm256_cmplt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2776,7 +2971,8 @@ pub fn _mm256_mask_cmplt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmplt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_lt(a.as_i8x16(), b.as_i8x16())) } } @@ -2787,7 +2983,8 @@ pub fn _mm_cmplt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -2798,7 +2995,8 @@ pub fn _mm_mask_cmplt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpgt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_gt(a.as_u16x32(), b.as_u16x32())) } } @@ -2809,7 +3007,8 @@ pub fn _mm512_cmpgt_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2820,7 +3019,8 @@ pub fn _mm512_mask_cmpgt_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpgt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_gt(a.as_u16x16(), b.as_u16x16())) } } @@ -2831,7 +3031,8 @@ pub fn _mm256_cmpgt_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2842,7 +3043,8 @@ pub fn _mm256_mask_cmpgt_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpgt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_gt(a.as_u16x8(), b.as_u16x8())) } } @@ -2853,7 +3055,8 @@ pub fn _mm_cmpgt_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2864,7 +3067,8 @@ pub fn _mm_mask_cmpgt_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpgt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_gt(a.as_u8x64(), b.as_u8x64())) } } @@ -2875,7 +3079,8 @@ pub fn _mm512_cmpgt_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2886,7 +3091,8 @@ pub fn _mm512_mask_cmpgt_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpgt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_gt(a.as_u8x32(), b.as_u8x32())) } } @@ -2897,7 +3103,8 @@ pub fn _mm256_cmpgt_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2908,7 +3115,8 @@ pub fn _mm256_mask_cmpgt_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpgt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_gt(a.as_u8x16(), b.as_u8x16())) } } @@ -2919,7 +3127,8 @@ pub fn _mm_cmpgt_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2930,7 +3139,8 @@ pub fn _mm_mask_cmpgt_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpgt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_gt(a.as_i16x32(), b.as_i16x32())) } } @@ -2941,7 +3151,8 @@ pub fn _mm512_cmpgt_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2952,7 +3163,8 @@ pub fn _mm512_mask_cmpgt_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpgt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_gt(a.as_i16x16(), b.as_i16x16())) } } @@ -2963,7 +3175,8 @@ pub fn _mm256_cmpgt_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2974,7 +3187,8 @@ pub fn _mm256_mask_cmpgt_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpgt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_gt(a.as_i16x8(), b.as_i16x8())) } } @@ -2985,7 +3199,8 @@ pub fn _mm_cmpgt_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -2996,7 +3211,8 @@ pub fn _mm_mask_cmpgt_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpgt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_gt(a.as_i8x64(), b.as_i8x64())) } } @@ -3007,7 +3223,8 @@ pub fn _mm512_cmpgt_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -3018,7 +3235,8 @@ pub fn _mm512_mask_cmpgt_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpgt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_gt(a.as_i8x32(), b.as_i8x32())) } } @@ -3029,7 +3247,8 @@ pub fn _mm256_cmpgt_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -3040,7 +3259,8 @@ pub fn _mm256_mask_cmpgt_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpgt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_gt(a.as_i8x16(), b.as_i8x16())) } } @@ -3051,7 +3271,8 @@ pub fn _mm_cmpgt_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -3062,7 +3283,8 @@ pub fn _mm_mask_cmpgt_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmple_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_le(a.as_u16x32(), b.as_u16x32())) } } @@ -3073,7 +3295,8 @@ pub fn _mm512_cmple_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3084,7 +3307,8 @@ pub fn _mm512_mask_cmple_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmple_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_le(a.as_u16x16(), b.as_u16x16())) } } @@ -3095,7 +3319,8 @@ pub fn _mm256_cmple_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3106,7 +3331,8 @@ pub fn _mm256_mask_cmple_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmple_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_le(a.as_u16x8(), b.as_u16x8())) } } @@ -3117,7 +3343,8 @@ pub fn _mm_cmple_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu16_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3128,7 +3355,8 @@ pub fn _mm_mask_cmple_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmple_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_le(a.as_u8x64(), b.as_u8x64())) } } @@ -3139,7 +3367,8 @@ pub fn _mm512_cmple_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3150,7 +3379,8 @@ pub fn _mm512_mask_cmple_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmple_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_le(a.as_u8x32(), b.as_u8x32())) } } @@ -3161,7 +3391,8 @@ pub fn _mm256_cmple_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3172,7 +3403,8 @@ pub fn _mm256_mask_cmple_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmple_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_le(a.as_u8x16(), b.as_u8x16())) } } @@ -3183,7 +3415,8 @@ pub fn _mm_cmple_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epu8_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3194,7 +3427,8 @@ pub fn _mm_mask_cmple_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmple_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_le(a.as_i16x32(), b.as_i16x32())) } } @@ -3205,7 +3439,8 @@ pub fn _mm512_cmple_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3216,7 +3451,8 @@ pub fn _mm512_mask_cmple_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmple_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_le(a.as_i16x16(), b.as_i16x16())) } } @@ -3227,7 +3463,8 @@ pub fn _mm256_cmple_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3238,7 +3475,8 @@ pub fn _mm256_mask_cmple_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmple_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_le(a.as_i16x8(), b.as_i16x8())) } } @@ -3249,7 +3487,8 @@ pub fn _mm_cmple_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi16_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3260,7 +3499,8 @@ pub fn _mm_mask_cmple_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmple_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_le(a.as_i8x64(), b.as_i8x64())) } } @@ -3271,7 +3511,8 @@ pub fn _mm512_cmple_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3282,7 +3523,8 @@ pub fn _mm512_mask_cmple_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmple_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_le(a.as_i8x32(), b.as_i8x32())) } } @@ -3293,7 +3535,8 @@ pub fn _mm256_cmple_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3304,7 +3547,8 @@ pub fn _mm256_mask_cmple_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmple_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_le(a.as_i8x16(), b.as_i8x16())) } } @@ -3315,7 +3559,8 @@ pub fn _mm_cmple_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epi8_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -3326,7 +3571,8 @@ pub fn _mm_mask_cmple_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpge_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_ge(a.as_u16x32(), b.as_u16x32())) } } @@ -3337,7 +3583,8 @@ pub fn _mm512_cmpge_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3348,7 +3595,8 @@ pub fn _mm512_mask_cmpge_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpge_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_ge(a.as_u16x16(), b.as_u16x16())) } } @@ -3359,7 +3607,8 @@ pub fn _mm256_cmpge_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3370,7 +3619,8 @@ pub fn _mm256_mask_cmpge_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpge_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ge(a.as_u16x8(), b.as_u16x8())) } } @@ -3381,7 +3631,8 @@ pub fn _mm_cmpge_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3392,7 +3643,8 @@ pub fn _mm_mask_cmpge_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpge_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_ge(a.as_u8x64(), b.as_u8x64())) } } @@ -3403,7 +3655,8 @@ pub fn _mm512_cmpge_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3414,7 +3667,8 @@ pub fn _mm512_mask_cmpge_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpge_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_ge(a.as_u8x32(), b.as_u8x32())) } } @@ -3425,7 +3679,8 @@ pub fn _mm256_cmpge_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3436,7 +3691,8 @@ pub fn _mm256_mask_cmpge_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpge_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_ge(a.as_u8x16(), b.as_u8x16())) } } @@ -3447,7 +3703,8 @@ pub fn _mm_cmpge_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3458,7 +3715,8 @@ pub fn _mm_mask_cmpge_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpge_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_ge(a.as_i16x32(), b.as_i16x32())) } } @@ -3469,7 +3727,8 @@ pub fn _mm512_cmpge_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3480,7 +3739,8 @@ pub fn _mm512_mask_cmpge_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpge_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_ge(a.as_i16x16(), b.as_i16x16())) } } @@ -3491,7 +3751,8 @@ pub fn _mm256_cmpge_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3502,7 +3763,8 @@ pub fn _mm256_mask_cmpge_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpge_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ge(a.as_i16x8(), b.as_i16x8())) } } @@ -3513,7 +3775,8 @@ pub fn _mm_cmpge_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3524,7 +3787,8 @@ pub fn _mm_mask_cmpge_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpge_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_ge(a.as_i8x64(), b.as_i8x64())) } } @@ -3535,7 +3799,8 @@ pub fn _mm512_cmpge_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3546,7 +3811,8 @@ pub fn _mm512_mask_cmpge_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpge_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_ge(a.as_i8x32(), b.as_i8x32())) } } @@ -3557,7 +3823,8 @@ pub fn _mm256_cmpge_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3568,7 +3835,8 @@ pub fn _mm256_mask_cmpge_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpge_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_ge(a.as_i8x16(), b.as_i8x16())) } } @@ -3579,7 +3847,8 @@ pub fn _mm_cmpge_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -3590,7 +3859,8 @@ pub fn _mm_mask_cmpge_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpeq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_eq(a.as_u16x32(), b.as_u16x32())) } } @@ -3601,7 +3871,8 @@ pub fn _mm512_cmpeq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3612,7 +3883,8 @@ pub fn _mm512_mask_cmpeq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpeq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_eq(a.as_u16x16(), b.as_u16x16())) } } @@ -3623,7 +3895,8 @@ pub fn _mm256_cmpeq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3634,7 +3907,8 @@ pub fn _mm256_mask_cmpeq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpeq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_eq(a.as_u16x8(), b.as_u16x8())) } } @@ -3645,7 +3919,8 @@ pub fn _mm_cmpeq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu16_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3656,7 +3931,8 @@ pub fn _mm_mask_cmpeq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpeq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_eq(a.as_u8x64(), b.as_u8x64())) } } @@ -3667,7 +3943,8 @@ pub fn _mm512_cmpeq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3678,7 +3955,8 @@ pub fn _mm512_mask_cmpeq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpeq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_eq(a.as_u8x32(), b.as_u8x32())) } } @@ -3689,7 +3967,8 @@ pub fn _mm256_cmpeq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3700,7 +3979,8 @@ pub fn _mm256_mask_cmpeq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpeq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_eq(a.as_u8x16(), b.as_u8x16())) } } @@ -3711,7 +3991,8 @@ pub fn _mm_cmpeq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epu8_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3722,7 +4003,8 @@ pub fn _mm_mask_cmpeq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpeq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_eq(a.as_i16x32(), b.as_i16x32())) } } @@ -3733,7 +4015,8 @@ pub fn _mm512_cmpeq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3744,7 +4027,8 @@ pub fn _mm512_mask_cmpeq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpeq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_eq(a.as_i16x16(), b.as_i16x16())) } } @@ -3755,7 +4039,8 @@ pub fn _mm256_cmpeq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3766,7 +4051,8 @@ pub fn _mm256_mask_cmpeq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpeq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_eq(a.as_i16x8(), b.as_i16x8())) } } @@ -3777,7 +4063,8 @@ pub fn _mm_cmpeq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi16_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3788,7 +4075,8 @@ pub fn _mm_mask_cmpeq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpeq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_eq(a.as_i8x64(), b.as_i8x64())) } } @@ -3799,7 +4087,8 @@ pub fn _mm512_cmpeq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3810,7 +4099,8 @@ pub fn _mm512_mask_cmpeq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpeq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_eq(a.as_i8x32(), b.as_i8x32())) } } @@ -3821,7 +4111,8 @@ pub fn _mm256_cmpeq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3832,7 +4123,8 @@ pub fn _mm256_mask_cmpeq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpeq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_eq(a.as_i8x16(), b.as_i8x16())) } } @@ -3843,7 +4135,8 @@ pub fn _mm_cmpeq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epi8_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -3854,7 +4147,8 @@ pub fn _mm_mask_cmpeq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpneq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_ne(a.as_u16x32(), b.as_u16x32())) } } @@ -3865,7 +4159,8 @@ pub fn _mm512_cmpneq_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -3876,7 +4171,8 @@ pub fn _mm512_mask_cmpneq_epu16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> _ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpneq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_ne(a.as_u16x16(), b.as_u16x16())) } } @@ -3887,7 +4183,8 @@ pub fn _mm256_cmpneq_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -3898,7 +4195,8 @@ pub fn _mm256_mask_cmpneq_epu16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> _ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpneq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ne(a.as_u16x8(), b.as_u16x8())) } } @@ -3909,7 +4207,8 @@ pub fn _mm_cmpneq_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu16_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -3920,7 +4219,8 @@ pub fn _mm_mask_cmpneq_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mma #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpneq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_ne(a.as_u8x64(), b.as_u8x64())) } } @@ -3931,7 +4231,8 @@ pub fn _mm512_cmpneq_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -3942,7 +4243,8 @@ pub fn _mm512_mask_cmpneq_epu8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpneq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_ne(a.as_u8x32(), b.as_u8x32())) } } @@ -3953,7 +4255,8 @@ pub fn _mm256_cmpneq_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -3964,7 +4267,8 @@ pub fn _mm256_mask_cmpneq_epu8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpneq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_ne(a.as_u8x16(), b.as_u8x16())) } } @@ -3975,7 +4279,8 @@ pub fn _mm_cmpneq_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epu8_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -3986,7 +4291,8 @@ pub fn _mm_mask_cmpneq_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mma #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpneq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { simd_bitmask::(simd_ne(a.as_i16x32(), b.as_i16x32())) } } @@ -3997,7 +4303,8 @@ pub fn _mm512_cmpneq_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { _mm512_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -4008,7 +4315,8 @@ pub fn _mm512_mask_cmpneq_epi16_mask(k1: __mmask32, a: __m512i, b: __m512i) -> _ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpneq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { simd_bitmask::(simd_ne(a.as_i16x16(), b.as_i16x16())) } } @@ -4019,7 +4327,8 @@ pub fn _mm256_cmpneq_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { _mm256_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -4030,7 +4339,8 @@ pub fn _mm256_mask_cmpneq_epi16_mask(k1: __mmask16, a: __m256i, b: __m256i) -> _ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpneq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ne(a.as_i16x8(), b.as_i16x8())) } } @@ -4041,7 +4351,8 @@ pub fn _mm_cmpneq_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi16_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -4052,7 +4363,8 @@ pub fn _mm_mask_cmpneq_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mma #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_cmpneq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { simd_bitmask::(simd_ne(a.as_i8x64(), b.as_i8x64())) } } @@ -4063,7 +4375,8 @@ pub fn _mm512_cmpneq_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { _mm512_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -4074,7 +4387,8 @@ pub fn _mm512_mask_cmpneq_epi8_mask(k1: __mmask64, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_cmpneq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { simd_bitmask::(simd_ne(a.as_i8x32(), b.as_i8x32())) } } @@ -4085,7 +4399,8 @@ pub fn _mm256_cmpneq_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { _mm256_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -4096,7 +4411,8 @@ pub fn _mm256_mask_cmpneq_epi8_mask(k1: __mmask32, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_cmpneq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { simd_bitmask::(simd_ne(a.as_i8x16(), b.as_i8x16())) } } @@ -4107,7 +4423,8 @@ pub fn _mm_cmpneq_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] -pub fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { _mm_mask_cmp_epi8_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -4119,7 +4436,8 @@ pub fn _mm_mask_cmpneq_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mma #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_cmp_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epu16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u16x32(); @@ -4146,7 +4464,8 @@ pub fn _mm512_cmp_epu16_mask(a: __m512i, b: __m512i) -> __mmask #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_mask_cmp_epu16_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epu16_mask( k1: __mmask32, a: __m512i, b: __m512i, @@ -4178,7 +4497,8 @@ pub fn _mm512_mask_cmp_epu16_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_cmp_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epu16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u16x16(); @@ -4205,7 +4525,8 @@ pub fn _mm256_cmp_epu16_mask(a: __m256i, b: __m256i) -> __mmask #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_mask_cmp_epu16_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epu16_mask( k1: __mmask16, a: __m256i, b: __m256i, @@ -4237,7 +4558,8 @@ pub fn _mm256_mask_cmp_epu16_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_cmp_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u16x8(); @@ -4264,7 +4586,12 @@ pub fn _mm_cmp_epu16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_mask_cmp_epu16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epu16_mask( + k1: __mmask8, + a: __m128i, + b: __m128i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u16x8(); @@ -4292,7 +4619,8 @@ pub fn _mm_mask_cmp_epu16_mask(k1: __mmask8, a: __m128i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_cmp_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epu8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u8x64(); @@ -4319,7 +4647,8 @@ pub fn _mm512_cmp_epu8_mask(a: __m512i, b: __m512i) -> __mmask6 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_mask_cmp_epu8_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epu8_mask( k1: __mmask64, a: __m512i, b: __m512i, @@ -4351,7 +4680,8 @@ pub fn _mm512_mask_cmp_epu8_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_cmp_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epu8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u8x32(); @@ -4378,7 +4708,8 @@ pub fn _mm256_cmp_epu8_mask(a: __m256i, b: __m256i) -> __mmask3 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_mask_cmp_epu8_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epu8_mask( k1: __mmask32, a: __m256i, b: __m256i, @@ -4410,7 +4741,8 @@ pub fn _mm256_mask_cmp_epu8_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_cmp_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u8x16(); @@ -4437,7 +4769,12 @@ pub fn _mm_cmp_epu8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_mask_cmp_epu8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epu8_mask( + k1: __mmask16, + a: __m128i, + b: __m128i, +) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_u8x16(); @@ -4465,7 +4802,8 @@ pub fn _mm_mask_cmp_epu8_mask(k1: __mmask16, a: __m128i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_cmp_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i16x32(); @@ -4492,7 +4830,8 @@ pub fn _mm512_cmp_epi16_mask(a: __m512i, b: __m512i) -> __mmask #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_mask_cmp_epi16_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epi16_mask( k1: __mmask32, a: __m512i, b: __m512i, @@ -4524,7 +4863,8 @@ pub fn _mm512_mask_cmp_epi16_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_cmp_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i16x16(); @@ -4551,7 +4891,8 @@ pub fn _mm256_cmp_epi16_mask(a: __m256i, b: __m256i) -> __mmask #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_mask_cmp_epi16_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epi16_mask( k1: __mmask16, a: __m256i, b: __m256i, @@ -4583,7 +4924,8 @@ pub fn _mm256_mask_cmp_epi16_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_cmp_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i16x8(); @@ -4610,7 +4952,12 @@ pub fn _mm_cmp_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_mask_cmp_epi16_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epi16_mask( + k1: __mmask8, + a: __m128i, + b: __m128i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i16x8(); @@ -4638,7 +4985,8 @@ pub fn _mm_mask_cmp_epi16_mask(k1: __mmask8, a: __m128i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_cmp_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i8x64(); @@ -4665,7 +5013,8 @@ pub fn _mm512_cmp_epi8_mask(a: __m512i, b: __m512i) -> __mmask6 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm512_mask_cmp_epi8_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epi8_mask( k1: __mmask64, a: __m512i, b: __m512i, @@ -4697,7 +5046,8 @@ pub fn _mm512_mask_cmp_epi8_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_cmp_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i8x32(); @@ -4724,7 +5074,8 @@ pub fn _mm256_cmp_epi8_mask(a: __m256i, b: __m256i) -> __mmask3 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm256_mask_cmp_epi8_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epi8_mask( k1: __mmask32, a: __m256i, b: __m256i, @@ -4756,7 +5107,8 @@ pub fn _mm256_mask_cmp_epi8_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_cmp_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i8x16(); @@ -4783,7 +5135,12 @@ pub fn _mm_cmp_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM8 = 0))] -pub fn _mm_mask_cmp_epi8_mask(k1: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epi8_mask( + k1: __mmask16, + a: __m128i, + b: __m128i, +) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 3); let a = a.as_i8x16(); @@ -4809,8 +5166,9 @@ pub fn _mm_mask_cmp_epi8_mask(k1: __mmask16, a: __m128i, b: __m #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_add_epi16(a: __m256i) -> i16 { - unsafe { simd_reduce_add_unordered(a.as_i16x16()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_add_epi16(a: __m256i) -> i16 { + unsafe { simd_reduce_add_ordered(a.as_i16x16(), 0) } } /// Reduce the packed 16-bit integers in a by addition using mask k. Returns the sum of all active elements in a. @@ -4819,8 +5177,9 @@ pub fn _mm256_reduce_add_epi16(a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_add_epi16(k: __mmask16, a: __m256i) -> i16 { - unsafe { simd_reduce_add_unordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO)) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_add_epi16(k: __mmask16, a: __m256i) -> i16 { + unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO), 0) } } /// Reduce the packed 16-bit integers in a by addition. Returns the sum of all elements in a. @@ -4829,8 +5188,9 @@ pub fn _mm256_mask_reduce_add_epi16(k: __mmask16, a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_add_epi16(a: __m128i) -> i16 { - unsafe { simd_reduce_add_unordered(a.as_i16x8()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_add_epi16(a: __m128i) -> i16 { + unsafe { simd_reduce_add_ordered(a.as_i16x8(), 0) } } /// Reduce the packed 16-bit integers in a by addition using mask k. Returns the sum of all active elements in a. @@ -4839,8 +5199,9 @@ pub fn _mm_reduce_add_epi16(a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_add_epi16(k: __mmask8, a: __m128i) -> i16 { - unsafe { simd_reduce_add_unordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO)) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_add_epi16(k: __mmask8, a: __m128i) -> i16 { + unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO), 0) } } /// Reduce the packed 8-bit integers in a by addition. Returns the sum of all elements in a. @@ -4849,8 +5210,9 @@ pub fn _mm_mask_reduce_add_epi16(k: __mmask8, a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_add_epi8(a: __m256i) -> i8 { - unsafe { simd_reduce_add_unordered(a.as_i8x32()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_add_epi8(a: __m256i) -> i8 { + unsafe { simd_reduce_add_ordered(a.as_i8x32(), 0) } } /// Reduce the packed 8-bit integers in a by addition using mask k. Returns the sum of all active elements in a. @@ -4859,8 +5221,9 @@ pub fn _mm256_reduce_add_epi8(a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_add_epi8(k: __mmask32, a: __m256i) -> i8 { - unsafe { simd_reduce_add_unordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO)) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_add_epi8(k: __mmask32, a: __m256i) -> i8 { + unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO), 0) } } /// Reduce the packed 8-bit integers in a by addition. Returns the sum of all elements in a. @@ -4869,8 +5232,9 @@ pub fn _mm256_mask_reduce_add_epi8(k: __mmask32, a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_add_epi8(a: __m128i) -> i8 { - unsafe { simd_reduce_add_unordered(a.as_i8x16()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_add_epi8(a: __m128i) -> i8 { + unsafe { simd_reduce_add_ordered(a.as_i8x16(), 0) } } /// Reduce the packed 8-bit integers in a by addition using mask k. Returns the sum of all active elements in a. @@ -4879,8 +5243,9 @@ pub fn _mm_reduce_add_epi8(a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_add_epi8(k: __mmask16, a: __m128i) -> i8 { - unsafe { simd_reduce_add_unordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO)) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_add_epi8(k: __mmask16, a: __m128i) -> i8 { + unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO), 0) } } /// Reduce the packed 16-bit integers in a by bitwise AND. Returns the bitwise AND of all elements in a. @@ -4889,7 +5254,8 @@ pub fn _mm_mask_reduce_add_epi8(k: __mmask16, a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_and_epi16(a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_and_epi16(a: __m256i) -> i16 { unsafe { simd_reduce_and(a.as_i16x16()) } } @@ -4899,7 +5265,8 @@ pub fn _mm256_reduce_and_epi16(a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_and_epi16(k: __mmask16, a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_and_epi16(k: __mmask16, a: __m256i) -> i16 { unsafe { simd_reduce_and(simd_select_bitmask( k, @@ -4915,7 +5282,8 @@ pub fn _mm256_mask_reduce_and_epi16(k: __mmask16, a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_and_epi16(a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_and_epi16(a: __m128i) -> i16 { unsafe { simd_reduce_and(a.as_i16x8()) } } @@ -4925,7 +5293,8 @@ pub fn _mm_reduce_and_epi16(a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_and_epi16(k: __mmask8, a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_and_epi16(k: __mmask8, a: __m128i) -> i16 { unsafe { simd_reduce_and(simd_select_bitmask( k, @@ -4941,7 +5310,8 @@ pub fn _mm_mask_reduce_and_epi16(k: __mmask8, a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_and_epi8(a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_and_epi8(a: __m256i) -> i8 { unsafe { simd_reduce_and(a.as_i8x32()) } } @@ -4951,7 +5321,8 @@ pub fn _mm256_reduce_and_epi8(a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_and_epi8(k: __mmask32, a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_and_epi8(k: __mmask32, a: __m256i) -> i8 { unsafe { simd_reduce_and(simd_select_bitmask( k, @@ -4967,7 +5338,8 @@ pub fn _mm256_mask_reduce_and_epi8(k: __mmask32, a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_and_epi8(a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_and_epi8(a: __m128i) -> i8 { unsafe { simd_reduce_and(a.as_i8x16()) } } @@ -4977,7 +5349,8 @@ pub fn _mm_reduce_and_epi8(a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_and_epi8(k: __mmask16, a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_and_epi8(k: __mmask16, a: __m128i) -> i8 { unsafe { simd_reduce_and(simd_select_bitmask( k, @@ -4993,7 +5366,8 @@ pub fn _mm_mask_reduce_and_epi8(k: __mmask16, a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_max_epi16(a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_max_epi16(a: __m256i) -> i16 { unsafe { simd_reduce_max(a.as_i16x16()) } } @@ -5003,7 +5377,8 @@ pub fn _mm256_reduce_max_epi16(a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_max_epi16(k: __mmask16, a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_max_epi16(k: __mmask16, a: __m256i) -> i16 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(-32768))) } } @@ -5013,7 +5388,8 @@ pub fn _mm256_mask_reduce_max_epi16(k: __mmask16, a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_max_epi16(a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_max_epi16(a: __m128i) -> i16 { unsafe { simd_reduce_max(a.as_i16x8()) } } @@ -5023,7 +5399,8 @@ pub fn _mm_reduce_max_epi16(a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_max_epi16(k: __mmask8, a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_max_epi16(k: __mmask8, a: __m128i) -> i16 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(-32768))) } } @@ -5033,7 +5410,8 @@ pub fn _mm_mask_reduce_max_epi16(k: __mmask8, a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_max_epi8(a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_max_epi8(a: __m256i) -> i8 { unsafe { simd_reduce_max(a.as_i8x32()) } } @@ -5043,7 +5421,8 @@ pub fn _mm256_reduce_max_epi8(a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_max_epi8(k: __mmask32, a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_max_epi8(k: __mmask32, a: __m256i) -> i8 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(-128))) } } @@ -5053,7 +5432,8 @@ pub fn _mm256_mask_reduce_max_epi8(k: __mmask32, a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_max_epi8(a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_max_epi8(a: __m128i) -> i8 { unsafe { simd_reduce_max(a.as_i8x16()) } } @@ -5063,7 +5443,8 @@ pub fn _mm_reduce_max_epi8(a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_max_epi8(k: __mmask16, a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_max_epi8(k: __mmask16, a: __m128i) -> i8 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(-128))) } } @@ -5073,7 +5454,8 @@ pub fn _mm_mask_reduce_max_epi8(k: __mmask16, a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_max_epu16(a: __m256i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_max_epu16(a: __m256i) -> u16 { unsafe { simd_reduce_max(a.as_u16x16()) } } @@ -5083,7 +5465,8 @@ pub fn _mm256_reduce_max_epu16(a: __m256i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_max_epu16(k: __mmask16, a: __m256i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_max_epu16(k: __mmask16, a: __m256i) -> u16 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u16x16(), u16x16::ZERO)) } } @@ -5093,7 +5476,8 @@ pub fn _mm256_mask_reduce_max_epu16(k: __mmask16, a: __m256i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_max_epu16(a: __m128i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_max_epu16(a: __m128i) -> u16 { unsafe { simd_reduce_max(a.as_u16x8()) } } @@ -5103,7 +5487,8 @@ pub fn _mm_reduce_max_epu16(a: __m128i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_max_epu16(k: __mmask8, a: __m128i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_max_epu16(k: __mmask8, a: __m128i) -> u16 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u16x8(), u16x8::ZERO)) } } @@ -5113,7 +5498,8 @@ pub fn _mm_mask_reduce_max_epu16(k: __mmask8, a: __m128i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_max_epu8(a: __m256i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_max_epu8(a: __m256i) -> u8 { unsafe { simd_reduce_max(a.as_u8x32()) } } @@ -5123,7 +5509,8 @@ pub fn _mm256_reduce_max_epu8(a: __m256i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_max_epu8(k: __mmask32, a: __m256i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_max_epu8(k: __mmask32, a: __m256i) -> u8 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u8x32(), u8x32::ZERO)) } } @@ -5133,7 +5520,8 @@ pub fn _mm256_mask_reduce_max_epu8(k: __mmask32, a: __m256i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_max_epu8(a: __m128i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_max_epu8(a: __m128i) -> u8 { unsafe { simd_reduce_max(a.as_u8x16()) } } @@ -5143,7 +5531,8 @@ pub fn _mm_reduce_max_epu8(a: __m128i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_max_epu8(k: __mmask16, a: __m128i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_max_epu8(k: __mmask16, a: __m128i) -> u8 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u8x16(), u8x16::ZERO)) } } @@ -5153,7 +5542,8 @@ pub fn _mm_mask_reduce_max_epu8(k: __mmask16, a: __m128i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_min_epi16(a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_min_epi16(a: __m256i) -> i16 { unsafe { simd_reduce_min(a.as_i16x16()) } } @@ -5163,7 +5553,8 @@ pub fn _mm256_reduce_min_epi16(a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_min_epi16(k: __mmask16, a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_min_epi16(k: __mmask16, a: __m256i) -> i16 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(0x7fff))) } } @@ -5173,7 +5564,8 @@ pub fn _mm256_mask_reduce_min_epi16(k: __mmask16, a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_min_epi16(a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_min_epi16(a: __m128i) -> i16 { unsafe { simd_reduce_min(a.as_i16x8()) } } @@ -5183,7 +5575,8 @@ pub fn _mm_reduce_min_epi16(a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_min_epi16(k: __mmask8, a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_min_epi16(k: __mmask8, a: __m128i) -> i16 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(0x7fff))) } } @@ -5193,7 +5586,8 @@ pub fn _mm_mask_reduce_min_epi16(k: __mmask8, a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_min_epi8(a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_min_epi8(a: __m256i) -> i8 { unsafe { simd_reduce_min(a.as_i8x32()) } } @@ -5203,7 +5597,8 @@ pub fn _mm256_reduce_min_epi8(a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_min_epi8(k: __mmask32, a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_min_epi8(k: __mmask32, a: __m256i) -> i8 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(0x7f))) } } @@ -5213,7 +5608,8 @@ pub fn _mm256_mask_reduce_min_epi8(k: __mmask32, a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_min_epi8(a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_min_epi8(a: __m128i) -> i8 { unsafe { simd_reduce_min(a.as_i8x16()) } } @@ -5223,7 +5619,8 @@ pub fn _mm_reduce_min_epi8(a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_min_epi8(k: __mmask16, a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_min_epi8(k: __mmask16, a: __m128i) -> i8 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(0x7f))) } } @@ -5233,7 +5630,8 @@ pub fn _mm_mask_reduce_min_epi8(k: __mmask16, a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_min_epu16(a: __m256i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_min_epu16(a: __m256i) -> u16 { unsafe { simd_reduce_min(a.as_u16x16()) } } @@ -5243,7 +5641,8 @@ pub fn _mm256_reduce_min_epu16(a: __m256i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_min_epu16(k: __mmask16, a: __m256i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_min_epu16(k: __mmask16, a: __m256i) -> u16 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u16x16(), u16x16::splat(0xffff))) } } @@ -5253,7 +5652,8 @@ pub fn _mm256_mask_reduce_min_epu16(k: __mmask16, a: __m256i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_min_epu16(a: __m128i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_min_epu16(a: __m128i) -> u16 { unsafe { simd_reduce_min(a.as_u16x8()) } } @@ -5263,7 +5663,8 @@ pub fn _mm_reduce_min_epu16(a: __m128i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_min_epu16(k: __mmask8, a: __m128i) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_min_epu16(k: __mmask8, a: __m128i) -> u16 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u16x8(), u16x8::splat(0xffff))) } } @@ -5273,7 +5674,8 @@ pub fn _mm_mask_reduce_min_epu16(k: __mmask8, a: __m128i) -> u16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_min_epu8(a: __m256i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_min_epu8(a: __m256i) -> u8 { unsafe { simd_reduce_min(a.as_u8x32()) } } @@ -5283,7 +5685,8 @@ pub fn _mm256_reduce_min_epu8(a: __m256i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_min_epu8(k: __mmask32, a: __m256i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_min_epu8(k: __mmask32, a: __m256i) -> u8 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u8x32(), u8x32::splat(0xff))) } } @@ -5293,7 +5696,8 @@ pub fn _mm256_mask_reduce_min_epu8(k: __mmask32, a: __m256i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_min_epu8(a: __m128i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_min_epu8(a: __m128i) -> u8 { unsafe { simd_reduce_min(a.as_u8x16()) } } @@ -5303,7 +5707,8 @@ pub fn _mm_reduce_min_epu8(a: __m128i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_min_epu8(k: __mmask16, a: __m128i) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_min_epu8(k: __mmask16, a: __m128i) -> u8 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u8x16(), u8x16::splat(0xff))) } } @@ -5313,8 +5718,9 @@ pub fn _mm_mask_reduce_min_epu8(k: __mmask16, a: __m128i) -> u8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_mul_epi16(a: __m256i) -> i16 { - unsafe { simd_reduce_mul_unordered(a.as_i16x16()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_mul_epi16(a: __m256i) -> i16 { + unsafe { simd_reduce_mul_ordered(a.as_i16x16(), 1) } } /// Reduce the packed 16-bit integers in a by multiplication using mask k. Returns the product of all active elements in a. @@ -5323,8 +5729,9 @@ pub fn _mm256_reduce_mul_epi16(a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_mul_epi16(k: __mmask16, a: __m256i) -> i16 { - unsafe { simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(1))) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_mul_epi16(k: __mmask16, a: __m256i) -> i16 { + unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i16x16(), i16x16::splat(1)), 1) } } /// Reduce the packed 16-bit integers in a by multiplication. Returns the product of all elements in a. @@ -5333,8 +5740,9 @@ pub fn _mm256_mask_reduce_mul_epi16(k: __mmask16, a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_mul_epi16(a: __m128i) -> i16 { - unsafe { simd_reduce_mul_unordered(a.as_i16x8()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_mul_epi16(a: __m128i) -> i16 { + unsafe { simd_reduce_mul_ordered(a.as_i16x8(), 1) } } /// Reduce the packed 16-bit integers in a by multiplication using mask k. Returns the product of all active elements in a. @@ -5343,8 +5751,9 @@ pub fn _mm_reduce_mul_epi16(a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_mul_epi16(k: __mmask8, a: __m128i) -> i16 { - unsafe { simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(1))) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_mul_epi16(k: __mmask8, a: __m128i) -> i16 { + unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i16x8(), i16x8::splat(1)), 1) } } /// Reduce the packed 8-bit integers in a by multiplication. Returns the product of all elements in a. @@ -5353,8 +5762,9 @@ pub fn _mm_mask_reduce_mul_epi16(k: __mmask8, a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_mul_epi8(a: __m256i) -> i8 { - unsafe { simd_reduce_mul_unordered(a.as_i8x32()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_mul_epi8(a: __m256i) -> i8 { + unsafe { simd_reduce_mul_ordered(a.as_i8x32(), 1) } } /// Reduce the packed 8-bit integers in a by multiplication using mask k. Returns the product of all active elements in a. @@ -5363,8 +5773,9 @@ pub fn _mm256_reduce_mul_epi8(a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_mul_epi8(k: __mmask32, a: __m256i) -> i8 { - unsafe { simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(1))) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_mul_epi8(k: __mmask32, a: __m256i) -> i8 { + unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i8x32(), i8x32::splat(1)), 1) } } /// Reduce the packed 8-bit integers in a by multiplication. Returns the product of all elements in a. @@ -5373,8 +5784,9 @@ pub fn _mm256_mask_reduce_mul_epi8(k: __mmask32, a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_mul_epi8(a: __m128i) -> i8 { - unsafe { simd_reduce_mul_unordered(a.as_i8x16()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_mul_epi8(a: __m128i) -> i8 { + unsafe { simd_reduce_mul_ordered(a.as_i8x16(), 1) } } /// Reduce the packed 8-bit integers in a by multiplication using mask k. Returns the product of all active elements in a. @@ -5383,8 +5795,9 @@ pub fn _mm_reduce_mul_epi8(a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_mul_epi8(k: __mmask16, a: __m128i) -> i8 { - unsafe { simd_reduce_mul_unordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(1))) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_mul_epi8(k: __mmask16, a: __m128i) -> i8 { + unsafe { simd_reduce_mul_ordered(simd_select_bitmask(k, a.as_i8x16(), i8x16::splat(1)), 1) } } /// Reduce the packed 16-bit integers in a by bitwise OR. Returns the bitwise OR of all elements in a. @@ -5393,7 +5806,8 @@ pub fn _mm_mask_reduce_mul_epi8(k: __mmask16, a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_or_epi16(a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_or_epi16(a: __m256i) -> i16 { unsafe { simd_reduce_or(a.as_i16x16()) } } @@ -5403,7 +5817,8 @@ pub fn _mm256_reduce_or_epi16(a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_or_epi16(k: __mmask16, a: __m256i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_or_epi16(k: __mmask16, a: __m256i) -> i16 { unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i16x16(), i16x16::ZERO)) } } @@ -5413,7 +5828,8 @@ pub fn _mm256_mask_reduce_or_epi16(k: __mmask16, a: __m256i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_or_epi16(a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_or_epi16(a: __m128i) -> i16 { unsafe { simd_reduce_or(a.as_i16x8()) } } @@ -5423,7 +5839,8 @@ pub fn _mm_reduce_or_epi16(a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_or_epi16(k: __mmask8, a: __m128i) -> i16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_or_epi16(k: __mmask8, a: __m128i) -> i16 { unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i16x8(), i16x8::ZERO)) } } @@ -5433,7 +5850,8 @@ pub fn _mm_mask_reduce_or_epi16(k: __mmask8, a: __m128i) -> i16 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_reduce_or_epi8(a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_or_epi8(a: __m256i) -> i8 { unsafe { simd_reduce_or(a.as_i8x32()) } } @@ -5443,7 +5861,8 @@ pub fn _mm256_reduce_or_epi8(a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_reduce_or_epi8(k: __mmask32, a: __m256i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_reduce_or_epi8(k: __mmask32, a: __m256i) -> i8 { unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i8x32(), i8x32::ZERO)) } } @@ -5453,7 +5872,8 @@ pub fn _mm256_mask_reduce_or_epi8(k: __mmask32, a: __m256i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_reduce_or_epi8(a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_or_epi8(a: __m128i) -> i8 { unsafe { simd_reduce_or(a.as_i8x16()) } } @@ -5463,7 +5883,8 @@ pub fn _mm_reduce_or_epi8(a: __m128i) -> i8 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_reduce_or_epi8(k: __mmask16, a: __m128i) -> i8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_reduce_or_epi8(k: __mmask16, a: __m128i) -> i8 { unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i8x16(), i8x16::ZERO)) } } @@ -5474,7 +5895,8 @@ pub fn _mm_mask_reduce_or_epi8(k: __mmask16, a: __m128i) -> i8 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16 -pub unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i { ptr::read_unaligned(mem_addr as *const __m512i) } @@ -5485,7 +5907,8 @@ pub unsafe fn _mm512_loadu_epi16(mem_addr: *const i16) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16 -pub unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i { ptr::read_unaligned(mem_addr as *const __m256i) } @@ -5496,7 +5919,8 @@ pub unsafe fn _mm256_loadu_epi16(mem_addr: *const i16) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16 -pub unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i { ptr::read_unaligned(mem_addr as *const __m128i) } @@ -5507,7 +5931,8 @@ pub unsafe fn _mm_loadu_epi16(mem_addr: *const i16) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8 -pub unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i { ptr::read_unaligned(mem_addr as *const __m512i) } @@ -5518,7 +5943,8 @@ pub unsafe fn _mm512_loadu_epi8(mem_addr: *const i8) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8 -pub unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i { ptr::read_unaligned(mem_addr as *const __m256i) } @@ -5529,7 +5955,8 @@ pub unsafe fn _mm256_loadu_epi8(mem_addr: *const i8) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8 -pub unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i { ptr::read_unaligned(mem_addr as *const __m128i) } @@ -5540,7 +5967,8 @@ pub unsafe fn _mm_loadu_epi8(mem_addr: *const i8) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16 -pub unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) { ptr::write_unaligned(mem_addr as *mut __m512i, a); } @@ -5551,7 +5979,8 @@ pub unsafe fn _mm512_storeu_epi16(mem_addr: *mut i16, a: __m512i) { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16 -pub unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) { ptr::write_unaligned(mem_addr as *mut __m256i, a); } @@ -5562,7 +5991,8 @@ pub unsafe fn _mm256_storeu_epi16(mem_addr: *mut i16, a: __m256i) { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu16 -pub unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) { ptr::write_unaligned(mem_addr as *mut __m128i, a); } @@ -5573,7 +6003,8 @@ pub unsafe fn _mm_storeu_epi16(mem_addr: *mut i16, a: __m128i) { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8 -pub unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) { ptr::write_unaligned(mem_addr as *mut __m512i, a); } @@ -5584,7 +6015,8 @@ pub unsafe fn _mm512_storeu_epi8(mem_addr: *mut i8, a: __m512i) { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8 -pub unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) { ptr::write_unaligned(mem_addr as *mut __m256i, a); } @@ -5595,7 +6027,8 @@ pub unsafe fn _mm256_storeu_epi8(mem_addr: *mut i8, a: __m256i) { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu8 -pub unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) { ptr::write_unaligned(mem_addr as *mut __m128i, a); } @@ -5608,7 +6041,12 @@ pub unsafe fn _mm_storeu_epi8(mem_addr: *mut i8, a: __m128i) { #[target_feature(enable = "avx512bw")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_loadu_epi16(src: __m512i, k: __mmask32, mem_addr: *const i16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_loadu_epi16( + src: __m512i, + k: __mmask32, + mem_addr: *const i16, +) -> __m512i { let mask = simd_select_bitmask(k, i16x32::splat(!0), i16x32::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x32()).as_m512i() } @@ -5622,7 +6060,8 @@ pub unsafe fn _mm512_mask_loadu_epi16(src: __m512i, k: __mmask32, mem_addr: *con #[target_feature(enable = "avx512bw")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __m512i { _mm512_mask_loadu_epi16(_mm512_setzero_si512(), k, mem_addr) } @@ -5635,7 +6074,12 @@ pub unsafe fn _mm512_maskz_loadu_epi16(k: __mmask32, mem_addr: *const i16) -> __ #[target_feature(enable = "avx512bw")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_loadu_epi8(src: __m512i, k: __mmask64, mem_addr: *const i8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_loadu_epi8( + src: __m512i, + k: __mmask64, + mem_addr: *const i8, +) -> __m512i { let mask = simd_select_bitmask(k, i8x64::splat(!0), i8x64::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x64()).as_m512i() } @@ -5649,7 +6093,8 @@ pub unsafe fn _mm512_mask_loadu_epi8(src: __m512i, k: __mmask64, mem_addr: *cons #[target_feature(enable = "avx512bw")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m512i { _mm512_mask_loadu_epi8(_mm512_setzero_si512(), k, mem_addr) } @@ -5662,7 +6107,12 @@ pub unsafe fn _mm512_maskz_loadu_epi8(k: __mmask64, mem_addr: *const i8) -> __m5 #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_loadu_epi16(src: __m256i, k: __mmask16, mem_addr: *const i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_loadu_epi16( + src: __m256i, + k: __mmask16, + mem_addr: *const i16, +) -> __m256i { let mask = simd_select_bitmask(k, i16x16::splat(!0), i16x16::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x16()).as_m256i() } @@ -5676,7 +6126,8 @@ pub unsafe fn _mm256_mask_loadu_epi16(src: __m256i, k: __mmask16, mem_addr: *con #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __m256i { _mm256_mask_loadu_epi16(_mm256_setzero_si256(), k, mem_addr) } @@ -5689,7 +6140,12 @@ pub unsafe fn _mm256_maskz_loadu_epi16(k: __mmask16, mem_addr: *const i16) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_loadu_epi8(src: __m256i, k: __mmask32, mem_addr: *const i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_loadu_epi8( + src: __m256i, + k: __mmask32, + mem_addr: *const i8, +) -> __m256i { let mask = simd_select_bitmask(k, i8x32::splat(!0), i8x32::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x32()).as_m256i() } @@ -5703,7 +6159,8 @@ pub unsafe fn _mm256_mask_loadu_epi8(src: __m256i, k: __mmask32, mem_addr: *cons #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m256i { _mm256_mask_loadu_epi8(_mm256_setzero_si256(), k, mem_addr) } @@ -5716,7 +6173,12 @@ pub unsafe fn _mm256_maskz_loadu_epi8(k: __mmask32, mem_addr: *const i8) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_loadu_epi16(src: __m128i, k: __mmask8, mem_addr: *const i16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_loadu_epi16( + src: __m128i, + k: __mmask8, + mem_addr: *const i16, +) -> __m128i { let mask = simd_select_bitmask(k, i16x8::splat(!0), i16x8::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i16x8()).as_m128i() } @@ -5730,7 +6192,8 @@ pub unsafe fn _mm_mask_loadu_epi16(src: __m128i, k: __mmask8, mem_addr: *const i #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128i { _mm_mask_loadu_epi16(_mm_setzero_si128(), k, mem_addr) } @@ -5743,7 +6206,12 @@ pub unsafe fn _mm_maskz_loadu_epi16(k: __mmask8, mem_addr: *const i16) -> __m128 #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_loadu_epi8(src: __m128i, k: __mmask16, mem_addr: *const i8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_loadu_epi8( + src: __m128i, + k: __mmask16, + mem_addr: *const i8, +) -> __m128i { let mask = simd_select_bitmask(k, i8x16::splat(!0), i8x16::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i8x16()).as_m128i() } @@ -5757,7 +6225,8 @@ pub unsafe fn _mm_mask_loadu_epi8(src: __m128i, k: __mmask16, mem_addr: *const i #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i { _mm_mask_loadu_epi8(_mm_setzero_si128(), k, mem_addr) } @@ -5769,7 +6238,8 @@ pub unsafe fn _mm_maskz_loadu_epi8(k: __mmask16, mem_addr: *const i8) -> __m128i #[target_feature(enable = "avx512bw")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: __m512i) { let mask = simd_select_bitmask(mask, i16x32::splat(!0), i16x32::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x32()); } @@ -5782,7 +6252,8 @@ pub unsafe fn _mm512_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask32, a: _ #[target_feature(enable = "avx512bw")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m512i) { let mask = simd_select_bitmask(mask, i8x64::splat(!0), i8x64::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x64()); } @@ -5795,7 +6266,8 @@ pub unsafe fn _mm512_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask64, a: __m #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: __m256i) { let mask = simd_select_bitmask(mask, i16x16::splat(!0), i16x16::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x16()); } @@ -5808,7 +6280,8 @@ pub unsafe fn _mm256_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask16, a: _ #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m256i) { let mask = simd_select_bitmask(mask, i8x32::splat(!0), i8x32::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x32()); } @@ -5821,7 +6294,8 @@ pub unsafe fn _mm256_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask32, a: __m #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu16))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m128i) { let mask = simd_select_bitmask(mask, i16x8::splat(!0), i16x8::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i16x8()); } @@ -5834,7 +6308,8 @@ pub unsafe fn _mm_mask_storeu_epi16(mem_addr: *mut i16, mask: __mmask8, a: __m12 #[target_feature(enable = "avx512bw,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu8))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128i) { let mask = simd_select_bitmask(mask, i8x16::splat(!0), i8x16::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i8x16()); } @@ -5847,20 +6322,19 @@ pub unsafe fn _mm_mask_storeu_epi8(mem_addr: *mut i8, mask: __mmask16, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaddwd))] pub fn _mm512_madd_epi16(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let r: i32x32 = simd_mul(simd_cast(a.as_i16x32()), simd_cast(b.as_i16x32())); - let even: i32x16 = simd_shuffle!( - r, - r, - [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30] - ); - let odd: i32x16 = simd_shuffle!( - r, - r, - [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31] - ); - simd_add(even, odd).as_m512i() - } + // It's a trick used in the Adler-32 algorithm to perform a widening addition. + // + // ```rust + // #[target_feature(enable = "avx512bw")] + // unsafe fn widening_add(mad: __m512i) -> __m512i { + // _mm512_madd_epi16(mad, _mm512_set1_epi16(1)) + // } + // ``` + // + // If we implement this using generic vector intrinsics, the optimizer + // will eliminate this pattern, and `vpmaddwd` will no longer be emitted. + // For this reason, we use x86 intrinsics. + unsafe { transmute(vpmaddwd(a.as_i16x32(), b.as_i16x32())) } } /// Multiply packed signed 16-bit integers in a and b, producing intermediate signed 32-bit integers. Horizontally add adjacent pairs of intermediate 32-bit integers, and pack the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -6429,7 +6903,8 @@ pub fn _mm_maskz_packus_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = simd_cast::<_, u32x32>(a.as_u16x32()); let b = simd_cast::<_, u32x32>(b.as_u16x32()); @@ -6445,7 +6920,8 @@ pub fn _mm512_avg_epu16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm512_mask_avg_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_avg_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let avg = _mm512_avg_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, avg, src.as_u16x32())) @@ -6459,7 +6935,8 @@ pub fn _mm512_mask_avg_epu16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm512_maskz_avg_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_avg_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let avg = _mm512_avg_epu16(a, b).as_u16x32(); transmute(simd_select_bitmask(k, avg, u16x32::ZERO)) @@ -6473,7 +6950,8 @@ pub fn _mm512_maskz_avg_epu16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm256_mask_avg_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_avg_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let avg = _mm256_avg_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, avg, src.as_u16x16())) @@ -6487,7 +6965,8 @@ pub fn _mm256_mask_avg_epu16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm256_maskz_avg_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_avg_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let avg = _mm256_avg_epu16(a, b).as_u16x16(); transmute(simd_select_bitmask(k, avg, u16x16::ZERO)) @@ -6501,7 +6980,8 @@ pub fn _mm256_maskz_avg_epu16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm_mask_avg_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_avg_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let avg = _mm_avg_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, avg, src.as_u16x8())) @@ -6515,7 +6995,8 @@ pub fn _mm_mask_avg_epu16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgw))] -pub fn _mm_maskz_avg_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_avg_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let avg = _mm_avg_epu16(a, b).as_u16x8(); transmute(simd_select_bitmask(k, avg, u16x8::ZERO)) @@ -6529,7 +7010,8 @@ pub fn _mm_maskz_avg_epu16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = simd_cast::<_, u16x64>(a.as_u8x64()); let b = simd_cast::<_, u16x64>(b.as_u8x64()); @@ -6545,7 +7027,8 @@ pub fn _mm512_avg_epu8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm512_mask_avg_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_avg_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let avg = _mm512_avg_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, avg, src.as_u8x64())) @@ -6559,7 +7042,8 @@ pub fn _mm512_mask_avg_epu8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm512_maskz_avg_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_avg_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let avg = _mm512_avg_epu8(a, b).as_u8x64(); transmute(simd_select_bitmask(k, avg, u8x64::ZERO)) @@ -6573,7 +7057,8 @@ pub fn _mm512_maskz_avg_epu8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm256_mask_avg_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_avg_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let avg = _mm256_avg_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, avg, src.as_u8x32())) @@ -6587,7 +7072,8 @@ pub fn _mm256_mask_avg_epu8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm256_maskz_avg_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_avg_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let avg = _mm256_avg_epu8(a, b).as_u8x32(); transmute(simd_select_bitmask(k, avg, u8x32::ZERO)) @@ -6601,7 +7087,8 @@ pub fn _mm256_maskz_avg_epu8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm_mask_avg_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_avg_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let avg = _mm_avg_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, avg, src.as_u8x16())) @@ -6615,7 +7102,8 @@ pub fn _mm_mask_avg_epu8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpavgb))] -pub fn _mm_maskz_avg_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_avg_epu8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let avg = _mm_avg_epu8(a, b).as_u8x16(); transmute(simd_select_bitmask(k, avg, u8x16::ZERO)) @@ -6725,7 +7213,8 @@ pub fn _mm_maskz_sll_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_slli_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_slli_epi16(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 16 { @@ -6744,7 +7233,12 @@ pub fn _mm512_slli_epi16(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_slli_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_slli_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 16 { @@ -6764,7 +7258,8 @@ pub fn _mm512_mask_slli_epi16(src: __m512i, k: __mmask32, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_slli_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_slli_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 16 { @@ -6784,7 +7279,12 @@ pub fn _mm512_maskz_slli_epi16(k: __mmask32, a: __m512i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_slli_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_slli_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 16 { @@ -6804,7 +7304,8 @@ pub fn _mm256_mask_slli_epi16(src: __m256i, k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_slli_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_slli_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 16 { @@ -6824,7 +7325,12 @@ pub fn _mm256_maskz_slli_epi16(k: __mmask16, a: __m256i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_slli_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_slli_epi16( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 16 { @@ -6844,7 +7350,8 @@ pub fn _mm_mask_slli_epi16(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_slli_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_slli_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 16 { @@ -6863,7 +7370,8 @@ pub fn _mm_maskz_slli_epi16(k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm512_sllv_epi16(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sllv_epi16(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u16x32(); let no_overflow: u16x32 = simd_lt(count, u16x32::splat(u16::BITS as u16)); @@ -6879,7 +7387,13 @@ pub fn _mm512_sllv_epi16(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm512_mask_sllv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sllv_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_sllv_epi16(a, count).as_i16x32(); transmute(simd_select_bitmask(k, shf, src.as_i16x32())) @@ -6893,7 +7407,8 @@ pub fn _mm512_mask_sllv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm512_maskz_sllv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sllv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_sllv_epi16(a, count).as_i16x32(); transmute(simd_select_bitmask(k, shf, i16x32::ZERO)) @@ -6907,7 +7422,8 @@ pub fn _mm512_maskz_sllv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m5 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm256_sllv_epi16(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sllv_epi16(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u16x16(); let no_overflow: u16x16 = simd_lt(count, u16x16::splat(u16::BITS as u16)); @@ -6923,7 +7439,13 @@ pub fn _mm256_sllv_epi16(a: __m256i, count: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm256_mask_sllv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sllv_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_sllv_epi16(a, count).as_i16x16(); transmute(simd_select_bitmask(k, shf, src.as_i16x16())) @@ -6937,7 +7459,8 @@ pub fn _mm256_mask_sllv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm256_maskz_sllv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sllv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_sllv_epi16(a, count).as_i16x16(); transmute(simd_select_bitmask(k, shf, i16x16::ZERO)) @@ -6951,7 +7474,8 @@ pub fn _mm256_maskz_sllv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm_sllv_epi16(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sllv_epi16(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u16x8(); let no_overflow: u16x8 = simd_lt(count, u16x8::splat(u16::BITS as u16)); @@ -6967,7 +7491,8 @@ pub fn _mm_sllv_epi16(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm_mask_sllv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sllv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_sllv_epi16(a, count).as_i16x8(); transmute(simd_select_bitmask(k, shf, src.as_i16x8())) @@ -6981,7 +7506,8 @@ pub fn _mm_mask_sllv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvw))] -pub fn _mm_maskz_sllv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sllv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_sllv_epi16(a, count).as_i16x8(); transmute(simd_select_bitmask(k, shf, i16x8::ZERO)) @@ -7091,7 +7617,8 @@ pub fn _mm_maskz_srl_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_srli_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srli_epi16(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 16 { @@ -7110,7 +7637,12 @@ pub fn _mm512_srli_epi16(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_srli_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srli_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 16 { @@ -7130,7 +7662,8 @@ pub fn _mm512_mask_srli_epi16(src: __m512i, k: __mmask32, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_srli_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srli_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); //imm8 should be u32, it seems the document to verify is incorrect @@ -7151,7 +7684,12 @@ pub fn _mm512_maskz_srli_epi16(k: __mmask32, a: __m512i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_srli_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srli_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_srli_epi16::(a); @@ -7167,7 +7705,8 @@ pub fn _mm256_mask_srli_epi16(src: __m256i, k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_srli_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srli_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_srli_epi16::(a); @@ -7183,7 +7722,12 @@ pub fn _mm256_maskz_srli_epi16(k: __mmask16, a: __m256i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_srli_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srli_epi16( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_srli_epi16::(a); @@ -7199,7 +7743,8 @@ pub fn _mm_mask_srli_epi16(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_srli_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srli_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_srli_epi16::(a); @@ -7214,7 +7759,8 @@ pub fn _mm_maskz_srli_epi16(k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm512_srlv_epi16(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srlv_epi16(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u16x32(); let no_overflow: u16x32 = simd_lt(count, u16x32::splat(u16::BITS as u16)); @@ -7230,7 +7776,13 @@ pub fn _mm512_srlv_epi16(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm512_mask_srlv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srlv_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_srlv_epi16(a, count).as_i16x32(); transmute(simd_select_bitmask(k, shf, src.as_i16x32())) @@ -7244,7 +7796,8 @@ pub fn _mm512_mask_srlv_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm512_maskz_srlv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srlv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_srlv_epi16(a, count).as_i16x32(); transmute(simd_select_bitmask(k, shf, i16x32::ZERO)) @@ -7258,7 +7811,8 @@ pub fn _mm512_maskz_srlv_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m5 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm256_srlv_epi16(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srlv_epi16(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u16x16(); let no_overflow: u16x16 = simd_lt(count, u16x16::splat(u16::BITS as u16)); @@ -7274,7 +7828,13 @@ pub fn _mm256_srlv_epi16(a: __m256i, count: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm256_mask_srlv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srlv_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_srlv_epi16(a, count).as_i16x16(); transmute(simd_select_bitmask(k, shf, src.as_i16x16())) @@ -7288,7 +7848,8 @@ pub fn _mm256_mask_srlv_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm256_maskz_srlv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srlv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_srlv_epi16(a, count).as_i16x16(); transmute(simd_select_bitmask(k, shf, i16x16::ZERO)) @@ -7302,7 +7863,8 @@ pub fn _mm256_maskz_srlv_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm_srlv_epi16(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srlv_epi16(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u16x8(); let no_overflow: u16x8 = simd_lt(count, u16x8::splat(u16::BITS as u16)); @@ -7318,7 +7880,8 @@ pub fn _mm_srlv_epi16(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm_mask_srlv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srlv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srlv_epi16(a, count).as_i16x8(); transmute(simd_select_bitmask(k, shf, src.as_i16x8())) @@ -7332,7 +7895,8 @@ pub fn _mm_mask_srlv_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvw))] -pub fn _mm_maskz_srlv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srlv_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srlv_epi16(a, count).as_i16x8(); transmute(simd_select_bitmask(k, shf, i16x8::ZERO)) @@ -7442,7 +8006,8 @@ pub fn _mm_maskz_sra_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_srai_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srai_epi16(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); transmute(simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16))) @@ -7457,7 +8022,12 @@ pub fn _mm512_srai_epi16(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_srai_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srai_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16)); @@ -7473,7 +8043,8 @@ pub fn _mm512_mask_srai_epi16(src: __m512i, k: __mmask32, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_srai_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srai_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i16x32(), i16x32::splat(IMM8.min(15) as i16)); @@ -7489,7 +8060,12 @@ pub fn _mm512_maskz_srai_epi16(k: __mmask32, a: __m512i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_srai_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srai_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16)); @@ -7505,7 +8081,8 @@ pub fn _mm256_mask_srai_epi16(src: __m256i, k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_srai_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srai_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = simd_shr(a.as_i16x16(), i16x16::splat(IMM8.min(15) as i16)); @@ -7521,7 +8098,12 @@ pub fn _mm256_maskz_srai_epi16(k: __mmask16, a: __m256i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_srai_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srai_epi16( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16)); @@ -7537,7 +8119,8 @@ pub fn _mm_mask_srai_epi16(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraw, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_srai_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srai_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16)); @@ -7552,7 +8135,8 @@ pub fn _mm_maskz_srai_epi16(k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm512_srav_epi16(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srav_epi16(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u16x32(); let no_overflow: u16x32 = simd_lt(count, u16x32::splat(u16::BITS as u16)); @@ -7568,7 +8152,13 @@ pub fn _mm512_srav_epi16(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm512_mask_srav_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srav_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_srav_epi16(a, count).as_i16x32(); transmute(simd_select_bitmask(k, shf, src.as_i16x32())) @@ -7582,7 +8172,8 @@ pub fn _mm512_mask_srav_epi16(src: __m512i, k: __mmask32, a: __m512i, count: __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm512_maskz_srav_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srav_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_srav_epi16(a, count).as_i16x32(); transmute(simd_select_bitmask(k, shf, i16x32::ZERO)) @@ -7596,7 +8187,8 @@ pub fn _mm512_maskz_srav_epi16(k: __mmask32, a: __m512i, count: __m512i) -> __m5 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm256_srav_epi16(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srav_epi16(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u16x16(); let no_overflow: u16x16 = simd_lt(count, u16x16::splat(u16::BITS as u16)); @@ -7612,7 +8204,13 @@ pub fn _mm256_srav_epi16(a: __m256i, count: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm256_mask_srav_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srav_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_srav_epi16(a, count).as_i16x16(); transmute(simd_select_bitmask(k, shf, src.as_i16x16())) @@ -7626,7 +8224,8 @@ pub fn _mm256_mask_srav_epi16(src: __m256i, k: __mmask16, a: __m256i, count: __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm256_maskz_srav_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srav_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_srav_epi16(a, count).as_i16x16(); transmute(simd_select_bitmask(k, shf, i16x16::ZERO)) @@ -7640,7 +8239,8 @@ pub fn _mm256_maskz_srav_epi16(k: __mmask16, a: __m256i, count: __m256i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm_srav_epi16(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srav_epi16(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u16x8(); let no_overflow: u16x8 = simd_lt(count, u16x8::splat(u16::BITS as u16)); @@ -7656,7 +8256,8 @@ pub fn _mm_srav_epi16(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm_mask_srav_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srav_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srav_epi16(a, count).as_i16x8(); transmute(simd_select_bitmask(k, shf, src.as_i16x8())) @@ -7670,7 +8271,8 @@ pub fn _mm_mask_srav_epi16(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravw))] -pub fn _mm_maskz_srav_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srav_epi16(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srav_epi16(a, count).as_i16x8(); transmute(simd_select_bitmask(k, shf, i16x8::ZERO)) @@ -8000,7 +8602,8 @@ pub fn _mm_maskz_permutexvar_epi16(k: __mmask8, idx: __m128i, a: __m128i) -> __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw -pub fn _mm512_mask_blend_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask(k, b.as_i16x32(), a.as_i16x32())) } } @@ -8011,7 +8614,8 @@ pub fn _mm512_mask_blend_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw -pub fn _mm256_mask_blend_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask(k, b.as_i16x16(), a.as_i16x16())) } } @@ -8022,7 +8626,8 @@ pub fn _mm256_mask_blend_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] //should be vpblendmw -pub fn _mm_mask_blend_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask(k, b.as_i16x8(), a.as_i16x8())) } } @@ -8033,7 +8638,8 @@ pub fn _mm_mask_blend_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb -pub fn _mm512_mask_blend_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask(k, b.as_i8x64(), a.as_i8x64())) } } @@ -8044,7 +8650,8 @@ pub fn _mm512_mask_blend_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb -pub fn _mm256_mask_blend_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask(k, b.as_i8x32(), a.as_i8x32())) } } @@ -8055,7 +8662,8 @@ pub fn _mm256_mask_blend_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] //should be vpblendmb -pub fn _mm_mask_blend_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask(k, b.as_i8x16(), a.as_i8x16())) } } @@ -8066,7 +8674,8 @@ pub fn _mm_mask_blend_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm512_broadcastw_epi16(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastw_epi16(a: __m128i) -> __m512i { unsafe { let a = _mm512_castsi128_si512(a).as_i16x32(); let ret: i16x32 = simd_shuffle!( @@ -8088,7 +8697,8 @@ pub fn _mm512_broadcastw_epi16(a: __m128i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm512_mask_broadcastw_epi16(src: __m512i, k: __mmask32, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcastw_epi16(src: __m512i, k: __mmask32, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastw_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, broadcast, src.as_i16x32())) @@ -8102,7 +8712,8 @@ pub fn _mm512_mask_broadcastw_epi16(src: __m512i, k: __mmask32, a: __m128i) -> _ #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm512_maskz_broadcastw_epi16(k: __mmask32, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcastw_epi16(k: __mmask32, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastw_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, broadcast, i16x32::ZERO)) @@ -8116,7 +8727,8 @@ pub fn _mm512_maskz_broadcastw_epi16(k: __mmask32, a: __m128i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm256_mask_broadcastw_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcastw_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastw_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, broadcast, src.as_i16x16())) @@ -8130,7 +8742,8 @@ pub fn _mm256_mask_broadcastw_epi16(src: __m256i, k: __mmask16, a: __m128i) -> _ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm256_maskz_broadcastw_epi16(k: __mmask16, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcastw_epi16(k: __mmask16, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastw_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, broadcast, i16x16::ZERO)) @@ -8144,7 +8757,8 @@ pub fn _mm256_maskz_broadcastw_epi16(k: __mmask16, a: __m128i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm_mask_broadcastw_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_broadcastw_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastw_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, broadcast, src.as_i16x8())) @@ -8158,7 +8772,8 @@ pub fn _mm_mask_broadcastw_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m12 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm_maskz_broadcastw_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_broadcastw_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastw_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, broadcast, i16x8::ZERO)) @@ -8172,7 +8787,8 @@ pub fn _mm_maskz_broadcastw_epi16(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm512_broadcastb_epi8(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastb_epi8(a: __m128i) -> __m512i { unsafe { let a = _mm512_castsi128_si512(a).as_i8x64(); let ret: i8x64 = simd_shuffle!( @@ -8195,7 +8811,8 @@ pub fn _mm512_broadcastb_epi8(a: __m128i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm512_mask_broadcastb_epi8(src: __m512i, k: __mmask64, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcastb_epi8(src: __m512i, k: __mmask64, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastb_epi8(a).as_i8x64(); transmute(simd_select_bitmask(k, broadcast, src.as_i8x64())) @@ -8209,7 +8826,8 @@ pub fn _mm512_mask_broadcastb_epi8(src: __m512i, k: __mmask64, a: __m128i) -> __ #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm512_maskz_broadcastb_epi8(k: __mmask64, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcastb_epi8(k: __mmask64, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastb_epi8(a).as_i8x64(); transmute(simd_select_bitmask(k, broadcast, i8x64::ZERO)) @@ -8223,7 +8841,8 @@ pub fn _mm512_maskz_broadcastb_epi8(k: __mmask64, a: __m128i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm256_mask_broadcastb_epi8(src: __m256i, k: __mmask32, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcastb_epi8(src: __m256i, k: __mmask32, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastb_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, broadcast, src.as_i8x32())) @@ -8237,7 +8856,8 @@ pub fn _mm256_mask_broadcastb_epi8(src: __m256i, k: __mmask32, a: __m128i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm256_maskz_broadcastb_epi8(k: __mmask32, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcastb_epi8(k: __mmask32, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastb_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, broadcast, i8x32::ZERO)) @@ -8251,7 +8871,8 @@ pub fn _mm256_maskz_broadcastb_epi8(k: __mmask32, a: __m128i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm_mask_broadcastb_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_broadcastb_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastb_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, broadcast, src.as_i8x16())) @@ -8265,7 +8886,8 @@ pub fn _mm_mask_broadcastb_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m12 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastb))] -pub fn _mm_maskz_broadcastb_epi8(k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_broadcastb_epi8(k: __mmask16, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastb_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, broadcast, i8x16::ZERO)) @@ -8279,7 +8901,8 @@ pub fn _mm_maskz_broadcastb_epi8(k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm512_unpackhi_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpackhi_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_i16x32(); let b = b.as_i16x32(); @@ -8309,7 +8932,13 @@ pub fn _mm512_unpackhi_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm512_mask_unpackhi_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpackhi_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, unpackhi, src.as_i16x32())) @@ -8323,7 +8952,8 @@ pub fn _mm512_mask_unpackhi_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm512_maskz_unpackhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpackhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, unpackhi, i16x32::ZERO)) @@ -8337,7 +8967,13 @@ pub fn _mm512_maskz_unpackhi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m5 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm256_mask_unpackhi_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpackhi_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, unpackhi, src.as_i16x16())) @@ -8351,7 +8987,8 @@ pub fn _mm256_mask_unpackhi_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm256_maskz_unpackhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpackhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, unpackhi, i16x16::ZERO)) @@ -8365,7 +9002,8 @@ pub fn _mm256_maskz_unpackhi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm_mask_unpackhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpackhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, unpackhi, src.as_i16x8())) @@ -8379,7 +9017,8 @@ pub fn _mm_mask_unpackhi_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhwd))] -pub fn _mm_maskz_unpackhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpackhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, unpackhi, i16x8::ZERO)) @@ -8393,7 +9032,8 @@ pub fn _mm_maskz_unpackhi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm512_unpackhi_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpackhi_epi8(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_i8x64(); let b = b.as_i8x64(); @@ -8431,7 +9071,13 @@ pub fn _mm512_unpackhi_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm512_mask_unpackhi_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpackhi_epi8( + src: __m512i, + k: __mmask64, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, unpackhi, src.as_i8x64())) @@ -8445,7 +9091,8 @@ pub fn _mm512_mask_unpackhi_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m5 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm512_maskz_unpackhi_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpackhi_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, unpackhi, i8x64::ZERO)) @@ -8459,7 +9106,13 @@ pub fn _mm512_maskz_unpackhi_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m51 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm256_mask_unpackhi_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpackhi_epi8( + src: __m256i, + k: __mmask32, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, unpackhi, src.as_i8x32())) @@ -8473,7 +9126,8 @@ pub fn _mm256_mask_unpackhi_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm256_maskz_unpackhi_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpackhi_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, unpackhi, i8x32::ZERO)) @@ -8487,7 +9141,8 @@ pub fn _mm256_maskz_unpackhi_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m25 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm_mask_unpackhi_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpackhi_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, unpackhi, src.as_i8x16())) @@ -8501,7 +9156,8 @@ pub fn _mm_mask_unpackhi_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhbw))] -pub fn _mm_maskz_unpackhi_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpackhi_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, unpackhi, i8x16::ZERO)) @@ -8515,7 +9171,8 @@ pub fn _mm_maskz_unpackhi_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm512_unpacklo_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpacklo_epi16(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_i16x32(); let b = b.as_i16x32(); @@ -8545,7 +9202,13 @@ pub fn _mm512_unpacklo_epi16(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm512_mask_unpacklo_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpacklo_epi16( + src: __m512i, + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, unpacklo, src.as_i16x32())) @@ -8559,7 +9222,8 @@ pub fn _mm512_mask_unpacklo_epi16(src: __m512i, k: __mmask32, a: __m512i, b: __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm512_maskz_unpacklo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpacklo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi16(a, b).as_i16x32(); transmute(simd_select_bitmask(k, unpacklo, i16x32::ZERO)) @@ -8573,7 +9237,13 @@ pub fn _mm512_maskz_unpacklo_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m5 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm256_mask_unpacklo_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpacklo_epi16( + src: __m256i, + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, unpacklo, src.as_i16x16())) @@ -8587,7 +9257,8 @@ pub fn _mm256_mask_unpacklo_epi16(src: __m256i, k: __mmask16, a: __m256i, b: __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm256_maskz_unpacklo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpacklo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi16(a, b).as_i16x16(); transmute(simd_select_bitmask(k, unpacklo, i16x16::ZERO)) @@ -8601,7 +9272,8 @@ pub fn _mm256_maskz_unpacklo_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm_mask_unpacklo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpacklo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, unpacklo, src.as_i16x8())) @@ -8615,7 +9287,8 @@ pub fn _mm_mask_unpacklo_epi16(src: __m128i, k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklwd))] -pub fn _mm_maskz_unpacklo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpacklo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi16(a, b).as_i16x8(); transmute(simd_select_bitmask(k, unpacklo, i16x8::ZERO)) @@ -8629,7 +9302,8 @@ pub fn _mm_maskz_unpacklo_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm512_unpacklo_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpacklo_epi8(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_i8x64(); let b = b.as_i8x64(); @@ -8667,7 +9341,13 @@ pub fn _mm512_unpacklo_epi8(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm512_mask_unpacklo_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpacklo_epi8( + src: __m512i, + k: __mmask64, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, unpacklo, src.as_i8x64())) @@ -8681,7 +9361,8 @@ pub fn _mm512_mask_unpacklo_epi8(src: __m512i, k: __mmask64, a: __m512i, b: __m5 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm512_maskz_unpacklo_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpacklo_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi8(a, b).as_i8x64(); transmute(simd_select_bitmask(k, unpacklo, i8x64::ZERO)) @@ -8695,7 +9376,13 @@ pub fn _mm512_maskz_unpacklo_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m51 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm256_mask_unpacklo_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpacklo_epi8( + src: __m256i, + k: __mmask32, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, unpacklo, src.as_i8x32())) @@ -8709,7 +9396,8 @@ pub fn _mm256_mask_unpacklo_epi8(src: __m256i, k: __mmask32, a: __m256i, b: __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm256_maskz_unpacklo_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpacklo_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi8(a, b).as_i8x32(); transmute(simd_select_bitmask(k, unpacklo, i8x32::ZERO)) @@ -8723,7 +9411,8 @@ pub fn _mm256_maskz_unpacklo_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m25 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm_mask_unpacklo_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpacklo_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, unpacklo, src.as_i8x16())) @@ -8737,7 +9426,8 @@ pub fn _mm_mask_unpacklo_epi8(src: __m128i, k: __mmask16, a: __m128i, b: __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklbw))] -pub fn _mm_maskz_unpacklo_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpacklo_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi8(a, b).as_i8x16(); transmute(simd_select_bitmask(k, unpacklo, i8x16::ZERO)) @@ -8751,7 +9441,8 @@ pub fn _mm_maskz_unpacklo_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] -pub fn _mm512_mask_mov_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mov_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i { unsafe { let mov = a.as_i16x32(); transmute(simd_select_bitmask(k, mov, src.as_i16x32())) @@ -8765,7 +9456,8 @@ pub fn _mm512_mask_mov_epi16(src: __m512i, k: __mmask32, a: __m512i) -> __m512i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] -pub fn _mm512_maskz_mov_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mov_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { let mov = a.as_i16x32(); transmute(simd_select_bitmask(k, mov, i16x32::ZERO)) @@ -8779,7 +9471,8 @@ pub fn _mm512_maskz_mov_epi16(k: __mmask32, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] -pub fn _mm256_mask_mov_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mov_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i { unsafe { let mov = a.as_i16x16(); transmute(simd_select_bitmask(k, mov, src.as_i16x16())) @@ -8793,7 +9486,8 @@ pub fn _mm256_mask_mov_epi16(src: __m256i, k: __mmask16, a: __m256i) -> __m256i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] -pub fn _mm256_maskz_mov_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mov_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { let mov = a.as_i16x16(); transmute(simd_select_bitmask(k, mov, i16x16::ZERO)) @@ -8807,7 +9501,8 @@ pub fn _mm256_maskz_mov_epi16(k: __mmask16, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] -pub fn _mm_mask_mov_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mov_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let mov = a.as_i16x8(); transmute(simd_select_bitmask(k, mov, src.as_i16x8())) @@ -8821,7 +9516,8 @@ pub fn _mm_mask_mov_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu16))] -pub fn _mm_maskz_mov_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mov_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { let mov = a.as_i16x8(); transmute(simd_select_bitmask(k, mov, i16x8::ZERO)) @@ -8835,7 +9531,8 @@ pub fn _mm_maskz_mov_epi16(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] -pub fn _mm512_mask_mov_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mov_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { unsafe { let mov = a.as_i8x64(); transmute(simd_select_bitmask(k, mov, src.as_i8x64())) @@ -8849,7 +9546,8 @@ pub fn _mm512_mask_mov_epi8(src: __m512i, k: __mmask64, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] -pub fn _mm512_maskz_mov_epi8(k: __mmask64, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mov_epi8(k: __mmask64, a: __m512i) -> __m512i { unsafe { let mov = a.as_i8x64(); transmute(simd_select_bitmask(k, mov, i8x64::ZERO)) @@ -8863,7 +9561,8 @@ pub fn _mm512_maskz_mov_epi8(k: __mmask64, a: __m512i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] -pub fn _mm256_mask_mov_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mov_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { unsafe { let mov = a.as_i8x32(); transmute(simd_select_bitmask(k, mov, src.as_i8x32())) @@ -8877,7 +9576,8 @@ pub fn _mm256_mask_mov_epi8(src: __m256i, k: __mmask32, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] -pub fn _mm256_maskz_mov_epi8(k: __mmask32, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mov_epi8(k: __mmask32, a: __m256i) -> __m256i { unsafe { let mov = a.as_i8x32(); transmute(simd_select_bitmask(k, mov, i8x32::ZERO)) @@ -8891,7 +9591,8 @@ pub fn _mm256_maskz_mov_epi8(k: __mmask32, a: __m256i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] -pub fn _mm_mask_mov_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mov_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { unsafe { let mov = a.as_i8x16(); transmute(simd_select_bitmask(k, mov, src.as_i8x16())) @@ -8905,7 +9606,8 @@ pub fn _mm_mask_mov_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqu8))] -pub fn _mm_maskz_mov_epi8(k: __mmask16, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mov_epi8(k: __mmask16, a: __m128i) -> __m128i { unsafe { let mov = a.as_i8x16(); transmute(simd_select_bitmask(k, mov, i8x16::ZERO)) @@ -8919,7 +9621,8 @@ pub fn _mm_maskz_mov_epi8(k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm512_mask_set1_epi16(src: __m512i, k: __mmask32, a: i16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_set1_epi16(src: __m512i, k: __mmask32, a: i16) -> __m512i { unsafe { let r = _mm512_set1_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, r, src.as_i16x32())) @@ -8933,7 +9636,8 @@ pub fn _mm512_mask_set1_epi16(src: __m512i, k: __mmask32, a: i16) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm512_maskz_set1_epi16(k: __mmask32, a: i16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_set1_epi16(k: __mmask32, a: i16) -> __m512i { unsafe { let r = _mm512_set1_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, r, i16x32::ZERO)) @@ -8947,7 +9651,8 @@ pub fn _mm512_maskz_set1_epi16(k: __mmask32, a: i16) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm256_mask_set1_epi16(src: __m256i, k: __mmask16, a: i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_set1_epi16(src: __m256i, k: __mmask16, a: i16) -> __m256i { unsafe { let r = _mm256_set1_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, r, src.as_i16x16())) @@ -8961,7 +9666,8 @@ pub fn _mm256_mask_set1_epi16(src: __m256i, k: __mmask16, a: i16) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm256_maskz_set1_epi16(k: __mmask16, a: i16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_set1_epi16(k: __mmask16, a: i16) -> __m256i { unsafe { let r = _mm256_set1_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, r, i16x16::ZERO)) @@ -8975,7 +9681,8 @@ pub fn _mm256_maskz_set1_epi16(k: __mmask16, a: i16) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm_mask_set1_epi16(src: __m128i, k: __mmask8, a: i16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_set1_epi16(src: __m128i, k: __mmask8, a: i16) -> __m128i { unsafe { let r = _mm_set1_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, r, src.as_i16x8())) @@ -8989,7 +9696,8 @@ pub fn _mm_mask_set1_epi16(src: __m128i, k: __mmask8, a: i16) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastw))] -pub fn _mm_maskz_set1_epi16(k: __mmask8, a: i16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_set1_epi16(k: __mmask8, a: i16) -> __m128i { unsafe { let r = _mm_set1_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, r, i16x8::ZERO)) @@ -9003,7 +9711,8 @@ pub fn _mm_maskz_set1_epi16(k: __mmask8, a: i16) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] -pub fn _mm512_mask_set1_epi8(src: __m512i, k: __mmask64, a: i8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_set1_epi8(src: __m512i, k: __mmask64, a: i8) -> __m512i { unsafe { let r = _mm512_set1_epi8(a).as_i8x64(); transmute(simd_select_bitmask(k, r, src.as_i8x64())) @@ -9017,7 +9726,8 @@ pub fn _mm512_mask_set1_epi8(src: __m512i, k: __mmask64, a: i8) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] -pub fn _mm512_maskz_set1_epi8(k: __mmask64, a: i8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_set1_epi8(k: __mmask64, a: i8) -> __m512i { unsafe { let r = _mm512_set1_epi8(a).as_i8x64(); transmute(simd_select_bitmask(k, r, i8x64::ZERO)) @@ -9031,7 +9741,8 @@ pub fn _mm512_maskz_set1_epi8(k: __mmask64, a: i8) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] -pub fn _mm256_mask_set1_epi8(src: __m256i, k: __mmask32, a: i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_set1_epi8(src: __m256i, k: __mmask32, a: i8) -> __m256i { unsafe { let r = _mm256_set1_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, r, src.as_i8x32())) @@ -9045,7 +9756,8 @@ pub fn _mm256_mask_set1_epi8(src: __m256i, k: __mmask32, a: i8) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] -pub fn _mm256_maskz_set1_epi8(k: __mmask32, a: i8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_set1_epi8(k: __mmask32, a: i8) -> __m256i { unsafe { let r = _mm256_set1_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, r, i8x32::ZERO)) @@ -9059,7 +9771,8 @@ pub fn _mm256_maskz_set1_epi8(k: __mmask32, a: i8) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] -pub fn _mm_mask_set1_epi8(src: __m128i, k: __mmask16, a: i8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_set1_epi8(src: __m128i, k: __mmask16, a: i8) -> __m128i { unsafe { let r = _mm_set1_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, r, src.as_i8x16())) @@ -9073,7 +9786,8 @@ pub fn _mm_mask_set1_epi8(src: __m128i, k: __mmask16, a: i8) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] -pub fn _mm_maskz_set1_epi8(k: __mmask16, a: i8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_set1_epi8(k: __mmask16, a: i8) -> __m128i { unsafe { let r = _mm_set1_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, r, i8x16::ZERO)) @@ -9088,7 +9802,8 @@ pub fn _mm_maskz_set1_epi8(k: __mmask16, a: i8) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_shufflelo_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shufflelo_epi16(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let a = a.as_i16x32(); @@ -9142,7 +9857,8 @@ pub fn _mm512_shufflelo_epi16(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_shufflelo_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shufflelo_epi16( src: __m512i, k: __mmask32, a: __m512i, @@ -9162,7 +9878,8 @@ pub fn _mm512_mask_shufflelo_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_shufflelo_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shufflelo_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm512_shufflelo_epi16::(a); @@ -9178,7 +9895,8 @@ pub fn _mm512_maskz_shufflelo_epi16(k: __mmask32, a: __m512i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_shufflelo_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shufflelo_epi16( src: __m256i, k: __mmask16, a: __m256i, @@ -9198,7 +9916,8 @@ pub fn _mm256_mask_shufflelo_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_shufflelo_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shufflelo_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shuffle = _mm256_shufflelo_epi16::(a); @@ -9214,7 +9933,12 @@ pub fn _mm256_maskz_shufflelo_epi16(k: __mmask16, a: __m256i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_shufflelo_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shufflelo_epi16( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shuffle = _mm_shufflelo_epi16::(a); @@ -9230,7 +9954,8 @@ pub fn _mm_mask_shufflelo_epi16(src: __m128i, k: __mmask8, a: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshuflw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_shufflelo_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shufflelo_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shuffle = _mm_shufflelo_epi16::(a); @@ -9246,7 +9971,8 @@ pub fn _mm_maskz_shufflelo_epi16(k: __mmask8, a: __m128i) -> __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_shufflehi_epi16(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shufflehi_epi16(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let a = a.as_i16x32(); @@ -9300,7 +10026,8 @@ pub fn _mm512_shufflehi_epi16(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_shufflehi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shufflehi_epi16( src: __m512i, k: __mmask32, a: __m512i, @@ -9320,7 +10047,8 @@ pub fn _mm512_mask_shufflehi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_shufflehi_epi16(k: __mmask32, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shufflehi_epi16(k: __mmask32, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm512_shufflehi_epi16::(a); @@ -9336,7 +10064,8 @@ pub fn _mm512_maskz_shufflehi_epi16(k: __mmask32, a: __m512i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_shufflehi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shufflehi_epi16( src: __m256i, k: __mmask16, a: __m256i, @@ -9356,7 +10085,8 @@ pub fn _mm256_mask_shufflehi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_shufflehi_epi16(k: __mmask16, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shufflehi_epi16(k: __mmask16, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shuffle = _mm256_shufflehi_epi16::(a); @@ -9372,7 +10102,12 @@ pub fn _mm256_maskz_shufflehi_epi16(k: __mmask16, a: __m256i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_shufflehi_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shufflehi_epi16( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shuffle = _mm_shufflehi_epi16::(a); @@ -9388,7 +10123,8 @@ pub fn _mm_mask_shufflehi_epi16(src: __m128i, k: __mmask8, a: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufhw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_shufflehi_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shufflehi_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shuffle = _mm_shufflehi_epi16::(a); @@ -9498,7 +10234,8 @@ pub fn _mm_maskz_shuffle_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmw))] -pub fn _mm512_test_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_test_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpneq_epi16_mask(and, zero) @@ -9511,7 +10248,8 @@ pub fn _mm512_test_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmw))] -pub fn _mm512_mask_test_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_test_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpneq_epi16_mask(k, and, zero) @@ -9524,7 +10262,8 @@ pub fn _mm512_mask_test_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mm #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmw))] -pub fn _mm256_test_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_test_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpneq_epi16_mask(and, zero) @@ -9537,7 +10276,8 @@ pub fn _mm256_test_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmw))] -pub fn _mm256_mask_test_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_test_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpneq_epi16_mask(k, and, zero) @@ -9550,7 +10290,8 @@ pub fn _mm256_mask_test_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mm #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmw))] -pub fn _mm_test_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_test_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpneq_epi16_mask(and, zero) @@ -9563,7 +10304,8 @@ pub fn _mm_test_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmw))] -pub fn _mm_mask_test_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_test_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpneq_epi16_mask(k, and, zero) @@ -9576,7 +10318,8 @@ pub fn _mm_mask_test_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmb))] -pub fn _mm512_test_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_test_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpneq_epi8_mask(and, zero) @@ -9589,7 +10332,8 @@ pub fn _mm512_test_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmb))] -pub fn _mm512_mask_test_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_test_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpneq_epi8_mask(k, and, zero) @@ -9602,7 +10346,8 @@ pub fn _mm512_mask_test_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mma #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmb))] -pub fn _mm256_test_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_test_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpneq_epi8_mask(and, zero) @@ -9615,7 +10360,8 @@ pub fn _mm256_test_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmb))] -pub fn _mm256_mask_test_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_test_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpneq_epi8_mask(k, and, zero) @@ -9628,7 +10374,8 @@ pub fn _mm256_mask_test_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mma #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmb))] -pub fn _mm_test_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_test_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpneq_epi8_mask(and, zero) @@ -9641,7 +10388,8 @@ pub fn _mm_test_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmb))] -pub fn _mm_mask_test_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_test_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpneq_epi8_mask(k, and, zero) @@ -9654,7 +10402,8 @@ pub fn _mm_mask_test_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask1 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmw))] -pub fn _mm512_testn_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_testn_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpeq_epi16_mask(and, zero) @@ -9667,7 +10416,8 @@ pub fn _mm512_testn_epi16_mask(a: __m512i, b: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmw))] -pub fn _mm512_mask_testn_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_testn_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __mmask32 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpeq_epi16_mask(k, and, zero) @@ -9680,7 +10430,8 @@ pub fn _mm512_mask_testn_epi16_mask(k: __mmask32, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmw))] -pub fn _mm256_testn_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_testn_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpeq_epi16_mask(and, zero) @@ -9693,7 +10444,8 @@ pub fn _mm256_testn_epi16_mask(a: __m256i, b: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmw))] -pub fn _mm256_mask_testn_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_testn_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __mmask16 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpeq_epi16_mask(k, and, zero) @@ -9706,7 +10458,8 @@ pub fn _mm256_mask_testn_epi16_mask(k: __mmask16, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmw))] -pub fn _mm_testn_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testn_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpeq_epi16_mask(and, zero) @@ -9719,7 +10472,8 @@ pub fn _mm_testn_epi16_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmw))] -pub fn _mm_mask_testn_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_testn_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpeq_epi16_mask(k, and, zero) @@ -9732,7 +10486,8 @@ pub fn _mm_mask_testn_epi16_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmb))] -pub fn _mm512_testn_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_testn_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpeq_epi8_mask(and, zero) @@ -9745,7 +10500,8 @@ pub fn _mm512_testn_epi8_mask(a: __m512i, b: __m512i) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmb))] -pub fn _mm512_mask_testn_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_testn_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mmask64 { let and = _mm512_and_si512(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpeq_epi8_mask(k, and, zero) @@ -9758,7 +10514,8 @@ pub fn _mm512_mask_testn_epi8_mask(k: __mmask64, a: __m512i, b: __m512i) -> __mm #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmb))] -pub fn _mm256_testn_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_testn_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpeq_epi8_mask(and, zero) @@ -9771,7 +10528,8 @@ pub fn _mm256_testn_epi8_mask(a: __m256i, b: __m256i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmb))] -pub fn _mm256_mask_testn_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_testn_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mmask32 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpeq_epi8_mask(k, and, zero) @@ -9784,7 +10542,8 @@ pub fn _mm256_mask_testn_epi8_mask(k: __mmask32, a: __m256i, b: __m256i) -> __mm #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmb))] -pub fn _mm_testn_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testn_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpeq_epi8_mask(and, zero) @@ -9797,7 +10556,8 @@ pub fn _mm_testn_epi8_mask(a: __m128i, b: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmb))] -pub fn _mm_mask_testn_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_testn_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask16 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpeq_epi8_mask(k, and, zero) @@ -9810,7 +10570,8 @@ pub fn _mm_mask_testn_epi8_mask(k: __mmask16, a: __m128i, b: __m128i) -> __mmask #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] //should be kmovq -pub unsafe fn _store_mask64(mem_addr: *mut __mmask64, a: __mmask64) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _store_mask64(mem_addr: *mut __mmask64, a: __mmask64) { ptr::write(mem_addr as *mut __mmask64, a); } @@ -9821,7 +10582,8 @@ pub unsafe fn _store_mask64(mem_addr: *mut __mmask64, a: __mmask64) { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] //should be kmovd -pub unsafe fn _store_mask32(mem_addr: *mut __mmask32, a: __mmask32) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _store_mask32(mem_addr: *mut __mmask32, a: __mmask32) { ptr::write(mem_addr as *mut __mmask32, a); } @@ -9832,7 +10594,8 @@ pub unsafe fn _store_mask32(mem_addr: *mut __mmask32, a: __mmask32) { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] //should be kmovq -pub unsafe fn _load_mask64(mem_addr: *const __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _load_mask64(mem_addr: *const __mmask64) -> __mmask64 { ptr::read(mem_addr as *const __mmask64) } @@ -9843,7 +10606,8 @@ pub unsafe fn _load_mask64(mem_addr: *const __mmask64) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] //should be kmovd -pub unsafe fn _load_mask32(mem_addr: *const __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _load_mask32(mem_addr: *const __mmask32) -> __mmask32 { ptr::read(mem_addr as *const __mmask32) } @@ -10042,7 +10806,8 @@ pub fn _mm_maskz_dbsad_epu8(k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovw2m))] -pub fn _mm512_movepi16_mask(a: __m512i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movepi16_mask(a: __m512i) -> __mmask32 { let filter = _mm512_set1_epi16(1 << 15); let a = _mm512_and_si512(a, filter); _mm512_cmpeq_epi16_mask(a, filter) @@ -10055,7 +10820,8 @@ pub fn _mm512_movepi16_mask(a: __m512i) -> __mmask32 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovw2m))] -pub fn _mm256_movepi16_mask(a: __m256i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movepi16_mask(a: __m256i) -> __mmask16 { let filter = _mm256_set1_epi16(1 << 15); let a = _mm256_and_si256(a, filter); _mm256_cmpeq_epi16_mask(a, filter) @@ -10068,7 +10834,8 @@ pub fn _mm256_movepi16_mask(a: __m256i) -> __mmask16 { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovw2m))] -pub fn _mm_movepi16_mask(a: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movepi16_mask(a: __m128i) -> __mmask8 { let filter = _mm_set1_epi16(1 << 15); let a = _mm_and_si128(a, filter); _mm_cmpeq_epi16_mask(a, filter) @@ -10081,7 +10848,8 @@ pub fn _mm_movepi16_mask(a: __m128i) -> __mmask8 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovb2m))] -pub fn _mm512_movepi8_mask(a: __m512i) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movepi8_mask(a: __m512i) -> __mmask64 { let filter = _mm512_set1_epi8(1 << 7); let a = _mm512_and_si512(a, filter); _mm512_cmpeq_epi8_mask(a, filter) @@ -10093,9 +10861,11 @@ pub fn _mm512_movepi8_mask(a: __m512i) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -#[cfg_attr(test, assert_instr(vpmovmskb))] // should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than +#[cfg_attr(test, assert_instr(vpmovmskb))] +// should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than // using vpmovb2m plus converting the mask register to a standard register. -pub fn _mm256_movepi8_mask(a: __m256i) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movepi8_mask(a: __m256i) -> __mmask32 { let filter = _mm256_set1_epi8(1 << 7); let a = _mm256_and_si256(a, filter); _mm256_cmpeq_epi8_mask(a, filter) @@ -10107,9 +10877,11 @@ pub fn _mm256_movepi8_mask(a: __m256i) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -#[cfg_attr(test, assert_instr(vpmovmskb))] // should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than +#[cfg_attr(test, assert_instr(vpmovmskb))] +// should be vpmovb2m but compiled to vpmovmskb in the test shim because that takes less cycles than // using vpmovb2m plus converting the mask register to a standard register. -pub fn _mm_movepi8_mask(a: __m128i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movepi8_mask(a: __m128i) -> __mmask16 { let filter = _mm_set1_epi8(1 << 7); let a = _mm_and_si128(a, filter); _mm_cmpeq_epi8_mask(a, filter) @@ -10122,7 +10894,8 @@ pub fn _mm_movepi8_mask(a: __m128i) -> __mmask16 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovm2w))] -pub fn _mm512_movm_epi16(k: __mmask32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movm_epi16(k: __mmask32) -> __m512i { unsafe { let one = _mm512_set1_epi16( 1 << 15 @@ -10154,7 +10927,8 @@ pub fn _mm512_movm_epi16(k: __mmask32) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovm2w))] -pub fn _mm256_movm_epi16(k: __mmask16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movm_epi16(k: __mmask16) -> __m256i { unsafe { let one = _mm256_set1_epi16( 1 << 15 @@ -10186,7 +10960,8 @@ pub fn _mm256_movm_epi16(k: __mmask16) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovm2w))] -pub fn _mm_movm_epi16(k: __mmask8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movm_epi16(k: __mmask8) -> __m128i { unsafe { let one = _mm_set1_epi16( 1 << 15 @@ -10218,7 +10993,8 @@ pub fn _mm_movm_epi16(k: __mmask8) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovm2b))] -pub fn _mm512_movm_epi8(k: __mmask64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movm_epi8(k: __mmask64) -> __m512i { unsafe { let one = _mm512_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0) @@ -10234,7 +11010,8 @@ pub fn _mm512_movm_epi8(k: __mmask64) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovm2b))] -pub fn _mm256_movm_epi8(k: __mmask32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movm_epi8(k: __mmask32) -> __m256i { unsafe { let one = _mm256_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0) @@ -10250,7 +11027,8 @@ pub fn _mm256_movm_epi8(k: __mmask32) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovm2b))] -pub fn _mm_movm_epi8(k: __mmask16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movm_epi8(k: __mmask16) -> __m128i { unsafe { let one = _mm_set1_epi8(1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0) @@ -10265,7 +11043,8 @@ pub fn _mm_movm_epi8(k: __mmask16) -> __m128i { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtmask32_u32(a: __mmask32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtmask32_u32(a: __mmask32) -> u32 { a } @@ -10275,7 +11054,8 @@ pub fn _cvtmask32_u32(a: __mmask32) -> u32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtu32_mask32(a: u32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtu32_mask32(a: u32) -> __mmask32 { a } @@ -10285,8 +11065,9 @@ pub fn _cvtu32_mask32(a: u32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { - a + b +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { + a.wrapping_add(b) } /// Add 64-bit masks in a and b, and store the result in k. @@ -10295,8 +11076,9 @@ pub fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { - a + b +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { + a.wrapping_add(b) } /// Compute the bitwise AND of 32-bit masks a and b, and store the result in k. @@ -10305,7 +11087,8 @@ pub fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { a & b } @@ -10315,7 +11098,8 @@ pub fn _kand_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { a & b } @@ -10325,7 +11109,8 @@ pub fn _kand_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _knot_mask32(a: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _knot_mask32(a: __mmask32) -> __mmask32 { !a } @@ -10335,7 +11120,8 @@ pub fn _knot_mask32(a: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _knot_mask64(a: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _knot_mask64(a: __mmask64) -> __mmask64 { !a } @@ -10345,7 +11131,8 @@ pub fn _knot_mask64(a: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { _knot_mask32(a) & b } @@ -10355,7 +11142,8 @@ pub fn _kandn_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { _knot_mask64(a) & b } @@ -10365,7 +11153,8 @@ pub fn _kandn_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { a | b } @@ -10375,7 +11164,8 @@ pub fn _kor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { a | b } @@ -10385,7 +11175,8 @@ pub fn _kor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { a ^ b } @@ -10395,7 +11186,8 @@ pub fn _kxor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { a ^ b } @@ -10405,7 +11197,8 @@ pub fn _kxor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { _knot_mask32(a ^ b) } @@ -10415,7 +11208,8 @@ pub fn _kxnor_mask32(a: __mmask32, b: __mmask32) -> __mmask32 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { _knot_mask64(a ^ b) } @@ -10426,7 +11220,8 @@ pub fn _kxnor_mask64(a: __mmask64, b: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _kortest_mask32_u8(a: __mmask32, b: __mmask32, all_ones: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _kortest_mask32_u8(a: __mmask32, b: __mmask32, all_ones: *mut u8) -> u8 { let tmp = _kor_mask32(a, b); *all_ones = (tmp == 0xffffffff) as u8; (tmp == 0) as u8 @@ -10439,7 +11234,8 @@ pub unsafe fn _kortest_mask32_u8(a: __mmask32, b: __mmask32, all_ones: *mut u8) #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _kortest_mask64_u8(a: __mmask64, b: __mmask64, all_ones: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _kortest_mask64_u8(a: __mmask64, b: __mmask64, all_ones: *mut u8) -> u8 { let tmp = _kor_mask64(a, b); *all_ones = (tmp == 0xffffffff_ffffffff) as u8; (tmp == 0) as u8 @@ -10452,7 +11248,8 @@ pub unsafe fn _kortest_mask64_u8(a: __mmask64, b: __mmask64, all_ones: *mut u8) #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { (_kor_mask32(a, b) == 0xffffffff) as u8 } @@ -10463,7 +11260,8 @@ pub fn _kortestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { (_kor_mask64(a, b) == 0xffffffff_ffffffff) as u8 } @@ -10474,7 +11272,8 @@ pub fn _kortestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { (_kor_mask32(a, b) == 0) as u8 } @@ -10485,7 +11284,8 @@ pub fn _kortestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { (_kor_mask64(a, b) == 0) as u8 } @@ -10496,7 +11296,8 @@ pub fn _kortestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { #[target_feature(enable = "avx512bw")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftli_mask32(a: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftli_mask32(a: __mmask32) -> __mmask32 { a.unbounded_shl(COUNT) } @@ -10507,7 +11308,8 @@ pub fn _kshiftli_mask32(a: __mmask32) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftli_mask64(a: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftli_mask64(a: __mmask64) -> __mmask64 { a.unbounded_shl(COUNT) } @@ -10518,7 +11320,8 @@ pub fn _kshiftli_mask64(a: __mmask64) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftri_mask32(a: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftri_mask32(a: __mmask32) -> __mmask32 { a.unbounded_shr(COUNT) } @@ -10529,7 +11332,8 @@ pub fn _kshiftri_mask32(a: __mmask32) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftri_mask64(a: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftri_mask64(a: __mmask64) -> __mmask64 { a.unbounded_shr(COUNT) } @@ -10541,7 +11345,8 @@ pub fn _kshiftri_mask64(a: __mmask64) -> __mmask64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _ktest_mask32_u8(a: __mmask32, b: __mmask32, and_not: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _ktest_mask32_u8(a: __mmask32, b: __mmask32, and_not: *mut u8) -> u8 { *and_not = (_kandn_mask32(a, b) == 0) as u8; (_kand_mask32(a, b) == 0) as u8 } @@ -10554,7 +11359,8 @@ pub unsafe fn _ktest_mask32_u8(a: __mmask32, b: __mmask32, and_not: *mut u8) -> #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _ktest_mask64_u8(a: __mmask64, b: __mmask64, and_not: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _ktest_mask64_u8(a: __mmask64, b: __mmask64, and_not: *mut u8) -> u8 { *and_not = (_kandn_mask64(a, b) == 0) as u8; (_kand_mask64(a, b) == 0) as u8 } @@ -10566,7 +11372,8 @@ pub unsafe fn _ktest_mask64_u8(a: __mmask64, b: __mmask64, and_not: *mut u8) -> #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { (_kandn_mask32(a, b) == 0) as u8 } @@ -10577,7 +11384,8 @@ pub fn _ktestc_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { (_kandn_mask64(a, b) == 0) as u8 } @@ -10588,7 +11396,8 @@ pub fn _ktestc_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { (_kand_mask32(a, b) == 0) as u8 } @@ -10599,7 +11408,8 @@ pub fn _ktestz_mask32_u8(a: __mmask32, b: __mmask32) -> u8 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { (_kand_mask64(a, b) == 0) as u8 } @@ -10610,7 +11420,8 @@ pub fn _ktestz_mask64_u8(a: __mmask64, b: __mmask64) -> u8 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckwd -pub fn _mm512_kunpackw(a: __mmask32, b: __mmask32) -> __mmask32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kunpackw(a: __mmask32, b: __mmask32) -> __mmask32 { ((a & 0xffff) << 16) | (b & 0xffff) } @@ -10621,7 +11432,8 @@ pub fn _mm512_kunpackw(a: __mmask32, b: __mmask32) -> __mmask32 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckdq -pub fn _mm512_kunpackd(a: __mmask64, b: __mmask64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kunpackd(a: __mmask64, b: __mmask64) -> __mmask64 { ((a & 0xffffffff) << 32) | (b & 0xffffffff) } @@ -10632,7 +11444,8 @@ pub fn _mm512_kunpackd(a: __mmask64, b: __mmask64) -> __mmask64 { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm512_cvtepi16_epi8(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi16_epi8(a: __m512i) -> __m256i { unsafe { let a = a.as_i16x32(); transmute::(simd_cast(a)) @@ -10646,7 +11459,8 @@ pub fn _mm512_cvtepi16_epi8(a: __m512i) -> __m256i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm512_mask_cvtepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i { unsafe { let convert = _mm512_cvtepi16_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, convert, src.as_i8x32())) @@ -10660,7 +11474,8 @@ pub fn _mm512_mask_cvtepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m2 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm512_maskz_cvtepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { unsafe { let convert = _mm512_cvtepi16_epi8(a).as_i8x32(); transmute(simd_select_bitmask(k, convert, i8x32::ZERO)) @@ -10674,7 +11489,8 @@ pub fn _mm512_maskz_cvtepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm256_cvtepi16_epi8(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi16_epi8(a: __m256i) -> __m128i { unsafe { let a = a.as_i16x16(); transmute::(simd_cast(a)) @@ -10688,7 +11504,8 @@ pub fn _mm256_cvtepi16_epi8(a: __m256i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm256_mask_cvtepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i { unsafe { let convert = _mm256_cvtepi16_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, convert, src.as_i8x16())) @@ -10702,7 +11519,8 @@ pub fn _mm256_mask_cvtepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m1 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm256_maskz_cvtepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { unsafe { let convert = _mm256_cvtepi16_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, convert, i8x16::ZERO)) @@ -10716,7 +11534,8 @@ pub fn _mm256_maskz_cvtepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm_cvtepi16_epi8(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi16_epi8(a: __m128i) -> __m128i { unsafe { let a = a.as_i16x8(); let v256: i16x16 = simd_shuffle!( @@ -10735,11 +11554,16 @@ pub fn _mm_cvtepi16_epi8(a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm_mask_cvtepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { - let convert = _mm_cvtepi16_epi8(a).as_i8x16(); - let k: __mmask16 = 0b11111111_11111111 & k as __mmask16; - transmute(simd_select_bitmask(k, convert, src.as_i8x16())) + let a = _mm_cvtepi16_epi8(a).as_i8x16(); + let src = simd_shuffle!( + src.as_i8x16(), + i8x16::ZERO, + [0, 1, 2, 3, 4, 5, 6, 7, 16, 16, 16, 16, 16, 16, 16, 16] + ); + simd_select_bitmask(k as u16, a, src).as_m128i() } } @@ -10750,12 +11574,9 @@ pub fn _mm_mask_cvtepi16_epi8(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub fn _mm_maskz_cvtepi16_epi8(k: __mmask8, a: __m128i) -> __m128i { - unsafe { - let convert = _mm_cvtepi16_epi8(a).as_i8x16(); - let k: __mmask16 = 0b11111111_11111111 & k as __mmask16; - transmute(simd_select_bitmask(k, convert, i8x16::ZERO)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi16_epi8(k: __mmask8, a: __m128i) -> __m128i { + _mm_mask_cvtepi16_epi8(_mm_setzero_si128(), k, a) } /// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst. @@ -10765,13 +11586,14 @@ pub fn _mm_maskz_cvtepi16_epi8(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovswb))] -pub fn _mm512_cvtsepi16_epi8(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm512_cvtsepi16_epi8(a: __m512i) -> __m256i { unsafe { - transmute(vpmovswb( - a.as_i16x32(), - i8x32::ZERO, - 0b11111111_11111111_11111111_11111111, + simd_cast::<_, i8x32>(simd_imax( + simd_imin(a.as_i16x32(), i16x32::splat(i8::MAX as _)), + i16x32::splat(i8::MIN as _), )) + .as_m256i() } } @@ -10782,8 +11604,11 @@ pub fn _mm512_cvtsepi16_epi8(a: __m512i) -> __m256i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovswb))] -pub fn _mm512_mask_cvtsepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i { - unsafe { transmute(vpmovswb(a.as_i16x32(), src.as_i8x32(), k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm512_mask_cvtsepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i { + unsafe { + simd_select_bitmask(k, _mm512_cvtsepi16_epi8(a).as_i8x32(), src.as_i8x32()).as_m256i() + } } /// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). @@ -10793,8 +11618,9 @@ pub fn _mm512_mask_cvtsepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovswb))] -pub fn _mm512_maskz_cvtsepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { - unsafe { transmute(vpmovswb(a.as_i16x32(), i8x32::ZERO, k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm512_maskz_cvtsepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { + unsafe { simd_select_bitmask(k, _mm512_cvtsepi16_epi8(a).as_i8x32(), i8x32::ZERO).as_m256i() } } /// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst. @@ -10804,8 +11630,15 @@ pub fn _mm512_maskz_cvtsepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovswb))] -pub fn _mm256_cvtsepi16_epi8(a: __m256i) -> __m128i { - unsafe { transmute(vpmovswb256(a.as_i16x16(), i8x16::ZERO, 0b11111111_11111111)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm256_cvtsepi16_epi8(a: __m256i) -> __m128i { + unsafe { + simd_cast::<_, i8x16>(simd_imax( + simd_imin(a.as_i16x16(), i16x16::splat(i8::MAX as _)), + i16x16::splat(i8::MIN as _), + )) + .as_m128i() + } } /// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -10815,8 +11648,11 @@ pub fn _mm256_cvtsepi16_epi8(a: __m256i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovswb))] -pub fn _mm256_mask_cvtsepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i { - unsafe { transmute(vpmovswb256(a.as_i16x16(), src.as_i8x16(), k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm256_mask_cvtsepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i { + unsafe { + simd_select_bitmask(k, _mm256_cvtsepi16_epi8(a).as_i8x16(), src.as_i8x16()).as_m128i() + } } /// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). @@ -10826,8 +11662,9 @@ pub fn _mm256_mask_cvtsepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovswb))] -pub fn _mm256_maskz_cvtsepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { - unsafe { transmute(vpmovswb256(a.as_i16x16(), i8x16::ZERO, k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm256_maskz_cvtsepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { + unsafe { simd_select_bitmask(k, _mm256_cvtsepi16_epi8(a).as_i8x16(), i8x16::ZERO).as_m128i() } } /// Convert packed signed 16-bit integers in a to packed 8-bit integers with signed saturation, and store the results in dst. @@ -10870,13 +11707,10 @@ pub fn _mm_maskz_cvtsepi16_epi8(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovuswb))] -pub fn _mm512_cvtusepi16_epi8(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm512_cvtusepi16_epi8(a: __m512i) -> __m256i { unsafe { - transmute(vpmovuswb( - a.as_u16x32(), - u8x32::ZERO, - 0b11111111_11111111_11111111_11111111, - )) + simd_cast::<_, u8x32>(simd_imin(a.as_u16x32(), u16x32::splat(u8::MAX as _))).as_m256i() } } @@ -10887,8 +11721,11 @@ pub fn _mm512_cvtusepi16_epi8(a: __m512i) -> __m256i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovuswb))] -pub fn _mm512_mask_cvtusepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i { - unsafe { transmute(vpmovuswb(a.as_u16x32(), src.as_u8x32(), k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm512_mask_cvtusepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __m256i { + unsafe { + simd_select_bitmask(k, _mm512_cvtusepi16_epi8(a).as_u8x32(), src.as_u8x32()).as_m256i() + } } /// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). @@ -10898,8 +11735,9 @@ pub fn _mm512_mask_cvtusepi16_epi8(src: __m256i, k: __mmask32, a: __m512i) -> __ #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovuswb))] -pub fn _mm512_maskz_cvtusepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { - unsafe { transmute(vpmovuswb(a.as_u16x32(), u8x32::ZERO, k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm512_maskz_cvtusepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { + unsafe { simd_select_bitmask(k, _mm512_cvtusepi16_epi8(a).as_u8x32(), u8x32::ZERO).as_m256i() } } /// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst. @@ -10909,13 +11747,10 @@ pub fn _mm512_maskz_cvtusepi16_epi8(k: __mmask32, a: __m512i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovuswb))] -pub fn _mm256_cvtusepi16_epi8(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm256_cvtusepi16_epi8(a: __m256i) -> __m128i { unsafe { - transmute(vpmovuswb256( - a.as_u16x16(), - u8x16::ZERO, - 0b11111111_11111111, - )) + simd_cast::<_, u8x16>(simd_imin(a.as_u16x16(), u16x16::splat(u8::MAX as _))).as_m128i() } } @@ -10926,8 +11761,11 @@ pub fn _mm256_cvtusepi16_epi8(a: __m256i) -> __m128i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovuswb))] -pub fn _mm256_mask_cvtusepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i { - unsafe { transmute(vpmovuswb256(a.as_u16x16(), src.as_u8x16(), k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm256_mask_cvtusepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __m128i { + unsafe { + simd_select_bitmask(k, _mm256_cvtusepi16_epi8(a).as_u8x16(), src.as_u8x16()).as_m128i() + } } /// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). @@ -10937,8 +11775,9 @@ pub fn _mm256_mask_cvtusepi16_epi8(src: __m128i, k: __mmask16, a: __m256i) -> __ #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovuswb))] -pub fn _mm256_maskz_cvtusepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { - unsafe { transmute(vpmovuswb256(a.as_u16x16(), u8x16::ZERO, k)) } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm256_maskz_cvtusepi16_epi8(k: __mmask16, a: __m256i) -> __m128i { + unsafe { simd_select_bitmask(k, _mm256_cvtusepi16_epi8(a).as_u8x16(), u8x16::ZERO).as_m128i() } } /// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the results in dst. @@ -10981,7 +11820,8 @@ pub fn _mm_maskz_cvtusepi16_epi8(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm512_cvtepi8_epi16(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi8_epi16(a: __m256i) -> __m512i { unsafe { let a = a.as_i8x32(); transmute::(simd_cast(a)) @@ -10995,7 +11835,8 @@ pub fn _mm512_cvtepi8_epi16(a: __m256i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm512_mask_cvtepi8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepi8_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, convert, src.as_i16x32())) @@ -11009,7 +11850,8 @@ pub fn _mm512_mask_cvtepi8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m5 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm512_maskz_cvtepi8_epi16(k: __mmask32, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi8_epi16(k: __mmask32, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepi8_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, convert, i16x32::ZERO)) @@ -11023,7 +11865,8 @@ pub fn _mm512_maskz_cvtepi8_epi16(k: __mmask32, a: __m256i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm256_mask_cvtepi8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi8_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, convert, src.as_i16x16())) @@ -11037,7 +11880,8 @@ pub fn _mm256_mask_cvtepi8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm256_maskz_cvtepi8_epi16(k: __mmask16, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi8_epi16(k: __mmask16, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi8_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, convert, i16x16::ZERO)) @@ -11051,7 +11895,8 @@ pub fn _mm256_maskz_cvtepi8_epi16(k: __mmask16, a: __m128i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm_mask_cvtepi8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi8_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, src.as_i16x8())) @@ -11065,7 +11910,8 @@ pub fn _mm_mask_cvtepi8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbw))] -pub fn _mm_maskz_cvtepi8_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi8_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi8_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, i16x8::ZERO)) @@ -11079,7 +11925,8 @@ pub fn _mm_maskz_cvtepi8_epi16(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm512_cvtepu8_epi16(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu8_epi16(a: __m256i) -> __m512i { unsafe { let a = a.as_u8x32(); transmute::(simd_cast(a)) @@ -11093,7 +11940,8 @@ pub fn _mm512_cvtepu8_epi16(a: __m256i) -> __m512i { #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm512_mask_cvtepu8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepu8_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, convert, src.as_i16x32())) @@ -11107,7 +11955,8 @@ pub fn _mm512_mask_cvtepu8_epi16(src: __m512i, k: __mmask32, a: __m256i) -> __m5 #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm512_maskz_cvtepu8_epi16(k: __mmask32, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu8_epi16(k: __mmask32, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepu8_epi16(a).as_i16x32(); transmute(simd_select_bitmask(k, convert, i16x32::ZERO)) @@ -11121,7 +11970,8 @@ pub fn _mm512_maskz_cvtepu8_epi16(k: __mmask32, a: __m256i) -> __m512i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm256_mask_cvtepu8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu8_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, convert, src.as_i16x16())) @@ -11135,7 +11985,8 @@ pub fn _mm256_mask_cvtepu8_epi16(src: __m256i, k: __mmask16, a: __m128i) -> __m2 #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm256_maskz_cvtepu8_epi16(k: __mmask16, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu8_epi16(k: __mmask16, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu8_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, convert, i16x16::ZERO)) @@ -11149,7 +12000,8 @@ pub fn _mm256_maskz_cvtepu8_epi16(k: __mmask16, a: __m128i) -> __m256i { #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu8_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, src.as_i16x8())) @@ -11163,7 +12015,8 @@ pub fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbw))] -pub fn _mm_maskz_cvtepu8_epi16(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu8_epi16(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu8_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, i16x8::ZERO)) @@ -11178,7 +12031,8 @@ pub fn _mm_maskz_cvtepu8_epi16(k: __mmask8, a: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslldq, IMM8 = 3))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_bslli_epi128(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_bslli_epi128(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); const fn mask(shift: i32, i: u32) -> u32 { @@ -11273,7 +12127,8 @@ pub fn _mm512_bslli_epi128(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrldq, IMM8 = 3))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_bsrli_epi128(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_bsrli_epi128(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); const fn mask(shift: i32, i: u32) -> u32 { @@ -11370,7 +12225,8 @@ pub fn _mm512_bsrli_epi128(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_alignr_epi8(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_alignr_epi8(a: __m512i, b: __m512i) -> __m512i { const fn mask(shift: u32, i: u32) -> u32 { let shift = shift % 16; let mod_i = i % 16; @@ -11480,7 +12336,8 @@ pub fn _mm512_alignr_epi8(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_alignr_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_alignr_epi8( src: __m512i, k: __mmask64, a: __m512i, @@ -11501,7 +12358,12 @@ pub fn _mm512_mask_alignr_epi8( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_alignr_epi8(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_alignr_epi8( + k: __mmask64, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm512_alignr_epi8::(a, b); @@ -11517,7 +12379,8 @@ pub fn _mm512_maskz_alignr_epi8(k: __mmask64, a: __m512i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(4)] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))] -pub fn _mm256_mask_alignr_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_alignr_epi8( src: __m256i, k: __mmask32, a: __m256i, @@ -11538,7 +12401,12 @@ pub fn _mm256_mask_alignr_epi8( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))] -pub fn _mm256_maskz_alignr_epi8(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_alignr_epi8( + k: __mmask32, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm256_alignr_epi8::(a, b); @@ -11554,7 +12422,8 @@ pub fn _mm256_maskz_alignr_epi8(k: __mmask32, a: __m256i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(4)] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))] -pub fn _mm_mask_alignr_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_alignr_epi8( src: __m128i, k: __mmask16, a: __m128i, @@ -11575,7 +12444,12 @@ pub fn _mm_mask_alignr_epi8( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 5))] -pub fn _mm_maskz_alignr_epi8(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_alignr_epi8( + k: __mmask16, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm_alignr_epi8::(a, b); @@ -11623,8 +12497,11 @@ pub unsafe fn _mm_mask_cvtsepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub unsafe fn _mm512_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) { - vpmovwbmem(mem_addr, a.as_i16x32(), k); +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const unsafe fn _mm512_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, a: __m512i) { + let result = _mm512_cvtepi16_epi8(a).as_i8x32(); + let mask = simd_select_bitmask(k, i8x32::splat(!0), i8x32::ZERO); + simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result); } /// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr. @@ -11634,8 +12511,11 @@ pub unsafe fn _mm512_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask32, #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub unsafe fn _mm256_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) { - vpmovwbmem256(mem_addr, a.as_i16x16(), k); +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const unsafe fn _mm256_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, a: __m256i) { + let result = _mm256_cvtepi16_epi8(a).as_i8x16(); + let mask = simd_select_bitmask(k, i8x16::splat(!0), i8x16::ZERO); + simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result); } /// Convert packed 16-bit integers in a to packed 8-bit integers with truncation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr. @@ -11645,8 +12525,15 @@ pub unsafe fn _mm256_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask16, #[target_feature(enable = "avx512bw,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovwb))] -pub unsafe fn _mm_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) { - vpmovwbmem128(mem_addr, a.as_i16x8(), k); +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const unsafe fn _mm_mask_cvtepi16_storeu_epi8(mem_addr: *mut i8, k: __mmask8, a: __m128i) { + let result: i8x8 = simd_shuffle!( + _mm_cvtepi16_epi8(a).as_i8x16(), + i8x16::ZERO, + [0, 1, 2, 3, 4, 5, 6, 7] + ); + let mask = simd_select_bitmask(k, i8x8::splat(!0), i8x8::ZERO); + simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, result); } /// Convert packed unsigned 16-bit integers in a to packed unsigned 8-bit integers with unsigned saturation, and store the active results (those with their respective bit set in writemask k) to unaligned memory at base_addr. @@ -11687,6 +12574,8 @@ unsafe extern "C" { #[link_name = "llvm.x86.avx512.pmul.hr.sw.512"] fn vpmulhrsw(a: i16x32, b: i16x32) -> i16x32; + #[link_name = "llvm.x86.avx512.pmaddw.d.512"] + fn vpmaddwd(a: i16x32, b: i16x32) -> i32x16; #[link_name = "llvm.x86.avx512.pmaddubs.w.512"] fn vpmaddubsw(a: u8x64, b: i8x64) -> i16x32; @@ -11735,17 +12624,9 @@ unsafe extern "C" { #[link_name = "llvm.x86.avx512.dbpsadbw.128"] fn vdbpsadbw128(a: u8x16, b: u8x16, imm8: i32) -> u16x8; - #[link_name = "llvm.x86.avx512.mask.pmovs.wb.512"] - fn vpmovswb(a: i16x32, src: i8x32, mask: u32) -> i8x32; - #[link_name = "llvm.x86.avx512.mask.pmovs.wb.256"] - fn vpmovswb256(a: i16x16, src: i8x16, mask: u16) -> i8x16; #[link_name = "llvm.x86.avx512.mask.pmovs.wb.128"] fn vpmovswb128(a: i16x8, src: i8x16, mask: u8) -> i8x16; - #[link_name = "llvm.x86.avx512.mask.pmovus.wb.512"] - fn vpmovuswb(a: u16x32, src: u8x32, mask: u32) -> u8x32; - #[link_name = "llvm.x86.avx512.mask.pmovus.wb.256"] - fn vpmovuswb256(a: u16x16, src: u8x16, mask: u16) -> u8x16; #[link_name = "llvm.x86.avx512.mask.pmovus.wb.128"] fn vpmovuswb128(a: u16x8, src: u8x16, mask: u8) -> u8x16; @@ -11756,13 +12637,6 @@ unsafe extern "C" { #[link_name = "llvm.x86.avx512.mask.pmovs.wb.mem.128"] fn vpmovswbmem128(mem_addr: *mut i8, a: i16x8, mask: u8); - #[link_name = "llvm.x86.avx512.mask.pmov.wb.mem.512"] - fn vpmovwbmem(mem_addr: *mut i8, a: i16x32, mask: u32); - #[link_name = "llvm.x86.avx512.mask.pmov.wb.mem.256"] - fn vpmovwbmem256(mem_addr: *mut i8, a: i16x16, mask: u16); - #[link_name = "llvm.x86.avx512.mask.pmov.wb.mem.128"] - fn vpmovwbmem128(mem_addr: *mut i8, a: i16x8, mask: u8); - #[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.512"] fn vpmovuswbmem(mem_addr: *mut i8, a: i16x32, mask: u32); #[link_name = "llvm.x86.avx512.mask.pmovus.wb.mem.256"] @@ -11773,6 +12647,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; @@ -11781,7 +12656,7 @@ mod tests { use crate::mem::{self}; #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_abs_epi16() { + const fn test_mm512_abs_epi16() { let a = _mm512_set1_epi16(-1); let r = _mm512_abs_epi16(a); let e = _mm512_set1_epi16(1); @@ -11789,7 +12664,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_abs_epi16() { + const fn test_mm512_mask_abs_epi16() { let a = _mm512_set1_epi16(-1); let r = _mm512_mask_abs_epi16(a, 0, a); assert_eq_m512i(r, a); @@ -11801,7 +12676,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_abs_epi16() { + const fn test_mm512_maskz_abs_epi16() { let a = _mm512_set1_epi16(-1); let r = _mm512_maskz_abs_epi16(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -11813,7 +12688,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_abs_epi16() { + const fn test_mm256_mask_abs_epi16() { let a = _mm256_set1_epi16(-1); let r = _mm256_mask_abs_epi16(a, 0, a); assert_eq_m256i(r, a); @@ -11823,7 +12698,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_abs_epi16() { + const fn test_mm256_maskz_abs_epi16() { let a = _mm256_set1_epi16(-1); let r = _mm256_maskz_abs_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -11833,7 +12708,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_abs_epi16() { + const fn test_mm_mask_abs_epi16() { let a = _mm_set1_epi16(-1); let r = _mm_mask_abs_epi16(a, 0, a); assert_eq_m128i(r, a); @@ -11843,7 +12718,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_abs_epi16() { + const fn test_mm_maskz_abs_epi16() { let a = _mm_set1_epi16(-1); let r = _mm_maskz_abs_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -11853,7 +12728,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_abs_epi8() { + const fn test_mm512_abs_epi8() { let a = _mm512_set1_epi8(-1); let r = _mm512_abs_epi8(a); let e = _mm512_set1_epi8(1); @@ -11861,7 +12736,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_abs_epi8() { + const fn test_mm512_mask_abs_epi8() { let a = _mm512_set1_epi8(-1); let r = _mm512_mask_abs_epi8(a, 0, a); assert_eq_m512i(r, a); @@ -11879,7 +12754,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_abs_epi8() { + const fn test_mm512_maskz_abs_epi8() { let a = _mm512_set1_epi8(-1); let r = _mm512_maskz_abs_epi8(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -11896,7 +12771,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_abs_epi8() { + const fn test_mm256_mask_abs_epi8() { let a = _mm256_set1_epi8(-1); let r = _mm256_mask_abs_epi8(a, 0, a); assert_eq_m256i(r, a); @@ -11908,7 +12783,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_abs_epi8() { + const fn test_mm256_maskz_abs_epi8() { let a = _mm256_set1_epi8(-1); let r = _mm256_maskz_abs_epi8(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -11920,7 +12795,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_abs_epi8() { + const fn test_mm_mask_abs_epi8() { let a = _mm_set1_epi8(-1); let r = _mm_mask_abs_epi8(a, 0, a); assert_eq_m128i(r, a); @@ -11930,7 +12805,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_abs_epi8() { + const fn test_mm_maskz_abs_epi8() { let a = _mm_set1_epi8(-1); let r = _mm_maskz_abs_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -11941,7 +12816,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_add_epi16() { + const fn test_mm512_add_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_add_epi16(a, b); @@ -11950,7 +12825,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_add_epi16() { + const fn test_mm512_mask_add_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_mask_add_epi16(a, 0, a, b); @@ -11963,7 +12838,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_add_epi16() { + const fn test_mm512_maskz_add_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_maskz_add_epi16(0, a, b); @@ -11976,7 +12851,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_add_epi16() { + const fn test_mm256_mask_add_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(2); let r = _mm256_mask_add_epi16(a, 0, a, b); @@ -11987,7 +12862,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_add_epi16() { + const fn test_mm256_maskz_add_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(2); let r = _mm256_maskz_add_epi16(0, a, b); @@ -11998,7 +12873,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_add_epi16() { + const fn test_mm_mask_add_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(2); let r = _mm_mask_add_epi16(a, 0, a, b); @@ -12009,7 +12884,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_add_epi16() { + const fn test_mm_maskz_add_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(2); let r = _mm_maskz_add_epi16(0, a, b); @@ -12020,7 +12895,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_add_epi8() { + const fn test_mm512_add_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_add_epi8(a, b); @@ -12029,7 +12904,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_add_epi8() { + const fn test_mm512_mask_add_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_mask_add_epi8(a, 0, a, b); @@ -12049,7 +12924,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_add_epi8() { + const fn test_mm512_maskz_add_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_maskz_add_epi8(0, a, b); @@ -12068,7 +12943,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_add_epi8() { + const fn test_mm256_mask_add_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(2); let r = _mm256_mask_add_epi8(a, 0, a, b); @@ -12081,7 +12956,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_add_epi8() { + const fn test_mm256_maskz_add_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(2); let r = _mm256_maskz_add_epi8(0, a, b); @@ -12094,7 +12969,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_add_epi8() { + const fn test_mm_mask_add_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(2); let r = _mm_mask_add_epi8(a, 0, a, b); @@ -12105,7 +12980,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_add_epi8() { + const fn test_mm_maskz_add_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(2); let r = _mm_maskz_add_epi8(0, a, b); @@ -12116,7 +12991,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_adds_epu16() { + const fn test_mm512_adds_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(u16::MAX as i16); let r = _mm512_adds_epu16(a, b); @@ -12125,7 +13000,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_adds_epu16() { + const fn test_mm512_mask_adds_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(u16::MAX as i16); let r = _mm512_mask_adds_epu16(a, 0, a, b); @@ -12138,7 +13013,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_adds_epu16() { + const fn test_mm512_maskz_adds_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(u16::MAX as i16); let r = _mm512_maskz_adds_epu16(0, a, b); @@ -12151,7 +13026,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_adds_epu16() { + const fn test_mm256_mask_adds_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(u16::MAX as i16); let r = _mm256_mask_adds_epu16(a, 0, a, b); @@ -12163,7 +13038,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_adds_epu16() { + const fn test_mm256_maskz_adds_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(u16::MAX as i16); let r = _mm256_maskz_adds_epu16(0, a, b); @@ -12175,7 +13050,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_adds_epu16() { + const fn test_mm_mask_adds_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(u16::MAX as i16); let r = _mm_mask_adds_epu16(a, 0, a, b); @@ -12187,7 +13062,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_adds_epu16() { + const fn test_mm_maskz_adds_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(u16::MAX as i16); let r = _mm_maskz_adds_epu16(0, a, b); @@ -12199,7 +13074,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_adds_epu8() { + const fn test_mm512_adds_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(u8::MAX as i8); let r = _mm512_adds_epu8(a, b); @@ -12208,7 +13083,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_adds_epu8() { + const fn test_mm512_mask_adds_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(u8::MAX as i8); let r = _mm512_mask_adds_epu8(a, 0, a, b); @@ -12228,7 +13103,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_adds_epu8() { + const fn test_mm512_maskz_adds_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(u8::MAX as i8); let r = _mm512_maskz_adds_epu8(0, a, b); @@ -12247,7 +13122,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_adds_epu8() { + const fn test_mm256_mask_adds_epu8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(u8::MAX as i8); let r = _mm256_mask_adds_epu8(a, 0, a, b); @@ -12260,7 +13135,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_adds_epu8() { + const fn test_mm256_maskz_adds_epu8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(u8::MAX as i8); let r = _mm256_maskz_adds_epu8(0, a, b); @@ -12273,7 +13148,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_adds_epu8() { + const fn test_mm_mask_adds_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(u8::MAX as i8); let r = _mm_mask_adds_epu8(a, 0, a, b); @@ -12285,7 +13160,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_adds_epu8() { + const fn test_mm_maskz_adds_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(u8::MAX as i8); let r = _mm_maskz_adds_epu8(0, a, b); @@ -12297,7 +13172,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_adds_epi16() { + const fn test_mm512_adds_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(i16::MAX); let r = _mm512_adds_epi16(a, b); @@ -12306,7 +13181,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_adds_epi16() { + const fn test_mm512_mask_adds_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(i16::MAX); let r = _mm512_mask_adds_epi16(a, 0, a, b); @@ -12319,7 +13194,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_adds_epi16() { + const fn test_mm512_maskz_adds_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(i16::MAX); let r = _mm512_maskz_adds_epi16(0, a, b); @@ -12332,7 +13207,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_adds_epi16() { + const fn test_mm256_mask_adds_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(i16::MAX); let r = _mm256_mask_adds_epi16(a, 0, a, b); @@ -12344,7 +13219,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_adds_epi16() { + const fn test_mm256_maskz_adds_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(i16::MAX); let r = _mm256_maskz_adds_epi16(0, a, b); @@ -12356,7 +13231,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_adds_epi16() { + const fn test_mm_mask_adds_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(i16::MAX); let r = _mm_mask_adds_epi16(a, 0, a, b); @@ -12367,7 +13242,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_adds_epi16() { + const fn test_mm_maskz_adds_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(i16::MAX); let r = _mm_maskz_adds_epi16(0, a, b); @@ -12378,7 +13253,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_adds_epi8() { + const fn test_mm512_adds_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(i8::MAX); let r = _mm512_adds_epi8(a, b); @@ -12387,7 +13262,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_adds_epi8() { + const fn test_mm512_mask_adds_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(i8::MAX); let r = _mm512_mask_adds_epi8(a, 0, a, b); @@ -12407,7 +13282,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_adds_epi8() { + const fn test_mm512_maskz_adds_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(i8::MAX); let r = _mm512_maskz_adds_epi8(0, a, b); @@ -12426,7 +13301,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_adds_epi8() { + const fn test_mm256_mask_adds_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(i8::MAX); let r = _mm256_mask_adds_epi8(a, 0, a, b); @@ -12439,7 +13314,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_adds_epi8() { + const fn test_mm256_maskz_adds_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(i8::MAX); let r = _mm256_maskz_adds_epi8(0, a, b); @@ -12452,7 +13327,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_adds_epi8() { + const fn test_mm_mask_adds_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(i8::MAX); let r = _mm_mask_adds_epi8(a, 0, a, b); @@ -12464,7 +13339,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_adds_epi8() { + const fn test_mm_maskz_adds_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(i8::MAX); let r = _mm_maskz_adds_epi8(0, a, b); @@ -12476,7 +13351,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_sub_epi16() { + const fn test_mm512_sub_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_sub_epi16(a, b); @@ -12485,7 +13360,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_sub_epi16() { + const fn test_mm512_mask_sub_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_mask_sub_epi16(a, 0, a, b); @@ -12498,7 +13373,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_sub_epi16() { + const fn test_mm512_maskz_sub_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_maskz_sub_epi16(0, a, b); @@ -12511,7 +13386,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_sub_epi16() { + const fn test_mm256_mask_sub_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(2); let r = _mm256_mask_sub_epi16(a, 0, a, b); @@ -12522,7 +13397,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_sub_epi16() { + const fn test_mm256_maskz_sub_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(2); let r = _mm256_maskz_sub_epi16(0, a, b); @@ -12533,7 +13408,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_sub_epi16() { + const fn test_mm_mask_sub_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(2); let r = _mm_mask_sub_epi16(a, 0, a, b); @@ -12544,7 +13419,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_sub_epi16() { + const fn test_mm_maskz_sub_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(2); let r = _mm_maskz_sub_epi16(0, a, b); @@ -12555,7 +13430,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_sub_epi8() { + const fn test_mm512_sub_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_sub_epi8(a, b); @@ -12564,7 +13439,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_sub_epi8() { + const fn test_mm512_mask_sub_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_mask_sub_epi8(a, 0, a, b); @@ -12584,7 +13459,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_sub_epi8() { + const fn test_mm512_maskz_sub_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_maskz_sub_epi8(0, a, b); @@ -12603,7 +13478,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_sub_epi8() { + const fn test_mm256_mask_sub_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(2); let r = _mm256_mask_sub_epi8(a, 0, a, b); @@ -12616,7 +13491,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_sub_epi8() { + const fn test_mm256_maskz_sub_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(2); let r = _mm256_maskz_sub_epi8(0, a, b); @@ -12629,7 +13504,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_sub_epi8() { + const fn test_mm_mask_sub_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(2); let r = _mm_mask_sub_epi8(a, 0, a, b); @@ -12640,7 +13515,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_sub_epi8() { + const fn test_mm_maskz_sub_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(2); let r = _mm_maskz_sub_epi8(0, a, b); @@ -12651,7 +13526,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_subs_epu16() { + const fn test_mm512_subs_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(u16::MAX as i16); let r = _mm512_subs_epu16(a, b); @@ -12660,7 +13535,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_subs_epu16() { + const fn test_mm512_mask_subs_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(u16::MAX as i16); let r = _mm512_mask_subs_epu16(a, 0, a, b); @@ -12673,7 +13548,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_subs_epu16() { + const fn test_mm512_maskz_subs_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(u16::MAX as i16); let r = _mm512_maskz_subs_epu16(0, a, b); @@ -12686,7 +13561,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_subs_epu16() { + const fn test_mm256_mask_subs_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(u16::MAX as i16); let r = _mm256_mask_subs_epu16(a, 0, a, b); @@ -12697,7 +13572,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_subs_epu16() { + const fn test_mm256_maskz_subs_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(u16::MAX as i16); let r = _mm256_maskz_subs_epu16(0, a, b); @@ -12708,7 +13583,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_subs_epu16() { + const fn test_mm_mask_subs_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(u16::MAX as i16); let r = _mm_mask_subs_epu16(a, 0, a, b); @@ -12719,7 +13594,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_subs_epu16() { + const fn test_mm_maskz_subs_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(u16::MAX as i16); let r = _mm_maskz_subs_epu16(0, a, b); @@ -12730,7 +13605,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_subs_epu8() { + const fn test_mm512_subs_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(u8::MAX as i8); let r = _mm512_subs_epu8(a, b); @@ -12739,7 +13614,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_subs_epu8() { + const fn test_mm512_mask_subs_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(u8::MAX as i8); let r = _mm512_mask_subs_epu8(a, 0, a, b); @@ -12759,7 +13634,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_subs_epu8() { + const fn test_mm512_maskz_subs_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(u8::MAX as i8); let r = _mm512_maskz_subs_epu8(0, a, b); @@ -12778,7 +13653,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_subs_epu8() { + const fn test_mm256_mask_subs_epu8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(u8::MAX as i8); let r = _mm256_mask_subs_epu8(a, 0, a, b); @@ -12791,7 +13666,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_subs_epu8() { + const fn test_mm256_maskz_subs_epu8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(u8::MAX as i8); let r = _mm256_maskz_subs_epu8(0, a, b); @@ -12804,7 +13679,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_subs_epu8() { + const fn test_mm_mask_subs_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(u8::MAX as i8); let r = _mm_mask_subs_epu8(a, 0, a, b); @@ -12815,7 +13690,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_subs_epu8() { + const fn test_mm_maskz_subs_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(u8::MAX as i8); let r = _mm_maskz_subs_epu8(0, a, b); @@ -12826,7 +13701,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_subs_epi16() { + const fn test_mm512_subs_epi16() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(i16::MAX); let r = _mm512_subs_epi16(a, b); @@ -12835,7 +13710,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_subs_epi16() { + const fn test_mm512_mask_subs_epi16() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(i16::MAX); let r = _mm512_mask_subs_epi16(a, 0, a, b); @@ -12848,7 +13723,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_subs_epi16() { + const fn test_mm512_maskz_subs_epi16() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(i16::MAX); let r = _mm512_maskz_subs_epi16(0, a, b); @@ -12861,7 +13736,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_subs_epi16() { + const fn test_mm256_mask_subs_epi16() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(i16::MAX); let r = _mm256_mask_subs_epi16(a, 0, a, b); @@ -12873,7 +13748,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_subs_epi16() { + const fn test_mm256_maskz_subs_epi16() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(i16::MAX); let r = _mm256_maskz_subs_epi16(0, a, b); @@ -12885,7 +13760,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_subs_epi16() { + const fn test_mm_mask_subs_epi16() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(i16::MAX); let r = _mm_mask_subs_epi16(a, 0, a, b); @@ -12896,7 +13771,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_subs_epi16() { + const fn test_mm_maskz_subs_epi16() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(i16::MAX); let r = _mm_maskz_subs_epi16(0, a, b); @@ -12907,7 +13782,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_subs_epi8() { + const fn test_mm512_subs_epi8() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(i8::MAX); let r = _mm512_subs_epi8(a, b); @@ -12916,7 +13791,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_subs_epi8() { + const fn test_mm512_mask_subs_epi8() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(i8::MAX); let r = _mm512_mask_subs_epi8(a, 0, a, b); @@ -12936,7 +13811,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_subs_epi8() { + const fn test_mm512_maskz_subs_epi8() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(i8::MAX); let r = _mm512_maskz_subs_epi8(0, a, b); @@ -12955,7 +13830,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_subs_epi8() { + const fn test_mm256_mask_subs_epi8() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(i8::MAX); let r = _mm256_mask_subs_epi8(a, 0, a, b); @@ -12968,7 +13843,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_subs_epi8() { + const fn test_mm256_maskz_subs_epi8() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(i8::MAX); let r = _mm256_maskz_subs_epi8(0, a, b); @@ -12981,7 +13856,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_subs_epi8() { + const fn test_mm_mask_subs_epi8() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(i8::MAX); let r = _mm_mask_subs_epi8(a, 0, a, b); @@ -12993,7 +13868,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_subs_epi8() { + const fn test_mm_maskz_subs_epi8() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(i8::MAX); let r = _mm_maskz_subs_epi8(0, a, b); @@ -13005,7 +13880,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mulhi_epu16() { + const fn test_mm512_mulhi_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mulhi_epu16(a, b); @@ -13014,7 +13889,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_mulhi_epu16() { + const fn test_mm512_mask_mulhi_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mask_mulhi_epu16(a, 0, a, b); @@ -13027,7 +13902,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_mulhi_epu16() { + const fn test_mm512_maskz_mulhi_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_mulhi_epu16(0, a, b); @@ -13040,7 +13915,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_mulhi_epu16() { + const fn test_mm256_mask_mulhi_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_mask_mulhi_epu16(a, 0, a, b); @@ -13051,7 +13926,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_mulhi_epu16() { + const fn test_mm256_maskz_mulhi_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_mulhi_epu16(0, a, b); @@ -13062,7 +13937,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_mulhi_epu16() { + const fn test_mm_mask_mulhi_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_mask_mulhi_epu16(a, 0, a, b); @@ -13073,7 +13948,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_mulhi_epu16() { + const fn test_mm_maskz_mulhi_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_maskz_mulhi_epu16(0, a, b); @@ -13084,7 +13959,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mulhi_epi16() { + const fn test_mm512_mulhi_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mulhi_epi16(a, b); @@ -13093,7 +13968,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_mulhi_epi16() { + const fn test_mm512_mask_mulhi_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mask_mulhi_epi16(a, 0, a, b); @@ -13106,7 +13981,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_mulhi_epi16() { + const fn test_mm512_maskz_mulhi_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_mulhi_epi16(0, a, b); @@ -13119,7 +13994,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_mulhi_epi16() { + const fn test_mm256_mask_mulhi_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_mask_mulhi_epi16(a, 0, a, b); @@ -13130,7 +14005,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_mulhi_epi16() { + const fn test_mm256_maskz_mulhi_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_mulhi_epi16(0, a, b); @@ -13141,7 +14016,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_mulhi_epi16() { + const fn test_mm_mask_mulhi_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_mask_mulhi_epi16(a, 0, a, b); @@ -13152,7 +14027,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_mulhi_epi16() { + const fn test_mm_maskz_mulhi_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_maskz_mulhi_epi16(0, a, b); @@ -13163,7 +14038,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mulhrs_epi16() { + fn test_mm512_mulhrs_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mulhrs_epi16(a, b); @@ -13172,7 +14047,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_mulhrs_epi16() { + fn test_mm512_mask_mulhrs_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mask_mulhrs_epi16(a, 0, a, b); @@ -13185,7 +14060,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_mulhrs_epi16() { + fn test_mm512_maskz_mulhrs_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_mulhrs_epi16(0, a, b); @@ -13198,7 +14073,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_mulhrs_epi16() { + fn test_mm256_mask_mulhrs_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_mask_mulhrs_epi16(a, 0, a, b); @@ -13209,7 +14084,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_mulhrs_epi16() { + fn test_mm256_maskz_mulhrs_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_mulhrs_epi16(0, a, b); @@ -13220,7 +14095,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_mulhrs_epi16() { + fn test_mm_mask_mulhrs_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_mask_mulhrs_epi16(a, 0, a, b); @@ -13231,7 +14106,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_mulhrs_epi16() { + fn test_mm_maskz_mulhrs_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_maskz_mulhrs_epi16(0, a, b); @@ -13242,7 +14117,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mullo_epi16() { + const fn test_mm512_mullo_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mullo_epi16(a, b); @@ -13251,7 +14126,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_mullo_epi16() { + const fn test_mm512_mask_mullo_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mask_mullo_epi16(a, 0, a, b); @@ -13264,7 +14139,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_mullo_epi16() { + const fn test_mm512_maskz_mullo_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_mullo_epi16(0, a, b); @@ -13277,7 +14152,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_mullo_epi16() { + const fn test_mm256_mask_mullo_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_mask_mullo_epi16(a, 0, a, b); @@ -13288,7 +14163,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_mullo_epi16() { + const fn test_mm256_maskz_mullo_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_mullo_epi16(0, a, b); @@ -13299,7 +14174,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_mullo_epi16() { + const fn test_mm_mask_mullo_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_mask_mullo_epi16(a, 0, a, b); @@ -13310,7 +14185,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_mullo_epi16() { + const fn test_mm_maskz_mullo_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_maskz_mullo_epi16(0, a, b); @@ -13321,7 +14196,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_max_epu16() { + const fn test_mm512_max_epu16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13336,7 +14211,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_max_epu16() { + const fn test_mm512_mask_max_epu16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13353,7 +14228,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_max_epu16() { + const fn test_mm512_maskz_max_epu16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13370,7 +14245,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_max_epu16() { + const fn test_mm256_mask_max_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_max_epu16(a, 0, a, b); @@ -13381,7 +14256,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_max_epu16() { + const fn test_mm256_maskz_max_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_max_epu16(0, a, b); @@ -13392,7 +14267,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_max_epu16() { + const fn test_mm_mask_max_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_max_epu16(a, 0, a, b); @@ -13403,7 +14278,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_max_epu16() { + const fn test_mm_maskz_max_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_max_epu16(0, a, b); @@ -13414,7 +14289,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_max_epu8() { + const fn test_mm512_max_epu8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13435,7 +14310,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_max_epu8() { + const fn test_mm512_mask_max_epu8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13463,7 +14338,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_max_epu8() { + const fn test_mm512_maskz_max_epu8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13490,7 +14365,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_max_epu8() { + const fn test_mm256_mask_max_epu8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13507,7 +14382,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_max_epu8() { + const fn test_mm256_maskz_max_epu8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13524,7 +14399,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_max_epu8() { + const fn test_mm_mask_max_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_max_epu8(a, 0, a, b); @@ -13535,7 +14410,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_max_epu8() { + const fn test_mm_maskz_max_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_max_epu8(0, a, b); @@ -13546,7 +14421,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_max_epi16() { + const fn test_mm512_max_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13561,7 +14436,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_max_epi16() { + const fn test_mm512_mask_max_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13578,7 +14453,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_max_epi16() { + const fn test_mm512_maskz_max_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13595,7 +14470,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_max_epi16() { + const fn test_mm256_mask_max_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_max_epi16(a, 0, a, b); @@ -13606,7 +14481,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_max_epi16() { + const fn test_mm256_maskz_max_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_max_epi16(0, a, b); @@ -13617,7 +14492,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_max_epi16() { + const fn test_mm_mask_max_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_max_epi16(a, 0, a, b); @@ -13628,7 +14503,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_max_epi16() { + const fn test_mm_maskz_max_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_max_epi16(0, a, b); @@ -13639,7 +14514,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_max_epi8() { + const fn test_mm512_max_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13660,7 +14535,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_max_epi8() { + const fn test_mm512_mask_max_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13688,7 +14563,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_max_epi8() { + const fn test_mm512_maskz_max_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13715,7 +14590,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_max_epi8() { + const fn test_mm256_mask_max_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13732,7 +14607,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_max_epi8() { + const fn test_mm256_maskz_max_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13749,7 +14624,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_max_epi8() { + const fn test_mm_mask_max_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_max_epi8(a, 0, a, b); @@ -13760,7 +14635,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_max_epi8() { + const fn test_mm_maskz_max_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_max_epi8(0, a, b); @@ -13771,7 +14646,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_min_epu16() { + const fn test_mm512_min_epu16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13786,7 +14661,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_min_epu16() { + const fn test_mm512_mask_min_epu16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13803,7 +14678,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_min_epu16() { + const fn test_mm512_maskz_min_epu16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13820,7 +14695,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_min_epu16() { + const fn test_mm256_mask_min_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_min_epu16(a, 0, a, b); @@ -13831,7 +14706,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_min_epu16() { + const fn test_mm256_maskz_min_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_min_epu16(0, a, b); @@ -13842,7 +14717,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_min_epu16() { + const fn test_mm_mask_min_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_min_epu16(a, 0, a, b); @@ -13853,7 +14728,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_min_epu16() { + const fn test_mm_maskz_min_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_min_epu16(0, a, b); @@ -13864,7 +14739,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_min_epu8() { + const fn test_mm512_min_epu8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13885,7 +14760,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_min_epu8() { + const fn test_mm512_mask_min_epu8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13913,7 +14788,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_min_epu8() { + const fn test_mm512_maskz_min_epu8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -13940,7 +14815,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_min_epu8() { + const fn test_mm256_mask_min_epu8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13957,7 +14832,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_min_epu8() { + const fn test_mm256_maskz_min_epu8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -13974,7 +14849,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_min_epu8() { + const fn test_mm_mask_min_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_min_epu8(a, 0, a, b); @@ -13985,7 +14860,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_min_epu8() { + const fn test_mm_maskz_min_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_min_epu8(0, a, b); @@ -13996,7 +14871,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_min_epi16() { + const fn test_mm512_min_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -14011,7 +14886,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_min_epi16() { + const fn test_mm512_mask_min_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -14028,7 +14903,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_min_epi16() { + const fn test_mm512_maskz_min_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -14045,7 +14920,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_min_epi16() { + const fn test_mm256_mask_min_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_min_epi16(a, 0, a, b); @@ -14056,7 +14931,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_min_epi16() { + const fn test_mm256_maskz_min_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm256_set_epi16(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_min_epi16(0, a, b); @@ -14067,7 +14942,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_min_epi16() { + const fn test_mm_mask_min_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_min_epi16(a, 0, a, b); @@ -14078,7 +14953,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_min_epi16() { + const fn test_mm_maskz_min_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_min_epi16(0, a, b); @@ -14089,7 +14964,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_min_epi8() { + const fn test_mm512_min_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -14110,7 +14985,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_min_epi8() { + const fn test_mm512_mask_min_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -14138,7 +15013,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_min_epi8() { + const fn test_mm512_maskz_min_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -14165,7 +15040,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_min_epi8() { + const fn test_mm256_mask_min_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -14182,7 +15057,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_min_epi8() { + const fn test_mm256_maskz_min_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -14199,7 +15074,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_min_epi8() { + const fn test_mm_mask_min_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_mask_min_epi8(a, 0, a, b); @@ -14210,7 +15085,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_min_epi8() { + const fn test_mm_maskz_min_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_maskz_min_epi8(0, a, b); @@ -14221,7 +15096,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmplt_epu16_mask() { + const fn test_mm512_cmplt_epu16_mask() { let a = _mm512_set1_epi16(-2); let b = _mm512_set1_epi16(-1); let m = _mm512_cmplt_epu16_mask(a, b); @@ -14229,7 +15104,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmplt_epu16_mask() { + const fn test_mm512_mask_cmplt_epu16_mask() { let a = _mm512_set1_epi16(-2); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14238,7 +15113,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmplt_epu16_mask() { + const fn test_mm256_cmplt_epu16_mask() { let a = _mm256_set1_epi16(-2); let b = _mm256_set1_epi16(-1); let m = _mm256_cmplt_epu16_mask(a, b); @@ -14246,7 +15121,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epu16_mask() { + const fn test_mm256_mask_cmplt_epu16_mask() { let a = _mm256_set1_epi16(-2); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -14255,7 +15130,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmplt_epu16_mask() { + const fn test_mm_cmplt_epu16_mask() { let a = _mm_set1_epi16(-2); let b = _mm_set1_epi16(-1); let m = _mm_cmplt_epu16_mask(a, b); @@ -14263,7 +15138,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmplt_epu16_mask() { + const fn test_mm_mask_cmplt_epu16_mask() { let a = _mm_set1_epi16(-2); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -14272,7 +15147,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmplt_epu8_mask() { + const fn test_mm512_cmplt_epu8_mask() { let a = _mm512_set1_epi8(-2); let b = _mm512_set1_epi8(-1); let m = _mm512_cmplt_epu8_mask(a, b); @@ -14283,7 +15158,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmplt_epu8_mask() { + const fn test_mm512_mask_cmplt_epu8_mask() { let a = _mm512_set1_epi8(-2); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14295,7 +15170,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmplt_epu8_mask() { + const fn test_mm256_cmplt_epu8_mask() { let a = _mm256_set1_epi8(-2); let b = _mm256_set1_epi8(-1); let m = _mm256_cmplt_epu8_mask(a, b); @@ -14303,7 +15178,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epu8_mask() { + const fn test_mm256_mask_cmplt_epu8_mask() { let a = _mm256_set1_epi8(-2); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14312,7 +15187,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmplt_epu8_mask() { + const fn test_mm_cmplt_epu8_mask() { let a = _mm_set1_epi8(-2); let b = _mm_set1_epi8(-1); let m = _mm_cmplt_epu8_mask(a, b); @@ -14320,7 +15195,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmplt_epu8_mask() { + const fn test_mm_mask_cmplt_epu8_mask() { let a = _mm_set1_epi8(-2); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -14329,7 +15204,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmplt_epi16_mask() { + const fn test_mm512_cmplt_epi16_mask() { let a = _mm512_set1_epi16(-2); let b = _mm512_set1_epi16(-1); let m = _mm512_cmplt_epi16_mask(a, b); @@ -14337,7 +15212,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmplt_epi16_mask() { + const fn test_mm512_mask_cmplt_epi16_mask() { let a = _mm512_set1_epi16(-2); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14346,7 +15221,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmplt_epi16_mask() { + const fn test_mm256_cmplt_epi16_mask() { let a = _mm256_set1_epi16(-2); let b = _mm256_set1_epi16(-1); let m = _mm256_cmplt_epi16_mask(a, b); @@ -14354,7 +15229,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epi16_mask() { + const fn test_mm256_mask_cmplt_epi16_mask() { let a = _mm256_set1_epi16(-2); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -14363,7 +15238,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmplt_epi16_mask() { + const fn test_mm_cmplt_epi16_mask() { let a = _mm_set1_epi16(-2); let b = _mm_set1_epi16(-1); let m = _mm_cmplt_epi16_mask(a, b); @@ -14371,7 +15246,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmplt_epi16_mask() { + const fn test_mm_mask_cmplt_epi16_mask() { let a = _mm_set1_epi16(-2); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -14380,7 +15255,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmplt_epi8_mask() { + const fn test_mm512_cmplt_epi8_mask() { let a = _mm512_set1_epi8(-2); let b = _mm512_set1_epi8(-1); let m = _mm512_cmplt_epi8_mask(a, b); @@ -14391,7 +15266,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmplt_epi8_mask() { + const fn test_mm512_mask_cmplt_epi8_mask() { let a = _mm512_set1_epi8(-2); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14403,7 +15278,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmplt_epi8_mask() { + const fn test_mm256_cmplt_epi8_mask() { let a = _mm256_set1_epi8(-2); let b = _mm256_set1_epi8(-1); let m = _mm256_cmplt_epi8_mask(a, b); @@ -14411,7 +15286,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epi8_mask() { + const fn test_mm256_mask_cmplt_epi8_mask() { let a = _mm256_set1_epi8(-2); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14420,7 +15295,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmplt_epi8_mask() { + const fn test_mm_cmplt_epi8_mask() { let a = _mm_set1_epi8(-2); let b = _mm_set1_epi8(-1); let m = _mm_cmplt_epi8_mask(a, b); @@ -14428,7 +15303,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmplt_epi8_mask() { + const fn test_mm_mask_cmplt_epi8_mask() { let a = _mm_set1_epi8(-2); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -14437,7 +15312,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpgt_epu16_mask() { + const fn test_mm512_cmpgt_epu16_mask() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(1); let m = _mm512_cmpgt_epu16_mask(a, b); @@ -14445,7 +15320,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpgt_epu16_mask() { + const fn test_mm512_mask_cmpgt_epu16_mask() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14454,7 +15329,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpgt_epu16_mask() { + const fn test_mm256_cmpgt_epu16_mask() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(1); let m = _mm256_cmpgt_epu16_mask(a, b); @@ -14462,7 +15337,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epu16_mask() { + const fn test_mm256_mask_cmpgt_epu16_mask() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(1); let mask = 0b01010101_01010101; @@ -14471,7 +15346,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpgt_epu16_mask() { + const fn test_mm_cmpgt_epu16_mask() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(1); let m = _mm_cmpgt_epu16_mask(a, b); @@ -14479,7 +15354,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epu16_mask() { + const fn test_mm_mask_cmpgt_epu16_mask() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(1); let mask = 0b01010101; @@ -14488,7 +15363,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpgt_epu8_mask() { + const fn test_mm512_cmpgt_epu8_mask() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(1); let m = _mm512_cmpgt_epu8_mask(a, b); @@ -14499,7 +15374,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpgt_epu8_mask() { + const fn test_mm512_mask_cmpgt_epu8_mask() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14511,7 +15386,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpgt_epu8_mask() { + const fn test_mm256_cmpgt_epu8_mask() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(1); let m = _mm256_cmpgt_epu8_mask(a, b); @@ -14519,7 +15394,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epu8_mask() { + const fn test_mm256_mask_cmpgt_epu8_mask() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14528,7 +15403,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpgt_epu8_mask() { + const fn test_mm_cmpgt_epu8_mask() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(1); let m = _mm_cmpgt_epu8_mask(a, b); @@ -14536,7 +15411,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epu8_mask() { + const fn test_mm_mask_cmpgt_epu8_mask() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(1); let mask = 0b01010101_01010101; @@ -14545,7 +15420,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpgt_epi16_mask() { + const fn test_mm512_cmpgt_epi16_mask() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(-1); let m = _mm512_cmpgt_epi16_mask(a, b); @@ -14553,7 +15428,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpgt_epi16_mask() { + const fn test_mm512_mask_cmpgt_epi16_mask() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14562,7 +15437,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpgt_epi16_mask() { + const fn test_mm256_cmpgt_epi16_mask() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(-1); let m = _mm256_cmpgt_epi16_mask(a, b); @@ -14570,7 +15445,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epi16_mask() { + const fn test_mm256_mask_cmpgt_epi16_mask() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(-1); let mask = 0b001010101_01010101; @@ -14579,7 +15454,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpgt_epi16_mask() { + const fn test_mm_cmpgt_epi16_mask() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(-1); let m = _mm_cmpgt_epi16_mask(a, b); @@ -14587,7 +15462,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epi16_mask() { + const fn test_mm_mask_cmpgt_epi16_mask() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -14596,7 +15471,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpgt_epi8_mask() { + const fn test_mm512_cmpgt_epi8_mask() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(-1); let m = _mm512_cmpgt_epi8_mask(a, b); @@ -14607,7 +15482,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpgt_epi8_mask() { + const fn test_mm512_mask_cmpgt_epi8_mask() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14619,7 +15494,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpgt_epi8_mask() { + const fn test_mm256_cmpgt_epi8_mask() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(-1); let m = _mm256_cmpgt_epi8_mask(a, b); @@ -14627,7 +15502,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epi8_mask() { + const fn test_mm256_mask_cmpgt_epi8_mask() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14636,7 +15511,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpgt_epi8_mask() { + const fn test_mm_cmpgt_epi8_mask() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(-1); let m = _mm_cmpgt_epi8_mask(a, b); @@ -14644,7 +15519,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epi8_mask() { + const fn test_mm_mask_cmpgt_epi8_mask() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -14653,7 +15528,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmple_epu16_mask() { + const fn test_mm512_cmple_epu16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let m = _mm512_cmple_epu16_mask(a, b); @@ -14661,7 +15536,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmple_epu16_mask() { + const fn test_mm512_mask_cmple_epu16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14670,7 +15545,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmple_epu16_mask() { + const fn test_mm256_cmple_epu16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let m = _mm256_cmple_epu16_mask(a, b); @@ -14678,7 +15553,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmple_epu16_mask() { + const fn test_mm256_mask_cmple_epu16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -14687,7 +15562,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmple_epu16_mask() { + const fn test_mm_cmple_epu16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let m = _mm_cmple_epu16_mask(a, b); @@ -14695,7 +15570,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmple_epu16_mask() { + const fn test_mm_mask_cmple_epu16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -14704,7 +15579,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmple_epu8_mask() { + const fn test_mm512_cmple_epu8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let m = _mm512_cmple_epu8_mask(a, b); @@ -14715,7 +15590,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmple_epu8_mask() { + const fn test_mm512_mask_cmple_epu8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14727,7 +15602,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmple_epu8_mask() { + const fn test_mm256_cmple_epu8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let m = _mm256_cmple_epu8_mask(a, b); @@ -14735,7 +15610,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmple_epu8_mask() { + const fn test_mm256_mask_cmple_epu8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14744,7 +15619,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmple_epu8_mask() { + const fn test_mm_cmple_epu8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let m = _mm_cmple_epu8_mask(a, b); @@ -14752,7 +15627,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmple_epu8_mask() { + const fn test_mm_mask_cmple_epu8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -14761,7 +15636,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmple_epi16_mask() { + const fn test_mm512_cmple_epi16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let m = _mm512_cmple_epi16_mask(a, b); @@ -14769,7 +15644,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmple_epi16_mask() { + const fn test_mm512_mask_cmple_epi16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14778,7 +15653,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmple_epi16_mask() { + const fn test_mm256_cmple_epi16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let m = _mm256_cmple_epi16_mask(a, b); @@ -14786,7 +15661,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmple_epi16_mask() { + const fn test_mm256_mask_cmple_epi16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -14795,7 +15670,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmple_epi16_mask() { + const fn test_mm_cmple_epi16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let m = _mm_cmple_epi16_mask(a, b); @@ -14803,7 +15678,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmple_epi16_mask() { + const fn test_mm_mask_cmple_epi16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -14812,7 +15687,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmple_epi8_mask() { + const fn test_mm512_cmple_epi8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let m = _mm512_cmple_epi8_mask(a, b); @@ -14823,7 +15698,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmple_epi8_mask() { + const fn test_mm512_mask_cmple_epi8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14835,7 +15710,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmple_epi8_mask() { + const fn test_mm256_cmple_epi8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let m = _mm256_cmple_epi8_mask(a, b); @@ -14843,7 +15718,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmple_epi8_mask() { + const fn test_mm256_mask_cmple_epi8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14852,7 +15727,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmple_epi8_mask() { + const fn test_mm_cmple_epi8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let m = _mm_cmple_epi8_mask(a, b); @@ -14860,7 +15735,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmple_epi8_mask() { + const fn test_mm_mask_cmple_epi8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -14869,7 +15744,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpge_epu16_mask() { + const fn test_mm512_cmpge_epu16_mask() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let m = _mm512_cmpge_epu16_mask(a, b); @@ -14877,7 +15752,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpge_epu16_mask() { + const fn test_mm512_mask_cmpge_epu16_mask() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14886,7 +15761,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpge_epu16_mask() { + const fn test_mm256_cmpge_epu16_mask() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let m = _mm256_cmpge_epu16_mask(a, b); @@ -14894,7 +15769,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epu16_mask() { + const fn test_mm256_mask_cmpge_epu16_mask() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let mask = 0b01010101_01010101; @@ -14903,7 +15778,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpge_epu16_mask() { + const fn test_mm_cmpge_epu16_mask() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let m = _mm_cmpge_epu16_mask(a, b); @@ -14911,7 +15786,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpge_epu16_mask() { + const fn test_mm_mask_cmpge_epu16_mask() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let mask = 0b01010101; @@ -14920,7 +15795,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpge_epu8_mask() { + const fn test_mm512_cmpge_epu8_mask() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let m = _mm512_cmpge_epu8_mask(a, b); @@ -14931,7 +15806,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpge_epu8_mask() { + const fn test_mm512_mask_cmpge_epu8_mask() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -14943,7 +15818,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpge_epu8_mask() { + const fn test_mm256_cmpge_epu8_mask() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let m = _mm256_cmpge_epu8_mask(a, b); @@ -14951,7 +15826,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epu8_mask() { + const fn test_mm256_mask_cmpge_epu8_mask() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14960,7 +15835,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpge_epu8_mask() { + const fn test_mm_cmpge_epu8_mask() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let m = _mm_cmpge_epu8_mask(a, b); @@ -14968,7 +15843,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpge_epu8_mask() { + const fn test_mm_mask_cmpge_epu8_mask() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let mask = 0b01010101_01010101; @@ -14977,7 +15852,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpge_epi16_mask() { + const fn test_mm512_cmpge_epi16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let m = _mm512_cmpge_epi16_mask(a, b); @@ -14985,7 +15860,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpge_epi16_mask() { + const fn test_mm512_mask_cmpge_epi16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -14994,7 +15869,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpge_epi16_mask() { + const fn test_mm256_cmpge_epi16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let m = _mm256_cmpge_epi16_mask(a, b); @@ -15002,7 +15877,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epi16_mask() { + const fn test_mm256_mask_cmpge_epi16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -15011,7 +15886,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpge_epi16_mask() { + const fn test_mm_cmpge_epi16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let m = _mm_cmpge_epi16_mask(a, b); @@ -15019,7 +15894,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpge_epi16_mask() { + const fn test_mm_mask_cmpge_epi16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -15028,7 +15903,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpge_epi8_mask() { + const fn test_mm512_cmpge_epi8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let m = _mm512_cmpge_epi8_mask(a, b); @@ -15039,7 +15914,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpge_epi8_mask() { + const fn test_mm512_mask_cmpge_epi8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15051,7 +15926,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpge_epi8_mask() { + const fn test_mm256_cmpge_epi8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let m = _mm256_cmpge_epi8_mask(a, b); @@ -15059,7 +15934,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epi8_mask() { + const fn test_mm256_mask_cmpge_epi8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15068,7 +15943,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpge_epi8_mask() { + const fn test_mm_cmpge_epi8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let m = _mm_cmpge_epi8_mask(a, b); @@ -15076,7 +15951,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpge_epi8_mask() { + const fn test_mm_mask_cmpge_epi8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -15085,7 +15960,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpeq_epu16_mask() { + const fn test_mm512_cmpeq_epu16_mask() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let m = _mm512_cmpeq_epu16_mask(a, b); @@ -15093,7 +15968,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpeq_epu16_mask() { + const fn test_mm512_mask_cmpeq_epu16_mask() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15102,7 +15977,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpeq_epu16_mask() { + const fn test_mm256_cmpeq_epu16_mask() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let m = _mm256_cmpeq_epu16_mask(a, b); @@ -15110,7 +15985,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epu16_mask() { + const fn test_mm256_mask_cmpeq_epu16_mask() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let mask = 0b01010101_01010101; @@ -15119,7 +15994,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpeq_epu16_mask() { + const fn test_mm_cmpeq_epu16_mask() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let m = _mm_cmpeq_epu16_mask(a, b); @@ -15127,7 +16002,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epu16_mask() { + const fn test_mm_mask_cmpeq_epu16_mask() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let mask = 0b01010101; @@ -15136,7 +16011,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpeq_epu8_mask() { + const fn test_mm512_cmpeq_epu8_mask() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let m = _mm512_cmpeq_epu8_mask(a, b); @@ -15147,7 +16022,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpeq_epu8_mask() { + const fn test_mm512_mask_cmpeq_epu8_mask() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15159,7 +16034,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpeq_epu8_mask() { + const fn test_mm256_cmpeq_epu8_mask() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let m = _mm256_cmpeq_epu8_mask(a, b); @@ -15167,7 +16042,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epu8_mask() { + const fn test_mm256_mask_cmpeq_epu8_mask() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15176,7 +16051,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpeq_epu8_mask() { + const fn test_mm_cmpeq_epu8_mask() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let m = _mm_cmpeq_epu8_mask(a, b); @@ -15184,7 +16059,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epu8_mask() { + const fn test_mm_mask_cmpeq_epu8_mask() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let mask = 0b01010101_01010101; @@ -15193,7 +16068,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpeq_epi16_mask() { + const fn test_mm512_cmpeq_epi16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let m = _mm512_cmpeq_epi16_mask(a, b); @@ -15201,7 +16076,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpeq_epi16_mask() { + const fn test_mm512_mask_cmpeq_epi16_mask() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15210,7 +16085,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpeq_epi16_mask() { + const fn test_mm256_cmpeq_epi16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let m = _mm256_cmpeq_epi16_mask(a, b); @@ -15218,7 +16093,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epi16_mask() { + const fn test_mm256_mask_cmpeq_epi16_mask() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -15227,7 +16102,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpeq_epi16_mask() { + const fn test_mm_cmpeq_epi16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let m = _mm_cmpeq_epi16_mask(a, b); @@ -15235,7 +16110,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epi16_mask() { + const fn test_mm_mask_cmpeq_epi16_mask() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -15244,7 +16119,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpeq_epi8_mask() { + const fn test_mm512_cmpeq_epi8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let m = _mm512_cmpeq_epi8_mask(a, b); @@ -15255,7 +16130,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpeq_epi8_mask() { + const fn test_mm512_mask_cmpeq_epi8_mask() { let a = _mm512_set1_epi8(-1); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15267,7 +16142,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpeq_epi8_mask() { + const fn test_mm256_cmpeq_epi8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let m = _mm256_cmpeq_epi8_mask(a, b); @@ -15275,7 +16150,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epi8_mask() { + const fn test_mm256_mask_cmpeq_epi8_mask() { let a = _mm256_set1_epi8(-1); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15284,7 +16159,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpeq_epi8_mask() { + const fn test_mm_cmpeq_epi8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let m = _mm_cmpeq_epi8_mask(a, b); @@ -15292,7 +16167,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epi8_mask() { + const fn test_mm_mask_cmpeq_epi8_mask() { let a = _mm_set1_epi8(-1); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -15301,7 +16176,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpneq_epu16_mask() { + const fn test_mm512_cmpneq_epu16_mask() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(1); let m = _mm512_cmpneq_epu16_mask(a, b); @@ -15309,7 +16184,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpneq_epu16_mask() { + const fn test_mm512_mask_cmpneq_epu16_mask() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15318,7 +16193,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpneq_epu16_mask() { + const fn test_mm256_cmpneq_epu16_mask() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(1); let m = _mm256_cmpneq_epu16_mask(a, b); @@ -15326,7 +16201,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epu16_mask() { + const fn test_mm256_mask_cmpneq_epu16_mask() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(1); let mask = 0b01010101_01010101; @@ -15335,7 +16210,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpneq_epu16_mask() { + const fn test_mm_cmpneq_epu16_mask() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(1); let m = _mm_cmpneq_epu16_mask(a, b); @@ -15343,7 +16218,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epu16_mask() { + const fn test_mm_mask_cmpneq_epu16_mask() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(1); let mask = 0b01010101; @@ -15352,7 +16227,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpneq_epu8_mask() { + const fn test_mm512_cmpneq_epu8_mask() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(1); let m = _mm512_cmpneq_epu8_mask(a, b); @@ -15363,7 +16238,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpneq_epu8_mask() { + const fn test_mm512_mask_cmpneq_epu8_mask() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15375,7 +16250,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpneq_epu8_mask() { + const fn test_mm256_cmpneq_epu8_mask() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(1); let m = _mm256_cmpneq_epu8_mask(a, b); @@ -15383,7 +16258,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epu8_mask() { + const fn test_mm256_mask_cmpneq_epu8_mask() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15392,7 +16267,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpneq_epu8_mask() { + const fn test_mm_cmpneq_epu8_mask() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(1); let m = _mm_cmpneq_epu8_mask(a, b); @@ -15400,7 +16275,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epu8_mask() { + const fn test_mm_mask_cmpneq_epu8_mask() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(1); let mask = 0b01010101_01010101; @@ -15409,7 +16284,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpneq_epi16_mask() { + const fn test_mm512_cmpneq_epi16_mask() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(-1); let m = _mm512_cmpneq_epi16_mask(a, b); @@ -15417,7 +16292,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpneq_epi16_mask() { + const fn test_mm512_mask_cmpneq_epi16_mask() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15426,7 +16301,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpneq_epi16_mask() { + const fn test_mm256_cmpneq_epi16_mask() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(-1); let m = _mm256_cmpneq_epi16_mask(a, b); @@ -15434,7 +16309,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epi16_mask() { + const fn test_mm256_mask_cmpneq_epi16_mask() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(-1); let mask = 0b01010101_01010101; @@ -15443,7 +16318,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpneq_epi16_mask() { + const fn test_mm_cmpneq_epi16_mask() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(-1); let m = _mm_cmpneq_epi16_mask(a, b); @@ -15451,7 +16326,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epi16_mask() { + const fn test_mm_mask_cmpneq_epi16_mask() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(-1); let mask = 0b01010101; @@ -15460,7 +16335,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmpneq_epi8_mask() { + const fn test_mm512_cmpneq_epi8_mask() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(-1); let m = _mm512_cmpneq_epi8_mask(a, b); @@ -15471,7 +16346,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmpneq_epi8_mask() { + const fn test_mm512_mask_cmpneq_epi8_mask() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15483,7 +16358,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmpneq_epi8_mask() { + const fn test_mm256_cmpneq_epi8_mask() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(-1); let m = _mm256_cmpneq_epi8_mask(a, b); @@ -15491,7 +16366,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epi8_mask() { + const fn test_mm256_mask_cmpneq_epi8_mask() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(-1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15500,7 +16375,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmpneq_epi8_mask() { + const fn test_mm_cmpneq_epi8_mask() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(-1); let m = _mm_cmpneq_epi8_mask(a, b); @@ -15508,7 +16383,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epi8_mask() { + const fn test_mm_mask_cmpneq_epi8_mask() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(-1); let mask = 0b01010101_01010101; @@ -15517,7 +16392,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmp_epu16_mask() { + const fn test_mm512_cmp_epu16_mask() { let a = _mm512_set1_epi16(0); let b = _mm512_set1_epi16(1); let m = _mm512_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b); @@ -15525,7 +16400,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmp_epu16_mask() { + const fn test_mm512_mask_cmp_epu16_mask() { let a = _mm512_set1_epi16(0); let b = _mm512_set1_epi16(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15534,7 +16409,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmp_epu16_mask() { + const fn test_mm256_cmp_epu16_mask() { let a = _mm256_set1_epi16(0); let b = _mm256_set1_epi16(1); let m = _mm256_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b); @@ -15542,7 +16417,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmp_epu16_mask() { + const fn test_mm256_mask_cmp_epu16_mask() { let a = _mm256_set1_epi16(0); let b = _mm256_set1_epi16(1); let mask = 0b01010101_01010101; @@ -15551,7 +16426,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmp_epu16_mask() { + const fn test_mm_cmp_epu16_mask() { let a = _mm_set1_epi16(0); let b = _mm_set1_epi16(1); let m = _mm_cmp_epu16_mask::<_MM_CMPINT_LT>(a, b); @@ -15559,7 +16434,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmp_epu16_mask() { + const fn test_mm_mask_cmp_epu16_mask() { let a = _mm_set1_epi16(0); let b = _mm_set1_epi16(1); let mask = 0b01010101; @@ -15568,7 +16443,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmp_epu8_mask() { + const fn test_mm512_cmp_epu8_mask() { let a = _mm512_set1_epi8(0); let b = _mm512_set1_epi8(1); let m = _mm512_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b); @@ -15579,7 +16454,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmp_epu8_mask() { + const fn test_mm512_mask_cmp_epu8_mask() { let a = _mm512_set1_epi8(0); let b = _mm512_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15591,7 +16466,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmp_epu8_mask() { + const fn test_mm256_cmp_epu8_mask() { let a = _mm256_set1_epi8(0); let b = _mm256_set1_epi8(1); let m = _mm256_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b); @@ -15599,7 +16474,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmp_epu8_mask() { + const fn test_mm256_mask_cmp_epu8_mask() { let a = _mm256_set1_epi8(0); let b = _mm256_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15608,7 +16483,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmp_epu8_mask() { + const fn test_mm_cmp_epu8_mask() { let a = _mm_set1_epi8(0); let b = _mm_set1_epi8(1); let m = _mm_cmp_epu8_mask::<_MM_CMPINT_LT>(a, b); @@ -15616,7 +16491,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmp_epu8_mask() { + const fn test_mm_mask_cmp_epu8_mask() { let a = _mm_set1_epi8(0); let b = _mm_set1_epi8(1); let mask = 0b01010101_01010101; @@ -15625,7 +16500,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmp_epi16_mask() { + const fn test_mm512_cmp_epi16_mask() { let a = _mm512_set1_epi16(0); let b = _mm512_set1_epi16(1); let m = _mm512_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b); @@ -15633,7 +16508,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmp_epi16_mask() { + const fn test_mm512_mask_cmp_epi16_mask() { let a = _mm512_set1_epi16(0); let b = _mm512_set1_epi16(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15642,7 +16517,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmp_epi16_mask() { + const fn test_mm256_cmp_epi16_mask() { let a = _mm256_set1_epi16(0); let b = _mm256_set1_epi16(1); let m = _mm256_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b); @@ -15650,7 +16525,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmp_epi16_mask() { + const fn test_mm256_mask_cmp_epi16_mask() { let a = _mm256_set1_epi16(0); let b = _mm256_set1_epi16(1); let mask = 0b01010101_01010101; @@ -15659,7 +16534,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmp_epi16_mask() { + const fn test_mm_cmp_epi16_mask() { let a = _mm_set1_epi16(0); let b = _mm_set1_epi16(1); let m = _mm_cmp_epi16_mask::<_MM_CMPINT_LT>(a, b); @@ -15667,7 +16542,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmp_epi16_mask() { + const fn test_mm_mask_cmp_epi16_mask() { let a = _mm_set1_epi16(0); let b = _mm_set1_epi16(1); let mask = 0b01010101; @@ -15676,7 +16551,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cmp_epi8_mask() { + const fn test_mm512_cmp_epi8_mask() { let a = _mm512_set1_epi8(0); let b = _mm512_set1_epi8(1); let m = _mm512_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b); @@ -15687,7 +16562,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cmp_epi8_mask() { + const fn test_mm512_mask_cmp_epi8_mask() { let a = _mm512_set1_epi8(0); let b = _mm512_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101_01010101_01010101_01010101_01010101; @@ -15699,7 +16574,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cmp_epi8_mask() { + const fn test_mm256_cmp_epi8_mask() { let a = _mm256_set1_epi8(0); let b = _mm256_set1_epi8(1); let m = _mm256_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b); @@ -15707,7 +16582,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cmp_epi8_mask() { + const fn test_mm256_mask_cmp_epi8_mask() { let a = _mm256_set1_epi8(0); let b = _mm256_set1_epi8(1); let mask = 0b01010101_01010101_01010101_01010101; @@ -15716,7 +16591,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cmp_epi8_mask() { + const fn test_mm_cmp_epi8_mask() { let a = _mm_set1_epi8(0); let b = _mm_set1_epi8(1); let m = _mm_cmp_epi8_mask::<_MM_CMPINT_LT>(a, b); @@ -15724,7 +16599,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cmp_epi8_mask() { + const fn test_mm_mask_cmp_epi8_mask() { let a = _mm_set1_epi8(0); let b = _mm_set1_epi8(1); let mask = 0b01010101_01010101; @@ -15733,91 +16608,91 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_add_epi16() { + const fn test_mm256_reduce_add_epi16() { let a = _mm256_set1_epi16(1); let e = _mm256_reduce_add_epi16(a); assert_eq!(16, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_add_epi16() { + const fn test_mm256_mask_reduce_add_epi16() { let a = _mm256_set1_epi16(1); let e = _mm256_mask_reduce_add_epi16(0b11111111_00000000, a); assert_eq!(8, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_add_epi16() { + const fn test_mm_reduce_add_epi16() { let a = _mm_set1_epi16(1); let e = _mm_reduce_add_epi16(a); assert_eq!(8, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_add_epi16() { + const fn test_mm_mask_reduce_add_epi16() { let a = _mm_set1_epi16(1); let e = _mm_mask_reduce_add_epi16(0b11110000, a); assert_eq!(4, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_add_epi8() { + const fn test_mm256_reduce_add_epi8() { let a = _mm256_set1_epi8(1); let e = _mm256_reduce_add_epi8(a); assert_eq!(32, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_add_epi8() { + const fn test_mm256_mask_reduce_add_epi8() { let a = _mm256_set1_epi8(1); let e = _mm256_mask_reduce_add_epi8(0b11111111_00000000_11111111_00000000, a); assert_eq!(16, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_add_epi8() { + const fn test_mm_reduce_add_epi8() { let a = _mm_set1_epi8(1); let e = _mm_reduce_add_epi8(a); assert_eq!(16, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_add_epi8() { + const fn test_mm_mask_reduce_add_epi8() { let a = _mm_set1_epi8(1); let e = _mm_mask_reduce_add_epi8(0b11111111_00000000, a); assert_eq!(8, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_and_epi16() { + const fn test_mm256_reduce_and_epi16() { let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm256_reduce_and_epi16(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_and_epi16() { + const fn test_mm256_mask_reduce_and_epi16() { let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm256_mask_reduce_and_epi16(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_and_epi16() { + const fn test_mm_reduce_and_epi16() { let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2); let e = _mm_reduce_and_epi16(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_and_epi16() { + const fn test_mm_mask_reduce_and_epi16() { let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2); let e = _mm_mask_reduce_and_epi16(0b11110000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_and_epi8() { + const fn test_mm256_reduce_and_epi8() { let a = _mm256_set_epi8( 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, @@ -15827,7 +16702,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_and_epi8() { + const fn test_mm256_mask_reduce_and_epi8() { let a = _mm256_set_epi8( 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, @@ -15837,49 +16712,49 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_and_epi8() { + const fn test_mm_reduce_and_epi8() { let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm_reduce_and_epi8(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_and_epi8() { + const fn test_mm_mask_reduce_and_epi8() { let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm_mask_reduce_and_epi8(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_mul_epi16() { + const fn test_mm256_reduce_mul_epi16() { let a = _mm256_set_epi16(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1); let e = _mm256_reduce_mul_epi16(a); assert_eq!(256, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_mul_epi16() { + const fn test_mm256_mask_reduce_mul_epi16() { let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm256_mask_reduce_mul_epi16(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_mul_epi16() { + const fn test_mm_reduce_mul_epi16() { let a = _mm_set_epi16(2, 2, 2, 2, 1, 1, 1, 1); let e = _mm_reduce_mul_epi16(a); assert_eq!(16, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_mul_epi16() { + const fn test_mm_mask_reduce_mul_epi16() { let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2); let e = _mm_mask_reduce_mul_epi16(0b11110000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_mul_epi8() { + const fn test_mm256_reduce_mul_epi8() { let a = _mm256_set_epi8( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, @@ -15889,7 +16764,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_mul_epi8() { + const fn test_mm256_mask_reduce_mul_epi8() { let a = _mm256_set_epi8( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, @@ -15899,49 +16774,49 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_mul_epi8() { + const fn test_mm_reduce_mul_epi8() { let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2); let e = _mm_reduce_mul_epi8(a); assert_eq!(8, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_mul_epi8() { + const fn test_mm_mask_reduce_mul_epi8() { let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2); let e = _mm_mask_reduce_mul_epi8(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_max_epi16() { + const fn test_mm256_reduce_max_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i16 = _mm256_reduce_max_epi16(a); assert_eq!(15, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_max_epi16() { + const fn test_mm256_mask_reduce_max_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i16 = _mm256_mask_reduce_max_epi16(0b11111111_00000000, a); assert_eq!(7, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_max_epi16() { + const fn test_mm_reduce_max_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: i16 = _mm_reduce_max_epi16(a); assert_eq!(7, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_max_epi16() { + const fn test_mm_mask_reduce_max_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: i16 = _mm_mask_reduce_max_epi16(0b11110000, a); assert_eq!(3, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_max_epi8() { + const fn test_mm256_reduce_max_epi8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -15951,7 +16826,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_max_epi8() { + const fn test_mm256_mask_reduce_max_epi8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -15961,49 +16836,49 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_max_epi8() { + const fn test_mm_reduce_max_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i8 = _mm_reduce_max_epi8(a); assert_eq!(15, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_max_epi8() { + const fn test_mm_mask_reduce_max_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i8 = _mm_mask_reduce_max_epi8(0b11111111_00000000, a); assert_eq!(7, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_max_epu16() { + const fn test_mm256_reduce_max_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u16 = _mm256_reduce_max_epu16(a); assert_eq!(15, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_max_epu16() { + const fn test_mm256_mask_reduce_max_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u16 = _mm256_mask_reduce_max_epu16(0b11111111_00000000, a); assert_eq!(7, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_max_epu16() { + const fn test_mm_reduce_max_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: u16 = _mm_reduce_max_epu16(a); assert_eq!(7, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_max_epu16() { + const fn test_mm_mask_reduce_max_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: u16 = _mm_mask_reduce_max_epu16(0b11110000, a); assert_eq!(3, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_max_epu8() { + const fn test_mm256_reduce_max_epu8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -16013,7 +16888,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_max_epu8() { + const fn test_mm256_mask_reduce_max_epu8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -16023,49 +16898,49 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_max_epu8() { + const fn test_mm_reduce_max_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u8 = _mm_reduce_max_epu8(a); assert_eq!(15, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_max_epu8() { + const fn test_mm_mask_reduce_max_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u8 = _mm_mask_reduce_max_epu8(0b11111111_00000000, a); assert_eq!(7, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_min_epi16() { + const fn test_mm256_reduce_min_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i16 = _mm256_reduce_min_epi16(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_min_epi16() { + const fn test_mm256_mask_reduce_min_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i16 = _mm256_mask_reduce_min_epi16(0b11111111_00000000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_min_epi16() { + const fn test_mm_reduce_min_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: i16 = _mm_reduce_min_epi16(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_min_epi16() { + const fn test_mm_mask_reduce_min_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: i16 = _mm_mask_reduce_min_epi16(0b11110000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_min_epi8() { + const fn test_mm256_reduce_min_epi8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -16075,7 +16950,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_min_epi8() { + const fn test_mm256_mask_reduce_min_epi8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -16085,49 +16960,49 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_min_epi8() { + const fn test_mm_reduce_min_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i8 = _mm_reduce_min_epi8(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_min_epi8() { + const fn test_mm_mask_reduce_min_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i8 = _mm_mask_reduce_min_epi8(0b11111111_00000000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_min_epu16() { + const fn test_mm256_reduce_min_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u16 = _mm256_reduce_min_epu16(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_min_epu16() { + const fn test_mm256_mask_reduce_min_epu16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u16 = _mm256_mask_reduce_min_epu16(0b11111111_00000000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_min_epu16() { + const fn test_mm_reduce_min_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: u16 = _mm_reduce_min_epu16(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_min_epu16() { + const fn test_mm_mask_reduce_min_epu16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let e: u16 = _mm_mask_reduce_min_epu16(0b11110000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_min_epu8() { + const fn test_mm256_reduce_min_epu8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -16137,7 +17012,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_min_epu8() { + const fn test_mm256_mask_reduce_min_epu8() { let a = _mm256_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -16147,49 +17022,49 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_min_epu8() { + const fn test_mm_reduce_min_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u8 = _mm_reduce_min_epu8(a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_min_epu8() { + const fn test_mm_mask_reduce_min_epu8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u8 = _mm_mask_reduce_min_epu8(0b11111111_00000000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_or_epi16() { + const fn test_mm256_reduce_or_epi16() { let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm256_reduce_or_epi16(a); assert_eq!(3, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_or_epi16() { + const fn test_mm256_mask_reduce_or_epi16() { let a = _mm256_set_epi16(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm256_mask_reduce_or_epi16(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_or_epi16() { + const fn test_mm_reduce_or_epi16() { let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2); let e = _mm_reduce_or_epi16(a); assert_eq!(3, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_or_epi16() { + const fn test_mm_mask_reduce_or_epi16() { let a = _mm_set_epi16(1, 1, 1, 1, 2, 2, 2, 2); let e = _mm_mask_reduce_or_epi16(0b11110000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_reduce_or_epi8() { + const fn test_mm256_reduce_or_epi8() { let a = _mm256_set_epi8( 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, @@ -16199,7 +17074,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_reduce_or_epi8() { + const fn test_mm256_mask_reduce_or_epi8() { let a = _mm256_set_epi8( 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, @@ -16209,21 +17084,21 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_reduce_or_epi8() { + const fn test_mm_reduce_or_epi8() { let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm_reduce_or_epi8(a); assert_eq!(3, e); } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_reduce_or_epi8() { + const fn test_mm_mask_reduce_or_epi8() { let a = _mm_set_epi8(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e = _mm_mask_reduce_or_epi8(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_loadu_epi16() { + const unsafe fn test_mm512_loadu_epi16() { #[rustfmt::skip] let a: [i16; 32] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; let r = _mm512_loadu_epi16(&a[0]); @@ -16233,7 +17108,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_loadu_epi16() { + const unsafe fn test_mm256_loadu_epi16() { let a: [i16; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let r = _mm256_loadu_epi16(&a[0]); let e = _mm256_set_epi16(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1); @@ -16241,7 +17116,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_loadu_epi16() { + const unsafe fn test_mm_loadu_epi16() { let a: [i16; 8] = [1, 2, 3, 4, 5, 6, 7, 8]; let r = _mm_loadu_epi16(&a[0]); let e = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1); @@ -16249,7 +17124,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_loadu_epi8() { + const unsafe fn test_mm512_loadu_epi8() { #[rustfmt::skip] let a: [i8; 64] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; @@ -16261,7 +17136,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_loadu_epi8() { + const unsafe fn test_mm256_loadu_epi8() { #[rustfmt::skip] let a: [i8; 32] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; let r = _mm256_loadu_epi8(&a[0]); @@ -16271,7 +17146,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_loadu_epi8() { + const unsafe fn test_mm_loadu_epi8() { let a: [i8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let r = _mm_loadu_epi8(&a[0]); let e = _mm_set_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1); @@ -16279,7 +17154,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_storeu_epi16() { + const unsafe fn test_mm512_storeu_epi16() { let a = _mm512_set1_epi16(9); let mut r = _mm512_undefined_epi32(); _mm512_storeu_epi16(&mut r as *mut _ as *mut i16, a); @@ -16287,7 +17162,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_storeu_epi16() { + const unsafe fn test_mm256_storeu_epi16() { let a = _mm256_set1_epi16(9); let mut r = _mm256_set1_epi32(0); _mm256_storeu_epi16(&mut r as *mut _ as *mut i16, a); @@ -16295,7 +17170,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_storeu_epi16() { + const unsafe fn test_mm_storeu_epi16() { let a = _mm_set1_epi16(9); let mut r = _mm_set1_epi32(0); _mm_storeu_epi16(&mut r as *mut _ as *mut i16, a); @@ -16303,7 +17178,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_storeu_epi8() { + const unsafe fn test_mm512_storeu_epi8() { let a = _mm512_set1_epi8(9); let mut r = _mm512_undefined_epi32(); _mm512_storeu_epi8(&mut r as *mut _ as *mut i8, a); @@ -16311,7 +17186,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_storeu_epi8() { + const unsafe fn test_mm256_storeu_epi8() { let a = _mm256_set1_epi8(9); let mut r = _mm256_set1_epi32(0); _mm256_storeu_epi8(&mut r as *mut _ as *mut i8, a); @@ -16319,7 +17194,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_storeu_epi8() { + const unsafe fn test_mm_storeu_epi8() { let a = _mm_set1_epi8(9); let mut r = _mm_set1_epi32(0); _mm_storeu_epi8(&mut r as *mut _ as *mut i8, a); @@ -16327,7 +17202,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_loadu_epi16() { + const unsafe fn test_mm512_mask_loadu_epi16() { let src = _mm512_set1_epi16(42); let a = &[ 1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -16345,7 +17220,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_loadu_epi16() { + const unsafe fn test_mm512_maskz_loadu_epi16() { let a = &[ 1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -16362,7 +17237,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_storeu_epi16() { + const unsafe fn test_mm512_mask_storeu_epi16() { let mut r = [42_i16; 32]; let a = &[ 1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -16380,7 +17255,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_loadu_epi8() { + const unsafe fn test_mm512_mask_loadu_epi8() { let src = _mm512_set1_epi8(42); let a = &[ 1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -16400,7 +17275,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_loadu_epi8() { + const unsafe fn test_mm512_maskz_loadu_epi8() { let a = &[ 1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, @@ -16419,7 +17294,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_storeu_epi8() { + const unsafe fn test_mm512_mask_storeu_epi8() { let mut r = [42_i8; 64]; let a = &[ 1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -16439,7 +17314,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_loadu_epi16() { + const unsafe fn test_mm256_mask_loadu_epi16() { let src = _mm256_set1_epi16(42); let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let p = a.as_ptr(); @@ -16453,7 +17328,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_loadu_epi16() { + const unsafe fn test_mm256_maskz_loadu_epi16() { let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let p = a.as_ptr(); let m = 0b11101000_11001010; @@ -16464,7 +17339,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_storeu_epi16() { + const unsafe fn test_mm256_mask_storeu_epi16() { let mut r = [42_i16; 16]; let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let a = _mm256_loadu_epi16(a.as_ptr()); @@ -16478,7 +17353,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_loadu_epi8() { + const unsafe fn test_mm256_mask_loadu_epi8() { let src = _mm256_set1_epi8(42); let a = &[ 1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -16496,7 +17371,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_loadu_epi8() { + const unsafe fn test_mm256_maskz_loadu_epi8() { let a = &[ 1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -16513,7 +17388,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_storeu_epi8() { + const unsafe fn test_mm256_mask_storeu_epi8() { let mut r = [42_i8; 32]; let a = &[ 1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -16531,7 +17406,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_loadu_epi16() { + const unsafe fn test_mm_mask_loadu_epi16() { let src = _mm_set1_epi16(42); let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8]; let p = a.as_ptr(); @@ -16543,7 +17418,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_loadu_epi16() { + const unsafe fn test_mm_maskz_loadu_epi16() { let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8]; let p = a.as_ptr(); let m = 0b11001010; @@ -16554,7 +17429,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_storeu_epi16() { + const unsafe fn test_mm_mask_storeu_epi16() { let mut r = [42_i16; 8]; let a = &[1_i16, 2, 3, 4, 5, 6, 7, 8]; let a = _mm_loadu_epi16(a.as_ptr()); @@ -16566,7 +17441,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_loadu_epi8() { + const unsafe fn test_mm_mask_loadu_epi8() { let src = _mm_set1_epi8(42); let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let p = a.as_ptr(); @@ -16580,7 +17455,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_loadu_epi8() { + const unsafe fn test_mm_maskz_loadu_epi8() { let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let p = a.as_ptr(); let m = 0b11101000_11001010; @@ -16591,7 +17466,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_storeu_epi8() { + const unsafe fn test_mm_mask_storeu_epi8() { let mut r = [42_i8; 16]; let a = &[1_i8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let a = _mm_loadu_epi8(a.as_ptr()); @@ -16605,7 +17480,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_madd_epi16() { + fn test_mm512_madd_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_madd_epi16(a, b); @@ -16614,7 +17489,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_madd_epi16() { + fn test_mm512_mask_madd_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mask_madd_epi16(a, 0, a, b); @@ -16642,7 +17517,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_madd_epi16() { + fn test_mm512_maskz_madd_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_madd_epi16(0, a, b); @@ -16653,7 +17528,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_madd_epi16() { + fn test_mm256_mask_madd_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_mask_madd_epi16(a, 0, a, b); @@ -16673,7 +17548,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_madd_epi16() { + fn test_mm256_maskz_madd_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_madd_epi16(0, a, b); @@ -16684,7 +17559,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_madd_epi16() { + fn test_mm_mask_madd_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_mask_madd_epi16(a, 0, a, b); @@ -16695,7 +17570,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_madd_epi16() { + fn test_mm_maskz_madd_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_maskz_madd_epi16(0, a, b); @@ -16706,7 +17581,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maddubs_epi16() { + fn test_mm512_maddubs_epi16() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_maddubs_epi16(a, b); @@ -16715,7 +17590,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_maddubs_epi16() { + fn test_mm512_mask_maddubs_epi16() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let src = _mm512_set1_epi16(1); @@ -16729,7 +17604,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_maddubs_epi16() { + fn test_mm512_maskz_maddubs_epi16() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_maskz_maddubs_epi16(0, a, b); @@ -16742,7 +17617,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_maddubs_epi16() { + fn test_mm256_mask_maddubs_epi16() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let src = _mm256_set1_epi16(1); @@ -16754,7 +17629,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_maddubs_epi16() { + fn test_mm256_maskz_maddubs_epi16() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let r = _mm256_maskz_maddubs_epi16(0, a, b); @@ -16765,7 +17640,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_maddubs_epi16() { + fn test_mm_mask_maddubs_epi16() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let src = _mm_set1_epi16(1); @@ -16777,7 +17652,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_maddubs_epi16() { + fn test_mm_maskz_maddubs_epi16() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let r = _mm_maskz_maddubs_epi16(0, a, b); @@ -16788,7 +17663,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_packs_epi32() { + fn test_mm512_packs_epi32() { let a = _mm512_set1_epi32(i32::MAX); let b = _mm512_set1_epi32(1); let r = _mm512_packs_epi32(a, b); @@ -16799,7 +17674,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_packs_epi32() { + fn test_mm512_mask_packs_epi32() { let a = _mm512_set1_epi32(i32::MAX); let b = _mm512_set1_epi32(1 << 16 | 1); let r = _mm512_mask_packs_epi32(a, 0, a, b); @@ -16812,7 +17687,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_packs_epi32() { + fn test_mm512_maskz_packs_epi32() { let a = _mm512_set1_epi32(i32::MAX); let b = _mm512_set1_epi32(1); let r = _mm512_maskz_packs_epi32(0, a, b); @@ -16825,7 +17700,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_packs_epi32() { + fn test_mm256_mask_packs_epi32() { let a = _mm256_set1_epi32(i32::MAX); let b = _mm256_set1_epi32(1 << 16 | 1); let r = _mm256_mask_packs_epi32(a, 0, a, b); @@ -16837,7 +17712,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_packs_epi32() { + fn test_mm256_maskz_packs_epi32() { let a = _mm256_set1_epi32(i32::MAX); let b = _mm256_set1_epi32(1); let r = _mm256_maskz_packs_epi32(0, a, b); @@ -16849,7 +17724,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_packs_epi32() { + fn test_mm_mask_packs_epi32() { let a = _mm_set1_epi32(i32::MAX); let b = _mm_set1_epi32(1 << 16 | 1); let r = _mm_mask_packs_epi32(a, 0, a, b); @@ -16860,7 +17735,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_packs_epi32() { + fn test_mm_maskz_packs_epi32() { let a = _mm_set1_epi32(i32::MAX); let b = _mm_set1_epi32(1); let r = _mm_maskz_packs_epi32(0, a, b); @@ -16871,7 +17746,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_packs_epi16() { + fn test_mm512_packs_epi16() { let a = _mm512_set1_epi16(i16::MAX); let b = _mm512_set1_epi16(1); let r = _mm512_packs_epi16(a, b); @@ -16884,7 +17759,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_packs_epi16() { + fn test_mm512_mask_packs_epi16() { let a = _mm512_set1_epi16(i16::MAX); let b = _mm512_set1_epi16(1 << 8 | 1); let r = _mm512_mask_packs_epi16(a, 0, a, b); @@ -16904,7 +17779,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_packs_epi16() { + fn test_mm512_maskz_packs_epi16() { let a = _mm512_set1_epi16(i16::MAX); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_packs_epi16(0, a, b); @@ -16923,7 +17798,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_packs_epi16() { + fn test_mm256_mask_packs_epi16() { let a = _mm256_set1_epi16(i16::MAX); let b = _mm256_set1_epi16(1 << 8 | 1); let r = _mm256_mask_packs_epi16(a, 0, a, b); @@ -16936,7 +17811,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_packs_epi16() { + fn test_mm256_maskz_packs_epi16() { let a = _mm256_set1_epi16(i16::MAX); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_packs_epi16(0, a, b); @@ -16949,7 +17824,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_packs_epi16() { + fn test_mm_mask_packs_epi16() { let a = _mm_set1_epi16(i16::MAX); let b = _mm_set1_epi16(1 << 8 | 1); let r = _mm_mask_packs_epi16(a, 0, a, b); @@ -16961,7 +17836,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_packs_epi16() { + fn test_mm_maskz_packs_epi16() { let a = _mm_set1_epi16(i16::MAX); let b = _mm_set1_epi16(1); let r = _mm_maskz_packs_epi16(0, a, b); @@ -16973,7 +17848,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_packus_epi32() { + fn test_mm512_packus_epi32() { let a = _mm512_set1_epi32(-1); let b = _mm512_set1_epi32(1); let r = _mm512_packus_epi32(a, b); @@ -16984,7 +17859,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_packus_epi32() { + fn test_mm512_mask_packus_epi32() { let a = _mm512_set1_epi32(-1); let b = _mm512_set1_epi32(1 << 16 | 1); let r = _mm512_mask_packus_epi32(a, 0, a, b); @@ -16997,7 +17872,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_packus_epi32() { + fn test_mm512_maskz_packus_epi32() { let a = _mm512_set1_epi32(-1); let b = _mm512_set1_epi32(1); let r = _mm512_maskz_packus_epi32(0, a, b); @@ -17010,7 +17885,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_packus_epi32() { + fn test_mm256_mask_packus_epi32() { let a = _mm256_set1_epi32(-1); let b = _mm256_set1_epi32(1 << 16 | 1); let r = _mm256_mask_packus_epi32(a, 0, a, b); @@ -17021,7 +17896,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_packus_epi32() { + fn test_mm256_maskz_packus_epi32() { let a = _mm256_set1_epi32(-1); let b = _mm256_set1_epi32(1); let r = _mm256_maskz_packus_epi32(0, a, b); @@ -17032,7 +17907,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_packus_epi32() { + fn test_mm_mask_packus_epi32() { let a = _mm_set1_epi32(-1); let b = _mm_set1_epi32(1 << 16 | 1); let r = _mm_mask_packus_epi32(a, 0, a, b); @@ -17043,7 +17918,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_packus_epi32() { + fn test_mm_maskz_packus_epi32() { let a = _mm_set1_epi32(-1); let b = _mm_set1_epi32(1); let r = _mm_maskz_packus_epi32(0, a, b); @@ -17054,7 +17929,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_packus_epi16() { + fn test_mm512_packus_epi16() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(1); let r = _mm512_packus_epi16(a, b); @@ -17067,7 +17942,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_packus_epi16() { + fn test_mm512_mask_packus_epi16() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(1 << 8 | 1); let r = _mm512_mask_packus_epi16(a, 0, a, b); @@ -17087,7 +17962,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_packus_epi16() { + fn test_mm512_maskz_packus_epi16() { let a = _mm512_set1_epi16(-1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_packus_epi16(0, a, b); @@ -17106,7 +17981,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_packus_epi16() { + fn test_mm256_mask_packus_epi16() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(1 << 8 | 1); let r = _mm256_mask_packus_epi16(a, 0, a, b); @@ -17119,7 +17994,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_packus_epi16() { + fn test_mm256_maskz_packus_epi16() { let a = _mm256_set1_epi16(-1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_packus_epi16(0, a, b); @@ -17132,7 +18007,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_packus_epi16() { + fn test_mm_mask_packus_epi16() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(1 << 8 | 1); let r = _mm_mask_packus_epi16(a, 0, a, b); @@ -17143,7 +18018,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_packus_epi16() { + fn test_mm_maskz_packus_epi16() { let a = _mm_set1_epi16(-1); let b = _mm_set1_epi16(1); let r = _mm_maskz_packus_epi16(0, a, b); @@ -17154,7 +18029,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_avg_epu16() { + const fn test_mm512_avg_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_avg_epu16(a, b); @@ -17163,7 +18038,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_avg_epu16() { + const fn test_mm512_mask_avg_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_mask_avg_epu16(a, 0, a, b); @@ -17176,7 +18051,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_avg_epu16() { + const fn test_mm512_maskz_avg_epu16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1); let r = _mm512_maskz_avg_epu16(0, a, b); @@ -17189,7 +18064,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_avg_epu16() { + const fn test_mm256_mask_avg_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_mask_avg_epu16(a, 0, a, b); @@ -17200,7 +18075,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_avg_epu16() { + const fn test_mm256_maskz_avg_epu16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1); let r = _mm256_maskz_avg_epu16(0, a, b); @@ -17211,7 +18086,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_avg_epu16() { + const fn test_mm_mask_avg_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_mask_avg_epu16(a, 0, a, b); @@ -17222,7 +18097,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_avg_epu16() { + const fn test_mm_maskz_avg_epu16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1); let r = _mm_maskz_avg_epu16(0, a, b); @@ -17233,7 +18108,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_avg_epu8() { + const fn test_mm512_avg_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_avg_epu8(a, b); @@ -17242,7 +18117,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_avg_epu8() { + const fn test_mm512_mask_avg_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_mask_avg_epu8(a, 0, a, b); @@ -17262,7 +18137,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_avg_epu8() { + const fn test_mm512_maskz_avg_epu8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_maskz_avg_epu8(0, a, b); @@ -17281,7 +18156,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_avg_epu8() { + const fn test_mm256_mask_avg_epu8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let r = _mm256_mask_avg_epu8(a, 0, a, b); @@ -17294,7 +18169,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_avg_epu8() { + const fn test_mm256_maskz_avg_epu8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let r = _mm256_maskz_avg_epu8(0, a, b); @@ -17307,7 +18182,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_avg_epu8() { + const fn test_mm_mask_avg_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let r = _mm_mask_avg_epu8(a, 0, a, b); @@ -17318,7 +18193,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_avg_epu8() { + const fn test_mm_maskz_avg_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let r = _mm_maskz_avg_epu8(0, a, b); @@ -17329,7 +18204,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_sll_epi16() { + fn test_mm512_sll_epi16() { let a = _mm512_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm512_sll_epi16(a, count); @@ -17338,7 +18213,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_sll_epi16() { + fn test_mm512_mask_sll_epi16() { let a = _mm512_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm512_mask_sll_epi16(a, 0, a, count); @@ -17349,7 +18224,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_sll_epi16() { + fn test_mm512_maskz_sll_epi16() { let a = _mm512_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm512_maskz_sll_epi16(0, a, count); @@ -17360,7 +18235,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_sll_epi16() { + fn test_mm256_mask_sll_epi16() { let a = _mm256_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm256_mask_sll_epi16(a, 0, a, count); @@ -17371,7 +18246,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_sll_epi16() { + fn test_mm256_maskz_sll_epi16() { let a = _mm256_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm256_maskz_sll_epi16(0, a, count); @@ -17382,7 +18257,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_sll_epi16() { + fn test_mm_mask_sll_epi16() { let a = _mm_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm_mask_sll_epi16(a, 0, a, count); @@ -17393,7 +18268,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_sll_epi16() { + fn test_mm_maskz_sll_epi16() { let a = _mm_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm_maskz_sll_epi16(0, a, count); @@ -17404,7 +18279,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_slli_epi16() { + const fn test_mm512_slli_epi16() { let a = _mm512_set1_epi16(1 << 15); let r = _mm512_slli_epi16::<1>(a); let e = _mm512_set1_epi16(0); @@ -17412,7 +18287,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_slli_epi16() { + const fn test_mm512_mask_slli_epi16() { let a = _mm512_set1_epi16(1 << 15); let r = _mm512_mask_slli_epi16::<1>(a, 0, a); assert_eq_m512i(r, a); @@ -17422,7 +18297,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_slli_epi16() { + const fn test_mm512_maskz_slli_epi16() { let a = _mm512_set1_epi16(1 << 15); let r = _mm512_maskz_slli_epi16::<1>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -17432,7 +18307,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_slli_epi16() { + const fn test_mm256_mask_slli_epi16() { let a = _mm256_set1_epi16(1 << 15); let r = _mm256_mask_slli_epi16::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -17442,7 +18317,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_slli_epi16() { + const fn test_mm256_maskz_slli_epi16() { let a = _mm256_set1_epi16(1 << 15); let r = _mm256_maskz_slli_epi16::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -17452,7 +18327,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_slli_epi16() { + const fn test_mm_mask_slli_epi16() { let a = _mm_set1_epi16(1 << 15); let r = _mm_mask_slli_epi16::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -17462,7 +18337,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_slli_epi16() { + const fn test_mm_maskz_slli_epi16() { let a = _mm_set1_epi16(1 << 15); let r = _mm_maskz_slli_epi16::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -17472,7 +18347,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_sllv_epi16() { + const fn test_mm512_sllv_epi16() { let a = _mm512_set1_epi16(1 << 15); let count = _mm512_set1_epi16(2); let r = _mm512_sllv_epi16(a, count); @@ -17481,7 +18356,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_sllv_epi16() { + const fn test_mm512_mask_sllv_epi16() { let a = _mm512_set1_epi16(1 << 15); let count = _mm512_set1_epi16(2); let r = _mm512_mask_sllv_epi16(a, 0, a, count); @@ -17492,7 +18367,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_sllv_epi16() { + const fn test_mm512_maskz_sllv_epi16() { let a = _mm512_set1_epi16(1 << 15); let count = _mm512_set1_epi16(2); let r = _mm512_maskz_sllv_epi16(0, a, count); @@ -17503,7 +18378,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_sllv_epi16() { + const fn test_mm256_sllv_epi16() { let a = _mm256_set1_epi16(1 << 15); let count = _mm256_set1_epi16(2); let r = _mm256_sllv_epi16(a, count); @@ -17512,7 +18387,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_sllv_epi16() { + const fn test_mm256_mask_sllv_epi16() { let a = _mm256_set1_epi16(1 << 15); let count = _mm256_set1_epi16(2); let r = _mm256_mask_sllv_epi16(a, 0, a, count); @@ -17523,7 +18398,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_sllv_epi16() { + const fn test_mm256_maskz_sllv_epi16() { let a = _mm256_set1_epi16(1 << 15); let count = _mm256_set1_epi16(2); let r = _mm256_maskz_sllv_epi16(0, a, count); @@ -17534,7 +18409,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_sllv_epi16() { + const fn test_mm_sllv_epi16() { let a = _mm_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm_sllv_epi16(a, count); @@ -17543,7 +18418,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_sllv_epi16() { + const fn test_mm_mask_sllv_epi16() { let a = _mm_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm_mask_sllv_epi16(a, 0, a, count); @@ -17554,7 +18429,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_sllv_epi16() { + const fn test_mm_maskz_sllv_epi16() { let a = _mm_set1_epi16(1 << 15); let count = _mm_set1_epi16(2); let r = _mm_maskz_sllv_epi16(0, a, count); @@ -17565,7 +18440,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_srl_epi16() { + fn test_mm512_srl_epi16() { let a = _mm512_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm512_srl_epi16(a, count); @@ -17574,7 +18449,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_srl_epi16() { + fn test_mm512_mask_srl_epi16() { let a = _mm512_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm512_mask_srl_epi16(a, 0, a, count); @@ -17585,7 +18460,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_srl_epi16() { + fn test_mm512_maskz_srl_epi16() { let a = _mm512_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm512_maskz_srl_epi16(0, a, count); @@ -17596,7 +18471,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_srl_epi16() { + fn test_mm256_mask_srl_epi16() { let a = _mm256_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm256_mask_srl_epi16(a, 0, a, count); @@ -17607,7 +18482,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_srl_epi16() { + fn test_mm256_maskz_srl_epi16() { let a = _mm256_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm256_maskz_srl_epi16(0, a, count); @@ -17618,7 +18493,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_srl_epi16() { + fn test_mm_mask_srl_epi16() { let a = _mm_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm_mask_srl_epi16(a, 0, a, count); @@ -17629,7 +18504,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_srl_epi16() { + fn test_mm_maskz_srl_epi16() { let a = _mm_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm_maskz_srl_epi16(0, a, count); @@ -17640,7 +18515,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_srli_epi16() { + const fn test_mm512_srli_epi16() { let a = _mm512_set1_epi16(1 << 1); let r = _mm512_srli_epi16::<2>(a); let e = _mm512_set1_epi16(0); @@ -17648,7 +18523,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_srli_epi16() { + const fn test_mm512_mask_srli_epi16() { let a = _mm512_set1_epi16(1 << 1); let r = _mm512_mask_srli_epi16::<2>(a, 0, a); assert_eq_m512i(r, a); @@ -17658,7 +18533,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_srli_epi16() { + const fn test_mm512_maskz_srli_epi16() { let a = _mm512_set1_epi16(1 << 1); let r = _mm512_maskz_srli_epi16::<2>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -17668,7 +18543,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_srli_epi16() { + const fn test_mm256_mask_srli_epi16() { let a = _mm256_set1_epi16(1 << 1); let r = _mm256_mask_srli_epi16::<2>(a, 0, a); assert_eq_m256i(r, a); @@ -17678,7 +18553,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_srli_epi16() { + const fn test_mm256_maskz_srli_epi16() { let a = _mm256_set1_epi16(1 << 1); let r = _mm256_maskz_srli_epi16::<2>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -17688,7 +18563,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_srli_epi16() { + const fn test_mm_mask_srli_epi16() { let a = _mm_set1_epi16(1 << 1); let r = _mm_mask_srli_epi16::<2>(a, 0, a); assert_eq_m128i(r, a); @@ -17698,7 +18573,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_srli_epi16() { + const fn test_mm_maskz_srli_epi16() { let a = _mm_set1_epi16(1 << 1); let r = _mm_maskz_srli_epi16::<2>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -17708,7 +18583,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_srlv_epi16() { + const fn test_mm512_srlv_epi16() { let a = _mm512_set1_epi16(1 << 1); let count = _mm512_set1_epi16(2); let r = _mm512_srlv_epi16(a, count); @@ -17717,7 +18592,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_srlv_epi16() { + const fn test_mm512_mask_srlv_epi16() { let a = _mm512_set1_epi16(1 << 1); let count = _mm512_set1_epi16(2); let r = _mm512_mask_srlv_epi16(a, 0, a, count); @@ -17728,7 +18603,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_srlv_epi16() { + const fn test_mm512_maskz_srlv_epi16() { let a = _mm512_set1_epi16(1 << 1); let count = _mm512_set1_epi16(2); let r = _mm512_maskz_srlv_epi16(0, a, count); @@ -17739,7 +18614,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_srlv_epi16() { + const fn test_mm256_srlv_epi16() { let a = _mm256_set1_epi16(1 << 1); let count = _mm256_set1_epi16(2); let r = _mm256_srlv_epi16(a, count); @@ -17748,7 +18623,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_srlv_epi16() { + const fn test_mm256_mask_srlv_epi16() { let a = _mm256_set1_epi16(1 << 1); let count = _mm256_set1_epi16(2); let r = _mm256_mask_srlv_epi16(a, 0, a, count); @@ -17759,7 +18634,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_srlv_epi16() { + const fn test_mm256_maskz_srlv_epi16() { let a = _mm256_set1_epi16(1 << 1); let count = _mm256_set1_epi16(2); let r = _mm256_maskz_srlv_epi16(0, a, count); @@ -17770,7 +18645,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_srlv_epi16() { + const fn test_mm_srlv_epi16() { let a = _mm_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm_srlv_epi16(a, count); @@ -17779,7 +18654,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_srlv_epi16() { + const fn test_mm_mask_srlv_epi16() { let a = _mm_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm_mask_srlv_epi16(a, 0, a, count); @@ -17790,7 +18665,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_srlv_epi16() { + const fn test_mm_maskz_srlv_epi16() { let a = _mm_set1_epi16(1 << 1); let count = _mm_set1_epi16(2); let r = _mm_maskz_srlv_epi16(0, a, count); @@ -17801,7 +18676,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_sra_epi16() { + fn test_mm512_sra_epi16() { let a = _mm512_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm512_sra_epi16(a, count); @@ -17810,7 +18685,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_sra_epi16() { + fn test_mm512_mask_sra_epi16() { let a = _mm512_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm512_mask_sra_epi16(a, 0, a, count); @@ -17821,7 +18696,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_sra_epi16() { + fn test_mm512_maskz_sra_epi16() { let a = _mm512_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm512_maskz_sra_epi16(0, a, count); @@ -17832,7 +18707,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_sra_epi16() { + fn test_mm256_mask_sra_epi16() { let a = _mm256_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm256_mask_sra_epi16(a, 0, a, count); @@ -17843,7 +18718,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_sra_epi16() { + fn test_mm256_maskz_sra_epi16() { let a = _mm256_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm256_maskz_sra_epi16(0, a, count); @@ -17854,7 +18729,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_sra_epi16() { + fn test_mm_mask_sra_epi16() { let a = _mm_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm_mask_sra_epi16(a, 0, a, count); @@ -17865,7 +18740,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_sra_epi16() { + fn test_mm_maskz_sra_epi16() { let a = _mm_set1_epi16(8); let count = _mm_set1_epi16(1); let r = _mm_maskz_sra_epi16(0, a, count); @@ -17876,7 +18751,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_srai_epi16() { + const fn test_mm512_srai_epi16() { let a = _mm512_set1_epi16(8); let r = _mm512_srai_epi16::<2>(a); let e = _mm512_set1_epi16(2); @@ -17884,7 +18759,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_srai_epi16() { + const fn test_mm512_mask_srai_epi16() { let a = _mm512_set1_epi16(8); let r = _mm512_mask_srai_epi16::<2>(a, 0, a); assert_eq_m512i(r, a); @@ -17894,7 +18769,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_srai_epi16() { + const fn test_mm512_maskz_srai_epi16() { let a = _mm512_set1_epi16(8); let r = _mm512_maskz_srai_epi16::<2>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -17904,7 +18779,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_srai_epi16() { + const fn test_mm256_mask_srai_epi16() { let a = _mm256_set1_epi16(8); let r = _mm256_mask_srai_epi16::<2>(a, 0, a); assert_eq_m256i(r, a); @@ -17914,7 +18789,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_srai_epi16() { + const fn test_mm256_maskz_srai_epi16() { let a = _mm256_set1_epi16(8); let r = _mm256_maskz_srai_epi16::<2>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -17924,7 +18799,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_srai_epi16() { + const fn test_mm_mask_srai_epi16() { let a = _mm_set1_epi16(8); let r = _mm_mask_srai_epi16::<2>(a, 0, a); assert_eq_m128i(r, a); @@ -17934,7 +18809,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_srai_epi16() { + const fn test_mm_maskz_srai_epi16() { let a = _mm_set1_epi16(8); let r = _mm_maskz_srai_epi16::<2>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -17944,7 +18819,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_srav_epi16() { + const fn test_mm512_srav_epi16() { let a = _mm512_set1_epi16(8); let count = _mm512_set1_epi16(2); let r = _mm512_srav_epi16(a, count); @@ -17953,7 +18828,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_srav_epi16() { + const fn test_mm512_mask_srav_epi16() { let a = _mm512_set1_epi16(8); let count = _mm512_set1_epi16(2); let r = _mm512_mask_srav_epi16(a, 0, a, count); @@ -17964,7 +18839,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_srav_epi16() { + const fn test_mm512_maskz_srav_epi16() { let a = _mm512_set1_epi16(8); let count = _mm512_set1_epi16(2); let r = _mm512_maskz_srav_epi16(0, a, count); @@ -17975,7 +18850,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_srav_epi16() { + const fn test_mm256_srav_epi16() { let a = _mm256_set1_epi16(8); let count = _mm256_set1_epi16(2); let r = _mm256_srav_epi16(a, count); @@ -17984,7 +18859,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_srav_epi16() { + const fn test_mm256_mask_srav_epi16() { let a = _mm256_set1_epi16(8); let count = _mm256_set1_epi16(2); let r = _mm256_mask_srav_epi16(a, 0, a, count); @@ -17995,7 +18870,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_srav_epi16() { + const fn test_mm256_maskz_srav_epi16() { let a = _mm256_set1_epi16(8); let count = _mm256_set1_epi16(2); let r = _mm256_maskz_srav_epi16(0, a, count); @@ -18006,7 +18881,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_srav_epi16() { + const fn test_mm_srav_epi16() { let a = _mm_set1_epi16(8); let count = _mm_set1_epi16(2); let r = _mm_srav_epi16(a, count); @@ -18015,7 +18890,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_srav_epi16() { + const fn test_mm_mask_srav_epi16() { let a = _mm_set1_epi16(8); let count = _mm_set1_epi16(2); let r = _mm_mask_srav_epi16(a, 0, a, count); @@ -18026,7 +18901,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_srav_epi16() { + const fn test_mm_maskz_srav_epi16() { let a = _mm_set1_epi16(8); let count = _mm_set1_epi16(2); let r = _mm_maskz_srav_epi16(0, a, count); @@ -18037,7 +18912,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_permutex2var_epi16() { + fn test_mm512_permutex2var_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -18055,7 +18930,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_permutex2var_epi16() { + fn test_mm512_mask_permutex2var_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -18075,7 +18950,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_permutex2var_epi16() { + fn test_mm512_maskz_permutex2var_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -18095,7 +18970,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask2_permutex2var_epi16() { + fn test_mm512_mask2_permutex2var_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -18115,7 +18990,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_permutex2var_epi16() { + fn test_mm256_permutex2var_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4); @@ -18128,7 +19003,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_permutex2var_epi16() { + fn test_mm256_mask_permutex2var_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4); @@ -18143,7 +19018,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_permutex2var_epi16() { + fn test_mm256_maskz_permutex2var_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4); @@ -18158,7 +19033,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask2_permutex2var_epi16() { + fn test_mm256_mask2_permutex2var_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm256_set_epi16(1, 1<<4, 2, 1<<4, 3, 1<<4, 4, 1<<4, 5, 1<<4, 6, 1<<4, 7, 1<<4, 8, 1<<4); @@ -18174,7 +19049,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_permutex2var_epi16() { + fn test_mm_permutex2var_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm_set1_epi16(100); @@ -18184,7 +19059,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_permutex2var_epi16() { + fn test_mm_mask_permutex2var_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm_set1_epi16(100); @@ -18196,7 +19071,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_permutex2var_epi16() { + fn test_mm_maskz_permutex2var_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm_set1_epi16(100); @@ -18208,7 +19083,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask2_permutex2var_epi16() { + fn test_mm_mask2_permutex2var_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm_set_epi16(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm_set1_epi16(100); @@ -18220,7 +19095,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_permutexvar_epi16() { + fn test_mm512_permutexvar_epi16() { let idx = _mm512_set1_epi16(1); #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -18231,7 +19106,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_permutexvar_epi16() { + fn test_mm512_mask_permutexvar_epi16() { let idx = _mm512_set1_epi16(1); #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -18244,7 +19119,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_permutexvar_epi16() { + fn test_mm512_maskz_permutexvar_epi16() { let idx = _mm512_set1_epi16(1); #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -18257,7 +19132,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_permutexvar_epi16() { + fn test_mm256_permutexvar_epi16() { let idx = _mm256_set1_epi16(1); let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_permutexvar_epi16(idx, a); @@ -18266,7 +19141,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_permutexvar_epi16() { + fn test_mm256_mask_permutexvar_epi16() { let idx = _mm256_set1_epi16(1); let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_mask_permutexvar_epi16(a, 0, idx, a); @@ -18277,7 +19152,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_permutexvar_epi16() { + fn test_mm256_maskz_permutexvar_epi16() { let idx = _mm256_set1_epi16(1); let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_permutexvar_epi16(0, idx, a); @@ -18288,7 +19163,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_permutexvar_epi16() { + fn test_mm_permutexvar_epi16() { let idx = _mm_set1_epi16(1); let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_permutexvar_epi16(idx, a); @@ -18297,7 +19172,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_permutexvar_epi16() { + fn test_mm_mask_permutexvar_epi16() { let idx = _mm_set1_epi16(1); let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_mask_permutexvar_epi16(a, 0, idx, a); @@ -18308,7 +19183,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_permutexvar_epi16() { + fn test_mm_maskz_permutexvar_epi16() { let idx = _mm_set1_epi16(1); let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_maskz_permutexvar_epi16(0, idx, a); @@ -18319,7 +19194,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_blend_epi16() { + const fn test_mm512_mask_blend_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(2); let r = _mm512_mask_blend_epi16(0b11111111_00000000_11111111_00000000, a, b); @@ -18330,7 +19205,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_blend_epi16() { + const fn test_mm256_mask_blend_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(2); let r = _mm256_mask_blend_epi16(0b11111111_00000000, a, b); @@ -18339,7 +19214,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_blend_epi16() { + const fn test_mm_mask_blend_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(2); let r = _mm_mask_blend_epi16(0b11110000, a, b); @@ -18348,7 +19223,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_blend_epi8() { + const fn test_mm512_mask_blend_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(2); let r = _mm512_mask_blend_epi8( @@ -18365,7 +19240,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_blend_epi8() { + const fn test_mm256_mask_blend_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(2); let r = _mm256_mask_blend_epi8(0b11111111_00000000_11111111_00000000, a, b); @@ -18376,7 +19251,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_blend_epi8() { + const fn test_mm_mask_blend_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(2); let r = _mm_mask_blend_epi8(0b11111111_00000000, a, b); @@ -18385,7 +19260,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_broadcastw_epi16() { + const fn test_mm512_broadcastw_epi16() { let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_broadcastw_epi16(a); let e = _mm512_set1_epi16(24); @@ -18393,7 +19268,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_broadcastw_epi16() { + const fn test_mm512_mask_broadcastw_epi16() { let src = _mm512_set1_epi16(1); let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_mask_broadcastw_epi16(src, 0, a); @@ -18404,7 +19279,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_broadcastw_epi16() { + const fn test_mm512_maskz_broadcastw_epi16() { let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_maskz_broadcastw_epi16(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -18414,7 +19289,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_broadcastw_epi16() { + const fn test_mm256_mask_broadcastw_epi16() { let src = _mm256_set1_epi16(1); let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm256_mask_broadcastw_epi16(src, 0, a); @@ -18425,7 +19300,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_broadcastw_epi16() { + const fn test_mm256_maskz_broadcastw_epi16() { let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm256_maskz_broadcastw_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -18435,7 +19310,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_broadcastw_epi16() { + const fn test_mm_mask_broadcastw_epi16() { let src = _mm_set1_epi16(1); let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm_mask_broadcastw_epi16(src, 0, a); @@ -18446,7 +19321,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_broadcastw_epi16() { + const fn test_mm_maskz_broadcastw_epi16() { let a = _mm_set_epi16(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm_maskz_broadcastw_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -18456,7 +19331,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_broadcastb_epi8() { + const fn test_mm512_broadcastb_epi8() { let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, ); @@ -18466,7 +19341,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_broadcastb_epi8() { + const fn test_mm512_mask_broadcastb_epi8() { let src = _mm512_set1_epi8(1); let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18483,7 +19358,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_broadcastb_epi8() { + const fn test_mm512_maskz_broadcastb_epi8() { let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, ); @@ -18498,7 +19373,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_broadcastb_epi8() { + const fn test_mm256_mask_broadcastb_epi8() { let src = _mm256_set1_epi8(1); let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18511,7 +19386,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_broadcastb_epi8() { + const fn test_mm256_maskz_broadcastb_epi8() { let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, ); @@ -18523,7 +19398,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_broadcastb_epi8() { + const fn test_mm_mask_broadcastb_epi8() { let src = _mm_set1_epi8(1); let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18536,7 +19411,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_broadcastb_epi8() { + const fn test_mm_maskz_broadcastb_epi8() { let a = _mm_set_epi8( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, ); @@ -18548,7 +19423,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_unpackhi_epi16() { + const fn test_mm512_unpackhi_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18563,7 +19438,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_unpackhi_epi16() { + const fn test_mm512_mask_unpackhi_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18580,7 +19455,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_unpackhi_epi16() { + const fn test_mm512_maskz_unpackhi_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18597,7 +19472,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_unpackhi_epi16() { + const fn test_mm256_mask_unpackhi_epi16() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi16( 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, @@ -18610,7 +19485,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_unpackhi_epi16() { + const fn test_mm256_maskz_unpackhi_epi16() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi16( 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, @@ -18623,7 +19498,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_unpackhi_epi16() { + const fn test_mm_mask_unpackhi_epi16() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40); let r = _mm_mask_unpackhi_epi16(a, 0, a, b); @@ -18634,7 +19509,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_unpackhi_epi16() { + const fn test_mm_maskz_unpackhi_epi16() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40); let r = _mm_maskz_unpackhi_epi16(0, a, b); @@ -18645,7 +19520,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_unpackhi_epi8() { + const fn test_mm512_unpackhi_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18666,7 +19541,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_unpackhi_epi8() { + const fn test_mm512_mask_unpackhi_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18694,7 +19569,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_unpackhi_epi8() { + const fn test_mm512_maskz_unpackhi_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18721,7 +19596,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_unpackhi_epi8() { + const fn test_mm256_mask_unpackhi_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18738,7 +19613,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_unpackhi_epi8() { + const fn test_mm256_maskz_unpackhi_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18755,7 +19630,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_unpackhi_epi8() { + const fn test_mm_mask_unpackhi_epi8() { let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_set_epi8( 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, @@ -18768,7 +19643,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_unpackhi_epi8() { + const fn test_mm_maskz_unpackhi_epi8() { let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_set_epi8( 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, @@ -18781,7 +19656,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_unpacklo_epi16() { + const fn test_mm512_unpacklo_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18796,7 +19671,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_unpacklo_epi16() { + const fn test_mm512_mask_unpacklo_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18813,7 +19688,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_unpacklo_epi16() { + const fn test_mm512_maskz_unpacklo_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18830,7 +19705,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_unpacklo_epi16() { + const fn test_mm256_mask_unpacklo_epi16() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi16( 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, @@ -18843,7 +19718,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_unpacklo_epi16() { + const fn test_mm256_maskz_unpacklo_epi16() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi16( 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, @@ -18856,7 +19731,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_unpacklo_epi16() { + const fn test_mm_mask_unpacklo_epi16() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40); let r = _mm_mask_unpacklo_epi16(a, 0, a, b); @@ -18867,7 +19742,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_unpacklo_epi16() { + const fn test_mm_maskz_unpacklo_epi16() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi16(33, 34, 35, 36, 37, 38, 39, 40); let r = _mm_maskz_unpacklo_epi16(0, a, b); @@ -18878,7 +19753,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_unpacklo_epi8() { + const fn test_mm512_unpacklo_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18899,7 +19774,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_unpacklo_epi8() { + const fn test_mm512_mask_unpacklo_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18927,7 +19802,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_unpacklo_epi8() { + const fn test_mm512_maskz_unpacklo_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -18954,7 +19829,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_unpacklo_epi8() { + const fn test_mm256_mask_unpacklo_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18971,7 +19846,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_unpacklo_epi8() { + const fn test_mm256_maskz_unpacklo_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); @@ -18988,7 +19863,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_unpacklo_epi8() { + const fn test_mm_mask_unpacklo_epi8() { let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_set_epi8( 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, @@ -19003,7 +19878,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_unpacklo_epi8() { + const fn test_mm_maskz_unpacklo_epi8() { let a = _mm_set_epi8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_set_epi8( 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, @@ -19018,7 +19893,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_mov_epi16() { + const fn test_mm512_mask_mov_epi16() { let src = _mm512_set1_epi16(1); let a = _mm512_set1_epi16(2); let r = _mm512_mask_mov_epi16(src, 0, a); @@ -19028,7 +19903,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_mov_epi16() { + const fn test_mm512_maskz_mov_epi16() { let a = _mm512_set1_epi16(2); let r = _mm512_maskz_mov_epi16(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -19037,7 +19912,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_mov_epi16() { + const fn test_mm256_mask_mov_epi16() { let src = _mm256_set1_epi16(1); let a = _mm256_set1_epi16(2); let r = _mm256_mask_mov_epi16(src, 0, a); @@ -19047,7 +19922,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_mov_epi16() { + const fn test_mm256_maskz_mov_epi16() { let a = _mm256_set1_epi16(2); let r = _mm256_maskz_mov_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -19056,7 +19931,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_mov_epi16() { + const fn test_mm_mask_mov_epi16() { let src = _mm_set1_epi16(1); let a = _mm_set1_epi16(2); let r = _mm_mask_mov_epi16(src, 0, a); @@ -19066,7 +19941,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_mov_epi16() { + const fn test_mm_maskz_mov_epi16() { let a = _mm_set1_epi16(2); let r = _mm_maskz_mov_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -19075,7 +19950,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_mov_epi8() { + const fn test_mm512_mask_mov_epi8() { let src = _mm512_set1_epi8(1); let a = _mm512_set1_epi8(2); let r = _mm512_mask_mov_epi8(src, 0, a); @@ -19089,7 +19964,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_mov_epi8() { + const fn test_mm512_maskz_mov_epi8() { let a = _mm512_set1_epi8(2); let r = _mm512_maskz_mov_epi8(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -19101,7 +19976,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_mov_epi8() { + const fn test_mm256_mask_mov_epi8() { let src = _mm256_set1_epi8(1); let a = _mm256_set1_epi8(2); let r = _mm256_mask_mov_epi8(src, 0, a); @@ -19111,7 +19986,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_mov_epi8() { + const fn test_mm256_maskz_mov_epi8() { let a = _mm256_set1_epi8(2); let r = _mm256_maskz_mov_epi8(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -19120,7 +19995,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_mov_epi8() { + const fn test_mm_mask_mov_epi8() { let src = _mm_set1_epi8(1); let a = _mm_set1_epi8(2); let r = _mm_mask_mov_epi8(src, 0, a); @@ -19130,7 +20005,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_mov_epi8() { + const fn test_mm_maskz_mov_epi8() { let a = _mm_set1_epi8(2); let r = _mm_maskz_mov_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -19139,7 +20014,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_set1_epi16() { + const fn test_mm512_mask_set1_epi16() { let src = _mm512_set1_epi16(2); let a: i16 = 11; let r = _mm512_mask_set1_epi16(src, 0, a); @@ -19150,7 +20025,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_set1_epi16() { + const fn test_mm512_maskz_set1_epi16() { let a: i16 = 11; let r = _mm512_maskz_set1_epi16(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -19160,7 +20035,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_set1_epi16() { + const fn test_mm256_mask_set1_epi16() { let src = _mm256_set1_epi16(2); let a: i16 = 11; let r = _mm256_mask_set1_epi16(src, 0, a); @@ -19171,7 +20046,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_set1_epi16() { + const fn test_mm256_maskz_set1_epi16() { let a: i16 = 11; let r = _mm256_maskz_set1_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -19181,7 +20056,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_set1_epi16() { + const fn test_mm_mask_set1_epi16() { let src = _mm_set1_epi16(2); let a: i16 = 11; let r = _mm_mask_set1_epi16(src, 0, a); @@ -19192,7 +20067,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_set1_epi16() { + const fn test_mm_maskz_set1_epi16() { let a: i16 = 11; let r = _mm_maskz_set1_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -19202,7 +20077,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_set1_epi8() { + const fn test_mm512_mask_set1_epi8() { let src = _mm512_set1_epi8(2); let a: i8 = 11; let r = _mm512_mask_set1_epi8(src, 0, a); @@ -19217,7 +20092,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_set1_epi8() { + const fn test_mm512_maskz_set1_epi8() { let a: i8 = 11; let r = _mm512_maskz_set1_epi8(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -19230,7 +20105,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_set1_epi8() { + const fn test_mm256_mask_set1_epi8() { let src = _mm256_set1_epi8(2); let a: i8 = 11; let r = _mm256_mask_set1_epi8(src, 0, a); @@ -19241,7 +20116,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_set1_epi8() { + const fn test_mm256_maskz_set1_epi8() { let a: i8 = 11; let r = _mm256_maskz_set1_epi8(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -19251,7 +20126,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_set1_epi8() { + const fn test_mm_mask_set1_epi8() { let src = _mm_set1_epi8(2); let a: i8 = 11; let r = _mm_mask_set1_epi8(src, 0, a); @@ -19262,7 +20137,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_set1_epi8() { + const fn test_mm_maskz_set1_epi8() { let a: i8 = 11; let r = _mm_maskz_set1_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -19272,7 +20147,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_shufflelo_epi16() { + const fn test_mm512_shufflelo_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -19288,7 +20163,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_shufflelo_epi16() { + const fn test_mm512_mask_shufflelo_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -19310,7 +20185,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_shufflelo_epi16() { + const fn test_mm512_maskz_shufflelo_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -19329,7 +20204,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_shufflelo_epi16() { + const fn test_mm256_mask_shufflelo_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a); assert_eq_m256i(r, a); @@ -19339,7 +20214,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_shufflelo_epi16() { + const fn test_mm256_maskz_shufflelo_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -19349,7 +20224,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_shufflelo_epi16() { + const fn test_mm_mask_shufflelo_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_mask_shufflelo_epi16::<0b00_01_01_11>(a, 0, a); assert_eq_m128i(r, a); @@ -19359,7 +20234,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_shufflelo_epi16() { + const fn test_mm_maskz_shufflelo_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_maskz_shufflelo_epi16::<0b00_01_01_11>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -19369,7 +20244,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_shufflehi_epi16() { + const fn test_mm512_shufflehi_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -19385,7 +20260,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_shufflehi_epi16() { + const fn test_mm512_mask_shufflehi_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -19407,7 +20282,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_shufflehi_epi16() { + const fn test_mm512_maskz_shufflehi_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -19426,7 +20301,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_shufflehi_epi16() { + const fn test_mm256_mask_shufflehi_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a); assert_eq_m256i(r, a); @@ -19436,7 +20311,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_shufflehi_epi16() { + const fn test_mm256_maskz_shufflehi_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -19446,7 +20321,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_shufflehi_epi16() { + const fn test_mm_mask_shufflehi_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_mask_shufflehi_epi16::<0b00_01_01_11>(a, 0, a); assert_eq_m128i(r, a); @@ -19456,7 +20331,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_shufflehi_epi16() { + const fn test_mm_maskz_shufflehi_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_maskz_shufflehi_epi16::<0b00_01_01_11>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -19466,7 +20341,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_shuffle_epi8() { + fn test_mm512_shuffle_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -19483,7 +20358,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_shuffle_epi8() { + fn test_mm512_mask_shuffle_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -19507,7 +20382,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_shuffle_epi8() { + fn test_mm512_maskz_shuffle_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -19530,7 +20405,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_shuffle_epi8() { + fn test_mm256_mask_shuffle_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -19545,7 +20420,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_epi8() { + fn test_mm256_maskz_shuffle_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -19560,7 +20435,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_shuffle_epi8() { + fn test_mm_mask_shuffle_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set1_epi8(1); let r = _mm_mask_shuffle_epi8(a, 0, a, b); @@ -19573,7 +20448,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_shuffle_epi8() { + fn test_mm_maskz_shuffle_epi8() { #[rustfmt::skip] let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_set1_epi8(1); @@ -19587,7 +20462,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_test_epi16_mask() { + const fn test_mm512_test_epi16_mask() { let a = _mm512_set1_epi16(1 << 0); let b = _mm512_set1_epi16(1 << 0 | 1 << 1); let r = _mm512_test_epi16_mask(a, b); @@ -19596,7 +20471,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_test_epi16_mask() { + const fn test_mm512_mask_test_epi16_mask() { let a = _mm512_set1_epi16(1 << 0); let b = _mm512_set1_epi16(1 << 0 | 1 << 1); let r = _mm512_mask_test_epi16_mask(0, a, b); @@ -19607,7 +20482,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_test_epi16_mask() { + const fn test_mm256_test_epi16_mask() { let a = _mm256_set1_epi16(1 << 0); let b = _mm256_set1_epi16(1 << 0 | 1 << 1); let r = _mm256_test_epi16_mask(a, b); @@ -19616,7 +20491,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_test_epi16_mask() { + const fn test_mm256_mask_test_epi16_mask() { let a = _mm256_set1_epi16(1 << 0); let b = _mm256_set1_epi16(1 << 0 | 1 << 1); let r = _mm256_mask_test_epi16_mask(0, a, b); @@ -19627,7 +20502,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_test_epi16_mask() { + const fn test_mm_test_epi16_mask() { let a = _mm_set1_epi16(1 << 0); let b = _mm_set1_epi16(1 << 0 | 1 << 1); let r = _mm_test_epi16_mask(a, b); @@ -19636,7 +20511,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_test_epi16_mask() { + const fn test_mm_mask_test_epi16_mask() { let a = _mm_set1_epi16(1 << 0); let b = _mm_set1_epi16(1 << 0 | 1 << 1); let r = _mm_mask_test_epi16_mask(0, a, b); @@ -19647,7 +20522,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_test_epi8_mask() { + const fn test_mm512_test_epi8_mask() { let a = _mm512_set1_epi8(1 << 0); let b = _mm512_set1_epi8(1 << 0 | 1 << 1); let r = _mm512_test_epi8_mask(a, b); @@ -19657,7 +20532,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_test_epi8_mask() { + const fn test_mm512_mask_test_epi8_mask() { let a = _mm512_set1_epi8(1 << 0); let b = _mm512_set1_epi8(1 << 0 | 1 << 1); let r = _mm512_mask_test_epi8_mask(0, a, b); @@ -19673,7 +20548,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_test_epi8_mask() { + const fn test_mm256_test_epi8_mask() { let a = _mm256_set1_epi8(1 << 0); let b = _mm256_set1_epi8(1 << 0 | 1 << 1); let r = _mm256_test_epi8_mask(a, b); @@ -19682,7 +20557,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_test_epi8_mask() { + const fn test_mm256_mask_test_epi8_mask() { let a = _mm256_set1_epi8(1 << 0); let b = _mm256_set1_epi8(1 << 0 | 1 << 1); let r = _mm256_mask_test_epi8_mask(0, a, b); @@ -19693,7 +20568,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_test_epi8_mask() { + const fn test_mm_test_epi8_mask() { let a = _mm_set1_epi8(1 << 0); let b = _mm_set1_epi8(1 << 0 | 1 << 1); let r = _mm_test_epi8_mask(a, b); @@ -19702,7 +20577,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_test_epi8_mask() { + const fn test_mm_mask_test_epi8_mask() { let a = _mm_set1_epi8(1 << 0); let b = _mm_set1_epi8(1 << 0 | 1 << 1); let r = _mm_mask_test_epi8_mask(0, a, b); @@ -19713,7 +20588,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_testn_epi16_mask() { + const fn test_mm512_testn_epi16_mask() { let a = _mm512_set1_epi16(1 << 0); let b = _mm512_set1_epi16(1 << 0 | 1 << 1); let r = _mm512_testn_epi16_mask(a, b); @@ -19722,7 +20597,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_testn_epi16_mask() { + const fn test_mm512_mask_testn_epi16_mask() { let a = _mm512_set1_epi16(1 << 0); let b = _mm512_set1_epi16(1 << 0 | 1 << 1); let r = _mm512_mask_testn_epi16_mask(0, a, b); @@ -19733,7 +20608,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_testn_epi16_mask() { + const fn test_mm256_testn_epi16_mask() { let a = _mm256_set1_epi16(1 << 0); let b = _mm256_set1_epi16(1 << 0 | 1 << 1); let r = _mm256_testn_epi16_mask(a, b); @@ -19742,7 +20617,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_testn_epi16_mask() { + const fn test_mm256_mask_testn_epi16_mask() { let a = _mm256_set1_epi16(1 << 0); let b = _mm256_set1_epi16(1 << 0 | 1 << 1); let r = _mm256_mask_testn_epi16_mask(0, a, b); @@ -19753,7 +20628,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_testn_epi16_mask() { + const fn test_mm_testn_epi16_mask() { let a = _mm_set1_epi16(1 << 0); let b = _mm_set1_epi16(1 << 0 | 1 << 1); let r = _mm_testn_epi16_mask(a, b); @@ -19762,7 +20637,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_testn_epi16_mask() { + const fn test_mm_mask_testn_epi16_mask() { let a = _mm_set1_epi16(1 << 0); let b = _mm_set1_epi16(1 << 0 | 1 << 1); let r = _mm_mask_testn_epi16_mask(0, a, b); @@ -19773,7 +20648,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_testn_epi8_mask() { + const fn test_mm512_testn_epi8_mask() { let a = _mm512_set1_epi8(1 << 0); let b = _mm512_set1_epi8(1 << 0 | 1 << 1); let r = _mm512_testn_epi8_mask(a, b); @@ -19783,7 +20658,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_testn_epi8_mask() { + const fn test_mm512_mask_testn_epi8_mask() { let a = _mm512_set1_epi8(1 << 0); let b = _mm512_set1_epi8(1 << 0 | 1 << 1); let r = _mm512_mask_testn_epi8_mask(0, a, b); @@ -19799,7 +20674,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_testn_epi8_mask() { + const fn test_mm256_testn_epi8_mask() { let a = _mm256_set1_epi8(1 << 0); let b = _mm256_set1_epi8(1 << 0 | 1 << 1); let r = _mm256_testn_epi8_mask(a, b); @@ -19808,7 +20683,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_testn_epi8_mask() { + const fn test_mm256_mask_testn_epi8_mask() { let a = _mm256_set1_epi8(1 << 0); let b = _mm256_set1_epi8(1 << 0 | 1 << 1); let r = _mm256_mask_testn_epi8_mask(0, a, b); @@ -19819,7 +20694,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_testn_epi8_mask() { + const fn test_mm_testn_epi8_mask() { let a = _mm_set1_epi8(1 << 0); let b = _mm_set1_epi8(1 << 0 | 1 << 1); let r = _mm_testn_epi8_mask(a, b); @@ -19828,7 +20703,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_testn_epi8_mask() { + const fn test_mm_mask_testn_epi8_mask() { let a = _mm_set1_epi8(1 << 0); let b = _mm_set1_epi8(1 << 0 | 1 << 1); let r = _mm_mask_testn_epi8_mask(0, a, b); @@ -19839,7 +20714,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_store_mask64() { + const unsafe fn test_store_mask64() { let a: __mmask64 = 0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000; let mut r = 0; @@ -19848,7 +20723,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_store_mask32() { + const unsafe fn test_store_mask32() { let a: __mmask32 = 0b11111111_00000000_11111111_00000000; let mut r = 0; _store_mask32(&mut r, a); @@ -19856,7 +20731,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_load_mask64() { + const unsafe fn test_load_mask64() { let p: __mmask64 = 0b11111111_00000000_11111111_00000000_11111111_00000000_11111111_00000000; let r = _load_mask64(&p); @@ -19866,7 +20741,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_load_mask32() { + const unsafe fn test_load_mask32() { let p: __mmask32 = 0b11111111_00000000_11111111_00000000; let r = _load_mask32(&p); let e: __mmask32 = 0b11111111_00000000_11111111_00000000; @@ -19874,7 +20749,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_sad_epu8() { + fn test_mm512_sad_epu8() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(4); let r = _mm512_sad_epu8(a, b); @@ -19883,7 +20758,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_dbsad_epu8() { + fn test_mm512_dbsad_epu8() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(4); let r = _mm512_dbsad_epu8::<0>(a, b); @@ -19892,7 +20767,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_dbsad_epu8() { + fn test_mm512_mask_dbsad_epu8() { let src = _mm512_set1_epi16(1); let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(4); @@ -19904,7 +20779,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_dbsad_epu8() { + fn test_mm512_maskz_dbsad_epu8() { let a = _mm512_set1_epi8(2); let b = _mm512_set1_epi8(4); let r = _mm512_maskz_dbsad_epu8::<0>(0, a, b); @@ -19915,7 +20790,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_dbsad_epu8() { + fn test_mm256_dbsad_epu8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_dbsad_epu8::<0>(a, b); @@ -19924,7 +20799,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_dbsad_epu8() { + fn test_mm256_mask_dbsad_epu8() { let src = _mm256_set1_epi16(1); let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); @@ -19936,7 +20811,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_dbsad_epu8() { + fn test_mm256_maskz_dbsad_epu8() { let a = _mm256_set1_epi8(2); let b = _mm256_set1_epi8(4); let r = _mm256_maskz_dbsad_epu8::<0>(0, a, b); @@ -19947,7 +20822,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_dbsad_epu8() { + fn test_mm_dbsad_epu8() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(4); let r = _mm_dbsad_epu8::<0>(a, b); @@ -19956,7 +20831,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_dbsad_epu8() { + fn test_mm_mask_dbsad_epu8() { let src = _mm_set1_epi16(1); let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(4); @@ -19968,7 +20843,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_dbsad_epu8() { + fn test_mm_maskz_dbsad_epu8() { let a = _mm_set1_epi8(2); let b = _mm_set1_epi8(4); let r = _mm_maskz_dbsad_epu8::<0>(0, a, b); @@ -19979,7 +20854,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_movepi16_mask() { + const fn test_mm512_movepi16_mask() { let a = _mm512_set1_epi16(1 << 15); let r = _mm512_movepi16_mask(a); let e: __mmask32 = 0b11111111_11111111_11111111_11111111; @@ -19987,7 +20862,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_movepi16_mask() { + const fn test_mm256_movepi16_mask() { let a = _mm256_set1_epi16(1 << 15); let r = _mm256_movepi16_mask(a); let e: __mmask16 = 0b11111111_11111111; @@ -19995,7 +20870,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_movepi16_mask() { + const fn test_mm_movepi16_mask() { let a = _mm_set1_epi16(1 << 15); let r = _mm_movepi16_mask(a); let e: __mmask8 = 0b11111111; @@ -20003,7 +20878,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_movepi8_mask() { + const fn test_mm512_movepi8_mask() { let a = _mm512_set1_epi8(1 << 7); let r = _mm512_movepi8_mask(a); let e: __mmask64 = @@ -20012,7 +20887,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_movepi8_mask() { + const fn test_mm256_movepi8_mask() { let a = _mm256_set1_epi8(1 << 7); let r = _mm256_movepi8_mask(a); let e: __mmask32 = 0b11111111_11111111_11111111_11111111; @@ -20020,7 +20895,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_movepi8_mask() { + const fn test_mm_movepi8_mask() { let a = _mm_set1_epi8(1 << 7); let r = _mm_movepi8_mask(a); let e: __mmask16 = 0b11111111_11111111; @@ -20028,7 +20903,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_movm_epi16() { + const fn test_mm512_movm_epi16() { let a: __mmask32 = 0b11111111_11111111_11111111_11111111; let r = _mm512_movm_epi16(a); let e = _mm512_set1_epi16( @@ -20053,7 +20928,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_movm_epi16() { + const fn test_mm256_movm_epi16() { let a: __mmask16 = 0b11111111_11111111; let r = _mm256_movm_epi16(a); let e = _mm256_set1_epi16( @@ -20078,7 +20953,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_movm_epi16() { + const fn test_mm_movm_epi16() { let a: __mmask8 = 0b11111111; let r = _mm_movm_epi16(a); let e = _mm_set1_epi16( @@ -20103,7 +20978,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_movm_epi8() { + const fn test_mm512_movm_epi8() { let a: __mmask64 = 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111; let r = _mm512_movm_epi8(a); @@ -20113,7 +20988,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_movm_epi8() { + const fn test_mm256_movm_epi8() { let a: __mmask32 = 0b11111111_11111111_11111111_11111111; let r = _mm256_movm_epi8(a); let e = @@ -20122,7 +20997,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_movm_epi8() { + const fn test_mm_movm_epi8() { let a: __mmask16 = 0b11111111_11111111; let r = _mm_movm_epi8(a); let e = @@ -20131,7 +21006,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_cvtmask32_u32() { + const fn test_cvtmask32_u32() { let a: __mmask32 = 0b11001100_00110011_01100110_10011001; let r = _cvtmask32_u32(a); let e: u32 = 0b11001100_00110011_01100110_10011001; @@ -20139,7 +21014,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_cvtu32_mask32() { + const fn test_cvtu32_mask32() { let a: u32 = 0b11001100_00110011_01100110_10011001; let r = _cvtu32_mask32(a); let e: __mmask32 = 0b11001100_00110011_01100110_10011001; @@ -20147,7 +21022,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kadd_mask32() { + const fn test_kadd_mask32() { let a: __mmask32 = 11; let b: __mmask32 = 22; let r = _kadd_mask32(a, b); @@ -20156,7 +21031,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kadd_mask64() { + const fn test_kadd_mask64() { let a: __mmask64 = 11; let b: __mmask64 = 22; let r = _kadd_mask64(a, b); @@ -20165,7 +21040,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kand_mask32() { + const fn test_kand_mask32() { let a: __mmask32 = 0b11001100_00110011_11001100_00110011; let b: __mmask32 = 0b11001100_00110011_11001100_00110011; let r = _kand_mask32(a, b); @@ -20174,7 +21049,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kand_mask64() { + const fn test_kand_mask64() { let a: __mmask64 = 0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011; let b: __mmask64 = @@ -20186,7 +21061,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_knot_mask32() { + const fn test_knot_mask32() { let a: __mmask32 = 0b11001100_00110011_11001100_00110011; let r = _knot_mask32(a); let e: __mmask32 = 0b00110011_11001100_00110011_11001100; @@ -20194,7 +21069,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_knot_mask64() { + const fn test_knot_mask64() { let a: __mmask64 = 0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011; let r = _knot_mask64(a); @@ -20204,7 +21079,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kandn_mask32() { + const fn test_kandn_mask32() { let a: __mmask32 = 0b11001100_00110011_11001100_00110011; let b: __mmask32 = 0b11001100_00110011_11001100_00110011; let r = _kandn_mask32(a, b); @@ -20213,7 +21088,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kandn_mask64() { + const fn test_kandn_mask64() { let a: __mmask64 = 0b11001100_00110011_11001100_00110011_11001100_00110011_11001100_00110011; let b: __mmask64 = @@ -20225,7 +21100,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kor_mask32() { + const fn test_kor_mask32() { let a: __mmask32 = 0b00110011_11001100_00110011_11001100; let b: __mmask32 = 0b11001100_00110011_11001100_00110011; let r = _kor_mask32(a, b); @@ -20234,7 +21109,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kor_mask64() { + const fn test_kor_mask64() { let a: __mmask64 = 0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100; let b: __mmask64 = @@ -20246,7 +21121,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kxor_mask32() { + const fn test_kxor_mask32() { let a: __mmask32 = 0b00110011_11001100_00110011_11001100; let b: __mmask32 = 0b11001100_00110011_11001100_00110011; let r = _kxor_mask32(a, b); @@ -20255,7 +21130,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kxor_mask64() { + const fn test_kxor_mask64() { let a: __mmask64 = 0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100; let b: __mmask64 = @@ -20267,7 +21142,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kxnor_mask32() { + const fn test_kxnor_mask32() { let a: __mmask32 = 0b00110011_11001100_00110011_11001100; let b: __mmask32 = 0b11001100_00110011_11001100_00110011; let r = _kxnor_mask32(a, b); @@ -20276,7 +21151,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kxnor_mask64() { + const fn test_kxnor_mask64() { let a: __mmask64 = 0b00110011_11001100_00110011_11001100_00110011_11001100_00110011_11001100; let b: __mmask64 = @@ -20288,7 +21163,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kortest_mask32_u8() { + const unsafe fn test_kortest_mask32_u8() { let a: __mmask32 = 0b0110100101101001_0110100101101001; let b: __mmask32 = 0b1011011010110110_1011011010110110; let mut all_ones: u8 = 0; @@ -20298,7 +21173,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kortest_mask64_u8() { + const unsafe fn test_kortest_mask64_u8() { let a: __mmask64 = 0b0110100101101001_0110100101101001; let b: __mmask64 = 0b1011011010110110_1011011010110110; let mut all_ones: u8 = 0; @@ -20308,7 +21183,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kortestc_mask32_u8() { + const fn test_kortestc_mask32_u8() { let a: __mmask32 = 0b0110100101101001_0110100101101001; let b: __mmask32 = 0b1011011010110110_1011011010110110; let r = _kortestc_mask32_u8(a, b); @@ -20316,7 +21191,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kortestc_mask64_u8() { + const fn test_kortestc_mask64_u8() { let a: __mmask64 = 0b0110100101101001_0110100101101001; let b: __mmask64 = 0b1011011010110110_1011011010110110; let r = _kortestc_mask64_u8(a, b); @@ -20324,7 +21199,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kortestz_mask32_u8() { + const fn test_kortestz_mask32_u8() { let a: __mmask32 = 0b0110100101101001_0110100101101001; let b: __mmask32 = 0b1011011010110110_1011011010110110; let r = _kortestz_mask32_u8(a, b); @@ -20332,7 +21207,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kortestz_mask64_u8() { + const fn test_kortestz_mask64_u8() { let a: __mmask64 = 0b0110100101101001_0110100101101001; let b: __mmask64 = 0b1011011010110110_1011011010110110; let r = _kortestz_mask64_u8(a, b); @@ -20340,7 +21215,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kshiftli_mask32() { + const fn test_kshiftli_mask32() { let a: __mmask32 = 0b0110100101101001_0110100101101001; let r = _kshiftli_mask32::<3>(a); let e: __mmask32 = 0b0100101101001011_0100101101001000; @@ -20360,7 +21235,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kshiftli_mask64() { + const fn test_kshiftli_mask64() { let a: __mmask64 = 0b0110100101101001_0110100101101001; let r = _kshiftli_mask64::<3>(a); let e: __mmask64 = 0b0110100101101001011_0100101101001000; @@ -20380,7 +21255,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kshiftri_mask32() { + const fn test_kshiftri_mask32() { let a: __mmask32 = 0b1010100101101001_0110100101101001; let r = _kshiftri_mask32::<3>(a); let e: __mmask32 = 0b0001010100101101_0010110100101101; @@ -20400,7 +21275,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_kshiftri_mask64() { + const fn test_kshiftri_mask64() { let a: __mmask64 = 0b1010100101101001011_0100101101001000; let r = _kshiftri_mask64::<3>(a); let e: __mmask64 = 0b1010100101101001_0110100101101001; @@ -20424,7 +21299,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_ktest_mask32_u8() { + const unsafe fn test_ktest_mask32_u8() { let a: __mmask32 = 0b0110100100111100_0110100100111100; let b: __mmask32 = 0b1001011011000011_1001011011000011; let mut and_not: u8 = 0; @@ -20434,7 +21309,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_ktestc_mask32_u8() { + const fn test_ktestc_mask32_u8() { let a: __mmask32 = 0b0110100100111100_0110100100111100; let b: __mmask32 = 0b1001011011000011_1001011011000011; let r = _ktestc_mask32_u8(a, b); @@ -20442,7 +21317,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_ktestz_mask32_u8() { + const fn test_ktestz_mask32_u8() { let a: __mmask32 = 0b0110100100111100_0110100100111100; let b: __mmask32 = 0b1001011011000011_1001011011000011; let r = _ktestz_mask32_u8(a, b); @@ -20450,7 +21325,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_ktest_mask64_u8() { + const unsafe fn test_ktest_mask64_u8() { let a: __mmask64 = 0b0110100100111100_0110100100111100; let b: __mmask64 = 0b1001011011000011_1001011011000011; let mut and_not: u8 = 0; @@ -20460,7 +21335,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_ktestc_mask64_u8() { + const fn test_ktestc_mask64_u8() { let a: __mmask64 = 0b0110100100111100_0110100100111100; let b: __mmask64 = 0b1001011011000011_1001011011000011; let r = _ktestc_mask64_u8(a, b); @@ -20468,7 +21343,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_ktestz_mask64_u8() { + const fn test_ktestz_mask64_u8() { let a: __mmask64 = 0b0110100100111100_0110100100111100; let b: __mmask64 = 0b1001011011000011_1001011011000011; let r = _ktestz_mask64_u8(a, b); @@ -20476,7 +21351,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_kunpackw() { + const fn test_mm512_kunpackw() { let a: u32 = 0x00110011; let b: u32 = 0x00001011; let r = _mm512_kunpackw(a, b); @@ -20485,7 +21360,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_kunpackd() { + const fn test_mm512_kunpackd() { let a: u64 = 0x11001100_00110011; let b: u64 = 0x00101110_00001011; let r = _mm512_kunpackd(a, b); @@ -20494,7 +21369,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cvtepi16_epi8() { + const fn test_mm512_cvtepi16_epi8() { let a = _mm512_set1_epi16(2); let r = _mm512_cvtepi16_epi8(a); let e = _mm256_set1_epi8(2); @@ -20502,7 +21377,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cvtepi16_epi8() { + const fn test_mm512_mask_cvtepi16_epi8() { let src = _mm256_set1_epi8(1); let a = _mm512_set1_epi16(2); let r = _mm512_mask_cvtepi16_epi8(src, 0, a); @@ -20513,7 +21388,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_cvtepi16_epi8() { + const fn test_mm512_maskz_cvtepi16_epi8() { let a = _mm512_set1_epi16(2); let r = _mm512_maskz_cvtepi16_epi8(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -20523,7 +21398,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cvtepi16_epi8() { + const fn test_mm256_cvtepi16_epi8() { let a = _mm256_set1_epi16(2); let r = _mm256_cvtepi16_epi8(a); let e = _mm_set1_epi8(2); @@ -20531,7 +21406,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cvtepi16_epi8() { + const fn test_mm256_mask_cvtepi16_epi8() { let src = _mm_set1_epi8(1); let a = _mm256_set1_epi16(2); let r = _mm256_mask_cvtepi16_epi8(src, 0, a); @@ -20542,7 +21417,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi16_epi8() { + const fn test_mm256_maskz_cvtepi16_epi8() { let a = _mm256_set1_epi16(2); let r = _mm256_maskz_cvtepi16_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20552,7 +21427,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cvtepi16_epi8() { + const fn test_mm_cvtepi16_epi8() { let a = _mm_set1_epi16(2); let r = _mm_cvtepi16_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2); @@ -20560,7 +21435,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cvtepi16_epi8() { + const fn test_mm_mask_cvtepi16_epi8() { let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1); let a = _mm_set1_epi16(2); let r = _mm_mask_cvtepi16_epi8(src, 0, a); @@ -20571,7 +21446,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_cvtepi16_epi8() { + const fn test_mm_maskz_cvtepi16_epi8() { let a = _mm_set1_epi16(2); let r = _mm_maskz_cvtepi16_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20581,7 +21456,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cvtsepi16_epi8() { + fn test_mm512_cvtsepi16_epi8() { let a = _mm512_set1_epi16(i16::MAX); let r = _mm512_cvtsepi16_epi8(a); let e = _mm256_set1_epi8(i8::MAX); @@ -20589,7 +21464,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cvtsepi16_epi8() { + fn test_mm512_mask_cvtsepi16_epi8() { let src = _mm256_set1_epi8(1); let a = _mm512_set1_epi16(i16::MAX); let r = _mm512_mask_cvtsepi16_epi8(src, 0, a); @@ -20600,7 +21475,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cvtsepi16_epi8() { + fn test_mm256_cvtsepi16_epi8() { let a = _mm256_set1_epi16(i16::MAX); let r = _mm256_cvtsepi16_epi8(a); let e = _mm_set1_epi8(i8::MAX); @@ -20608,7 +21483,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cvtsepi16_epi8() { + fn test_mm256_mask_cvtsepi16_epi8() { let src = _mm_set1_epi8(1); let a = _mm256_set1_epi16(i16::MAX); let r = _mm256_mask_cvtsepi16_epi8(src, 0, a); @@ -20619,7 +21494,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_cvtsepi16_epi8() { + fn test_mm256_maskz_cvtsepi16_epi8() { let a = _mm256_set1_epi16(i16::MAX); let r = _mm256_maskz_cvtsepi16_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20629,7 +21504,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cvtsepi16_epi8() { + fn test_mm_cvtsepi16_epi8() { let a = _mm_set1_epi16(i16::MAX); let r = _mm_cvtsepi16_epi8(a); #[rustfmt::skip] @@ -20638,7 +21513,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cvtsepi16_epi8() { + fn test_mm_mask_cvtsepi16_epi8() { let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1); let a = _mm_set1_epi16(i16::MAX); let r = _mm_mask_cvtsepi16_epi8(src, 0, a); @@ -20650,7 +21525,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_cvtsepi16_epi8() { + fn test_mm_maskz_cvtsepi16_epi8() { let a = _mm_set1_epi16(i16::MAX); let r = _mm_maskz_cvtsepi16_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20661,7 +21536,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_cvtsepi16_epi8() { + fn test_mm512_maskz_cvtsepi16_epi8() { let a = _mm512_set1_epi16(i16::MAX); let r = _mm512_maskz_cvtsepi16_epi8(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -20671,7 +21546,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cvtusepi16_epi8() { + fn test_mm512_cvtusepi16_epi8() { let a = _mm512_set1_epi16(i16::MIN); let r = _mm512_cvtusepi16_epi8(a); let e = _mm256_set1_epi8(-1); @@ -20679,7 +21554,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cvtusepi16_epi8() { + fn test_mm512_mask_cvtusepi16_epi8() { let src = _mm256_set1_epi8(1); let a = _mm512_set1_epi16(i16::MIN); let r = _mm512_mask_cvtusepi16_epi8(src, 0, a); @@ -20690,7 +21565,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_cvtusepi16_epi8() { + fn test_mm512_maskz_cvtusepi16_epi8() { let a = _mm512_set1_epi16(i16::MIN); let r = _mm512_maskz_cvtusepi16_epi8(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -20700,7 +21575,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_cvtusepi16_epi8() { + fn test_mm256_cvtusepi16_epi8() { let a = _mm256_set1_epi16(i16::MIN); let r = _mm256_cvtusepi16_epi8(a); let e = _mm_set1_epi8(-1); @@ -20708,7 +21583,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cvtusepi16_epi8() { + fn test_mm256_mask_cvtusepi16_epi8() { let src = _mm_set1_epi8(1); let a = _mm256_set1_epi16(i16::MIN); let r = _mm256_mask_cvtusepi16_epi8(src, 0, a); @@ -20719,7 +21594,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_cvtusepi16_epi8() { + fn test_mm256_maskz_cvtusepi16_epi8() { let a = _mm256_set1_epi16(i16::MIN); let r = _mm256_maskz_cvtusepi16_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20729,7 +21604,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_cvtusepi16_epi8() { + fn test_mm_cvtusepi16_epi8() { let a = _mm_set1_epi16(i16::MIN); let r = _mm_cvtusepi16_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1); @@ -20737,7 +21612,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cvtusepi16_epi8() { + fn test_mm_mask_cvtusepi16_epi8() { let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1); let a = _mm_set1_epi16(i16::MIN); let r = _mm_mask_cvtusepi16_epi8(src, 0, a); @@ -20748,7 +21623,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_cvtusepi16_epi8() { + fn test_mm_maskz_cvtusepi16_epi8() { let a = _mm_set1_epi16(i16::MIN); let r = _mm_maskz_cvtusepi16_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20758,7 +21633,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cvtepi8_epi16() { + const fn test_mm512_cvtepi8_epi16() { let a = _mm256_set1_epi8(2); let r = _mm512_cvtepi8_epi16(a); let e = _mm512_set1_epi16(2); @@ -20766,7 +21641,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cvtepi8_epi16() { + const fn test_mm512_mask_cvtepi8_epi16() { let src = _mm512_set1_epi16(1); let a = _mm256_set1_epi8(2); let r = _mm512_mask_cvtepi8_epi16(src, 0, a); @@ -20777,7 +21652,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_cvtepi8_epi16() { + const fn test_mm512_maskz_cvtepi8_epi16() { let a = _mm256_set1_epi8(2); let r = _mm512_maskz_cvtepi8_epi16(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -20787,7 +21662,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cvtepi8_epi16() { + const fn test_mm256_mask_cvtepi8_epi16() { let src = _mm256_set1_epi16(1); let a = _mm_set1_epi8(2); let r = _mm256_mask_cvtepi8_epi16(src, 0, a); @@ -20798,7 +21673,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi8_epi16() { + const fn test_mm256_maskz_cvtepi8_epi16() { let a = _mm_set1_epi8(2); let r = _mm256_maskz_cvtepi8_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -20808,7 +21683,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cvtepi8_epi16() { + const fn test_mm_mask_cvtepi8_epi16() { let src = _mm_set1_epi16(1); let a = _mm_set1_epi8(2); let r = _mm_mask_cvtepi8_epi16(src, 0, a); @@ -20819,7 +21694,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_cvtepi8_epi16() { + const fn test_mm_maskz_cvtepi8_epi16() { let a = _mm_set1_epi8(2); let r = _mm_maskz_cvtepi8_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20829,7 +21704,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_cvtepu8_epi16() { + const fn test_mm512_cvtepu8_epi16() { let a = _mm256_set1_epi8(2); let r = _mm512_cvtepu8_epi16(a); let e = _mm512_set1_epi16(2); @@ -20837,7 +21712,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_cvtepu8_epi16() { + const fn test_mm512_mask_cvtepu8_epi16() { let src = _mm512_set1_epi16(1); let a = _mm256_set1_epi8(2); let r = _mm512_mask_cvtepu8_epi16(src, 0, a); @@ -20848,7 +21723,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_cvtepu8_epi16() { + const fn test_mm512_maskz_cvtepu8_epi16() { let a = _mm256_set1_epi8(2); let r = _mm512_maskz_cvtepu8_epi16(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -20858,7 +21733,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_cvtepu8_epi16() { + const fn test_mm256_mask_cvtepu8_epi16() { let src = _mm256_set1_epi16(1); let a = _mm_set1_epi8(2); let r = _mm256_mask_cvtepu8_epi16(src, 0, a); @@ -20869,7 +21744,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu8_epi16() { + const fn test_mm256_maskz_cvtepu8_epi16() { let a = _mm_set1_epi8(2); let r = _mm256_maskz_cvtepu8_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -20879,7 +21754,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_cvtepu8_epi16() { + const fn test_mm_mask_cvtepu8_epi16() { let src = _mm_set1_epi16(1); let a = _mm_set1_epi8(2); let r = _mm_mask_cvtepu8_epi16(src, 0, a); @@ -20890,7 +21765,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_cvtepu8_epi16() { + const fn test_mm_maskz_cvtepu8_epi16() { let a = _mm_set1_epi8(2); let r = _mm_maskz_cvtepu8_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -20900,7 +21775,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_bslli_epi128() { + const fn test_mm512_bslli_epi128() { #[rustfmt::skip] let a = _mm512_set_epi8( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, @@ -20920,7 +21795,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_bsrli_epi128() { + const fn test_mm512_bsrli_epi128() { #[rustfmt::skip] let a = _mm512_set_epi8( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, @@ -20940,7 +21815,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_alignr_epi8() { + const fn test_mm512_alignr_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, @@ -20961,7 +21836,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_mask_alignr_epi8() { + const fn test_mm512_mask_alignr_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, @@ -20989,7 +21864,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_mm512_maskz_alignr_epi8() { + const fn test_mm512_maskz_alignr_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, @@ -21016,7 +21891,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_mask_alignr_epi8() { + const fn test_mm256_mask_alignr_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, @@ -21035,7 +21910,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm256_maskz_alignr_epi8() { + const fn test_mm256_maskz_alignr_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, @@ -21054,7 +21929,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_mask_alignr_epi8() { + const fn test_mm_mask_alignr_epi8() { let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0); let b = _mm_set1_epi8(1); let r = _mm_mask_alignr_epi8::<14>(a, 0, a, b); @@ -21065,7 +21940,7 @@ mod tests { } #[simd_test(enable = "avx512bw,avx512vl")] - unsafe fn test_mm_maskz_alignr_epi8() { + const fn test_mm_maskz_alignr_epi8() { let a = _mm_set_epi8(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0); let b = _mm_set1_epi8(1); let r = _mm_maskz_alignr_epi8::<14>(0, a, b); @@ -21172,7 +22047,7 @@ mod tests { let e = _mm_set_epi8( 0, 0, 0, 0, 0, 0, 0, 0, - u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, + u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, u8::MAX as i8, ); assert_eq_m128i(r, e); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512cd.rs b/library/stdarch/crates/core_arch/src/x86/avx512cd.rs index 78735fcc90f5..4082433e7075 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512cd.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512cd.rs @@ -11,7 +11,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmw2d -pub fn _mm512_broadcastmw_epi32(k: __mmask16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastmw_epi32(k: __mmask16) -> __m512i { _mm512_set1_epi32(k as i32) } @@ -22,7 +23,8 @@ pub fn _mm512_broadcastmw_epi32(k: __mmask16) -> __m512i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmw2d -pub fn _mm256_broadcastmw_epi32(k: __mmask16) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastmw_epi32(k: __mmask16) -> __m256i { _mm256_set1_epi32(k as i32) } @@ -33,7 +35,8 @@ pub fn _mm256_broadcastmw_epi32(k: __mmask16) -> __m256i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmw2d -pub fn _mm_broadcastmw_epi32(k: __mmask16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastmw_epi32(k: __mmask16) -> __m128i { _mm_set1_epi32(k as i32) } @@ -44,7 +47,8 @@ pub fn _mm_broadcastmw_epi32(k: __mmask16) -> __m128i { #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmb2q -pub fn _mm512_broadcastmb_epi64(k: __mmask8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastmb_epi64(k: __mmask8) -> __m512i { _mm512_set1_epi64(k as i64) } @@ -55,7 +59,8 @@ pub fn _mm512_broadcastmb_epi64(k: __mmask8) -> __m512i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmb2q -pub fn _mm256_broadcastmb_epi64(k: __mmask8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcastmb_epi64(k: __mmask8) -> __m256i { _mm256_set1_epi64x(k as i64) } @@ -66,7 +71,8 @@ pub fn _mm256_broadcastmb_epi64(k: __mmask8) -> __m256i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] // should be vpbroadcastmb2q -pub fn _mm_broadcastmb_epi64(k: __mmask8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcastmb_epi64(k: __mmask8) -> __m128i { _mm_set1_epi64x(k as i64) } @@ -311,7 +317,8 @@ pub fn _mm_maskz_conflict_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm512_lzcnt_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_lzcnt_epi32(a: __m512i) -> __m512i { unsafe { transmute(simd_ctlz(a.as_i32x16())) } } @@ -322,7 +329,8 @@ pub fn _mm512_lzcnt_epi32(a: __m512i) -> __m512i { #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm512_mask_lzcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_lzcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { unsafe { let zerocount = _mm512_lzcnt_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, zerocount, src.as_i32x16())) @@ -336,7 +344,8 @@ pub fn _mm512_mask_lzcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512 #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm512_maskz_lzcnt_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_lzcnt_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { let zerocount = _mm512_lzcnt_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, zerocount, i32x16::ZERO)) @@ -350,7 +359,8 @@ pub fn _mm512_maskz_lzcnt_epi32(k: __mmask16, a: __m512i) -> __m512i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm256_lzcnt_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_lzcnt_epi32(a: __m256i) -> __m256i { unsafe { transmute(simd_ctlz(a.as_i32x8())) } } @@ -361,7 +371,8 @@ pub fn _mm256_lzcnt_epi32(a: __m256i) -> __m256i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm256_mask_lzcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_lzcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { let zerocount = _mm256_lzcnt_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, zerocount, src.as_i32x8())) @@ -375,7 +386,8 @@ pub fn _mm256_mask_lzcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm256_maskz_lzcnt_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_lzcnt_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { let zerocount = _mm256_lzcnt_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, zerocount, i32x8::ZERO)) @@ -389,7 +401,8 @@ pub fn _mm256_maskz_lzcnt_epi32(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm_lzcnt_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_lzcnt_epi32(a: __m128i) -> __m128i { unsafe { transmute(simd_ctlz(a.as_i32x4())) } } @@ -400,7 +413,8 @@ pub fn _mm_lzcnt_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm_mask_lzcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_lzcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let zerocount = _mm_lzcnt_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, zerocount, src.as_i32x4())) @@ -414,7 +428,8 @@ pub fn _mm_mask_lzcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntd))] -pub fn _mm_maskz_lzcnt_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_lzcnt_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let zerocount = _mm_lzcnt_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, zerocount, i32x4::ZERO)) @@ -428,7 +443,8 @@ pub fn _mm_maskz_lzcnt_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm512_lzcnt_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_lzcnt_epi64(a: __m512i) -> __m512i { unsafe { transmute(simd_ctlz(a.as_i64x8())) } } @@ -439,7 +455,8 @@ pub fn _mm512_lzcnt_epi64(a: __m512i) -> __m512i { #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm512_mask_lzcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_lzcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { unsafe { let zerocount = _mm512_lzcnt_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, zerocount, src.as_i64x8())) @@ -453,7 +470,8 @@ pub fn _mm512_mask_lzcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i #[target_feature(enable = "avx512cd")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm512_maskz_lzcnt_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_lzcnt_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { let zerocount = _mm512_lzcnt_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, zerocount, i64x8::ZERO)) @@ -467,7 +485,8 @@ pub fn _mm512_maskz_lzcnt_epi64(k: __mmask8, a: __m512i) -> __m512i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm256_lzcnt_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_lzcnt_epi64(a: __m256i) -> __m256i { unsafe { transmute(simd_ctlz(a.as_i64x4())) } } @@ -478,7 +497,8 @@ pub fn _mm256_lzcnt_epi64(a: __m256i) -> __m256i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm256_mask_lzcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_lzcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { let zerocount = _mm256_lzcnt_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, zerocount, src.as_i64x4())) @@ -492,7 +512,8 @@ pub fn _mm256_mask_lzcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm256_maskz_lzcnt_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_lzcnt_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { let zerocount = _mm256_lzcnt_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, zerocount, i64x4::ZERO)) @@ -506,7 +527,8 @@ pub fn _mm256_maskz_lzcnt_epi64(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm_lzcnt_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_lzcnt_epi64(a: __m128i) -> __m128i { unsafe { transmute(simd_ctlz(a.as_i64x2())) } } @@ -517,7 +539,8 @@ pub fn _mm_lzcnt_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm_mask_lzcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_lzcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let zerocount = _mm_lzcnt_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, zerocount, src.as_i64x2())) @@ -531,7 +554,8 @@ pub fn _mm_mask_lzcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512cd,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vplzcntq))] -pub fn _mm_maskz_lzcnt_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_lzcnt_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let zerocount = _mm_lzcnt_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, zerocount, i64x2::ZERO)) @@ -557,12 +581,13 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::core_arch::x86::*; use stdarch_test::simd_test; #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_broadcastmw_epi32() { + const fn test_mm512_broadcastmw_epi32() { let a: __mmask16 = 2; let r = _mm512_broadcastmw_epi32(a); let e = _mm512_set1_epi32(2); @@ -570,7 +595,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_broadcastmw_epi32() { + const fn test_mm256_broadcastmw_epi32() { let a: __mmask16 = 2; let r = _mm256_broadcastmw_epi32(a); let e = _mm256_set1_epi32(2); @@ -578,7 +603,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_broadcastmw_epi32() { + const fn test_mm_broadcastmw_epi32() { let a: __mmask16 = 2; let r = _mm_broadcastmw_epi32(a); let e = _mm_set1_epi32(2); @@ -586,7 +611,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_broadcastmb_epi64() { + const fn test_mm512_broadcastmb_epi64() { let a: __mmask8 = 2; let r = _mm512_broadcastmb_epi64(a); let e = _mm512_set1_epi64(2); @@ -594,7 +619,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_broadcastmb_epi64() { + const fn test_mm256_broadcastmb_epi64() { let a: __mmask8 = 2; let r = _mm256_broadcastmb_epi64(a); let e = _mm256_set1_epi64x(2); @@ -602,7 +627,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_broadcastmb_epi64() { + const fn test_mm_broadcastmb_epi64() { let a: __mmask8 = 2; let r = _mm_broadcastmb_epi64(a); let e = _mm_set1_epi64x(2); @@ -610,7 +635,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_conflict_epi32() { + fn test_mm512_conflict_epi32() { let a = _mm512_set1_epi32(1); let r = _mm512_conflict_epi32(a); let e = _mm512_set_epi32( @@ -695,7 +720,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_mask_conflict_epi32() { + fn test_mm512_mask_conflict_epi32() { let a = _mm512_set1_epi32(1); let r = _mm512_mask_conflict_epi32(a, 0, a); assert_eq_m512i(r, a); @@ -782,7 +807,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_maskz_conflict_epi32() { + fn test_mm512_maskz_conflict_epi32() { let a = _mm512_set1_epi32(1); let r = _mm512_maskz_conflict_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -869,7 +894,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_conflict_epi32() { + fn test_mm256_conflict_epi32() { let a = _mm256_set1_epi32(1); let r = _mm256_conflict_epi32(a); let e = _mm256_set_epi32( @@ -886,7 +911,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_mask_conflict_epi32() { + fn test_mm256_mask_conflict_epi32() { let a = _mm256_set1_epi32(1); let r = _mm256_mask_conflict_epi32(a, 0, a); assert_eq_m256i(r, a); @@ -905,7 +930,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_maskz_conflict_epi32() { + fn test_mm256_maskz_conflict_epi32() { let a = _mm256_set1_epi32(1); let r = _mm256_maskz_conflict_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -924,7 +949,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_conflict_epi32() { + fn test_mm_conflict_epi32() { let a = _mm_set1_epi32(1); let r = _mm_conflict_epi32(a); let e = _mm_set_epi32(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0); @@ -932,7 +957,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_mask_conflict_epi32() { + fn test_mm_mask_conflict_epi32() { let a = _mm_set1_epi32(1); let r = _mm_mask_conflict_epi32(a, 0, a); assert_eq_m128i(r, a); @@ -942,7 +967,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_maskz_conflict_epi32() { + fn test_mm_maskz_conflict_epi32() { let a = _mm_set1_epi32(1); let r = _mm_maskz_conflict_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -952,7 +977,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_conflict_epi64() { + fn test_mm512_conflict_epi64() { let a = _mm512_set1_epi64(1); let r = _mm512_conflict_epi64(a); let e = _mm512_set_epi64( @@ -969,7 +994,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_mask_conflict_epi64() { + fn test_mm512_mask_conflict_epi64() { let a = _mm512_set1_epi64(1); let r = _mm512_mask_conflict_epi64(a, 0, a); assert_eq_m512i(r, a); @@ -988,7 +1013,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_maskz_conflict_epi64() { + fn test_mm512_maskz_conflict_epi64() { let a = _mm512_set1_epi64(1); let r = _mm512_maskz_conflict_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -1007,7 +1032,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_conflict_epi64() { + fn test_mm256_conflict_epi64() { let a = _mm256_set1_epi64x(1); let r = _mm256_conflict_epi64(a); let e = _mm256_set_epi64x(1 << 2 | 1 << 1 | 1 << 0, 1 << 1 | 1 << 0, 1 << 0, 0); @@ -1015,7 +1040,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_mask_conflict_epi64() { + fn test_mm256_mask_conflict_epi64() { let a = _mm256_set1_epi64x(1); let r = _mm256_mask_conflict_epi64(a, 0, a); assert_eq_m256i(r, a); @@ -1025,7 +1050,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_maskz_conflict_epi64() { + fn test_mm256_maskz_conflict_epi64() { let a = _mm256_set1_epi64x(1); let r = _mm256_maskz_conflict_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -1035,7 +1060,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_conflict_epi64() { + fn test_mm_conflict_epi64() { let a = _mm_set1_epi64x(1); let r = _mm_conflict_epi64(a); let e = _mm_set_epi64x(1 << 0, 0); @@ -1043,7 +1068,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_mask_conflict_epi64() { + fn test_mm_mask_conflict_epi64() { let a = _mm_set1_epi64x(1); let r = _mm_mask_conflict_epi64(a, 0, a); assert_eq_m128i(r, a); @@ -1053,7 +1078,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_maskz_conflict_epi64() { + fn test_mm_maskz_conflict_epi64() { let a = _mm_set1_epi64x(1); let r = _mm_maskz_conflict_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -1063,7 +1088,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_lzcnt_epi32() { + const fn test_mm512_lzcnt_epi32() { let a = _mm512_set1_epi32(1); let r = _mm512_lzcnt_epi32(a); let e = _mm512_set1_epi32(31); @@ -1071,7 +1096,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_mask_lzcnt_epi32() { + const fn test_mm512_mask_lzcnt_epi32() { let a = _mm512_set1_epi32(1); let r = _mm512_mask_lzcnt_epi32(a, 0, a); assert_eq_m512i(r, a); @@ -1081,7 +1106,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_maskz_lzcnt_epi32() { + const fn test_mm512_maskz_lzcnt_epi32() { let a = _mm512_set1_epi32(2); let r = _mm512_maskz_lzcnt_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -1091,7 +1116,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_lzcnt_epi32() { + const fn test_mm256_lzcnt_epi32() { let a = _mm256_set1_epi32(1); let r = _mm256_lzcnt_epi32(a); let e = _mm256_set1_epi32(31); @@ -1099,7 +1124,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_mask_lzcnt_epi32() { + const fn test_mm256_mask_lzcnt_epi32() { let a = _mm256_set1_epi32(1); let r = _mm256_mask_lzcnt_epi32(a, 0, a); assert_eq_m256i(r, a); @@ -1109,7 +1134,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_maskz_lzcnt_epi32() { + const fn test_mm256_maskz_lzcnt_epi32() { let a = _mm256_set1_epi32(1); let r = _mm256_maskz_lzcnt_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -1119,7 +1144,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_lzcnt_epi32() { + const fn test_mm_lzcnt_epi32() { let a = _mm_set1_epi32(1); let r = _mm_lzcnt_epi32(a); let e = _mm_set1_epi32(31); @@ -1127,7 +1152,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_mask_lzcnt_epi32() { + const fn test_mm_mask_lzcnt_epi32() { let a = _mm_set1_epi32(1); let r = _mm_mask_lzcnt_epi32(a, 0, a); assert_eq_m128i(r, a); @@ -1137,7 +1162,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_maskz_lzcnt_epi32() { + const fn test_mm_maskz_lzcnt_epi32() { let a = _mm_set1_epi32(1); let r = _mm_maskz_lzcnt_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -1147,7 +1172,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_lzcnt_epi64() { + const fn test_mm512_lzcnt_epi64() { let a = _mm512_set1_epi64(1); let r = _mm512_lzcnt_epi64(a); let e = _mm512_set1_epi64(63); @@ -1155,7 +1180,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_mask_lzcnt_epi64() { + const fn test_mm512_mask_lzcnt_epi64() { let a = _mm512_set1_epi64(1); let r = _mm512_mask_lzcnt_epi64(a, 0, a); assert_eq_m512i(r, a); @@ -1165,7 +1190,7 @@ mod tests { } #[simd_test(enable = "avx512cd")] - unsafe fn test_mm512_maskz_lzcnt_epi64() { + const fn test_mm512_maskz_lzcnt_epi64() { let a = _mm512_set1_epi64(2); let r = _mm512_maskz_lzcnt_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -1175,7 +1200,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_lzcnt_epi64() { + const fn test_mm256_lzcnt_epi64() { let a = _mm256_set1_epi64x(1); let r = _mm256_lzcnt_epi64(a); let e = _mm256_set1_epi64x(63); @@ -1183,7 +1208,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_mask_lzcnt_epi64() { + const fn test_mm256_mask_lzcnt_epi64() { let a = _mm256_set1_epi64x(1); let r = _mm256_mask_lzcnt_epi64(a, 0, a); assert_eq_m256i(r, a); @@ -1193,7 +1218,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm256_maskz_lzcnt_epi64() { + const fn test_mm256_maskz_lzcnt_epi64() { let a = _mm256_set1_epi64x(1); let r = _mm256_maskz_lzcnt_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -1203,7 +1228,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_lzcnt_epi64() { + const fn test_mm_lzcnt_epi64() { let a = _mm_set1_epi64x(1); let r = _mm_lzcnt_epi64(a); let e = _mm_set1_epi64x(63); @@ -1211,7 +1236,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_mask_lzcnt_epi64() { + const fn test_mm_mask_lzcnt_epi64() { let a = _mm_set1_epi64x(1); let r = _mm_mask_lzcnt_epi64(a, 0, a); assert_eq_m128i(r, a); @@ -1221,7 +1246,7 @@ mod tests { } #[simd_test(enable = "avx512cd,avx512vl")] - unsafe fn test_mm_maskz_lzcnt_epi64() { + const fn test_mm_maskz_lzcnt_epi64() { let a = _mm_set1_epi64x(1); let r = _mm_maskz_lzcnt_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512dq.rs b/library/stdarch/crates/core_arch/src/x86/avx512dq.rs index afeb548a553c..ebe75cd22d8e 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512dq.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512dq.rs @@ -15,7 +15,8 @@ use crate::{ #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_and_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_and_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let and = _mm_and_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, and, src.as_f64x2())) @@ -30,7 +31,8 @@ pub fn _mm_mask_and_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_and_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_and_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let and = _mm_and_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, and, f64x2::ZERO)) @@ -46,7 +48,8 @@ pub fn _mm_maskz_and_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_and_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_and_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let and = _mm256_and_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, and, src.as_f64x4())) @@ -61,7 +64,8 @@ pub fn _mm256_mask_and_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_and_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_and_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let and = _mm256_and_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, and, f64x4::ZERO)) @@ -76,7 +80,8 @@ pub fn _mm256_maskz_and_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandp))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_and_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_and_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_and(transmute::<_, u64x8>(a), transmute::<_, u64x8>(b))) } } @@ -89,7 +94,8 @@ pub fn _mm512_and_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_and_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_and_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let and = _mm512_and_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, and, src.as_f64x8())) @@ -104,7 +110,8 @@ pub fn _mm512_mask_and_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_and_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_and_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let and = _mm512_and_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, and, f64x8::ZERO)) @@ -120,7 +127,8 @@ pub fn _mm512_maskz_and_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_and_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_and_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let and = _mm_and_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, and, src.as_f32x4())) @@ -135,7 +143,8 @@ pub fn _mm_mask_and_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_and_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_and_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let and = _mm_and_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, and, f32x4::ZERO)) @@ -151,7 +160,8 @@ pub fn _mm_maskz_and_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_and_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_and_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let and = _mm256_and_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, and, src.as_f32x8())) @@ -166,7 +176,8 @@ pub fn _mm256_mask_and_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_and_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_and_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let and = _mm256_and_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, and, f32x8::ZERO)) @@ -181,7 +192,8 @@ pub fn _mm256_maskz_and_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_and_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_and_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_and( transmute::<_, u32x16>(a), @@ -199,7 +211,8 @@ pub fn _mm512_and_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_and_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_and_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let and = _mm512_and_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, and, src.as_f32x16())) @@ -214,7 +227,8 @@ pub fn _mm512_mask_and_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __ #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_and_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_and_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let and = _mm512_and_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, and, f32x16::ZERO)) @@ -232,7 +246,8 @@ pub fn _mm512_maskz_and_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_andnot_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_andnot_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let andnot = _mm_andnot_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, andnot, src.as_f64x2())) @@ -248,7 +263,8 @@ pub fn _mm_mask_andnot_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_andnot_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_andnot_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let andnot = _mm_andnot_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, andnot, f64x2::ZERO)) @@ -264,7 +280,8 @@ pub fn _mm_maskz_andnot_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_andnot_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_andnot_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let andnot = _mm256_andnot_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, andnot, src.as_f64x4())) @@ -280,7 +297,8 @@ pub fn _mm256_mask_andnot_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_andnot_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_andnot_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let andnot = _mm256_andnot_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, andnot, f64x4::ZERO)) @@ -295,7 +313,8 @@ pub fn _mm256_maskz_andnot_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandnp))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_andnot_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_andnot_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { _mm512_and_pd(_mm512_xor_pd(a, transmute(_mm512_set1_epi64(-1))), b) } } @@ -308,7 +327,8 @@ pub fn _mm512_andnot_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandnpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_andnot_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_andnot_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let andnot = _mm512_andnot_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, andnot, src.as_f64x8())) @@ -324,7 +344,8 @@ pub fn _mm512_mask_andnot_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandnpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_andnot_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_andnot_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let andnot = _mm512_andnot_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, andnot, f64x8::ZERO)) @@ -340,7 +361,8 @@ pub fn _mm512_maskz_andnot_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_andnot_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_andnot_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let andnot = _mm_andnot_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, andnot, src.as_f32x4())) @@ -356,7 +378,8 @@ pub fn _mm_mask_andnot_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_andnot_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_andnot_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let andnot = _mm_andnot_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, andnot, f32x4::ZERO)) @@ -372,7 +395,8 @@ pub fn _mm_maskz_andnot_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_andnot_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_andnot_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let andnot = _mm256_andnot_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, andnot, src.as_f32x8())) @@ -388,7 +412,8 @@ pub fn _mm256_mask_andnot_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_andnot_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_andnot_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let andnot = _mm256_andnot_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, andnot, f32x8::ZERO)) @@ -403,7 +428,8 @@ pub fn _mm256_maskz_andnot_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_andnot_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_andnot_ps(a: __m512, b: __m512) -> __m512 { unsafe { _mm512_and_ps(_mm512_xor_ps(a, transmute(_mm512_set1_epi32(-1))), b) } } @@ -416,7 +442,8 @@ pub fn _mm512_andnot_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_andnot_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_andnot_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let andnot = _mm512_andnot_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, andnot, src.as_f32x16())) @@ -432,7 +459,8 @@ pub fn _mm512_mask_andnot_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vandnps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_andnot_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_andnot_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let andnot = _mm512_andnot_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, andnot, f32x16::ZERO)) @@ -450,7 +478,8 @@ pub fn _mm512_maskz_andnot_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_or_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_or_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let or = _mm_or_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, or, src.as_f64x2())) @@ -465,7 +494,8 @@ pub fn _mm_mask_or_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m1 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_or_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_or_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let or = _mm_or_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, or, f64x2::ZERO)) @@ -481,7 +511,8 @@ pub fn _mm_maskz_or_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_or_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_or_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let or = _mm256_or_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, or, src.as_f64x4())) @@ -496,7 +527,8 @@ pub fn _mm256_mask_or_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> _ #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_or_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_or_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let or = _mm256_or_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, or, f64x4::ZERO)) @@ -511,7 +543,8 @@ pub fn _mm256_maskz_or_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vorp))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_or_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_or_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_or(transmute::<_, u64x8>(a), transmute::<_, u64x8>(b))) } } @@ -524,7 +557,8 @@ pub fn _mm512_or_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_or_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_or_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let or = _mm512_or_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, or, src.as_f64x8())) @@ -539,7 +573,8 @@ pub fn _mm512_mask_or_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> _ #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_or_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_or_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let or = _mm512_or_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, or, f64x8::ZERO)) @@ -555,7 +590,8 @@ pub fn _mm512_maskz_or_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_or_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_or_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let or = _mm_or_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, or, src.as_f32x4())) @@ -570,7 +606,8 @@ pub fn _mm_mask_or_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_or_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_or_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let or = _mm_or_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, or, f32x4::ZERO)) @@ -586,7 +623,8 @@ pub fn _mm_maskz_or_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_or_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_or_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let or = _mm256_or_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, or, src.as_f32x8())) @@ -601,7 +639,8 @@ pub fn _mm256_mask_or_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m2 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_or_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_or_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let or = _mm256_or_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, or, f32x8::ZERO)) @@ -616,7 +655,8 @@ pub fn _mm256_maskz_or_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_or_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_or_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_or( transmute::<_, u32x16>(a), @@ -634,7 +674,8 @@ pub fn _mm512_or_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_or_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_or_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let or = _mm512_or_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, or, src.as_f32x16())) @@ -649,7 +690,8 @@ pub fn _mm512_mask_or_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_or_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_or_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let or = _mm512_or_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, or, f32x16::ZERO)) @@ -667,7 +709,8 @@ pub fn _mm512_maskz_or_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_xor_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_xor_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let xor = _mm_xor_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, xor, src.as_f64x2())) @@ -682,7 +725,8 @@ pub fn _mm_mask_xor_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_xor_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_xor_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let xor = _mm_xor_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, xor, f64x2::ZERO)) @@ -698,7 +742,8 @@ pub fn _mm_maskz_xor_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_xor_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_xor_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let xor = _mm256_xor_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, xor, src.as_f64x4())) @@ -713,7 +758,8 @@ pub fn _mm256_mask_xor_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_xor_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_xor_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let xor = _mm256_xor_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, xor, f64x4::ZERO)) @@ -728,7 +774,8 @@ pub fn _mm256_maskz_xor_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vxorp))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_xor_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_xor_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_xor(transmute::<_, u64x8>(a), transmute::<_, u64x8>(b))) } } @@ -741,7 +788,8 @@ pub fn _mm512_xor_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vxorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_xor_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_xor_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let xor = _mm512_xor_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, xor, src.as_f64x8())) @@ -756,7 +804,8 @@ pub fn _mm512_mask_xor_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vxorpd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_xor_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_xor_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let xor = _mm512_xor_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, xor, f64x8::ZERO)) @@ -772,7 +821,8 @@ pub fn _mm512_maskz_xor_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_xor_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_xor_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let xor = _mm_xor_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, xor, src.as_f32x4())) @@ -787,7 +837,8 @@ pub fn _mm_mask_xor_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_xor_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_xor_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let xor = _mm_xor_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, xor, f32x4::ZERO)) @@ -803,7 +854,8 @@ pub fn _mm_maskz_xor_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_xor_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_xor_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let xor = _mm256_xor_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, xor, src.as_f32x8())) @@ -818,7 +870,8 @@ pub fn _mm256_mask_xor_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_xor_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_xor_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let xor = _mm256_xor_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, xor, f32x8::ZERO)) @@ -833,7 +886,8 @@ pub fn _mm256_maskz_xor_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_xor_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_xor_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_xor( transmute::<_, u32x16>(a), @@ -851,7 +905,8 @@ pub fn _mm512_xor_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_xor_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_xor_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let xor = _mm512_xor_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, xor, src.as_f32x16())) @@ -866,7 +921,8 @@ pub fn _mm512_mask_xor_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __ #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vxorps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_xor_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_xor_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let xor = _mm512_xor_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, xor, f32x16::ZERO)) @@ -882,7 +938,8 @@ pub fn _mm512_maskz_xor_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_broadcast_f32x2(a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_f32x2(a: __m128) -> __m256 { unsafe { let b: f32x8 = simd_shuffle!(a, a, [0, 1, 0, 1, 0, 1, 0, 1]); transmute(b) @@ -897,7 +954,8 @@ pub fn _mm256_broadcast_f32x2(a: __m128) -> __m256 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vbroadcastf32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_broadcast_f32x2(src: __m256, k: __mmask8, a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcast_f32x2(src: __m256, k: __mmask8, a: __m128) -> __m256 { unsafe { let b = _mm256_broadcast_f32x2(a).as_f32x8(); transmute(simd_select_bitmask(k, b, src.as_f32x8())) @@ -912,7 +970,8 @@ pub fn _mm256_mask_broadcast_f32x2(src: __m256, k: __mmask8, a: __m128) -> __m25 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vbroadcastf32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_broadcast_f32x2(k: __mmask8, a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcast_f32x2(k: __mmask8, a: __m128) -> __m256 { unsafe { let b = _mm256_broadcast_f32x2(a).as_f32x8(); transmute(simd_select_bitmask(k, b, f32x8::ZERO)) @@ -926,7 +985,8 @@ pub fn _mm256_maskz_broadcast_f32x2(k: __mmask8, a: __m128) -> __m256 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_f32x2(a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_f32x2(a: __m128) -> __m512 { unsafe { let b: f32x16 = simd_shuffle!(a, a, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]); transmute(b) @@ -941,7 +1001,8 @@ pub fn _mm512_broadcast_f32x2(a: __m128) -> __m512 { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vbroadcastf32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_f32x2(src: __m512, k: __mmask16, a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_f32x2(src: __m512, k: __mmask16, a: __m128) -> __m512 { unsafe { let b = _mm512_broadcast_f32x2(a).as_f32x16(); transmute(simd_select_bitmask(k, b, src.as_f32x16())) @@ -956,7 +1017,8 @@ pub fn _mm512_mask_broadcast_f32x2(src: __m512, k: __mmask16, a: __m128) -> __m5 #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vbroadcastf32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_f32x2(k: __mmask16, a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_f32x2(k: __mmask16, a: __m128) -> __m512 { unsafe { let b = _mm512_broadcast_f32x2(a).as_f32x16(); transmute(simd_select_bitmask(k, b, f32x16::ZERO)) @@ -970,7 +1032,8 @@ pub fn _mm512_maskz_broadcast_f32x2(k: __mmask16, a: __m128) -> __m512 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_f32x8(a: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_f32x8(a: __m256) -> __m512 { unsafe { let b: f32x16 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]); transmute(b) @@ -984,7 +1047,8 @@ pub fn _mm512_broadcast_f32x8(a: __m256) -> __m512 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_f32x8(src: __m512, k: __mmask16, a: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_f32x8(src: __m512, k: __mmask16, a: __m256) -> __m512 { unsafe { let b = _mm512_broadcast_f32x8(a).as_f32x16(); transmute(simd_select_bitmask(k, b, src.as_f32x16())) @@ -998,7 +1062,8 @@ pub fn _mm512_mask_broadcast_f32x8(src: __m512, k: __mmask16, a: __m256) -> __m5 #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_f32x8(k: __mmask16, a: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_f32x8(k: __mmask16, a: __m256) -> __m512 { unsafe { let b = _mm512_broadcast_f32x8(a).as_f32x16(); transmute(simd_select_bitmask(k, b, f32x16::ZERO)) @@ -1012,7 +1077,8 @@ pub fn _mm512_maskz_broadcast_f32x8(k: __mmask16, a: __m256) -> __m512 { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_broadcast_f64x2(a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_f64x2(a: __m128d) -> __m256d { unsafe { let b: f64x4 = simd_shuffle!(a, a, [0, 1, 0, 1]); transmute(b) @@ -1026,7 +1092,8 @@ pub fn _mm256_broadcast_f64x2(a: __m128d) -> __m256d { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_broadcast_f64x2(src: __m256d, k: __mmask8, a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcast_f64x2(src: __m256d, k: __mmask8, a: __m128d) -> __m256d { unsafe { let b = _mm256_broadcast_f64x2(a).as_f64x4(); transmute(simd_select_bitmask(k, b, src.as_f64x4())) @@ -1040,7 +1107,8 @@ pub fn _mm256_mask_broadcast_f64x2(src: __m256d, k: __mmask8, a: __m128d) -> __m #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_broadcast_f64x2(k: __mmask8, a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcast_f64x2(k: __mmask8, a: __m128d) -> __m256d { unsafe { let b = _mm256_broadcast_f64x2(a).as_f64x4(); transmute(simd_select_bitmask(k, b, f64x4::ZERO)) @@ -1054,7 +1122,8 @@ pub fn _mm256_maskz_broadcast_f64x2(k: __mmask8, a: __m128d) -> __m256d { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_f64x2(a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_f64x2(a: __m128d) -> __m512d { unsafe { let b: f64x8 = simd_shuffle!(a, a, [0, 1, 0, 1, 0, 1, 0, 1]); transmute(b) @@ -1068,7 +1137,8 @@ pub fn _mm512_broadcast_f64x2(a: __m128d) -> __m512d { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_f64x2(src: __m512d, k: __mmask8, a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_f64x2(src: __m512d, k: __mmask8, a: __m128d) -> __m512d { unsafe { let b = _mm512_broadcast_f64x2(a).as_f64x8(); transmute(simd_select_bitmask(k, b, src.as_f64x8())) @@ -1082,7 +1152,8 @@ pub fn _mm512_mask_broadcast_f64x2(src: __m512d, k: __mmask8, a: __m128d) -> __m #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_f64x2(k: __mmask8, a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_f64x2(k: __mmask8, a: __m128d) -> __m512d { unsafe { let b = _mm512_broadcast_f64x2(a).as_f64x8(); transmute(simd_select_bitmask(k, b, f64x8::ZERO)) @@ -1095,7 +1166,8 @@ pub fn _mm512_maskz_broadcast_f64x2(k: __mmask8, a: __m128d) -> __m512d { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_broadcast_i32x2(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_broadcast_i32x2(a: __m128i) -> __m128i { unsafe { let a = a.as_i32x4(); let b: i32x4 = simd_shuffle!(a, a, [0, 1, 0, 1]); @@ -1111,7 +1183,8 @@ pub fn _mm_broadcast_i32x2(a: __m128i) -> __m128i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vbroadcasti32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_broadcast_i32x2(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_broadcast_i32x2(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let b = _mm_broadcast_i32x2(a).as_i32x4(); transmute(simd_select_bitmask(k, b, src.as_i32x4())) @@ -1126,7 +1199,8 @@ pub fn _mm_mask_broadcast_i32x2(src: __m128i, k: __mmask8, a: __m128i) -> __m128 #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vbroadcasti32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_broadcast_i32x2(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_broadcast_i32x2(k: __mmask8, a: __m128i) -> __m128i { unsafe { let b = _mm_broadcast_i32x2(a).as_i32x4(); transmute(simd_select_bitmask(k, b, i32x4::ZERO)) @@ -1139,7 +1213,8 @@ pub fn _mm_maskz_broadcast_i32x2(k: __mmask8, a: __m128i) -> __m128i { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_broadcast_i32x2(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_i32x2(a: __m128i) -> __m256i { unsafe { let a = a.as_i32x4(); let b: i32x8 = simd_shuffle!(a, a, [0, 1, 0, 1, 0, 1, 0, 1]); @@ -1155,7 +1230,8 @@ pub fn _mm256_broadcast_i32x2(a: __m128i) -> __m256i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vbroadcasti32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_broadcast_i32x2(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcast_i32x2(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let b = _mm256_broadcast_i32x2(a).as_i32x8(); transmute(simd_select_bitmask(k, b, src.as_i32x8())) @@ -1170,7 +1246,8 @@ pub fn _mm256_mask_broadcast_i32x2(src: __m256i, k: __mmask8, a: __m128i) -> __m #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vbroadcasti32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_broadcast_i32x2(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcast_i32x2(k: __mmask8, a: __m128i) -> __m256i { unsafe { let b = _mm256_broadcast_i32x2(a).as_i32x8(); transmute(simd_select_bitmask(k, b, i32x8::ZERO)) @@ -1183,7 +1260,8 @@ pub fn _mm256_maskz_broadcast_i32x2(k: __mmask8, a: __m128i) -> __m256i { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_i32x2(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_i32x2(a: __m128i) -> __m512i { unsafe { let a = a.as_i32x4(); let b: i32x16 = simd_shuffle!(a, a, [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]); @@ -1199,7 +1277,8 @@ pub fn _mm512_broadcast_i32x2(a: __m128i) -> __m512i { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vbroadcasti32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_i32x2(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_i32x2(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { unsafe { let b = _mm512_broadcast_i32x2(a).as_i32x16(); transmute(simd_select_bitmask(k, b, src.as_i32x16())) @@ -1214,7 +1293,8 @@ pub fn _mm512_mask_broadcast_i32x2(src: __m512i, k: __mmask16, a: __m128i) -> __ #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vbroadcasti32x2))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_i32x2(k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_i32x2(k: __mmask16, a: __m128i) -> __m512i { unsafe { let b = _mm512_broadcast_i32x2(a).as_i32x16(); transmute(simd_select_bitmask(k, b, i32x16::ZERO)) @@ -1227,7 +1307,8 @@ pub fn _mm512_maskz_broadcast_i32x2(k: __mmask16, a: __m128i) -> __m512i { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_i32x8(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_i32x8(a: __m256i) -> __m512i { unsafe { let a = a.as_i32x8(); let b: i32x16 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]); @@ -1242,7 +1323,8 @@ pub fn _mm512_broadcast_i32x8(a: __m256i) -> __m512i { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_i32x8(src: __m512i, k: __mmask16, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_i32x8(src: __m512i, k: __mmask16, a: __m256i) -> __m512i { unsafe { let b = _mm512_broadcast_i32x8(a).as_i32x16(); transmute(simd_select_bitmask(k, b, src.as_i32x16())) @@ -1256,7 +1338,8 @@ pub fn _mm512_mask_broadcast_i32x8(src: __m512i, k: __mmask16, a: __m256i) -> __ #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_i32x8(k: __mmask16, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_i32x8(k: __mmask16, a: __m256i) -> __m512i { unsafe { let b = _mm512_broadcast_i32x8(a).as_i32x16(); transmute(simd_select_bitmask(k, b, i32x16::ZERO)) @@ -1269,7 +1352,8 @@ pub fn _mm512_maskz_broadcast_i32x8(k: __mmask16, a: __m256i) -> __m512i { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_broadcast_i64x2(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_i64x2(a: __m128i) -> __m256i { unsafe { let a = a.as_i64x2(); let b: i64x4 = simd_shuffle!(a, a, [0, 1, 0, 1]); @@ -1284,7 +1368,8 @@ pub fn _mm256_broadcast_i64x2(a: __m128i) -> __m256i { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_broadcast_i64x2(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcast_i64x2(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let b = _mm256_broadcast_i64x2(a).as_i64x4(); transmute(simd_select_bitmask(k, b, src.as_i64x4())) @@ -1298,7 +1383,8 @@ pub fn _mm256_mask_broadcast_i64x2(src: __m256i, k: __mmask8, a: __m128i) -> __m #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_broadcast_i64x2(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcast_i64x2(k: __mmask8, a: __m128i) -> __m256i { unsafe { let b = _mm256_broadcast_i64x2(a).as_i64x4(); transmute(simd_select_bitmask(k, b, i64x4::ZERO)) @@ -1311,7 +1397,8 @@ pub fn _mm256_maskz_broadcast_i64x2(k: __mmask8, a: __m128i) -> __m256i { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_i64x2(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_i64x2(a: __m128i) -> __m512i { unsafe { let a = a.as_i64x2(); let b: i64x8 = simd_shuffle!(a, a, [0, 1, 0, 1, 0, 1, 0, 1]); @@ -1326,7 +1413,8 @@ pub fn _mm512_broadcast_i64x2(a: __m128i) -> __m512i { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_i64x2(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_i64x2(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { unsafe { let b = _mm512_broadcast_i64x2(a).as_i64x8(); transmute(simd_select_bitmask(k, b, src.as_i64x8())) @@ -1340,7 +1428,8 @@ pub fn _mm512_mask_broadcast_i64x2(src: __m512i, k: __mmask8, a: __m128i) -> __m #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_i64x2(k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_i64x2(k: __mmask8, a: __m128i) -> __m512i { unsafe { let b = _mm512_broadcast_i64x2(a).as_i64x8(); transmute(simd_select_bitmask(k, b, i64x8::ZERO)) @@ -1357,7 +1446,8 @@ pub fn _mm512_maskz_broadcast_i64x2(k: __mmask8, a: __m128i) -> __m512i { #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_extractf32x8_ps(a: __m512) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extractf32x8_ps(a: __m512) -> __m256 { unsafe { static_assert_uimm_bits!(IMM8, 1); match IMM8 & 1 { @@ -1377,7 +1467,12 @@ pub fn _mm512_extractf32x8_ps(a: __m512) -> __m256 { #[cfg_attr(test, assert_instr(vextractf32x8, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_extractf32x8_ps(src: __m256, k: __mmask8, a: __m512) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extractf32x8_ps( + src: __m256, + k: __mmask8, + a: __m512, +) -> __m256 { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm512_extractf32x8_ps::(a); @@ -1395,7 +1490,8 @@ pub fn _mm512_mask_extractf32x8_ps(src: __m256, k: __mmask8, a: #[cfg_attr(test, assert_instr(vextractf32x8, IMM8 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_extractf32x8_ps(k: __mmask8, a: __m512) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extractf32x8_ps(k: __mmask8, a: __m512) -> __m256 { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm512_extractf32x8_ps::(a); @@ -1411,7 +1507,8 @@ pub fn _mm512_maskz_extractf32x8_ps(k: __mmask8, a: __m512) -> #[target_feature(enable = "avx512dq,avx512vl")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_extractf64x2_pd(a: __m256d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extractf64x2_pd(a: __m256d) -> __m128d { unsafe { static_assert_uimm_bits!(IMM8, 1); match IMM8 & 1 { @@ -1431,7 +1528,8 @@ pub fn _mm256_extractf64x2_pd(a: __m256d) -> __m128d { #[cfg_attr(test, assert_instr(vextractf64x2, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_extractf64x2_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_extractf64x2_pd( src: __m128d, k: __mmask8, a: __m256d, @@ -1453,7 +1551,8 @@ pub fn _mm256_mask_extractf64x2_pd( #[cfg_attr(test, assert_instr(vextractf64x2, IMM8 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_extractf64x2_pd(k: __mmask8, a: __m256d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_extractf64x2_pd(k: __mmask8, a: __m256d) -> __m128d { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm256_extractf64x2_pd::(a); @@ -1469,7 +1568,8 @@ pub fn _mm256_maskz_extractf64x2_pd(k: __mmask8, a: __m256d) -> #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_extractf64x2_pd(a: __m512d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extractf64x2_pd(a: __m512d) -> __m128d { unsafe { static_assert_uimm_bits!(IMM8, 2); match IMM8 & 3 { @@ -1491,7 +1591,8 @@ pub fn _mm512_extractf64x2_pd(a: __m512d) -> __m128d { #[cfg_attr(test, assert_instr(vextractf64x2, IMM8 = 3))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_extractf64x2_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extractf64x2_pd( src: __m128d, k: __mmask8, a: __m512d, @@ -1513,7 +1614,8 @@ pub fn _mm512_mask_extractf64x2_pd( #[cfg_attr(test, assert_instr(vextractf64x2, IMM8 = 3))] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_extractf64x2_pd(k: __mmask8, a: __m512d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extractf64x2_pd(k: __mmask8, a: __m512d) -> __m128d { unsafe { static_assert_uimm_bits!(IMM8, 2); let b = _mm512_extractf64x2_pd::(a).as_f64x2(); @@ -1529,7 +1631,8 @@ pub fn _mm512_maskz_extractf64x2_pd(k: __mmask8, a: __m512d) -> #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_extracti32x8_epi32(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extracti32x8_epi32(a: __m512i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 1); let a = a.as_i32x16(); @@ -1550,7 +1653,8 @@ pub fn _mm512_extracti32x8_epi32(a: __m512i) -> __m256i { #[cfg_attr(test, assert_instr(vextracti32x8, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_extracti32x8_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extracti32x8_epi32( src: __m256i, k: __mmask8, a: __m512i, @@ -1571,7 +1675,8 @@ pub fn _mm512_mask_extracti32x8_epi32( #[cfg_attr(test, assert_instr(vextracti32x8, IMM8 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_extracti32x8_epi32(k: __mmask8, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extracti32x8_epi32(k: __mmask8, a: __m512i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm512_extracti32x8_epi32::(a).as_i32x8(); @@ -1587,7 +1692,8 @@ pub fn _mm512_maskz_extracti32x8_epi32(k: __mmask8, a: __m512i) #[target_feature(enable = "avx512dq,avx512vl")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_extracti64x2_epi64(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extracti64x2_epi64(a: __m256i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 1); let a = a.as_i64x4(); @@ -1607,7 +1713,8 @@ pub fn _mm256_extracti64x2_epi64(a: __m256i) -> __m128i { #[cfg_attr(test, assert_instr(vextracti64x2, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_extracti64x2_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_extracti64x2_epi64( src: __m128i, k: __mmask8, a: __m256i, @@ -1628,7 +1735,8 @@ pub fn _mm256_mask_extracti64x2_epi64( #[cfg_attr(test, assert_instr(vextracti64x2, IMM8 = 1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_extracti64x2_epi64(k: __mmask8, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_extracti64x2_epi64(k: __mmask8, a: __m256i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm256_extracti64x2_epi64::(a).as_i64x2(); @@ -1644,7 +1752,8 @@ pub fn _mm256_maskz_extracti64x2_epi64(k: __mmask8, a: __m256i) #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_extracti64x2_epi64(a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extracti64x2_epi64(a: __m512i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 2); let a = a.as_i64x8(); @@ -1666,7 +1775,8 @@ pub fn _mm512_extracti64x2_epi64(a: __m512i) -> __m128i { #[cfg_attr(test, assert_instr(vextracti64x2, IMM8 = 3))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_extracti64x2_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extracti64x2_epi64( src: __m128i, k: __mmask8, a: __m512i, @@ -1687,7 +1797,8 @@ pub fn _mm512_mask_extracti64x2_epi64( #[cfg_attr(test, assert_instr(vextracti64x2, IMM8 = 3))] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_extracti64x2_epi64(k: __mmask8, a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extracti64x2_epi64(k: __mmask8, a: __m512i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 2); let b = _mm512_extracti64x2_epi64::(a).as_i64x2(); @@ -1705,7 +1816,8 @@ pub fn _mm512_maskz_extracti64x2_epi64(k: __mmask8, a: __m512i) #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_insertf32x8(a: __m512, b: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_insertf32x8(a: __m512, b: __m256) -> __m512 { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm512_castps256_ps512(b); @@ -1738,7 +1850,8 @@ pub fn _mm512_insertf32x8(a: __m512, b: __m256) -> __m512 { #[cfg_attr(test, assert_instr(vinsertf32x8, IMM8 = 1))] #[rustc_legacy_const_generics(4)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_insertf32x8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_insertf32x8( src: __m512, k: __mmask16, a: __m512, @@ -1761,7 +1874,12 @@ pub fn _mm512_mask_insertf32x8( #[cfg_attr(test, assert_instr(vinsertf32x8, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_insertf32x8(k: __mmask16, a: __m512, b: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_insertf32x8( + k: __mmask16, + a: __m512, + b: __m256, +) -> __m512 { unsafe { static_assert_uimm_bits!(IMM8, 1); let c = _mm512_insertf32x8::(a, b).as_f32x16(); @@ -1777,7 +1895,8 @@ pub fn _mm512_maskz_insertf32x8(k: __mmask16, a: __m512, b: __m #[target_feature(enable = "avx512dq,avx512vl")] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_insertf64x2(a: __m256d, b: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insertf64x2(a: __m256d, b: __m128d) -> __m256d { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm256_castpd128_pd256(b); @@ -1798,7 +1917,8 @@ pub fn _mm256_insertf64x2(a: __m256d, b: __m128d) -> __m256d { #[cfg_attr(test, assert_instr(vinsertf64x2, IMM8 = 1))] #[rustc_legacy_const_generics(4)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_insertf64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_insertf64x2( src: __m256d, k: __mmask8, a: __m256d, @@ -1821,7 +1941,12 @@ pub fn _mm256_mask_insertf64x2( #[cfg_attr(test, assert_instr(vinsertf64x2, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_insertf64x2(k: __mmask8, a: __m256d, b: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_insertf64x2( + k: __mmask8, + a: __m256d, + b: __m128d, +) -> __m256d { unsafe { static_assert_uimm_bits!(IMM8, 1); let c = _mm256_insertf64x2::(a, b).as_f64x4(); @@ -1837,7 +1962,8 @@ pub fn _mm256_maskz_insertf64x2(k: __mmask8, a: __m256d, b: __m #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_insertf64x2(a: __m512d, b: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_insertf64x2(a: __m512d, b: __m128d) -> __m512d { unsafe { static_assert_uimm_bits!(IMM8, 2); let b = _mm512_castpd128_pd512(b); @@ -1860,7 +1986,8 @@ pub fn _mm512_insertf64x2(a: __m512d, b: __m128d) -> __m512d { #[cfg_attr(test, assert_instr(vinsertf64x2, IMM8 = 3))] #[rustc_legacy_const_generics(4)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_insertf64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_insertf64x2( src: __m512d, k: __mmask8, a: __m512d, @@ -1883,7 +2010,12 @@ pub fn _mm512_mask_insertf64x2( #[cfg_attr(test, assert_instr(vinsertf64x2, IMM8 = 3))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_insertf64x2(k: __mmask8, a: __m512d, b: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_insertf64x2( + k: __mmask8, + a: __m512d, + b: __m128d, +) -> __m512d { unsafe { static_assert_uimm_bits!(IMM8, 2); let c = _mm512_insertf64x2::(a, b).as_f64x8(); @@ -1899,7 +2031,8 @@ pub fn _mm512_maskz_insertf64x2(k: __mmask8, a: __m512d, b: __m #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_inserti32x8(a: __m512i, b: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_inserti32x8(a: __m512i, b: __m256i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 1); let a = a.as_i32x16(); @@ -1934,7 +2067,8 @@ pub fn _mm512_inserti32x8(a: __m512i, b: __m256i) -> __m512i { #[cfg_attr(test, assert_instr(vinserti32x8, IMM8 = 1))] #[rustc_legacy_const_generics(4)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_inserti32x8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_inserti32x8( src: __m512i, k: __mmask16, a: __m512i, @@ -1957,7 +2091,12 @@ pub fn _mm512_mask_inserti32x8( #[cfg_attr(test, assert_instr(vinserti32x8, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_inserti32x8(k: __mmask16, a: __m512i, b: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_inserti32x8( + k: __mmask16, + a: __m512i, + b: __m256i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 1); let c = _mm512_inserti32x8::(a, b).as_i32x16(); @@ -1973,7 +2112,8 @@ pub fn _mm512_maskz_inserti32x8(k: __mmask16, a: __m512i, b: __ #[target_feature(enable = "avx512dq,avx512vl")] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_inserti64x2(a: __m256i, b: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_inserti64x2(a: __m256i, b: __m128i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 1); let a = a.as_i64x4(); @@ -1995,7 +2135,8 @@ pub fn _mm256_inserti64x2(a: __m256i, b: __m128i) -> __m256i { #[cfg_attr(test, assert_instr(vinserti64x2, IMM8 = 1))] #[rustc_legacy_const_generics(4)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_inserti64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_inserti64x2( src: __m256i, k: __mmask8, a: __m256i, @@ -2018,7 +2159,12 @@ pub fn _mm256_mask_inserti64x2( #[cfg_attr(test, assert_instr(vinserti64x2, IMM8 = 1))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_inserti64x2(k: __mmask8, a: __m256i, b: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_inserti64x2( + k: __mmask8, + a: __m256i, + b: __m128i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 1); let c = _mm256_inserti64x2::(a, b).as_i64x4(); @@ -2034,7 +2180,8 @@ pub fn _mm256_maskz_inserti64x2(k: __mmask8, a: __m256i, b: __m #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(2)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_inserti64x2(a: __m512i, b: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_inserti64x2(a: __m512i, b: __m128i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 2); let a = a.as_i64x8(); @@ -2058,7 +2205,8 @@ pub fn _mm512_inserti64x2(a: __m512i, b: __m128i) -> __m512i { #[cfg_attr(test, assert_instr(vinserti64x2, IMM8 = 3))] #[rustc_legacy_const_generics(4)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_inserti64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_inserti64x2( src: __m512i, k: __mmask8, a: __m512i, @@ -2081,7 +2229,12 @@ pub fn _mm512_mask_inserti64x2( #[cfg_attr(test, assert_instr(vinserti64x2, IMM8 = 3))] #[rustc_legacy_const_generics(3)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_inserti64x2(k: __mmask8, a: __m512i, b: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_inserti64x2( + k: __mmask8, + a: __m512i, + b: __m128i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 2); let c = _mm512_inserti64x2::(a, b).as_i64x8(); @@ -4333,7 +4486,8 @@ pub fn _mm512_maskz_cvttps_epu64(k: __mmask8, a: __m256) -> __m512i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mullo_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mullo_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_mul(a.as_i64x2(), b.as_i64x2())) } } @@ -4346,7 +4500,8 @@ pub fn _mm_mullo_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_mask_mullo_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mullo_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let b = _mm_mullo_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, b, src.as_i64x2())) @@ -4362,7 +4517,8 @@ pub fn _mm_mask_mullo_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_maskz_mullo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mullo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let b = _mm_mullo_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, b, i64x2::ZERO)) @@ -4377,7 +4533,8 @@ pub fn _mm_maskz_mullo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mullo_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mullo_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_mul(a.as_i64x4(), b.as_i64x4())) } } @@ -4390,7 +4547,8 @@ pub fn _mm256_mullo_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_mullo_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mullo_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let b = _mm256_mullo_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, b, src.as_i64x4())) @@ -4406,7 +4564,8 @@ pub fn _mm256_mask_mullo_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_mullo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mullo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let b = _mm256_mullo_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, b, i64x4::ZERO)) @@ -4421,7 +4580,8 @@ pub fn _mm256_maskz_mullo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mullo_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mullo_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_mul(a.as_i64x8(), b.as_i64x8())) } } @@ -4434,7 +4594,8 @@ pub fn _mm512_mullo_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_mullo_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mullo_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let b = _mm512_mullo_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, b, src.as_i64x8())) @@ -4450,7 +4611,8 @@ pub fn _mm512_mask_mullo_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vpmullq))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_mullo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mullo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let b = _mm512_mullo_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, b, i64x8::ZERO)) @@ -4465,7 +4627,8 @@ pub fn _mm512_maskz_mullo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtmask8_u32(a: __mmask8) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtmask8_u32(a: __mmask8) -> u32 { a as u32 } @@ -4475,7 +4638,8 @@ pub fn _cvtmask8_u32(a: __mmask8) -> u32 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtu32_mask8(a: u32) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtu32_mask8(a: u32) -> __mmask8 { a as __mmask8 } @@ -4485,8 +4649,9 @@ pub fn _cvtu32_mask8(a: u32) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kadd_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { - a + b +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kadd_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { + a.wrapping_add(b) } /// Add 8-bit masks a and b, and store the result in dst. @@ -4495,8 +4660,9 @@ pub fn _kadd_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kadd_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { - a + b +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kadd_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { + a.wrapping_add(b) } /// Bitwise AND of 8-bit masks a and b, and store the result in dst. @@ -4505,7 +4671,8 @@ pub fn _kadd_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kand_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kand_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { a & b } @@ -4515,7 +4682,8 @@ pub fn _kand_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kandn_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kandn_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { _knot_mask8(a) & b } @@ -4525,7 +4693,8 @@ pub fn _kandn_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _knot_mask8(a: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _knot_mask8(a: __mmask8) -> __mmask8 { a ^ 0b11111111 } @@ -4535,7 +4704,8 @@ pub fn _knot_mask8(a: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { a | b } @@ -4545,7 +4715,8 @@ pub fn _kor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kxnor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxnor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { _knot_mask8(_kxor_mask8(a, b)) } @@ -4555,7 +4726,8 @@ pub fn _kxnor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kxor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { a ^ b } @@ -4566,7 +4738,8 @@ pub fn _kxor_mask8(a: __mmask8, b: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _kortest_mask8_u8(a: __mmask8, b: __mmask8, all_ones: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _kortest_mask8_u8(a: __mmask8, b: __mmask8, all_ones: *mut u8) -> u8 { let tmp = _kor_mask8(a, b); *all_ones = (tmp == 0xff) as u8; (tmp == 0) as u8 @@ -4579,7 +4752,8 @@ pub unsafe fn _kortest_mask8_u8(a: __mmask8, b: __mmask8, all_ones: *mut u8) -> #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestc_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestc_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { (_kor_mask8(a, b) == 0xff) as u8 } @@ -4590,7 +4764,8 @@ pub fn _kortestc_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestz_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestz_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { (_kor_mask8(a, b) == 0) as u8 } @@ -4601,7 +4776,8 @@ pub fn _kortestz_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftli_mask8(a: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftli_mask8(a: __mmask8) -> __mmask8 { a.unbounded_shl(COUNT) } @@ -4612,7 +4788,8 @@ pub fn _kshiftli_mask8(a: __mmask8) -> __mmask8 { #[target_feature(enable = "avx512dq")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftri_mask8(a: __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftri_mask8(a: __mmask8) -> __mmask8 { a.unbounded_shr(COUNT) } @@ -4624,7 +4801,8 @@ pub fn _kshiftri_mask8(a: __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _ktest_mask16_u8(a: __mmask16, b: __mmask16, and_not: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _ktest_mask16_u8(a: __mmask16, b: __mmask16, and_not: *mut u8) -> u8 { *and_not = (_kandn_mask16(a, b) == 0) as u8; (_kand_mask16(a, b) == 0) as u8 } @@ -4637,7 +4815,8 @@ pub unsafe fn _ktest_mask16_u8(a: __mmask16, b: __mmask16, and_not: *mut u8) -> #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _ktest_mask8_u8(a: __mmask8, b: __mmask8, and_not: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _ktest_mask8_u8(a: __mmask8, b: __mmask8, and_not: *mut u8) -> u8 { *and_not = (_kandn_mask8(a, b) == 0) as u8; (_kand_mask8(a, b) == 0) as u8 } @@ -4649,7 +4828,8 @@ pub unsafe fn _ktest_mask8_u8(a: __mmask8, b: __mmask8, and_not: *mut u8) -> u8 #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { (_kandn_mask16(a, b) == 0) as u8 } @@ -4660,7 +4840,8 @@ pub fn _ktestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestc_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestc_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { (_kandn_mask8(a, b) == 0) as u8 } @@ -4671,7 +4852,8 @@ pub fn _ktestc_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { (_kand_mask16(a, b) == 0) as u8 } @@ -4682,7 +4864,8 @@ pub fn _ktestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _ktestz_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _ktestz_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { (_kand_mask8(a, b) == 0) as u8 } @@ -4692,7 +4875,8 @@ pub fn _ktestz_mask8_u8(a: __mmask8, b: __mmask8) -> u8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _load_mask8(mem_addr: *const __mmask8) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _load_mask8(mem_addr: *const __mmask8) -> __mmask8 { *mem_addr } @@ -4702,7 +4886,8 @@ pub unsafe fn _load_mask8(mem_addr: *const __mmask8) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _store_mask8(mem_addr: *mut __mmask8, a: __mmask8) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _store_mask8(mem_addr: *mut __mmask8, a: __mmask8) { *mem_addr = a; } @@ -4713,7 +4898,8 @@ pub unsafe fn _store_mask8(mem_addr: *mut __mmask8, a: __mmask8) { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_movepi32_mask(a: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movepi32_mask(a: __m128i) -> __mmask8 { let zero = _mm_setzero_si128(); _mm_cmplt_epi32_mask(a, zero) } @@ -4725,7 +4911,8 @@ pub fn _mm_movepi32_mask(a: __m128i) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_movepi32_mask(a: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movepi32_mask(a: __m256i) -> __mmask8 { let zero = _mm256_setzero_si256(); _mm256_cmplt_epi32_mask(a, zero) } @@ -4737,7 +4924,8 @@ pub fn _mm256_movepi32_mask(a: __m256i) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_movepi32_mask(a: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movepi32_mask(a: __m512i) -> __mmask16 { let zero = _mm512_setzero_si512(); _mm512_cmplt_epi32_mask(a, zero) } @@ -4749,7 +4937,8 @@ pub fn _mm512_movepi32_mask(a: __m512i) -> __mmask16 { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_movepi64_mask(a: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movepi64_mask(a: __m128i) -> __mmask8 { let zero = _mm_setzero_si128(); _mm_cmplt_epi64_mask(a, zero) } @@ -4761,7 +4950,8 @@ pub fn _mm_movepi64_mask(a: __m128i) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_movepi64_mask(a: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movepi64_mask(a: __m256i) -> __mmask8 { let zero = _mm256_setzero_si256(); _mm256_cmplt_epi64_mask(a, zero) } @@ -4773,7 +4963,8 @@ pub fn _mm256_movepi64_mask(a: __m256i) -> __mmask8 { #[inline] #[target_feature(enable = "avx512dq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_movepi64_mask(a: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movepi64_mask(a: __m512i) -> __mmask8 { let zero = _mm512_setzero_si512(); _mm512_cmplt_epi64_mask(a, zero) } @@ -4786,7 +4977,8 @@ pub fn _mm512_movepi64_mask(a: __m512i) -> __mmask8 { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmovm2d))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_movm_epi32(k: __mmask8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movm_epi32(k: __mmask8) -> __m128i { let ones = _mm_set1_epi32(-1); _mm_maskz_mov_epi32(k, ones) } @@ -4799,7 +4991,8 @@ pub fn _mm_movm_epi32(k: __mmask8) -> __m128i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmovm2d))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_movm_epi32(k: __mmask8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movm_epi32(k: __mmask8) -> __m256i { let ones = _mm256_set1_epi32(-1); _mm256_maskz_mov_epi32(k, ones) } @@ -4812,7 +5005,8 @@ pub fn _mm256_movm_epi32(k: __mmask8) -> __m256i { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vpmovm2d))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_movm_epi32(k: __mmask16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movm_epi32(k: __mmask16) -> __m512i { let ones = _mm512_set1_epi32(-1); _mm512_maskz_mov_epi32(k, ones) } @@ -4825,7 +5019,8 @@ pub fn _mm512_movm_epi32(k: __mmask16) -> __m512i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmovm2q))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm_movm_epi64(k: __mmask8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movm_epi64(k: __mmask8) -> __m128i { let ones = _mm_set1_epi64x(-1); _mm_maskz_mov_epi64(k, ones) } @@ -4838,7 +5033,8 @@ pub fn _mm_movm_epi64(k: __mmask8) -> __m128i { #[target_feature(enable = "avx512dq,avx512vl")] #[cfg_attr(test, assert_instr(vpmovm2q))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_movm_epi64(k: __mmask8) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_movm_epi64(k: __mmask8) -> __m256i { let ones = _mm256_set1_epi64x(-1); _mm256_maskz_mov_epi64(k, ones) } @@ -4851,7 +5047,8 @@ pub fn _mm256_movm_epi64(k: __mmask8) -> __m256i { #[target_feature(enable = "avx512dq")] #[cfg_attr(test, assert_instr(vpmovm2q))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_movm_epi64(k: __mmask8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movm_epi64(k: __mmask8) -> __m512i { let ones = _mm512_set1_epi64(-1); _mm512_maskz_mov_epi64(k, ones) } @@ -7203,6 +7400,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { use super::*; + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; @@ -7226,7 +7424,7 @@ mod tests { const XOR_32: f32 = unsafe { transmute(0x66666666_u32) }; #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_and_pd() { + const fn test_mm_mask_and_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let src = _mm_set_pd(1., 2.); @@ -7236,7 +7434,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_and_pd() { + const fn test_mm_maskz_and_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let r = _mm_maskz_and_pd(0b01, a, b); @@ -7245,7 +7443,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_and_pd() { + const fn test_mm256_mask_and_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let src = _mm256_set_pd(1., 2., 3., 4.); @@ -7255,7 +7453,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_and_pd() { + const fn test_mm256_maskz_and_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let r = _mm256_maskz_and_pd(0b0101, a, b); @@ -7264,7 +7462,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_and_pd() { + const fn test_mm512_and_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_and_pd(a, b); @@ -7273,7 +7471,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_and_pd() { + const fn test_mm512_mask_and_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let src = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7283,7 +7481,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_and_pd() { + const fn test_mm512_maskz_and_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_maskz_and_pd(0b01010101, a, b); @@ -7292,7 +7490,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_and_ps() { + const fn test_mm_mask_and_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let src = _mm_set_ps(1., 2., 3., 4.); @@ -7302,7 +7500,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_and_ps() { + const fn test_mm_maskz_and_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let r = _mm_maskz_and_ps(0b0101, a, b); @@ -7311,7 +7509,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_and_ps() { + const fn test_mm256_mask_and_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let src = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7321,7 +7519,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_and_ps() { + const fn test_mm256_maskz_and_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let r = _mm256_maskz_and_ps(0b01010101, a, b); @@ -7330,7 +7528,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_and_ps() { + const fn test_mm512_and_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_and_ps(a, b); @@ -7339,7 +7537,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_and_ps() { + const fn test_mm512_mask_and_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let src = _mm512_set_ps( @@ -7354,7 +7552,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_and_ps() { + const fn test_mm512_maskz_and_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_maskz_and_ps(0b0101010101010101, a, b); @@ -7366,7 +7564,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_andnot_pd() { + const fn test_mm_mask_andnot_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let src = _mm_set_pd(1., 2.); @@ -7376,7 +7574,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_andnot_pd() { + const fn test_mm_maskz_andnot_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let r = _mm_maskz_andnot_pd(0b01, a, b); @@ -7385,7 +7583,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_andnot_pd() { + const fn test_mm256_mask_andnot_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let src = _mm256_set_pd(1., 2., 3., 4.); @@ -7395,7 +7593,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_andnot_pd() { + const fn test_mm256_maskz_andnot_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let r = _mm256_maskz_andnot_pd(0b0101, a, b); @@ -7404,7 +7602,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_andnot_pd() { + const fn test_mm512_andnot_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_andnot_pd(a, b); @@ -7413,7 +7611,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_andnot_pd() { + const fn test_mm512_mask_andnot_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let src = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7423,7 +7621,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_andnot_pd() { + const fn test_mm512_maskz_andnot_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_maskz_andnot_pd(0b01010101, a, b); @@ -7432,7 +7630,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_andnot_ps() { + const fn test_mm_mask_andnot_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let src = _mm_set_ps(1., 2., 3., 4.); @@ -7442,7 +7640,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_andnot_ps() { + const fn test_mm_maskz_andnot_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let r = _mm_maskz_andnot_ps(0b0101, a, b); @@ -7451,7 +7649,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_andnot_ps() { + const fn test_mm256_mask_andnot_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let src = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7461,7 +7659,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_andnot_ps() { + const fn test_mm256_maskz_andnot_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let r = _mm256_maskz_andnot_ps(0b01010101, a, b); @@ -7470,7 +7668,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_andnot_ps() { + const fn test_mm512_andnot_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_andnot_ps(a, b); @@ -7479,7 +7677,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_andnot_ps() { + const fn test_mm512_mask_andnot_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let src = _mm512_set_ps( @@ -7494,7 +7692,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_andnot_ps() { + const fn test_mm512_maskz_andnot_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_maskz_andnot_ps(0b0101010101010101, a, b); @@ -7506,7 +7704,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_or_pd() { + const fn test_mm_mask_or_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let src = _mm_set_pd(1., 2.); @@ -7516,7 +7714,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_or_pd() { + const fn test_mm_maskz_or_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let r = _mm_maskz_or_pd(0b01, a, b); @@ -7525,7 +7723,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_or_pd() { + const fn test_mm256_mask_or_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let src = _mm256_set_pd(1., 2., 3., 4.); @@ -7535,7 +7733,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_or_pd() { + const fn test_mm256_maskz_or_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let r = _mm256_maskz_or_pd(0b0101, a, b); @@ -7544,7 +7742,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_or_pd() { + const fn test_mm512_or_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_or_pd(a, b); @@ -7553,7 +7751,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_or_pd() { + const fn test_mm512_mask_or_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let src = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7563,7 +7761,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_or_pd() { + const fn test_mm512_maskz_or_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_maskz_or_pd(0b01010101, a, b); @@ -7572,7 +7770,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_or_ps() { + const fn test_mm_mask_or_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let src = _mm_set_ps(1., 2., 3., 4.); @@ -7582,7 +7780,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_or_ps() { + const fn test_mm_maskz_or_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let r = _mm_maskz_or_ps(0b0101, a, b); @@ -7591,7 +7789,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_or_ps() { + const fn test_mm256_mask_or_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let src = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7601,7 +7799,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_or_ps() { + const fn test_mm256_maskz_or_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let r = _mm256_maskz_or_ps(0b01010101, a, b); @@ -7610,7 +7808,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_or_ps() { + const fn test_mm512_or_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_or_ps(a, b); @@ -7619,7 +7817,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_or_ps() { + const fn test_mm512_mask_or_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let src = _mm512_set_ps( @@ -7634,7 +7832,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_or_ps() { + const fn test_mm512_maskz_or_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_maskz_or_ps(0b0101010101010101, a, b); @@ -7645,7 +7843,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_xor_pd() { + const fn test_mm_mask_xor_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let src = _mm_set_pd(1., 2.); @@ -7655,7 +7853,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_xor_pd() { + const fn test_mm_maskz_xor_pd() { let a = _mm_set1_pd(OPRND1_64); let b = _mm_set1_pd(OPRND2_64); let r = _mm_maskz_xor_pd(0b01, a, b); @@ -7664,7 +7862,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_xor_pd() { + const fn test_mm256_mask_xor_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let src = _mm256_set_pd(1., 2., 3., 4.); @@ -7674,7 +7872,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_xor_pd() { + const fn test_mm256_maskz_xor_pd() { let a = _mm256_set1_pd(OPRND1_64); let b = _mm256_set1_pd(OPRND2_64); let r = _mm256_maskz_xor_pd(0b0101, a, b); @@ -7683,7 +7881,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_xor_pd() { + const fn test_mm512_xor_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_xor_pd(a, b); @@ -7692,7 +7890,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_xor_pd() { + const fn test_mm512_mask_xor_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let src = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7702,7 +7900,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_xor_pd() { + const fn test_mm512_maskz_xor_pd() { let a = _mm512_set1_pd(OPRND1_64); let b = _mm512_set1_pd(OPRND2_64); let r = _mm512_maskz_xor_pd(0b01010101, a, b); @@ -7711,7 +7909,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_xor_ps() { + const fn test_mm_mask_xor_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let src = _mm_set_ps(1., 2., 3., 4.); @@ -7721,7 +7919,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_xor_ps() { + const fn test_mm_maskz_xor_ps() { let a = _mm_set1_ps(OPRND1_32); let b = _mm_set1_ps(OPRND2_32); let r = _mm_maskz_xor_ps(0b0101, a, b); @@ -7730,7 +7928,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_xor_ps() { + const fn test_mm256_mask_xor_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let src = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -7740,7 +7938,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_xor_ps() { + const fn test_mm256_maskz_xor_ps() { let a = _mm256_set1_ps(OPRND1_32); let b = _mm256_set1_ps(OPRND2_32); let r = _mm256_maskz_xor_ps(0b01010101, a, b); @@ -7749,7 +7947,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_xor_ps() { + const fn test_mm512_xor_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_xor_ps(a, b); @@ -7758,7 +7956,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_xor_ps() { + const fn test_mm512_mask_xor_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let src = _mm512_set_ps( @@ -7773,7 +7971,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_xor_ps() { + const fn test_mm512_maskz_xor_ps() { let a = _mm512_set1_ps(OPRND1_32); let b = _mm512_set1_ps(OPRND2_32); let r = _mm512_maskz_xor_ps(0b0101010101010101, a, b); @@ -7785,7 +7983,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_broadcast_f32x2() { + const fn test_mm256_broadcast_f32x2() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_broadcast_f32x2(a); let e = _mm256_set_ps(3., 4., 3., 4., 3., 4., 3., 4.); @@ -7793,7 +7991,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_broadcast_f32x2() { + const fn test_mm256_mask_broadcast_f32x2() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm256_set_ps(5., 6., 7., 8., 9., 10., 11., 12.); let r = _mm256_mask_broadcast_f32x2(b, 0b01101001, a); @@ -7802,7 +8000,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_broadcast_f32x2() { + const fn test_mm256_maskz_broadcast_f32x2() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_maskz_broadcast_f32x2(0b01101001, a); let e = _mm256_set_ps(0., 4., 3., 0., 3., 0., 0., 4.); @@ -7810,7 +8008,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_broadcast_f32x2() { + const fn test_mm512_broadcast_f32x2() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm512_broadcast_f32x2(a); let e = _mm512_set_ps( @@ -7820,7 +8018,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_broadcast_f32x2() { + const fn test_mm512_mask_broadcast_f32x2() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm512_set_ps( 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., @@ -7833,7 +8031,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_broadcast_f32x2() { + const fn test_mm512_maskz_broadcast_f32x2() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm512_maskz_broadcast_f32x2(0b0110100100111100, a); let e = _mm512_set_ps( @@ -7843,7 +8041,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_broadcast_f32x8() { + const fn test_mm512_broadcast_f32x8() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_broadcast_f32x8(a); let e = _mm512_set_ps( @@ -7853,7 +8051,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_broadcast_f32x8() { + const fn test_mm512_mask_broadcast_f32x8() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_ps( 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., @@ -7866,7 +8064,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_broadcast_f32x8() { + const fn test_mm512_maskz_broadcast_f32x8() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_broadcast_f32x8(0b0110100100111100, a); let e = _mm512_set_ps( @@ -7876,7 +8074,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_broadcast_f64x2() { + const fn test_mm256_broadcast_f64x2() { let a = _mm_set_pd(1., 2.); let r = _mm256_broadcast_f64x2(a); let e = _mm256_set_pd(1., 2., 1., 2.); @@ -7884,7 +8082,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_broadcast_f64x2() { + const fn test_mm256_mask_broadcast_f64x2() { let a = _mm_set_pd(1., 2.); let b = _mm256_set_pd(3., 4., 5., 6.); let r = _mm256_mask_broadcast_f64x2(b, 0b0110, a); @@ -7893,7 +8091,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_broadcast_f64x2() { + const fn test_mm256_maskz_broadcast_f64x2() { let a = _mm_set_pd(1., 2.); let r = _mm256_maskz_broadcast_f64x2(0b0110, a); let e = _mm256_set_pd(0., 2., 1., 0.); @@ -7901,7 +8099,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_broadcast_f64x2() { + const fn test_mm512_broadcast_f64x2() { let a = _mm_set_pd(1., 2.); let r = _mm512_broadcast_f64x2(a); let e = _mm512_set_pd(1., 2., 1., 2., 1., 2., 1., 2.); @@ -7909,7 +8107,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_broadcast_f64x2() { + const fn test_mm512_mask_broadcast_f64x2() { let a = _mm_set_pd(1., 2.); let b = _mm512_set_pd(3., 4., 5., 6., 7., 8., 9., 10.); let r = _mm512_mask_broadcast_f64x2(b, 0b01101001, a); @@ -7918,7 +8116,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_broadcast_f64x2() { + const fn test_mm512_maskz_broadcast_f64x2() { let a = _mm_set_pd(1., 2.); let r = _mm512_maskz_broadcast_f64x2(0b01101001, a); let e = _mm512_set_pd(0., 2., 1., 0., 1., 0., 0., 2.); @@ -7926,7 +8124,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_broadcast_i32x2() { + const fn test_mm_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_broadcast_i32x2(a); let e = _mm_set_epi32(3, 4, 3, 4); @@ -7934,7 +8132,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_broadcast_i32x2() { + const fn test_mm_mask_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm_set_epi32(5, 6, 7, 8); let r = _mm_mask_broadcast_i32x2(b, 0b0110, a); @@ -7943,7 +8141,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_broadcast_i32x2() { + const fn test_mm_maskz_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_maskz_broadcast_i32x2(0b0110, a); let e = _mm_set_epi32(0, 4, 3, 0); @@ -7951,7 +8149,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_broadcast_i32x2() { + const fn test_mm256_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm256_broadcast_i32x2(a); let e = _mm256_set_epi32(3, 4, 3, 4, 3, 4, 3, 4); @@ -7959,7 +8157,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_broadcast_i32x2() { + const fn test_mm256_mask_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm256_set_epi32(5, 6, 7, 8, 9, 10, 11, 12); let r = _mm256_mask_broadcast_i32x2(b, 0b01101001, a); @@ -7968,7 +8166,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_broadcast_i32x2() { + const fn test_mm256_maskz_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm256_maskz_broadcast_i32x2(0b01101001, a); let e = _mm256_set_epi32(0, 4, 3, 0, 3, 0, 0, 4); @@ -7976,7 +8174,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_broadcast_i32x2() { + const fn test_mm512_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm512_broadcast_i32x2(a); let e = _mm512_set_epi32(3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4); @@ -7984,7 +8182,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_broadcast_i32x2() { + const fn test_mm512_mask_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm512_set_epi32(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20); let r = _mm512_mask_broadcast_i32x2(b, 0b0110100100111100, a); @@ -7993,7 +8191,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_broadcast_i32x2() { + const fn test_mm512_maskz_broadcast_i32x2() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm512_maskz_broadcast_i32x2(0b0110100100111100, a); let e = _mm512_set_epi32(0, 4, 3, 0, 3, 0, 0, 4, 0, 0, 3, 4, 3, 4, 0, 0); @@ -8001,7 +8199,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_broadcast_i32x8() { + const fn test_mm512_broadcast_i32x8() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_broadcast_i32x8(a); let e = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8); @@ -8009,7 +8207,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_broadcast_i32x8() { + const fn test_mm512_mask_broadcast_i32x8() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi32( 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -8020,7 +8218,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_broadcast_i32x8() { + const fn test_mm512_maskz_broadcast_i32x8() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_broadcast_i32x8(0b0110100100111100, a); let e = _mm512_set_epi32(0, 2, 3, 0, 5, 0, 0, 8, 0, 0, 3, 4, 5, 6, 0, 0); @@ -8028,7 +8226,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_broadcast_i64x2() { + const fn test_mm256_broadcast_i64x2() { let a = _mm_set_epi64x(1, 2); let r = _mm256_broadcast_i64x2(a); let e = _mm256_set_epi64x(1, 2, 1, 2); @@ -8036,7 +8234,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_broadcast_i64x2() { + const fn test_mm256_mask_broadcast_i64x2() { let a = _mm_set_epi64x(1, 2); let b = _mm256_set_epi64x(3, 4, 5, 6); let r = _mm256_mask_broadcast_i64x2(b, 0b0110, a); @@ -8045,7 +8243,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_broadcast_i64x2() { + const fn test_mm256_maskz_broadcast_i64x2() { let a = _mm_set_epi64x(1, 2); let r = _mm256_maskz_broadcast_i64x2(0b0110, a); let e = _mm256_set_epi64x(0, 2, 1, 0); @@ -8053,7 +8251,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_broadcast_i64x2() { + const fn test_mm512_broadcast_i64x2() { let a = _mm_set_epi64x(1, 2); let r = _mm512_broadcast_i64x2(a); let e = _mm512_set_epi64(1, 2, 1, 2, 1, 2, 1, 2); @@ -8061,7 +8259,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_broadcast_i64x2() { + const fn test_mm512_mask_broadcast_i64x2() { let a = _mm_set_epi64x(1, 2); let b = _mm512_set_epi64(3, 4, 5, 6, 7, 8, 9, 10); let r = _mm512_mask_broadcast_i64x2(b, 0b01101001, a); @@ -8070,7 +8268,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_broadcast_i64x2() { + const fn test_mm512_maskz_broadcast_i64x2() { let a = _mm_set_epi64x(1, 2); let r = _mm512_maskz_broadcast_i64x2(0b01101001, a); let e = _mm512_set_epi64(0, 2, 1, 0, 1, 0, 0, 2); @@ -8078,7 +8276,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_extractf32x8_ps() { + const fn test_mm512_extractf32x8_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -8088,7 +8286,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_extractf32x8_ps() { + const fn test_mm512_mask_extractf32x8_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -8099,7 +8297,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_extractf32x8_ps() { + const fn test_mm512_maskz_extractf32x8_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -8109,7 +8307,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_extractf64x2_pd() { + const fn test_mm256_extractf64x2_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_extractf64x2_pd::<1>(a); let e = _mm_set_pd(1., 2.); @@ -8117,7 +8315,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_extractf64x2_pd() { + const fn test_mm256_mask_extractf64x2_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm_set_pd(5., 6.); let r = _mm256_mask_extractf64x2_pd::<1>(b, 0b01, a); @@ -8126,7 +8324,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_extractf64x2_pd() { + const fn test_mm256_maskz_extractf64x2_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_maskz_extractf64x2_pd::<1>(0b01, a); let e = _mm_set_pd(0., 2.); @@ -8134,7 +8332,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_extractf64x2_pd() { + const fn test_mm512_extractf64x2_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_extractf64x2_pd::<2>(a); let e = _mm_set_pd(3., 4.); @@ -8142,7 +8340,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_extractf64x2_pd() { + const fn test_mm512_mask_extractf64x2_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_pd(9., 10.); let r = _mm512_mask_extractf64x2_pd::<2>(b, 0b01, a); @@ -8151,7 +8349,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_extractf64x2_pd() { + const fn test_mm512_maskz_extractf64x2_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_extractf64x2_pd::<2>(0b01, a); let e = _mm_set_pd(0., 4.); @@ -8159,7 +8357,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_extracti32x8_epi32() { + const fn test_mm512_extracti32x8_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_extracti32x8_epi32::<1>(a); let e = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); @@ -8167,7 +8365,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_extracti32x8_epi32() { + const fn test_mm512_mask_extracti32x8_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_mask_extracti32x8_epi32::<1>(b, 0b01101001, a); @@ -8176,7 +8374,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_extracti32x8_epi32() { + const fn test_mm512_maskz_extracti32x8_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_extracti32x8_epi32::<1>(0b01101001, a); let e = _mm256_set_epi32(0, 2, 3, 0, 5, 0, 0, 8); @@ -8184,7 +8382,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_extracti64x2_epi64() { + const fn test_mm256_extracti64x2_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_extracti64x2_epi64::<1>(a); let e = _mm_set_epi64x(1, 2); @@ -8192,7 +8390,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_extracti64x2_epi64() { + const fn test_mm256_mask_extracti64x2_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm_set_epi64x(5, 6); let r = _mm256_mask_extracti64x2_epi64::<1>(b, 0b01, a); @@ -8201,7 +8399,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_extracti64x2_epi64() { + const fn test_mm256_maskz_extracti64x2_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_extracti64x2_epi64::<1>(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -8209,7 +8407,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_extracti64x2_epi64() { + const fn test_mm512_extracti64x2_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_extracti64x2_epi64::<2>(a); let e = _mm_set_epi64x(3, 4); @@ -8217,7 +8415,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_extracti64x2_epi64() { + const fn test_mm512_mask_extracti64x2_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi64x(9, 10); let r = _mm512_mask_extracti64x2_epi64::<2>(b, 0b01, a); @@ -8226,7 +8424,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_extracti64x2_epi64() { + const fn test_mm512_maskz_extracti64x2_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_extracti64x2_epi64::<2>(0b01, a); let e = _mm_set_epi64x(0, 4); @@ -8234,7 +8432,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_insertf32x8() { + const fn test_mm512_insertf32x8() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -8247,7 +8445,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_insertf32x8() { + const fn test_mm512_mask_insertf32x8() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -8263,7 +8461,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_insertf32x8() { + const fn test_mm512_maskz_insertf32x8() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -8276,7 +8474,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_insertf64x2() { + const fn test_mm256_insertf64x2() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm_set_pd(5., 6.); let r = _mm256_insertf64x2::<1>(a, b); @@ -8285,7 +8483,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_insertf64x2() { + const fn test_mm256_mask_insertf64x2() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm_set_pd(5., 6.); let src = _mm256_set_pd(7., 8., 9., 10.); @@ -8295,7 +8493,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_insertf64x2() { + const fn test_mm256_maskz_insertf64x2() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm_set_pd(5., 6.); let r = _mm256_maskz_insertf64x2::<1>(0b0110, a, b); @@ -8304,7 +8502,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_insertf64x2() { + const fn test_mm512_insertf64x2() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_pd(9., 10.); let r = _mm512_insertf64x2::<2>(a, b); @@ -8313,7 +8511,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_insertf64x2() { + const fn test_mm512_mask_insertf64x2() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_pd(9., 10.); let src = _mm512_set_pd(11., 12., 13., 14., 15., 16., 17., 18.); @@ -8323,7 +8521,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_insertf64x2() { + const fn test_mm512_maskz_insertf64x2() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_pd(9., 10.); let r = _mm512_maskz_insertf64x2::<2>(0b01101001, a, b); @@ -8332,7 +8530,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_inserti32x8() { + const fn test_mm512_inserti32x8() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_inserti32x8::<1>(a, b); @@ -8343,7 +8541,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_inserti32x8() { + const fn test_mm512_mask_inserti32x8() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let src = _mm512_set_epi32( @@ -8357,7 +8555,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_inserti32x8() { + const fn test_mm512_maskz_inserti32x8() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_maskz_inserti32x8::<1>(0b0110100100111100, a, b); @@ -8366,7 +8564,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_inserti64x2() { + const fn test_mm256_inserti64x2() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm_set_epi64x(5, 6); let r = _mm256_inserti64x2::<1>(a, b); @@ -8375,7 +8573,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_inserti64x2() { + const fn test_mm256_mask_inserti64x2() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm_set_epi64x(5, 6); let src = _mm256_set_epi64x(7, 8, 9, 10); @@ -8385,7 +8583,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_inserti64x2() { + const fn test_mm256_maskz_inserti64x2() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm_set_epi64x(5, 6); let r = _mm256_maskz_inserti64x2::<1>(0b0110, a, b); @@ -8394,7 +8592,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_inserti64x2() { + const fn test_mm512_inserti64x2() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi64x(9, 10); let r = _mm512_inserti64x2::<2>(a, b); @@ -8403,7 +8601,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_inserti64x2() { + const fn test_mm512_mask_inserti64x2() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi64x(9, 10); let src = _mm512_set_epi64(11, 12, 13, 14, 15, 16, 17, 18); @@ -8413,7 +8611,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_inserti64x2() { + const fn test_mm512_maskz_inserti64x2() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi64x(9, 10); let r = _mm512_maskz_inserti64x2::<2>(0b01101001, a, b); @@ -8422,7 +8620,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundepi64_pd() { + fn test_mm512_cvt_roundepi64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvt_roundepi64_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8430,7 +8628,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundepi64_pd() { + fn test_mm512_mask_cvt_roundepi64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_pd(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvt_roundepi64_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -8441,7 +8639,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundepi64_pd() { + fn test_mm512_maskz_cvt_roundepi64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvt_roundepi64_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -8451,7 +8649,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtepi64_pd() { + fn test_mm_cvtepi64_pd() { let a = _mm_set_epi64x(1, 2); let r = _mm_cvtepi64_pd(a); let e = _mm_set_pd(1., 2.); @@ -8459,7 +8657,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtepi64_pd() { + fn test_mm_mask_cvtepi64_pd() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_pd(3., 4.); let r = _mm_mask_cvtepi64_pd(b, 0b01, a); @@ -8468,7 +8666,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtepi64_pd() { + fn test_mm_maskz_cvtepi64_pd() { let a = _mm_set_epi64x(1, 2); let r = _mm_maskz_cvtepi64_pd(0b01, a); let e = _mm_set_pd(0., 2.); @@ -8476,7 +8674,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtepi64_pd() { + fn test_mm256_cvtepi64_pd() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepi64_pd(a); let e = _mm256_set_pd(1., 2., 3., 4.); @@ -8484,7 +8682,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtepi64_pd() { + fn test_mm256_mask_cvtepi64_pd() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_pd(5., 6., 7., 8.); let r = _mm256_mask_cvtepi64_pd(b, 0b0110, a); @@ -8493,7 +8691,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi64_pd() { + fn test_mm256_maskz_cvtepi64_pd() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepi64_pd(0b0110, a); let e = _mm256_set_pd(0., 2., 3., 0.); @@ -8501,7 +8699,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtepi64_pd() { + fn test_mm512_cvtepi64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvtepi64_pd(a); let e = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8509,7 +8707,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtepi64_pd() { + fn test_mm512_mask_cvtepi64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_pd(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvtepi64_pd(b, 0b01101001, a); @@ -8518,7 +8716,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtepi64_pd() { + fn test_mm512_maskz_cvtepi64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvtepi64_pd(0b01101001, a); let e = _mm512_set_pd(0., 2., 3., 0., 5., 0., 0., 8.); @@ -8526,7 +8724,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundepi64_ps() { + fn test_mm512_cvt_roundepi64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvt_roundepi64_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8534,7 +8732,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundepi64_ps() { + fn test_mm512_mask_cvt_roundepi64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvt_roundepi64_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -8545,7 +8743,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundepi64_ps() { + fn test_mm512_maskz_cvt_roundepi64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvt_roundepi64_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -8555,7 +8753,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtepi64_ps() { + fn test_mm_cvtepi64_ps() { let a = _mm_set_epi64x(1, 2); let r = _mm_cvtepi64_ps(a); let e = _mm_set_ps(0., 0., 1., 2.); @@ -8563,7 +8761,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtepi64_ps() { + fn test_mm_mask_cvtepi64_ps() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_ps(3., 4., 5., 6.); let r = _mm_mask_cvtepi64_ps(b, 0b01, a); @@ -8572,7 +8770,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtepi64_ps() { + fn test_mm_maskz_cvtepi64_ps() { let a = _mm_set_epi64x(1, 2); let r = _mm_maskz_cvtepi64_ps(0b01, a); let e = _mm_set_ps(0., 0., 0., 2.); @@ -8580,7 +8778,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtepi64_ps() { + fn test_mm256_cvtepi64_ps() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepi64_ps(a); let e = _mm_set_ps(1., 2., 3., 4.); @@ -8588,7 +8786,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtepi64_ps() { + fn test_mm256_mask_cvtepi64_ps() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm_set_ps(5., 6., 7., 8.); let r = _mm256_mask_cvtepi64_ps(b, 0b0110, a); @@ -8597,7 +8795,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi64_ps() { + fn test_mm256_maskz_cvtepi64_ps() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepi64_ps(0b0110, a); let e = _mm_set_ps(0., 2., 3., 0.); @@ -8605,7 +8803,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtepi64_ps() { + fn test_mm512_cvtepi64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvtepi64_ps(a); let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8613,7 +8811,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtepi64_ps() { + fn test_mm512_mask_cvtepi64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvtepi64_ps(b, 0b01101001, a); @@ -8622,7 +8820,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtepi64_ps() { + fn test_mm512_maskz_cvtepi64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvtepi64_ps(0b01101001, a); let e = _mm256_set_ps(0., 2., 3., 0., 5., 0., 0., 8.); @@ -8630,7 +8828,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundepu64_pd() { + fn test_mm512_cvt_roundepu64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvt_roundepu64_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8638,7 +8836,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundepu64_pd() { + fn test_mm512_mask_cvt_roundepu64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_pd(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvt_roundepu64_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -8649,7 +8847,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundepu64_pd() { + fn test_mm512_maskz_cvt_roundepu64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvt_roundepu64_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -8659,7 +8857,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtepu64_pd() { + fn test_mm_cvtepu64_pd() { let a = _mm_set_epi64x(1, 2); let r = _mm_cvtepu64_pd(a); let e = _mm_set_pd(1., 2.); @@ -8667,7 +8865,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtepu64_pd() { + fn test_mm_mask_cvtepu64_pd() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_pd(3., 4.); let r = _mm_mask_cvtepu64_pd(b, 0b01, a); @@ -8676,7 +8874,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtepu64_pd() { + fn test_mm_maskz_cvtepu64_pd() { let a = _mm_set_epi64x(1, 2); let r = _mm_maskz_cvtepu64_pd(0b01, a); let e = _mm_set_pd(0., 2.); @@ -8684,7 +8882,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtepu64_pd() { + fn test_mm256_cvtepu64_pd() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepu64_pd(a); let e = _mm256_set_pd(1., 2., 3., 4.); @@ -8692,7 +8890,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtepu64_pd() { + fn test_mm256_mask_cvtepu64_pd() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_pd(5., 6., 7., 8.); let r = _mm256_mask_cvtepu64_pd(b, 0b0110, a); @@ -8701,7 +8899,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu64_pd() { + fn test_mm256_maskz_cvtepu64_pd() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepu64_pd(0b0110, a); let e = _mm256_set_pd(0., 2., 3., 0.); @@ -8709,7 +8907,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtepu64_pd() { + fn test_mm512_cvtepu64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvtepu64_pd(a); let e = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8717,7 +8915,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtepu64_pd() { + fn test_mm512_mask_cvtepu64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_pd(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvtepu64_pd(b, 0b01101001, a); @@ -8726,7 +8924,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtepu64_pd() { + fn test_mm512_maskz_cvtepu64_pd() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvtepu64_pd(0b01101001, a); let e = _mm512_set_pd(0., 2., 3., 0., 5., 0., 0., 8.); @@ -8734,7 +8932,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundepu64_ps() { + fn test_mm512_cvt_roundepu64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvt_roundepu64_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8742,7 +8940,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundepu64_ps() { + fn test_mm512_mask_cvt_roundepu64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvt_roundepu64_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -8753,7 +8951,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundepu64_ps() { + fn test_mm512_maskz_cvt_roundepu64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvt_roundepu64_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -8763,7 +8961,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtepu64_ps() { + fn test_mm_cvtepu64_ps() { let a = _mm_set_epi64x(1, 2); let r = _mm_cvtepu64_ps(a); let e = _mm_set_ps(0., 0., 1., 2.); @@ -8771,7 +8969,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtepu64_ps() { + fn test_mm_mask_cvtepu64_ps() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_ps(3., 4., 5., 6.); let r = _mm_mask_cvtepu64_ps(b, 0b01, a); @@ -8780,7 +8978,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtepu64_ps() { + fn test_mm_maskz_cvtepu64_ps() { let a = _mm_set_epi64x(1, 2); let r = _mm_maskz_cvtepu64_ps(0b01, a); let e = _mm_set_ps(0., 0., 0., 2.); @@ -8788,7 +8986,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtepu64_ps() { + fn test_mm256_cvtepu64_ps() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepu64_ps(a); let e = _mm_set_ps(1., 2., 3., 4.); @@ -8796,7 +8994,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtepu64_ps() { + fn test_mm256_mask_cvtepu64_ps() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm_set_ps(5., 6., 7., 8.); let r = _mm256_mask_cvtepu64_ps(b, 0b0110, a); @@ -8805,7 +9003,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu64_ps() { + fn test_mm256_maskz_cvtepu64_ps() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepu64_ps(0b0110, a); let e = _mm_set_ps(0., 2., 3., 0.); @@ -8813,7 +9011,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtepu64_ps() { + fn test_mm512_cvtepu64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvtepu64_ps(a); let e = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); @@ -8821,7 +9019,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtepu64_ps() { + fn test_mm512_mask_cvtepu64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_ps(9., 10., 11., 12., 13., 14., 15., 16.); let r = _mm512_mask_cvtepu64_ps(b, 0b01101001, a); @@ -8830,7 +9028,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtepu64_ps() { + fn test_mm512_maskz_cvtepu64_ps() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvtepu64_ps(0b01101001, a); let e = _mm256_set_ps(0., 2., 3., 0., 5., 0., 0., 8.); @@ -8838,7 +9036,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundpd_epi64() { + fn test_mm512_cvt_roundpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvt_roundpd_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -8846,7 +9044,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundpd_epi64() { + fn test_mm512_mask_cvt_roundpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvt_roundpd_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -8857,7 +9055,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundpd_epi64() { + fn test_mm512_maskz_cvt_roundpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvt_roundpd_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -8867,7 +9065,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtpd_epi64() { + fn test_mm_cvtpd_epi64() { let a = _mm_set_pd(1., 2.); let r = _mm_cvtpd_epi64(a); let e = _mm_set_epi64x(1, 2); @@ -8875,7 +9073,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtpd_epi64() { + fn test_mm_mask_cvtpd_epi64() { let a = _mm_set_pd(1., 2.); let b = _mm_set_epi64x(3, 4); let r = _mm_mask_cvtpd_epi64(b, 0b01, a); @@ -8884,7 +9082,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtpd_epi64() { + fn test_mm_maskz_cvtpd_epi64() { let a = _mm_set_pd(1., 2.); let r = _mm_maskz_cvtpd_epi64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -8892,7 +9090,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtpd_epi64() { + fn test_mm256_cvtpd_epi64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_cvtpd_epi64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -8900,7 +9098,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtpd_epi64() { + fn test_mm256_mask_cvtpd_epi64() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvtpd_epi64(b, 0b0110, a); @@ -8909,7 +9107,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtpd_epi64() { + fn test_mm256_maskz_cvtpd_epi64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_maskz_cvtpd_epi64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -8917,7 +9115,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtpd_epi64() { + fn test_mm512_cvtpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtpd_epi64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -8925,7 +9123,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtpd_epi64() { + fn test_mm512_mask_cvtpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtpd_epi64(b, 0b01101001, a); @@ -8934,7 +9132,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtpd_epi64() { + fn test_mm512_maskz_cvtpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtpd_epi64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -8942,7 +9140,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundps_epi64() { + fn test_mm512_cvt_roundps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvt_roundps_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -8950,7 +9148,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundps_epi64() { + fn test_mm512_mask_cvt_roundps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvt_roundps_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -8961,7 +9159,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundps_epi64() { + fn test_mm512_maskz_cvt_roundps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvt_roundps_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -8971,7 +9169,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtps_epi64() { + fn test_mm_cvtps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_cvtps_epi64(a); let e = _mm_set_epi64x(3, 4); @@ -8979,7 +9177,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtps_epi64() { + fn test_mm_mask_cvtps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_epi64x(5, 6); let r = _mm_mask_cvtps_epi64(b, 0b01, a); @@ -8988,7 +9186,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtps_epi64() { + fn test_mm_maskz_cvtps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_maskz_cvtps_epi64(0b01, a); let e = _mm_set_epi64x(0, 4); @@ -8996,7 +9194,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtps_epi64() { + fn test_mm256_cvtps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_cvtps_epi64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9004,7 +9202,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtps_epi64() { + fn test_mm256_mask_cvtps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvtps_epi64(b, 0b0110, a); @@ -9013,7 +9211,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtps_epi64() { + fn test_mm256_maskz_cvtps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_maskz_cvtps_epi64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9021,7 +9219,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtps_epi64() { + fn test_mm512_cvtps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtps_epi64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9029,7 +9227,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtps_epi64() { + fn test_mm512_mask_cvtps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtps_epi64(b, 0b01101001, a); @@ -9038,7 +9236,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtps_epi64() { + fn test_mm512_maskz_cvtps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtps_epi64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9046,7 +9244,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundpd_epu64() { + fn test_mm512_cvt_roundpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvt_roundpd_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9054,7 +9252,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundpd_epu64() { + fn test_mm512_mask_cvt_roundpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvt_roundpd_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -9065,7 +9263,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundpd_epu64() { + fn test_mm512_maskz_cvt_roundpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvt_roundpd_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -9075,7 +9273,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtpd_epu64() { + fn test_mm_cvtpd_epu64() { let a = _mm_set_pd(1., 2.); let r = _mm_cvtpd_epu64(a); let e = _mm_set_epi64x(1, 2); @@ -9083,7 +9281,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtpd_epu64() { + fn test_mm_mask_cvtpd_epu64() { let a = _mm_set_pd(1., 2.); let b = _mm_set_epi64x(3, 4); let r = _mm_mask_cvtpd_epu64(b, 0b01, a); @@ -9092,7 +9290,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtpd_epu64() { + fn test_mm_maskz_cvtpd_epu64() { let a = _mm_set_pd(1., 2.); let r = _mm_maskz_cvtpd_epu64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -9100,7 +9298,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtpd_epu64() { + fn test_mm256_cvtpd_epu64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_cvtpd_epu64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9108,7 +9306,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtpd_epu64() { + fn test_mm256_mask_cvtpd_epu64() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvtpd_epu64(b, 0b0110, a); @@ -9117,7 +9315,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtpd_epu64() { + fn test_mm256_maskz_cvtpd_epu64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_maskz_cvtpd_epu64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9125,7 +9323,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtpd_epu64() { + fn test_mm512_cvtpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtpd_epu64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9133,7 +9331,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtpd_epu64() { + fn test_mm512_mask_cvtpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtpd_epu64(b, 0b01101001, a); @@ -9142,7 +9340,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtpd_epu64() { + fn test_mm512_maskz_cvtpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtpd_epu64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9150,7 +9348,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvt_roundps_epu64() { + fn test_mm512_cvt_roundps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvt_roundps_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9158,7 +9356,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvt_roundps_epu64() { + fn test_mm512_mask_cvt_roundps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvt_roundps_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -9169,7 +9367,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvt_roundps_epu64() { + fn test_mm512_maskz_cvt_roundps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvt_roundps_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01101001, a, @@ -9179,7 +9377,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvtps_epu64() { + fn test_mm_cvtps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_cvtps_epu64(a); let e = _mm_set_epi64x(3, 4); @@ -9187,7 +9385,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvtps_epu64() { + fn test_mm_mask_cvtps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_epi64x(5, 6); let r = _mm_mask_cvtps_epu64(b, 0b01, a); @@ -9196,7 +9394,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvtps_epu64() { + fn test_mm_maskz_cvtps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_maskz_cvtps_epu64(0b01, a); let e = _mm_set_epi64x(0, 4); @@ -9204,7 +9402,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvtps_epu64() { + fn test_mm256_cvtps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_cvtps_epu64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9212,7 +9410,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvtps_epu64() { + fn test_mm256_mask_cvtps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvtps_epu64(b, 0b0110, a); @@ -9221,7 +9419,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvtps_epu64() { + fn test_mm256_maskz_cvtps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_maskz_cvtps_epu64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9229,7 +9427,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtps_epu64() { + fn test_mm512_cvtps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtps_epu64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9237,7 +9435,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtps_epu64() { + fn test_mm512_mask_cvtps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtps_epu64(b, 0b01101001, a); @@ -9246,7 +9444,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtps_epu64() { + fn test_mm512_maskz_cvtps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtps_epu64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9254,7 +9452,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtt_roundpd_epi64() { + fn test_mm512_cvtt_roundpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtt_roundpd_epi64::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9262,7 +9460,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtt_roundpd_epi64() { + fn test_mm512_mask_cvtt_roundpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtt_roundpd_epi64::<_MM_FROUND_NO_EXC>(b, 0b01101001, a); @@ -9271,7 +9469,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtt_roundpd_epi64() { + fn test_mm512_maskz_cvtt_roundpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtt_roundpd_epi64::<_MM_FROUND_NO_EXC>(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9279,7 +9477,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvttpd_epi64() { + fn test_mm_cvttpd_epi64() { let a = _mm_set_pd(1., 2.); let r = _mm_cvttpd_epi64(a); let e = _mm_set_epi64x(1, 2); @@ -9287,7 +9485,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvttpd_epi64() { + fn test_mm_mask_cvttpd_epi64() { let a = _mm_set_pd(1., 2.); let b = _mm_set_epi64x(3, 4); let r = _mm_mask_cvttpd_epi64(b, 0b01, a); @@ -9296,7 +9494,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvttpd_epi64() { + fn test_mm_maskz_cvttpd_epi64() { let a = _mm_set_pd(1., 2.); let r = _mm_maskz_cvttpd_epi64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -9304,7 +9502,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvttpd_epi64() { + fn test_mm256_cvttpd_epi64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_cvttpd_epi64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9312,7 +9510,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvttpd_epi64() { + fn test_mm256_mask_cvttpd_epi64() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvttpd_epi64(b, 0b0110, a); @@ -9321,7 +9519,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvttpd_epi64() { + fn test_mm256_maskz_cvttpd_epi64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_maskz_cvttpd_epi64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9329,7 +9527,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvttpd_epi64() { + fn test_mm512_cvttpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvttpd_epi64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9337,7 +9535,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvttpd_epi64() { + fn test_mm512_mask_cvttpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvttpd_epi64(b, 0b01101001, a); @@ -9346,7 +9544,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvttpd_epi64() { + fn test_mm512_maskz_cvttpd_epi64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvttpd_epi64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9354,7 +9552,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtt_roundps_epi64() { + fn test_mm512_cvtt_roundps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtt_roundps_epi64::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9362,7 +9560,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtt_roundps_epi64() { + fn test_mm512_mask_cvtt_roundps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtt_roundps_epi64::<_MM_FROUND_NO_EXC>(b, 0b01101001, a); @@ -9371,7 +9569,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtt_roundps_epi64() { + fn test_mm512_maskz_cvtt_roundps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtt_roundps_epi64::<_MM_FROUND_NO_EXC>(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9379,7 +9577,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvttps_epi64() { + fn test_mm_cvttps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_cvttps_epi64(a); let e = _mm_set_epi64x(3, 4); @@ -9387,7 +9585,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvttps_epi64() { + fn test_mm_mask_cvttps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_epi64x(5, 6); let r = _mm_mask_cvttps_epi64(b, 0b01, a); @@ -9396,7 +9594,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvttps_epi64() { + fn test_mm_maskz_cvttps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_maskz_cvttps_epi64(0b01, a); let e = _mm_set_epi64x(0, 4); @@ -9404,7 +9602,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvttps_epi64() { + fn test_mm256_cvttps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_cvttps_epi64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9412,7 +9610,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvttps_epi64() { + fn test_mm256_mask_cvttps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvttps_epi64(b, 0b0110, a); @@ -9421,7 +9619,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvttps_epi64() { + fn test_mm256_maskz_cvttps_epi64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_maskz_cvttps_epi64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9429,7 +9627,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvttps_epi64() { + fn test_mm512_cvttps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvttps_epi64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9437,7 +9635,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvttps_epi64() { + fn test_mm512_mask_cvttps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvttps_epi64(b, 0b01101001, a); @@ -9446,7 +9644,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvttps_epi64() { + fn test_mm512_maskz_cvttps_epi64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvttps_epi64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9454,7 +9652,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtt_roundpd_epu64() { + fn test_mm512_cvtt_roundpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtt_roundpd_epu64::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9462,7 +9660,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtt_roundpd_epu64() { + fn test_mm512_mask_cvtt_roundpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtt_roundpd_epu64::<_MM_FROUND_NO_EXC>(b, 0b01101001, a); @@ -9471,7 +9669,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtt_roundpd_epu64() { + fn test_mm512_maskz_cvtt_roundpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtt_roundpd_epu64::<_MM_FROUND_NO_EXC>(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9479,7 +9677,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvttpd_epu64() { + fn test_mm_cvttpd_epu64() { let a = _mm_set_pd(1., 2.); let r = _mm_cvttpd_epu64(a); let e = _mm_set_epi64x(1, 2); @@ -9487,7 +9685,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvttpd_epu64() { + fn test_mm_mask_cvttpd_epu64() { let a = _mm_set_pd(1., 2.); let b = _mm_set_epi64x(3, 4); let r = _mm_mask_cvttpd_epu64(b, 0b01, a); @@ -9496,7 +9694,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvttpd_epu64() { + fn test_mm_maskz_cvttpd_epu64() { let a = _mm_set_pd(1., 2.); let r = _mm_maskz_cvttpd_epu64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -9504,7 +9702,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvttpd_epu64() { + fn test_mm256_cvttpd_epu64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_cvttpd_epu64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9512,7 +9710,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvttpd_epu64() { + fn test_mm256_mask_cvttpd_epu64() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvttpd_epu64(b, 0b0110, a); @@ -9521,7 +9719,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvttpd_epu64() { + fn test_mm256_maskz_cvttpd_epu64() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_maskz_cvttpd_epu64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9529,7 +9727,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvttpd_epu64() { + fn test_mm512_cvttpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvttpd_epu64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9537,7 +9735,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvttpd_epu64() { + fn test_mm512_mask_cvttpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvttpd_epu64(b, 0b01101001, a); @@ -9546,7 +9744,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvttpd_epu64() { + fn test_mm512_maskz_cvttpd_epu64() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvttpd_epu64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9554,7 +9752,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvtt_roundps_epu64() { + fn test_mm512_cvtt_roundps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvtt_roundps_epu64::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9562,7 +9760,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvtt_roundps_epu64() { + fn test_mm512_mask_cvtt_roundps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvtt_roundps_epu64::<_MM_FROUND_NO_EXC>(b, 0b01101001, a); @@ -9571,7 +9769,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvtt_roundps_epu64() { + fn test_mm512_maskz_cvtt_roundps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvtt_roundps_epu64::<_MM_FROUND_NO_EXC>(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9579,7 +9777,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_cvttps_epu64() { + fn test_mm_cvttps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_cvttps_epu64(a); let e = _mm_set_epi64x(3, 4); @@ -9587,7 +9785,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_cvttps_epu64() { + fn test_mm_mask_cvttps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_epi64x(5, 6); let r = _mm_mask_cvttps_epu64(b, 0b01, a); @@ -9596,7 +9794,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_cvttps_epu64() { + fn test_mm_maskz_cvttps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_maskz_cvttps_epu64(0b01, a); let e = _mm_set_epi64x(0, 4); @@ -9604,7 +9802,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_cvttps_epu64() { + fn test_mm256_cvttps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_cvttps_epu64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -9612,7 +9810,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_cvttps_epu64() { + fn test_mm256_mask_cvttps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mask_cvttps_epu64(b, 0b0110, a); @@ -9621,7 +9819,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_cvttps_epu64() { + fn test_mm256_maskz_cvttps_epu64() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm256_maskz_cvttps_epu64(0b0110, a); let e = _mm256_set_epi64x(0, 2, 3, 0); @@ -9629,7 +9827,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_cvttps_epu64() { + fn test_mm512_cvttps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_cvttps_epu64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -9637,7 +9835,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_cvttps_epu64() { + fn test_mm512_mask_cvttps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_cvttps_epu64(b, 0b01101001, a); @@ -9646,7 +9844,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_cvttps_epu64() { + fn test_mm512_maskz_cvttps_epu64() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_cvttps_epu64(0b01101001, a); let e = _mm512_set_epi64(0, 2, 3, 0, 5, 0, 0, 8); @@ -9654,7 +9852,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mullo_epi64() { + const fn test_mm_mullo_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(3, 4); let r = _mm_mullo_epi64(a, b); @@ -9663,7 +9861,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_mullo_epi64() { + const fn test_mm_mask_mullo_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(3, 4); let c = _mm_set_epi64x(5, 6); @@ -9673,7 +9871,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_mullo_epi64() { + const fn test_mm_maskz_mullo_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(3, 4); let r = _mm_maskz_mullo_epi64(0b01, a, b); @@ -9682,7 +9880,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mullo_epi64() { + const fn test_mm256_mullo_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_mullo_epi64(a, b); @@ -9691,7 +9889,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_mullo_epi64() { + const fn test_mm256_mask_mullo_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(5, 6, 7, 8); let c = _mm256_set_epi64x(9, 10, 11, 12); @@ -9701,7 +9899,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_mullo_epi64() { + const fn test_mm256_maskz_mullo_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(5, 6, 7, 8); let r = _mm256_maskz_mullo_epi64(0b0110, a, b); @@ -9710,7 +9908,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mullo_epi64() { + const fn test_mm512_mullo_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mullo_epi64(a, b); @@ -9719,7 +9917,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_mullo_epi64() { + const fn test_mm512_mask_mullo_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let c = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); @@ -9729,7 +9927,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_mullo_epi64() { + const fn test_mm512_maskz_mullo_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_mullo_epi64(0b01101001, a, b); @@ -9738,7 +9936,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_cvtmask8_u32() { + const fn test_cvtmask8_u32() { let a: __mmask8 = 0b01101001; let r = _cvtmask8_u32(a); let e: u32 = 0b01101001; @@ -9746,7 +9944,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_cvtu32_mask8() { + const fn test_cvtu32_mask8() { let a: u32 = 0b01101001; let r = _cvtu32_mask8(a); let e: __mmask8 = 0b01101001; @@ -9754,7 +9952,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kadd_mask16() { + const fn test_kadd_mask16() { let a: __mmask16 = 27549; let b: __mmask16 = 23434; let r = _kadd_mask16(a, b); @@ -9763,7 +9961,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kadd_mask8() { + const fn test_kadd_mask8() { let a: __mmask8 = 98; let b: __mmask8 = 117; let r = _kadd_mask8(a, b); @@ -9772,7 +9970,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kand_mask8() { + const fn test_kand_mask8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110011; let r = _kand_mask8(a, b); @@ -9781,7 +9979,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kandn_mask8() { + const fn test_kandn_mask8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110011; let r = _kandn_mask8(a, b); @@ -9790,7 +9988,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_knot_mask8() { + const fn test_knot_mask8() { let a: __mmask8 = 0b01101001; let r = _knot_mask8(a); let e: __mmask8 = 0b10010110; @@ -9798,7 +9996,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kor_mask8() { + const fn test_kor_mask8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110011; let r = _kor_mask8(a, b); @@ -9807,7 +10005,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kxnor_mask8() { + const fn test_kxnor_mask8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110011; let r = _kxnor_mask8(a, b); @@ -9816,7 +10014,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kxor_mask8() { + const fn test_kxor_mask8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110011; let r = _kxor_mask8(a, b); @@ -9825,7 +10023,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kortest_mask8_u8() { + const unsafe fn test_kortest_mask8_u8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110110; let mut all_ones: u8 = 0; @@ -9835,7 +10033,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kortestc_mask8_u8() { + const fn test_kortestc_mask8_u8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110110; let r = _kortestc_mask8_u8(a, b); @@ -9843,7 +10041,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kortestz_mask8_u8() { + const fn test_kortestz_mask8_u8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10110110; let r = _kortestz_mask8_u8(a, b); @@ -9851,7 +10049,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kshiftli_mask8() { + const unsafe fn test_kshiftli_mask8() { let a: __mmask8 = 0b01101001; let r = _kshiftli_mask8::<3>(a); let e: __mmask8 = 0b01001000; @@ -9871,7 +10069,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_kshiftri_mask8() { + const fn test_kshiftri_mask8() { let a: __mmask8 = 0b10101001; let r = _kshiftri_mask8::<3>(a); let e: __mmask8 = 0b00010101; @@ -9891,7 +10089,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_ktest_mask8_u8() { + const unsafe fn test_ktest_mask8_u8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10010110; let mut and_not: u8 = 0; @@ -9901,7 +10099,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_ktestc_mask8_u8() { + const fn test_ktestc_mask8_u8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10010110; let r = _ktestc_mask8_u8(a, b); @@ -9909,7 +10107,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_ktestz_mask8_u8() { + const fn test_ktestz_mask8_u8() { let a: __mmask8 = 0b01101001; let b: __mmask8 = 0b10010110; let r = _ktestz_mask8_u8(a, b); @@ -9917,7 +10115,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_ktest_mask16_u8() { + const unsafe fn test_ktest_mask16_u8() { let a: __mmask16 = 0b0110100100111100; let b: __mmask16 = 0b1001011011000011; let mut and_not: u8 = 0; @@ -9927,7 +10125,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_ktestc_mask16_u8() { + const fn test_ktestc_mask16_u8() { let a: __mmask16 = 0b0110100100111100; let b: __mmask16 = 0b1001011011000011; let r = _ktestc_mask16_u8(a, b); @@ -9935,7 +10133,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_ktestz_mask16_u8() { + const fn test_ktestz_mask16_u8() { let a: __mmask16 = 0b0110100100111100; let b: __mmask16 = 0b1001011011000011; let r = _ktestz_mask16_u8(a, b); @@ -9943,7 +10141,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_load_mask8() { + const unsafe fn test_load_mask8() { let a: __mmask8 = 0b01101001; let r = _load_mask8(&a); let e: __mmask8 = 0b01101001; @@ -9951,7 +10149,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_store_mask8() { + const unsafe fn test_store_mask8() { let a: __mmask8 = 0b01101001; let mut r = 0; _store_mask8(&mut r, a); @@ -9960,7 +10158,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_movepi32_mask() { + const fn test_mm_movepi32_mask() { let a = _mm_set_epi32(0, -2, -3, 4); let r = _mm_movepi32_mask(a); let e = 0b0110; @@ -9968,7 +10166,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_movepi32_mask() { + const fn test_mm256_movepi32_mask() { let a = _mm256_set_epi32(0, -2, -3, 4, -5, 6, 7, -8); let r = _mm256_movepi32_mask(a); let e = 0b01101001; @@ -9976,7 +10174,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_movepi32_mask() { + const fn test_mm512_movepi32_mask() { let a = _mm512_set_epi32( 0, -2, -3, 4, -5, 6, 7, -8, 9, 10, -11, -12, -13, -14, 15, 16, ); @@ -9986,7 +10184,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_movepi64_mask() { + const fn test_mm_movepi64_mask() { let a = _mm_set_epi64x(0, -2); let r = _mm_movepi64_mask(a); let e = 0b01; @@ -9994,7 +10192,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_movepi64_mask() { + const fn test_mm256_movepi64_mask() { let a = _mm256_set_epi64x(0, -2, -3, 4); let r = _mm256_movepi64_mask(a); let e = 0b0110; @@ -10002,7 +10200,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_movepi64_mask() { + const fn test_mm512_movepi64_mask() { let a = _mm512_set_epi64(0, -2, -3, 4, -5, 6, 7, -8); let r = _mm512_movepi64_mask(a); let e = 0b01101001; @@ -10010,7 +10208,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_movm_epi32() { + const fn test_mm_movm_epi32() { let a = 0b0110; let r = _mm_movm_epi32(a); let e = _mm_set_epi32(0, -1, -1, 0); @@ -10018,7 +10216,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_movm_epi32() { + const fn test_mm256_movm_epi32() { let a = 0b01101001; let r = _mm256_movm_epi32(a); let e = _mm256_set_epi32(0, -1, -1, 0, -1, 0, 0, -1); @@ -10026,7 +10224,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_movm_epi32() { + const fn test_mm512_movm_epi32() { let a = 0b0110100100111100; let r = _mm512_movm_epi32(a); let e = _mm512_set_epi32(0, -1, -1, 0, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0); @@ -10034,7 +10232,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_movm_epi64() { + const fn test_mm_movm_epi64() { let a = 0b01; let r = _mm_movm_epi64(a); let e = _mm_set_epi64x(0, -1); @@ -10042,7 +10240,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_movm_epi64() { + const fn test_mm256_movm_epi64() { let a = 0b0110; let r = _mm256_movm_epi64(a); let e = _mm256_set_epi64x(0, -1, -1, 0); @@ -10050,7 +10248,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_movm_epi64() { + const fn test_mm512_movm_epi64() { let a = 0b01101001; let r = _mm512_movm_epi64(a); let e = _mm512_set_epi64(0, -1, -1, 0, -1, 0, 0, -1); @@ -10058,7 +10256,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_range_round_pd() { + fn test_mm512_range_round_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(2., 1., 4., 3., 6., 5., 8., 7.); let r = _mm512_range_round_pd::<0b0101, _MM_FROUND_NO_EXC>(a, b); @@ -10067,7 +10265,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_range_round_pd() { + fn test_mm512_mask_range_round_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(2., 1., 4., 3., 6., 5., 8., 7.); let c = _mm512_set_pd(9., 10., 11., 12., 13., 14., 15., 16.); @@ -10077,7 +10275,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_range_round_pd() { + fn test_mm512_maskz_range_round_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(2., 1., 4., 3., 6., 5., 8., 7.); let r = _mm512_maskz_range_round_pd::<0b0101, _MM_FROUND_NO_EXC>(0b01101001, a, b); @@ -10086,7 +10284,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_range_pd() { + fn test_mm_range_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(2., 1.); let r = _mm_range_pd::<0b0101>(a, b); @@ -10095,7 +10293,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_range_pd() { + fn test_mm_mask_range_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(2., 1.); let c = _mm_set_pd(3., 4.); @@ -10105,7 +10303,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_range_pd() { + fn test_mm_maskz_range_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(2., 1.); let r = _mm_maskz_range_pd::<0b0101>(0b01, a, b); @@ -10114,7 +10312,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_range_pd() { + fn test_mm256_range_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(2., 1., 4., 3.); let r = _mm256_range_pd::<0b0101>(a, b); @@ -10123,7 +10321,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_range_pd() { + fn test_mm256_mask_range_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(2., 1., 4., 3.); let c = _mm256_set_pd(5., 6., 7., 8.); @@ -10133,7 +10331,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_range_pd() { + fn test_mm256_maskz_range_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(2., 1., 4., 3.); let r = _mm256_maskz_range_pd::<0b0101>(0b0110, a, b); @@ -10142,7 +10340,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_range_pd() { + fn test_mm512_range_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(2., 1., 4., 3., 6., 5., 8., 7.); let r = _mm512_range_pd::<0b0101>(a, b); @@ -10151,7 +10349,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_range_pd() { + fn test_mm512_mask_range_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(2., 1., 4., 3., 6., 5., 8., 7.); let c = _mm512_set_pd(9., 10., 11., 12., 13., 14., 15., 16.); @@ -10161,7 +10359,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_range_pd() { + fn test_mm512_maskz_range_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(2., 1., 4., 3., 6., 5., 8., 7.); let r = _mm512_maskz_range_pd::<0b0101>(0b01101001, a, b); @@ -10170,7 +10368,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_range_round_ps() { + fn test_mm512_range_round_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -10185,7 +10383,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_range_round_ps() { + fn test_mm512_mask_range_round_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -10204,7 +10402,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_range_round_ps() { + fn test_mm512_maskz_range_round_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -10219,7 +10417,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_range_ps() { + fn test_mm_range_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(2., 1., 4., 3.); let r = _mm_range_ps::<0b0101>(a, b); @@ -10228,7 +10426,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_range_ps() { + fn test_mm_mask_range_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(2., 1., 4., 3.); let c = _mm_set_ps(5., 6., 7., 8.); @@ -10238,7 +10436,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_range_ps() { + fn test_mm_maskz_range_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(2., 1., 4., 3.); let r = _mm_maskz_range_ps::<0b0101>(0b0110, a, b); @@ -10247,7 +10445,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_range_ps() { + fn test_mm256_range_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(2., 1., 4., 3., 6., 5., 8., 7.); let r = _mm256_range_ps::<0b0101>(a, b); @@ -10256,7 +10454,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_range_ps() { + fn test_mm256_mask_range_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(2., 1., 4., 3., 6., 5., 8., 7.); let c = _mm256_set_ps(9., 10., 11., 12., 13., 14., 15., 16.); @@ -10266,7 +10464,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_range_ps() { + fn test_mm256_maskz_range_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(2., 1., 4., 3., 6., 5., 8., 7.); let r = _mm256_maskz_range_ps::<0b0101>(0b01101001, a, b); @@ -10275,7 +10473,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_range_ps() { + fn test_mm512_range_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -10290,7 +10488,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_range_ps() { + fn test_mm512_mask_range_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -10308,7 +10506,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_range_ps() { + fn test_mm512_maskz_range_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -10323,7 +10521,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_range_round_sd() { + fn test_mm_range_round_sd() { let a = _mm_set_sd(1.); let b = _mm_set_sd(2.); let r = _mm_range_round_sd::<0b0101, _MM_FROUND_NO_EXC>(a, b); @@ -10332,7 +10530,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_range_round_sd() { + fn test_mm_mask_range_round_sd() { let a = _mm_set_sd(1.); let b = _mm_set_sd(2.); let c = _mm_set_sd(3.); @@ -10342,7 +10540,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_range_round_sd() { + fn test_mm_maskz_range_round_sd() { let a = _mm_set_sd(1.); let b = _mm_set_sd(2.); let r = _mm_maskz_range_round_sd::<0b0101, _MM_FROUND_NO_EXC>(0b0, a, b); @@ -10351,7 +10549,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_range_sd() { + fn test_mm_mask_range_sd() { let a = _mm_set_sd(1.); let b = _mm_set_sd(2.); let c = _mm_set_sd(3.); @@ -10361,7 +10559,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_range_sd() { + fn test_mm_maskz_range_sd() { let a = _mm_set_sd(1.); let b = _mm_set_sd(2.); let r = _mm_maskz_range_sd::<0b0101>(0b0, a, b); @@ -10370,7 +10568,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_range_round_ss() { + fn test_mm_range_round_ss() { let a = _mm_set_ss(1.); let b = _mm_set_ss(2.); let r = _mm_range_round_ss::<0b0101, _MM_FROUND_NO_EXC>(a, b); @@ -10379,7 +10577,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_range_round_ss() { + fn test_mm_mask_range_round_ss() { let a = _mm_set_ss(1.); let b = _mm_set_ss(2.); let c = _mm_set_ss(3.); @@ -10389,7 +10587,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_range_round_ss() { + fn test_mm_maskz_range_round_ss() { let a = _mm_set_ss(1.); let b = _mm_set_ss(2.); let r = _mm_maskz_range_round_ss::<0b0101, _MM_FROUND_NO_EXC>(0b0, a, b); @@ -10398,7 +10596,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_range_ss() { + fn test_mm_mask_range_ss() { let a = _mm_set_ss(1.); let b = _mm_set_ss(2.); let c = _mm_set_ss(3.); @@ -10408,7 +10606,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_range_ss() { + fn test_mm_maskz_range_ss() { let a = _mm_set_ss(1.); let b = _mm_set_ss(2.); let r = _mm_maskz_range_ss::<0b0101>(0b0, a, b); @@ -10417,7 +10615,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_reduce_round_pd() { + fn test_mm512_reduce_round_pd() { let a = _mm512_set_pd(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let r = _mm512_reduce_round_pd::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>(a); let e = _mm512_set_pd(0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.); @@ -10425,7 +10623,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_reduce_round_pd() { + fn test_mm512_mask_reduce_round_pd() { let a = _mm512_set_pd(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let src = _mm512_set_pd(3., 4., 5., 6., 7., 8., 9., 10.); let r = _mm512_mask_reduce_round_pd::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>( @@ -10436,7 +10634,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_reduce_round_pd() { + fn test_mm512_maskz_reduce_round_pd() { let a = _mm512_set_pd(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let r = _mm512_maskz_reduce_round_pd::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>( 0b01101001, a, @@ -10446,7 +10644,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_reduce_pd() { + fn test_mm_reduce_pd() { let a = _mm_set_pd(0.25, 0.50); let r = _mm_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm_set_pd(0.25, 0.); @@ -10454,7 +10652,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_reduce_pd() { + fn test_mm_mask_reduce_pd() { let a = _mm_set_pd(0.25, 0.50); let src = _mm_set_pd(3., 4.); let r = _mm_mask_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b01, a); @@ -10463,7 +10661,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_reduce_pd() { + fn test_mm_maskz_reduce_pd() { let a = _mm_set_pd(0.25, 0.50); let r = _mm_maskz_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(0b01, a); let e = _mm_set_pd(0., 0.); @@ -10471,7 +10669,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_reduce_pd() { + fn test_mm256_reduce_pd() { let a = _mm256_set_pd(0.25, 0.50, 0.75, 1.0); let r = _mm256_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm256_set_pd(0.25, 0., 0.25, 0.); @@ -10479,7 +10677,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_reduce_pd() { + fn test_mm256_mask_reduce_pd() { let a = _mm256_set_pd(0.25, 0.50, 0.75, 1.0); let src = _mm256_set_pd(3., 4., 5., 6.); let r = _mm256_mask_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b0110, a); @@ -10488,7 +10686,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_reduce_pd() { + fn test_mm256_maskz_reduce_pd() { let a = _mm256_set_pd(0.25, 0.50, 0.75, 1.0); let r = _mm256_maskz_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(0b0110, a); let e = _mm256_set_pd(0., 0., 0.25, 0.); @@ -10496,7 +10694,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_reduce_pd() { + fn test_mm512_reduce_pd() { let a = _mm512_set_pd(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let r = _mm512_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm512_set_pd(0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.); @@ -10504,7 +10702,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_reduce_pd() { + fn test_mm512_mask_reduce_pd() { let a = _mm512_set_pd(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let src = _mm512_set_pd(3., 4., 5., 6., 7., 8., 9., 10.); let r = _mm512_mask_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b01101001, a); @@ -10513,7 +10711,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_reduce_pd() { + fn test_mm512_maskz_reduce_pd() { let a = _mm512_set_pd(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let r = _mm512_maskz_reduce_pd::<{ 16 | _MM_FROUND_TO_ZERO }>(0b01101001, a); let e = _mm512_set_pd(0., 0., 0.25, 0., 0.25, 0., 0., 0.); @@ -10521,7 +10719,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_reduce_round_ps() { + fn test_mm512_reduce_round_ps() { let a = _mm512_set_ps( 0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, 2.25, 2.50, 2.75, 3.0, 3.25, 3.50, 3.75, 4.0, @@ -10534,7 +10732,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_reduce_round_ps() { + fn test_mm512_mask_reduce_round_ps() { let a = _mm512_set_ps( 0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, 2.25, 2.50, 2.75, 3.0, 3.25, 3.50, 3.75, 4.0, @@ -10554,7 +10752,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_reduce_round_ps() { + fn test_mm512_maskz_reduce_round_ps() { let a = _mm512_set_ps( 0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, 2.25, 2.50, 2.75, 3.0, 3.25, 3.50, 3.75, 4.0, @@ -10570,7 +10768,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_reduce_ps() { + fn test_mm_reduce_ps() { let a = _mm_set_ps(0.25, 0.50, 0.75, 1.0); let r = _mm_reduce_ps::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm_set_ps(0.25, 0., 0.25, 0.); @@ -10578,7 +10776,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_reduce_ps() { + fn test_mm_mask_reduce_ps() { let a = _mm_set_ps(0.25, 0.50, 0.75, 1.0); let src = _mm_set_ps(2., 3., 4., 5.); let r = _mm_mask_reduce_ps::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b0110, a); @@ -10587,7 +10785,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_maskz_reduce_ps() { + fn test_mm_maskz_reduce_ps() { let a = _mm_set_ps(0.25, 0.50, 0.75, 1.0); let r = _mm_maskz_reduce_ps::<{ 16 | _MM_FROUND_TO_ZERO }>(0b0110, a); let e = _mm_set_ps(0., 0., 0.25, 0.); @@ -10595,7 +10793,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_reduce_ps() { + fn test_mm256_reduce_ps() { let a = _mm256_set_ps(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let r = _mm256_reduce_ps::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm256_set_ps(0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.); @@ -10603,7 +10801,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_reduce_ps() { + fn test_mm256_mask_reduce_ps() { let a = _mm256_set_ps(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let src = _mm256_set_ps(3., 4., 5., 6., 7., 8., 9., 10.); let r = _mm256_mask_reduce_ps::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b01101001, a); @@ -10612,7 +10810,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_maskz_reduce_ps() { + fn test_mm256_maskz_reduce_ps() { let a = _mm256_set_ps(0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0); let r = _mm256_maskz_reduce_ps::<{ 16 | _MM_FROUND_TO_ZERO }>(0b01101001, a); let e = _mm256_set_ps(0., 0., 0.25, 0., 0.25, 0., 0., 0.); @@ -10620,7 +10818,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_reduce_ps() { + fn test_mm512_reduce_ps() { let a = _mm512_set_ps( 0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, 2.25, 2.50, 2.75, 3.0, 3.25, 3.50, 3.75, 4.0, @@ -10633,7 +10831,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_reduce_ps() { + fn test_mm512_mask_reduce_ps() { let a = _mm512_set_ps( 0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, 2.25, 2.50, 2.75, 3.0, 3.25, 3.50, 3.75, 4.0, @@ -10649,7 +10847,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_maskz_reduce_ps() { + fn test_mm512_maskz_reduce_ps() { let a = _mm512_set_ps( 0.25, 0.50, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, 2.25, 2.50, 2.75, 3.0, 3.25, 3.50, 3.75, 4.0, @@ -10662,7 +10860,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_reduce_round_sd() { + fn test_mm_reduce_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_sd(0.25); let r = _mm_reduce_round_sd::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>(a, b); @@ -10671,7 +10869,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_reduce_round_sd() { + fn test_mm_mask_reduce_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_sd(0.25); let c = _mm_set_pd(3., 4.); @@ -10683,7 +10881,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_reduce_round_sd() { + fn test_mm_maskz_reduce_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_sd(0.25); let r = @@ -10693,7 +10891,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_reduce_sd() { + fn test_mm_reduce_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_sd(0.25); let r = _mm_reduce_sd::<{ 16 | _MM_FROUND_TO_ZERO }>(a, b); @@ -10702,7 +10900,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_reduce_sd() { + fn test_mm_mask_reduce_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_sd(0.25); let c = _mm_set_pd(3., 4.); @@ -10712,7 +10910,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_reduce_sd() { + fn test_mm_maskz_reduce_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_sd(0.25); let r = _mm_maskz_reduce_sd::<{ 16 | _MM_FROUND_TO_ZERO }>(0b0, a, b); @@ -10721,7 +10919,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_reduce_round_ss() { + fn test_mm_reduce_round_ss() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ss(0.25); let r = _mm_reduce_round_ss::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>(a, b); @@ -10730,7 +10928,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_reduce_round_ss() { + fn test_mm_mask_reduce_round_ss() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ss(0.25); let c = _mm_set_ps(5., 6., 7., 8.); @@ -10742,7 +10940,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_reduce_round_ss() { + fn test_mm_maskz_reduce_round_ss() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ss(0.25); let r = @@ -10752,7 +10950,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_reduce_ss() { + fn test_mm_reduce_ss() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ss(0.25); let r = _mm_reduce_ss::<{ 16 | _MM_FROUND_TO_ZERO }>(a, b); @@ -10761,7 +10959,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_reduce_ss() { + fn test_mm_mask_reduce_ss() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ss(0.25); let c = _mm_set_ps(5., 6., 7., 8.); @@ -10771,7 +10969,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_maskz_reduce_ss() { + fn test_mm_maskz_reduce_ss() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ss(0.25); let r = _mm_maskz_reduce_ss::<{ 16 | _MM_FROUND_TO_ZERO }>(0b0, a, b); @@ -10780,7 +10978,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_fpclass_pd_mask() { + fn test_mm_fpclass_pd_mask() { let a = _mm_set_pd(1., f64::INFINITY); let r = _mm_fpclass_pd_mask::<0x18>(a); let e = 0b01; @@ -10788,7 +10986,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_fpclass_pd_mask() { + fn test_mm_mask_fpclass_pd_mask() { let a = _mm_set_pd(1., f64::INFINITY); let r = _mm_mask_fpclass_pd_mask::<0x18>(0b10, a); let e = 0b00; @@ -10796,7 +10994,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_fpclass_pd_mask() { + fn test_mm256_fpclass_pd_mask() { let a = _mm256_set_pd(1., f64::INFINITY, f64::NEG_INFINITY, 0.0); let r = _mm256_fpclass_pd_mask::<0x18>(a); let e = 0b0110; @@ -10804,7 +11002,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_fpclass_pd_mask() { + fn test_mm256_mask_fpclass_pd_mask() { let a = _mm256_set_pd(1., f64::INFINITY, f64::NEG_INFINITY, 0.0); let r = _mm256_mask_fpclass_pd_mask::<0x18>(0b1010, a); let e = 0b0010; @@ -10812,7 +11010,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_fpclass_pd_mask() { + fn test_mm512_fpclass_pd_mask() { let a = _mm512_set_pd( 1., f64::INFINITY, @@ -10829,7 +11027,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_fpclass_pd_mask() { + fn test_mm512_mask_fpclass_pd_mask() { let a = _mm512_set_pd( 1., f64::INFINITY, @@ -10846,7 +11044,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_fpclass_ps_mask() { + fn test_mm_fpclass_ps_mask() { let a = _mm_set_ps(1., f32::INFINITY, f32::NEG_INFINITY, 0.0); let r = _mm_fpclass_ps_mask::<0x18>(a); let e = 0b0110; @@ -10854,7 +11052,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm_mask_fpclass_ps_mask() { + fn test_mm_mask_fpclass_ps_mask() { let a = _mm_set_ps(1., f32::INFINITY, f32::NEG_INFINITY, 0.0); let r = _mm_mask_fpclass_ps_mask::<0x18>(0b1010, a); let e = 0b0010; @@ -10862,7 +11060,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_fpclass_ps_mask() { + fn test_mm256_fpclass_ps_mask() { let a = _mm256_set_ps( 1., f32::INFINITY, @@ -10879,7 +11077,7 @@ mod tests { } #[simd_test(enable = "avx512dq,avx512vl")] - unsafe fn test_mm256_mask_fpclass_ps_mask() { + fn test_mm256_mask_fpclass_ps_mask() { let a = _mm256_set_ps( 1., f32::INFINITY, @@ -10896,7 +11094,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_fpclass_ps_mask() { + fn test_mm512_fpclass_ps_mask() { let a = _mm512_set_ps( 1., f32::INFINITY, @@ -10921,7 +11119,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm512_mask_fpclass_ps_mask() { + fn test_mm512_mask_fpclass_ps_mask() { let a = _mm512_set_ps( 1., f32::INFINITY, @@ -10946,7 +11144,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_fpclass_sd_mask() { + fn test_mm_fpclass_sd_mask() { let a = _mm_set_pd(1., f64::INFINITY); let r = _mm_fpclass_sd_mask::<0x18>(a); let e = 0b1; @@ -10954,7 +11152,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_fpclass_sd_mask() { + fn test_mm_mask_fpclass_sd_mask() { let a = _mm_set_sd(f64::INFINITY); let r = _mm_mask_fpclass_sd_mask::<0x18>(0b0, a); let e = 0b0; @@ -10962,7 +11160,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_fpclass_ss_mask() { + fn test_mm_fpclass_ss_mask() { let a = _mm_set_ss(f32::INFINITY); let r = _mm_fpclass_ss_mask::<0x18>(a); let e = 0b1; @@ -10970,7 +11168,7 @@ mod tests { } #[simd_test(enable = "avx512dq")] - unsafe fn test_mm_mask_fpclass_ss_mask() { + fn test_mm_mask_fpclass_ss_mask() { let a = _mm_set_ss(f32::INFINITY); let r = _mm_mask_fpclass_ss_mask::<0x18>(0b0, a); let e = 0b0; diff --git a/library/stdarch/crates/core_arch/src/x86/avx512f.rs b/library/stdarch/crates/core_arch/src/x86/avx512f.rs index f7bf9178dbb9..76b753938383 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512f.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512f.rs @@ -17,7 +17,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm512_abs_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_epi32(a: __m512i) -> __m512i { unsafe { let a = a.as_i32x16(); let r = simd_select::(simd_lt(a, i32x16::ZERO), simd_neg(a), a); @@ -34,7 +35,8 @@ pub fn _mm512_abs_epi32(a: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm512_mask_abs_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_abs_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, abs, src.as_i32x16())) @@ -50,7 +52,8 @@ pub fn _mm512_mask_abs_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, abs, i32x16::ZERO)) @@ -64,7 +67,8 @@ pub fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm256_mask_abs_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_abs_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, abs, src.as_i32x8())) @@ -78,7 +82,8 @@ pub fn _mm256_mask_abs_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm256_maskz_abs_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_abs_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, abs, i32x8::ZERO)) @@ -92,7 +97,8 @@ pub fn _mm256_maskz_abs_epi32(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm_mask_abs_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_abs_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, abs, src.as_i32x4())) @@ -106,7 +112,8 @@ pub fn _mm_mask_abs_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsd))] -pub fn _mm_maskz_abs_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_abs_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, abs, i32x4::ZERO)) @@ -120,7 +127,8 @@ pub fn _mm_maskz_abs_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm512_abs_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_epi64(a: __m512i) -> __m512i { unsafe { let a = a.as_i64x8(); let r = simd_select::(simd_lt(a, i64x8::ZERO), simd_neg(a), a); @@ -135,7 +143,8 @@ pub fn _mm512_abs_epi64(a: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm512_mask_abs_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_abs_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, abs, src.as_i64x8())) @@ -149,7 +158,8 @@ pub fn _mm512_mask_abs_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm512_maskz_abs_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_abs_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { let abs = _mm512_abs_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, abs, i64x8::ZERO)) @@ -163,7 +173,8 @@ pub fn _mm512_maskz_abs_epi64(k: __mmask8, a: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm256_abs_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_abs_epi64(a: __m256i) -> __m256i { unsafe { let a = a.as_i64x4(); let r = simd_select::(simd_lt(a, i64x4::ZERO), simd_neg(a), a); @@ -178,7 +189,8 @@ pub fn _mm256_abs_epi64(a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm256_mask_abs_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_abs_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, abs, src.as_i64x4())) @@ -192,7 +204,8 @@ pub fn _mm256_mask_abs_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm256_maskz_abs_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_abs_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { let abs = _mm256_abs_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, abs, i64x4::ZERO)) @@ -206,7 +219,8 @@ pub fn _mm256_maskz_abs_epi64(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm_abs_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_abs_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_i64x2(); let r = simd_select::(simd_lt(a, i64x2::ZERO), simd_neg(a), a); @@ -221,7 +235,8 @@ pub fn _mm_abs_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm_mask_abs_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_abs_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, abs, src.as_i64x2())) @@ -235,7 +250,8 @@ pub fn _mm_mask_abs_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpabsq))] -pub fn _mm_maskz_abs_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_abs_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let abs = _mm_abs_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, abs, i64x2::ZERO)) @@ -249,7 +265,8 @@ pub fn _mm_maskz_abs_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm512_abs_ps(v2: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_ps(v2: __m512) -> __m512 { unsafe { simd_fabs(v2) } } @@ -260,7 +277,8 @@ pub fn _mm512_abs_ps(v2: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm512_mask_abs_ps(src: __m512, k: __mmask16, v2: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_abs_ps(src: __m512, k: __mmask16, v2: __m512) -> __m512 { unsafe { simd_select_bitmask(k, simd_fabs(v2), src) } } @@ -271,7 +289,8 @@ pub fn _mm512_mask_abs_ps(src: __m512, k: __mmask16, v2: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm512_abs_pd(v2: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_pd(v2: __m512d) -> __m512d { unsafe { simd_fabs(v2) } } @@ -282,7 +301,8 @@ pub fn _mm512_abs_pd(v2: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm512_mask_abs_pd(src: __m512d, k: __mmask8, v2: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_abs_pd(src: __m512d, k: __mmask8, v2: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, simd_fabs(v2), src) } } @@ -293,7 +313,8 @@ pub fn _mm512_mask_abs_pd(src: __m512d, k: __mmask8, v2: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] -pub fn _mm512_mask_mov_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mov_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { unsafe { let mov = a.as_i32x16(); transmute(simd_select_bitmask(k, mov, src.as_i32x16())) @@ -307,7 +328,8 @@ pub fn _mm512_mask_mov_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] -pub fn _mm512_maskz_mov_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mov_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { let mov = a.as_i32x16(); transmute(simd_select_bitmask(k, mov, i32x16::ZERO)) @@ -321,7 +343,8 @@ pub fn _mm512_maskz_mov_epi32(k: __mmask16, a: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] -pub fn _mm256_mask_mov_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mov_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { let mov = a.as_i32x8(); transmute(simd_select_bitmask(k, mov, src.as_i32x8())) @@ -335,7 +358,8 @@ pub fn _mm256_mask_mov_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] -pub fn _mm256_maskz_mov_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mov_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { let mov = a.as_i32x8(); transmute(simd_select_bitmask(k, mov, i32x8::ZERO)) @@ -349,7 +373,8 @@ pub fn _mm256_maskz_mov_epi32(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] -pub fn _mm_mask_mov_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mov_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let mov = a.as_i32x4(); transmute(simd_select_bitmask(k, mov, src.as_i32x4())) @@ -363,7 +388,8 @@ pub fn _mm_mask_mov_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] -pub fn _mm_maskz_mov_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mov_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let mov = a.as_i32x4(); transmute(simd_select_bitmask(k, mov, i32x4::ZERO)) @@ -377,7 +403,8 @@ pub fn _mm_maskz_mov_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] -pub fn _mm512_mask_mov_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mov_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { unsafe { let mov = a.as_i64x8(); transmute(simd_select_bitmask(k, mov, src.as_i64x8())) @@ -391,7 +418,8 @@ pub fn _mm512_mask_mov_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] -pub fn _mm512_maskz_mov_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mov_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { let mov = a.as_i64x8(); transmute(simd_select_bitmask(k, mov, i64x8::ZERO)) @@ -405,7 +433,8 @@ pub fn _mm512_maskz_mov_epi64(k: __mmask8, a: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] -pub fn _mm256_mask_mov_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mov_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { let mov = a.as_i64x4(); transmute(simd_select_bitmask(k, mov, src.as_i64x4())) @@ -419,7 +448,8 @@ pub fn _mm256_mask_mov_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] -pub fn _mm256_maskz_mov_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mov_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { let mov = a.as_i64x4(); transmute(simd_select_bitmask(k, mov, i64x4::ZERO)) @@ -433,7 +463,8 @@ pub fn _mm256_maskz_mov_epi64(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] -pub fn _mm_mask_mov_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mov_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let mov = a.as_i64x2(); transmute(simd_select_bitmask(k, mov, src.as_i64x2())) @@ -447,7 +478,8 @@ pub fn _mm_mask_mov_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] -pub fn _mm_maskz_mov_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mov_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let mov = a.as_i64x2(); transmute(simd_select_bitmask(k, mov, i64x2::ZERO)) @@ -461,7 +493,8 @@ pub fn _mm_maskz_mov_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] -pub fn _mm512_mask_mov_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mov_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { unsafe { let mov = a.as_f32x16(); transmute(simd_select_bitmask(k, mov, src.as_f32x16())) @@ -475,7 +508,8 @@ pub fn _mm512_mask_mov_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] -pub fn _mm512_maskz_mov_ps(k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mov_ps(k: __mmask16, a: __m512) -> __m512 { unsafe { let mov = a.as_f32x16(); transmute(simd_select_bitmask(k, mov, f32x16::ZERO)) @@ -489,7 +523,8 @@ pub fn _mm512_maskz_mov_ps(k: __mmask16, a: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] -pub fn _mm256_mask_mov_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mov_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { unsafe { let mov = a.as_f32x8(); transmute(simd_select_bitmask(k, mov, src.as_f32x8())) @@ -503,7 +538,8 @@ pub fn _mm256_mask_mov_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] -pub fn _mm256_maskz_mov_ps(k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mov_ps(k: __mmask8, a: __m256) -> __m256 { unsafe { let mov = a.as_f32x8(); transmute(simd_select_bitmask(k, mov, f32x8::ZERO)) @@ -517,7 +553,8 @@ pub fn _mm256_maskz_mov_ps(k: __mmask8, a: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] -pub fn _mm_mask_mov_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mov_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { unsafe { let mov = a.as_f32x4(); transmute(simd_select_bitmask(k, mov, src.as_f32x4())) @@ -531,7 +568,8 @@ pub fn _mm_mask_mov_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] -pub fn _mm_maskz_mov_ps(k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mov_ps(k: __mmask8, a: __m128) -> __m128 { unsafe { let mov = a.as_f32x4(); transmute(simd_select_bitmask(k, mov, f32x4::ZERO)) @@ -545,7 +583,8 @@ pub fn _mm_maskz_mov_ps(k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] -pub fn _mm512_mask_mov_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mov_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { unsafe { let mov = a.as_f64x8(); transmute(simd_select_bitmask(k, mov, src.as_f64x8())) @@ -559,7 +598,8 @@ pub fn _mm512_mask_mov_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] -pub fn _mm512_maskz_mov_pd(k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mov_pd(k: __mmask8, a: __m512d) -> __m512d { unsafe { let mov = a.as_f64x8(); transmute(simd_select_bitmask(k, mov, f64x8::ZERO)) @@ -573,7 +613,8 @@ pub fn _mm512_maskz_mov_pd(k: __mmask8, a: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] -pub fn _mm256_mask_mov_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mov_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { unsafe { let mov = a.as_f64x4(); transmute(simd_select_bitmask(k, mov, src.as_f64x4())) @@ -587,7 +628,8 @@ pub fn _mm256_mask_mov_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] -pub fn _mm256_maskz_mov_pd(k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mov_pd(k: __mmask8, a: __m256d) -> __m256d { unsafe { let mov = a.as_f64x4(); transmute(simd_select_bitmask(k, mov, f64x4::ZERO)) @@ -601,7 +643,8 @@ pub fn _mm256_maskz_mov_pd(k: __mmask8, a: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] -pub fn _mm_mask_mov_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mov_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { unsafe { let mov = a.as_f64x2(); transmute(simd_select_bitmask(k, mov, src.as_f64x2())) @@ -615,7 +658,8 @@ pub fn _mm_mask_mov_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] -pub fn _mm_maskz_mov_pd(k: __mmask8, a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mov_pd(k: __mmask8, a: __m128d) -> __m128d { unsafe { let mov = a.as_f64x2(); transmute(simd_select_bitmask(k, mov, f64x2::ZERO)) @@ -629,7 +673,8 @@ pub fn _mm_maskz_mov_pd(k: __mmask8, a: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm512_add_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_add(a.as_i32x16(), b.as_i32x16())) } } @@ -640,7 +685,8 @@ pub fn _mm512_add_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm512_mask_add_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, add, src.as_i32x16())) @@ -654,7 +700,8 @@ pub fn _mm512_mask_add_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm512_maskz_add_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, add, i32x16::ZERO)) @@ -668,7 +715,8 @@ pub fn _mm512_maskz_add_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm256_mask_add_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, add, src.as_i32x8())) @@ -682,7 +730,8 @@ pub fn _mm256_mask_add_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm256_maskz_add_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, add, i32x8::ZERO)) @@ -696,7 +745,8 @@ pub fn _mm256_maskz_add_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm_mask_add_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, add, src.as_i32x4())) @@ -710,7 +760,8 @@ pub fn _mm_mask_add_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddd))] -pub fn _mm_maskz_add_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, add, i32x4::ZERO)) @@ -724,7 +775,8 @@ pub fn _mm_maskz_add_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm512_add_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_add(a.as_i64x8(), b.as_i64x8())) } } @@ -735,7 +787,8 @@ pub fn _mm512_add_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm512_mask_add_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, add, src.as_i64x8())) @@ -749,7 +802,8 @@ pub fn _mm512_mask_add_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm512_maskz_add_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let add = _mm512_add_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, add, i64x8::ZERO)) @@ -763,7 +817,8 @@ pub fn _mm512_maskz_add_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm256_mask_add_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, add, src.as_i64x4())) @@ -777,7 +832,8 @@ pub fn _mm256_mask_add_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm256_maskz_add_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let add = _mm256_add_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, add, i64x4::ZERO)) @@ -791,7 +847,8 @@ pub fn _mm256_maskz_add_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm_mask_add_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, add, src.as_i64x2())) @@ -805,7 +862,8 @@ pub fn _mm_mask_add_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpaddq))] -pub fn _mm_maskz_add_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let add = _mm_add_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, add, i64x2::ZERO)) @@ -819,7 +877,8 @@ pub fn _mm_maskz_add_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm512_add_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_add(a.as_f32x16(), b.as_f32x16())) } } @@ -830,7 +889,8 @@ pub fn _mm512_add_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm512_mask_add_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let add = _mm512_add_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, add, src.as_f32x16())) @@ -844,7 +904,8 @@ pub fn _mm512_mask_add_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm512_maskz_add_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let add = _mm512_add_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, add, f32x16::ZERO)) @@ -858,7 +919,8 @@ pub fn _mm512_maskz_add_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm256_mask_add_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let add = _mm256_add_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, add, src.as_f32x8())) @@ -872,7 +934,8 @@ pub fn _mm256_mask_add_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm256_maskz_add_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let add = _mm256_add_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, add, f32x8::ZERO)) @@ -886,7 +949,8 @@ pub fn _mm256_maskz_add_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm_mask_add_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let add = _mm_add_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, add, src.as_f32x4())) @@ -900,7 +964,8 @@ pub fn _mm_mask_add_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddps))] -pub fn _mm_maskz_add_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let add = _mm_add_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, add, f32x4::ZERO)) @@ -914,7 +979,8 @@ pub fn _mm_maskz_add_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm512_add_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_add(a.as_f64x8(), b.as_f64x8())) } } @@ -925,7 +991,8 @@ pub fn _mm512_add_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm512_mask_add_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let add = _mm512_add_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, add, src.as_f64x8())) @@ -939,7 +1006,8 @@ pub fn _mm512_mask_add_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm512_maskz_add_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let add = _mm512_add_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, add, f64x8::ZERO)) @@ -953,7 +1021,8 @@ pub fn _mm512_maskz_add_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm256_mask_add_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let add = _mm256_add_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, add, src.as_f64x4())) @@ -967,7 +1036,8 @@ pub fn _mm256_mask_add_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm256_maskz_add_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let add = _mm256_add_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, add, f64x4::ZERO)) @@ -981,7 +1051,8 @@ pub fn _mm256_maskz_add_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm_mask_add_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let add = _mm_add_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, add, src.as_f64x2())) @@ -995,7 +1066,8 @@ pub fn _mm_mask_add_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddpd))] -pub fn _mm_maskz_add_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let add = _mm_add_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, add, f64x2::ZERO)) @@ -1009,7 +1081,8 @@ pub fn _mm_maskz_add_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm512_sub_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_sub(a.as_i32x16(), b.as_i32x16())) } } @@ -1020,7 +1093,8 @@ pub fn _mm512_sub_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm512_mask_sub_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, sub, src.as_i32x16())) @@ -1034,7 +1108,8 @@ pub fn _mm512_mask_sub_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm512_maskz_sub_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, sub, i32x16::ZERO)) @@ -1048,7 +1123,8 @@ pub fn _mm512_maskz_sub_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm256_mask_sub_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, sub, src.as_i32x8())) @@ -1062,7 +1138,8 @@ pub fn _mm256_mask_sub_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm256_maskz_sub_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, sub, i32x8::ZERO)) @@ -1076,7 +1153,8 @@ pub fn _mm256_maskz_sub_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm_mask_sub_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, sub, src.as_i32x4())) @@ -1090,7 +1168,8 @@ pub fn _mm_mask_sub_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubd))] -pub fn _mm_maskz_sub_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, sub, i32x4::ZERO)) @@ -1104,7 +1183,8 @@ pub fn _mm_maskz_sub_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm512_sub_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_sub(a.as_i64x8(), b.as_i64x8())) } } @@ -1115,7 +1195,8 @@ pub fn _mm512_sub_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm512_mask_sub_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, sub, src.as_i64x8())) @@ -1129,7 +1210,8 @@ pub fn _mm512_mask_sub_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm512_maskz_sub_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let sub = _mm512_sub_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, sub, i64x8::ZERO)) @@ -1143,7 +1225,8 @@ pub fn _mm512_maskz_sub_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm256_mask_sub_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, sub, src.as_i64x4())) @@ -1157,7 +1240,8 @@ pub fn _mm256_mask_sub_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm256_maskz_sub_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let sub = _mm256_sub_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, sub, i64x4::ZERO)) @@ -1171,7 +1255,8 @@ pub fn _mm256_maskz_sub_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm_mask_sub_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, sub, src.as_i64x2())) @@ -1185,7 +1270,8 @@ pub fn _mm_mask_sub_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsubq))] -pub fn _mm_maskz_sub_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let sub = _mm_sub_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, sub, i64x2::ZERO)) @@ -1199,7 +1285,8 @@ pub fn _mm_maskz_sub_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm512_sub_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_sub(a.as_f32x16(), b.as_f32x16())) } } @@ -1210,7 +1297,8 @@ pub fn _mm512_sub_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm512_mask_sub_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let sub = _mm512_sub_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, sub, src.as_f32x16())) @@ -1224,7 +1312,8 @@ pub fn _mm512_mask_sub_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm512_maskz_sub_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let sub = _mm512_sub_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, sub, f32x16::ZERO)) @@ -1238,7 +1327,8 @@ pub fn _mm512_maskz_sub_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm256_mask_sub_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let sub = _mm256_sub_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, sub, src.as_f32x8())) @@ -1252,7 +1342,8 @@ pub fn _mm256_mask_sub_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm256_maskz_sub_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let sub = _mm256_sub_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, sub, f32x8::ZERO)) @@ -1266,7 +1357,8 @@ pub fn _mm256_maskz_sub_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm_mask_sub_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let sub = _mm_sub_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, sub, src.as_f32x4())) @@ -1280,7 +1372,8 @@ pub fn _mm_mask_sub_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubps))] -pub fn _mm_maskz_sub_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let sub = _mm_sub_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, sub, f32x4::ZERO)) @@ -1294,7 +1387,8 @@ pub fn _mm_maskz_sub_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm512_sub_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_sub(a.as_f64x8(), b.as_f64x8())) } } @@ -1305,7 +1399,8 @@ pub fn _mm512_sub_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm512_mask_sub_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let sub = _mm512_sub_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, sub, src.as_f64x8())) @@ -1319,7 +1414,8 @@ pub fn _mm512_mask_sub_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm512_maskz_sub_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let sub = _mm512_sub_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, sub, f64x8::ZERO)) @@ -1333,7 +1429,8 @@ pub fn _mm512_maskz_sub_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm256_mask_sub_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let sub = _mm256_sub_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, sub, src.as_f64x4())) @@ -1347,7 +1444,8 @@ pub fn _mm256_mask_sub_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm256_maskz_sub_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let sub = _mm256_sub_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, sub, f64x4::ZERO)) @@ -1361,7 +1459,8 @@ pub fn _mm256_maskz_sub_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm_mask_sub_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let sub = _mm_sub_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, sub, src.as_f64x2())) @@ -1375,7 +1474,8 @@ pub fn _mm_mask_sub_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubpd))] -pub fn _mm_maskz_sub_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let sub = _mm_sub_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, sub, f64x2::ZERO)) @@ -1389,7 +1489,8 @@ pub fn _mm_maskz_sub_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm512_mul_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mul_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = simd_cast::<_, i64x8>(simd_cast::<_, i32x8>(a.as_i64x8())); let b = simd_cast::<_, i64x8>(simd_cast::<_, i32x8>(b.as_i64x8())); @@ -1404,7 +1505,8 @@ pub fn _mm512_mul_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm512_mask_mul_epi32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mul_epi32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mul_epi32(a, b).as_i64x8(); transmute(simd_select_bitmask(k, mul, src.as_i64x8())) @@ -1418,7 +1520,8 @@ pub fn _mm512_mask_mul_epi32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm512_maskz_mul_epi32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mul_epi32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mul_epi32(a, b).as_i64x8(); transmute(simd_select_bitmask(k, mul, i64x8::ZERO)) @@ -1432,7 +1535,8 @@ pub fn _mm512_maskz_mul_epi32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm256_mask_mul_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mul_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mul_epi32(a, b).as_i64x4(); transmute(simd_select_bitmask(k, mul, src.as_i64x4())) @@ -1446,7 +1550,8 @@ pub fn _mm256_mask_mul_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm256_maskz_mul_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mul_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mul_epi32(a, b).as_i64x4(); transmute(simd_select_bitmask(k, mul, i64x4::ZERO)) @@ -1460,7 +1565,8 @@ pub fn _mm256_maskz_mul_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm_mask_mul_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mul_epi32(a, b).as_i64x2(); transmute(simd_select_bitmask(k, mul, src.as_i64x2())) @@ -1474,7 +1580,8 @@ pub fn _mm_mask_mul_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuldq))] -pub fn _mm_maskz_mul_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mul_epi32(a, b).as_i64x2(); transmute(simd_select_bitmask(k, mul, i64x2::ZERO)) @@ -1488,7 +1595,8 @@ pub fn _mm_maskz_mul_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm512_mullo_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mullo_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_mul(a.as_i32x16(), b.as_i32x16())) } } @@ -1499,7 +1607,13 @@ pub fn _mm512_mullo_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm512_mask_mullo_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mullo_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let mul = _mm512_mullo_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, mul, src.as_i32x16())) @@ -1513,7 +1627,8 @@ pub fn _mm512_mask_mullo_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm512_maskz_mullo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mullo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mullo_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, mul, i32x16::ZERO)) @@ -1527,7 +1642,8 @@ pub fn _mm512_maskz_mullo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm256_mask_mullo_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mullo_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mullo_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, mul, src.as_i32x8())) @@ -1541,7 +1657,8 @@ pub fn _mm256_mask_mullo_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm256_maskz_mullo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mullo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mullo_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, mul, i32x8::ZERO)) @@ -1555,7 +1672,8 @@ pub fn _mm256_maskz_mullo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm_mask_mullo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mullo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mullo_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, mul, src.as_i32x4())) @@ -1569,7 +1687,8 @@ pub fn _mm_mask_mullo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmulld))] -pub fn _mm_maskz_mullo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mullo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mullo_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, mul, i32x4::ZERO)) @@ -1584,7 +1703,8 @@ pub fn _mm_maskz_mullo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mullox_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mullox_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_mul(a.as_i64x8(), b.as_i64x8())) } } @@ -1596,7 +1716,13 @@ pub fn _mm512_mullox_epi64(a: __m512i, b: __m512i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_mullox_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mullox_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let mul = _mm512_mullox_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, mul, src.as_i64x8())) @@ -1610,11 +1736,12 @@ pub fn _mm512_mask_mullox_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm512_mul_epu32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mul_epu32(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_u64x8(); let b = b.as_u64x8(); - let mask = u64x8::splat(u32::MAX.into()); + let mask = u64x8::splat(u32::MAX as u64); transmute(simd_mul(simd_and(a, mask), simd_and(b, mask))) } } @@ -1626,7 +1753,8 @@ pub fn _mm512_mul_epu32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm512_mask_mul_epu32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mul_epu32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mul_epu32(a, b).as_u64x8(); transmute(simd_select_bitmask(k, mul, src.as_u64x8())) @@ -1640,7 +1768,8 @@ pub fn _mm512_mask_mul_epu32(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm512_maskz_mul_epu32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mul_epu32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let mul = _mm512_mul_epu32(a, b).as_u64x8(); transmute(simd_select_bitmask(k, mul, u64x8::ZERO)) @@ -1654,7 +1783,8 @@ pub fn _mm512_maskz_mul_epu32(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm256_mask_mul_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mul_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mul_epu32(a, b).as_u64x4(); transmute(simd_select_bitmask(k, mul, src.as_u64x4())) @@ -1668,7 +1798,8 @@ pub fn _mm256_mask_mul_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm256_maskz_mul_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mul_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let mul = _mm256_mul_epu32(a, b).as_u64x4(); transmute(simd_select_bitmask(k, mul, u64x4::ZERO)) @@ -1682,7 +1813,8 @@ pub fn _mm256_maskz_mul_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm_mask_mul_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mul_epu32(a, b).as_u64x2(); transmute(simd_select_bitmask(k, mul, src.as_u64x2())) @@ -1696,7 +1828,8 @@ pub fn _mm_mask_mul_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmuludq))] -pub fn _mm_maskz_mul_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let mul = _mm_mul_epu32(a, b).as_u64x2(); transmute(simd_select_bitmask(k, mul, u64x2::ZERO)) @@ -1710,7 +1843,8 @@ pub fn _mm_maskz_mul_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm512_mul_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mul_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_mul(a.as_f32x16(), b.as_f32x16())) } } @@ -1721,7 +1855,8 @@ pub fn _mm512_mul_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm512_mask_mul_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mul_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let mul = _mm512_mul_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, mul, src.as_f32x16())) @@ -1735,7 +1870,8 @@ pub fn _mm512_mask_mul_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm512_maskz_mul_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mul_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let mul = _mm512_mul_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, mul, f32x16::ZERO)) @@ -1749,7 +1885,8 @@ pub fn _mm512_maskz_mul_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm256_mask_mul_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mul_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let mul = _mm256_mul_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, mul, src.as_f32x8())) @@ -1763,7 +1900,8 @@ pub fn _mm256_mask_mul_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm256_maskz_mul_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mul_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let mul = _mm256_mul_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, mul, f32x8::ZERO)) @@ -1777,7 +1915,8 @@ pub fn _mm256_maskz_mul_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm_mask_mul_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mul = _mm_mul_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, mul, src.as_f32x4())) @@ -1791,7 +1930,8 @@ pub fn _mm_mask_mul_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulps))] -pub fn _mm_maskz_mul_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mul = _mm_mul_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, mul, f32x4::ZERO)) @@ -1805,7 +1945,8 @@ pub fn _mm_maskz_mul_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm512_mul_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mul_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_mul(a.as_f64x8(), b.as_f64x8())) } } @@ -1816,7 +1957,8 @@ pub fn _mm512_mul_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm512_mask_mul_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mul_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let mul = _mm512_mul_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, mul, src.as_f64x8())) @@ -1830,7 +1972,8 @@ pub fn _mm512_mask_mul_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm512_maskz_mul_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mul_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let mul = _mm512_mul_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, mul, f64x8::ZERO)) @@ -1844,7 +1987,8 @@ pub fn _mm512_maskz_mul_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm256_mask_mul_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mul_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let mul = _mm256_mul_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, mul, src.as_f64x4())) @@ -1858,7 +2002,8 @@ pub fn _mm256_mask_mul_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm256_maskz_mul_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mul_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let mul = _mm256_mul_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, mul, f64x4::ZERO)) @@ -1872,7 +2017,8 @@ pub fn _mm256_maskz_mul_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm_mask_mul_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mul = _mm_mul_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, mul, src.as_f64x2())) @@ -1886,7 +2032,8 @@ pub fn _mm_mask_mul_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulpd))] -pub fn _mm_maskz_mul_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mul = _mm_mul_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, mul, f64x2::ZERO)) @@ -1900,7 +2047,8 @@ pub fn _mm_maskz_mul_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm512_div_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_div_ps(a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_div(a.as_f32x16(), b.as_f32x16())) } } @@ -1911,7 +2059,8 @@ pub fn _mm512_div_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm512_mask_div_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_div_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let div = _mm512_div_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, div, src.as_f32x16())) @@ -1925,7 +2074,8 @@ pub fn _mm512_mask_div_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm512_maskz_div_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_div_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let div = _mm512_div_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, div, f32x16::ZERO)) @@ -1939,7 +2089,8 @@ pub fn _mm512_maskz_div_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm256_mask_div_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_div_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let div = _mm256_div_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, div, src.as_f32x8())) @@ -1953,7 +2104,8 @@ pub fn _mm256_mask_div_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm256_maskz_div_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_div_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let div = _mm256_div_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, div, f32x8::ZERO)) @@ -1967,7 +2119,8 @@ pub fn _mm256_maskz_div_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm_mask_div_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_div_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let div = _mm_div_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, div, src.as_f32x4())) @@ -1981,7 +2134,8 @@ pub fn _mm_mask_div_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivps))] -pub fn _mm_maskz_div_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_div_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let div = _mm_div_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, div, f32x4::ZERO)) @@ -1995,7 +2149,8 @@ pub fn _mm_maskz_div_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm512_div_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_div_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_div(a.as_f64x8(), b.as_f64x8())) } } @@ -2006,7 +2161,8 @@ pub fn _mm512_div_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm512_mask_div_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_div_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let div = _mm512_div_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, div, src.as_f64x8())) @@ -2020,7 +2176,8 @@ pub fn _mm512_mask_div_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm512_maskz_div_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_div_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let div = _mm512_div_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, div, f64x8::ZERO)) @@ -2034,7 +2191,8 @@ pub fn _mm512_maskz_div_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm256_mask_div_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_div_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let div = _mm256_div_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, div, src.as_f64x4())) @@ -2048,7 +2206,8 @@ pub fn _mm256_mask_div_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm256_maskz_div_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_div_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let div = _mm256_div_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, div, f64x4::ZERO)) @@ -2062,7 +2221,8 @@ pub fn _mm256_maskz_div_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm_mask_div_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_div_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let div = _mm_div_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, div, src.as_f64x2())) @@ -2076,7 +2236,8 @@ pub fn _mm_mask_div_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivpd))] -pub fn _mm_maskz_div_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_div_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let div = _mm_div_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, div, f64x2::ZERO)) @@ -2090,12 +2251,9 @@ pub fn _mm_maskz_div_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm512_max_epi32(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i32x16(); - let b = b.as_i32x16(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epi32(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_i32x16(), b.as_i32x16()).as_m512i() } } /// Compare packed signed 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2105,7 +2263,8 @@ pub fn _mm512_max_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm512_mask_max_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, max, src.as_i32x16())) @@ -2119,7 +2278,8 @@ pub fn _mm512_mask_max_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm512_maskz_max_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, max, i32x16::ZERO)) @@ -2133,7 +2293,8 @@ pub fn _mm512_maskz_max_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm256_mask_max_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, max, src.as_i32x8())) @@ -2147,7 +2308,8 @@ pub fn _mm256_mask_max_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm256_maskz_max_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, max, i32x8::ZERO)) @@ -2161,7 +2323,8 @@ pub fn _mm256_maskz_max_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm_mask_max_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, max, src.as_i32x4())) @@ -2175,7 +2338,8 @@ pub fn _mm_mask_max_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsd))] -pub fn _mm_maskz_max_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, max, i32x4::ZERO)) @@ -2189,12 +2353,9 @@ pub fn _mm_maskz_max_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm512_max_epi64(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i64x8(); - let b = b.as_i64x8(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epi64(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_i64x8(), b.as_i64x8()).as_m512i() } } /// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2204,7 +2365,8 @@ pub fn _mm512_max_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm512_mask_max_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, max, src.as_i64x8())) @@ -2218,7 +2380,8 @@ pub fn _mm512_mask_max_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm512_maskz_max_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, max, i64x8::ZERO)) @@ -2232,12 +2395,9 @@ pub fn _mm512_maskz_max_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm256_max_epi64(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i64x4(); - let b = b.as_i64x4(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epi64(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_i64x4(), b.as_i64x4()).as_m256i() } } /// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2247,7 +2407,8 @@ pub fn _mm256_max_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm256_mask_max_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, max, src.as_i64x4())) @@ -2261,7 +2422,8 @@ pub fn _mm256_mask_max_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm256_maskz_max_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, max, i64x4::ZERO)) @@ -2275,12 +2437,9 @@ pub fn _mm256_maskz_max_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm_max_epi64(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i64x2(); - let b = b.as_i64x2(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epi64(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_i64x2(), b.as_i64x2()).as_m128i() } } /// Compare packed signed 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2290,7 +2449,8 @@ pub fn _mm_max_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm_mask_max_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, max, src.as_i64x2())) @@ -2304,7 +2464,8 @@ pub fn _mm_mask_max_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxsq))] -pub fn _mm_maskz_max_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, max, i64x2::ZERO)) @@ -2514,12 +2675,9 @@ pub fn _mm_maskz_max_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm512_max_epu32(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u32x16(); - let b = b.as_u32x16(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epu32(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_u32x16(), b.as_u32x16()).as_m512i() } } /// Compare packed unsigned 32-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2529,7 +2687,8 @@ pub fn _mm512_max_epu32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm512_mask_max_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu32(a, b).as_u32x16(); transmute(simd_select_bitmask(k, max, src.as_u32x16())) @@ -2543,7 +2702,8 @@ pub fn _mm512_mask_max_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm512_maskz_max_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu32(a, b).as_u32x16(); transmute(simd_select_bitmask(k, max, u32x16::ZERO)) @@ -2557,7 +2717,8 @@ pub fn _mm512_maskz_max_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm256_mask_max_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu32(a, b).as_u32x8(); transmute(simd_select_bitmask(k, max, src.as_u32x8())) @@ -2571,7 +2732,8 @@ pub fn _mm256_mask_max_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm256_maskz_max_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu32(a, b).as_u32x8(); transmute(simd_select_bitmask(k, max, u32x8::ZERO)) @@ -2585,7 +2747,8 @@ pub fn _mm256_maskz_max_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm_mask_max_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu32(a, b).as_u32x4(); transmute(simd_select_bitmask(k, max, src.as_u32x4())) @@ -2599,7 +2762,8 @@ pub fn _mm_mask_max_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxud))] -pub fn _mm_maskz_max_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu32(a, b).as_u32x4(); transmute(simd_select_bitmask(k, max, u32x4::ZERO)) @@ -2613,12 +2777,9 @@ pub fn _mm_maskz_max_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm512_max_epu64(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u64x8(); - let b = b.as_u64x8(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_max_epu64(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imax(a.as_u64x8(), b.as_u64x8()).as_m512i() } } /// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2628,7 +2789,8 @@ pub fn _mm512_max_epu64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm512_mask_max_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_max_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu64(a, b).as_u64x8(); transmute(simd_select_bitmask(k, max, src.as_u64x8())) @@ -2642,7 +2804,8 @@ pub fn _mm512_mask_max_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm512_maskz_max_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_max_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let max = _mm512_max_epu64(a, b).as_u64x8(); transmute(simd_select_bitmask(k, max, u64x8::ZERO)) @@ -2656,12 +2819,9 @@ pub fn _mm512_maskz_max_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm256_max_epu64(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u64x4(); - let b = b.as_u64x4(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_max_epu64(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imax(a.as_u64x4(), b.as_u64x4()).as_m256i() } } /// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2671,7 +2831,8 @@ pub fn _mm256_max_epu64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm256_mask_max_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_max_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu64(a, b).as_u64x4(); transmute(simd_select_bitmask(k, max, src.as_u64x4())) @@ -2685,7 +2846,8 @@ pub fn _mm256_mask_max_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm256_maskz_max_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_max_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let max = _mm256_max_epu64(a, b).as_u64x4(); transmute(simd_select_bitmask(k, max, u64x4::ZERO)) @@ -2699,12 +2861,9 @@ pub fn _mm256_maskz_max_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm_max_epu64(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u64x2(); - let b = b.as_u64x2(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epu64(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_u64x2(), b.as_u64x2()).as_m128i() } } /// Compare packed unsigned 64-bit integers in a and b, and store packed maximum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2714,7 +2873,8 @@ pub fn _mm_max_epu64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm_mask_max_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_max_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu64(a, b).as_u64x2(); transmute(simd_select_bitmask(k, max, src.as_u64x2())) @@ -2728,7 +2888,8 @@ pub fn _mm_mask_max_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmaxuq))] -pub fn _mm_maskz_max_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_max_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let max = _mm_max_epu64(a, b).as_u64x2(); transmute(simd_select_bitmask(k, max, u64x2::ZERO)) @@ -2742,12 +2903,9 @@ pub fn _mm_maskz_max_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm512_min_epi32(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i32x16(); - let b = b.as_i32x16(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epi32(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_i32x16(), b.as_i32x16()).as_m512i() } } /// Compare packed signed 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2757,7 +2915,8 @@ pub fn _mm512_min_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm512_mask_min_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, min, src.as_i32x16())) @@ -2771,7 +2930,8 @@ pub fn _mm512_mask_min_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm512_maskz_min_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, min, i32x16::ZERO)) @@ -2785,7 +2945,8 @@ pub fn _mm512_maskz_min_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm256_mask_min_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, min, src.as_i32x8())) @@ -2799,7 +2960,8 @@ pub fn _mm256_mask_min_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm256_maskz_min_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, min, i32x8::ZERO)) @@ -2813,7 +2975,8 @@ pub fn _mm256_maskz_min_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm_mask_min_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, min, src.as_i32x4())) @@ -2827,7 +2990,8 @@ pub fn _mm_mask_min_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsd))] -pub fn _mm_maskz_min_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, min, i32x4::ZERO)) @@ -2841,12 +3005,9 @@ pub fn _mm_maskz_min_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm512_min_epi64(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_i64x8(); - let b = b.as_i64x8(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epi64(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_i64x8(), b.as_i64x8()).as_m512i() } } /// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2856,7 +3017,8 @@ pub fn _mm512_min_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm512_mask_min_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, min, src.as_i64x8())) @@ -2870,7 +3032,8 @@ pub fn _mm512_mask_min_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm512_maskz_min_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, min, i64x8::ZERO)) @@ -2884,12 +3047,9 @@ pub fn _mm512_maskz_min_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm256_min_epi64(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_i64x4(); - let b = b.as_i64x4(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epi64(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_i64x4(), b.as_i64x4()).as_m256i() } } /// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2899,7 +3059,8 @@ pub fn _mm256_min_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm256_mask_min_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, min, src.as_i64x4())) @@ -2913,7 +3074,8 @@ pub fn _mm256_mask_min_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm256_maskz_min_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, min, i64x4::ZERO)) @@ -2927,12 +3089,9 @@ pub fn _mm256_maskz_min_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm_min_epi64(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i64x2(); - let b = b.as_i64x2(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epi64(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_i64x2(), b.as_i64x2()).as_m128i() } } /// Compare packed signed 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -2942,7 +3101,8 @@ pub fn _mm_min_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm_mask_min_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, min, src.as_i64x2())) @@ -2956,7 +3116,8 @@ pub fn _mm_mask_min_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminsq))] -pub fn _mm_maskz_min_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, min, i64x2::ZERO)) @@ -3166,12 +3327,9 @@ pub fn _mm_maskz_min_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm512_min_epu32(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u32x16(); - let b = b.as_u32x16(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epu32(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_u32x16(), b.as_u32x16()).as_m512i() } } /// Compare packed unsigned 32-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -3181,7 +3339,8 @@ pub fn _mm512_min_epu32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm512_mask_min_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu32(a, b).as_u32x16(); transmute(simd_select_bitmask(k, min, src.as_u32x16())) @@ -3195,7 +3354,8 @@ pub fn _mm512_mask_min_epu32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm512_maskz_min_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu32(a, b).as_u32x16(); transmute(simd_select_bitmask(k, min, u32x16::ZERO)) @@ -3209,7 +3369,8 @@ pub fn _mm512_maskz_min_epu32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm256_mask_min_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu32(a, b).as_u32x8(); transmute(simd_select_bitmask(k, min, src.as_u32x8())) @@ -3223,7 +3384,8 @@ pub fn _mm256_mask_min_epu32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm256_maskz_min_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu32(a, b).as_u32x8(); transmute(simd_select_bitmask(k, min, u32x8::ZERO)) @@ -3237,7 +3399,8 @@ pub fn _mm256_maskz_min_epu32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm_mask_min_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu32(a, b).as_u32x4(); transmute(simd_select_bitmask(k, min, src.as_u32x4())) @@ -3251,7 +3414,8 @@ pub fn _mm_mask_min_epu32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminud))] -pub fn _mm_maskz_min_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu32(a, b).as_u32x4(); transmute(simd_select_bitmask(k, min, u32x4::ZERO)) @@ -3265,12 +3429,9 @@ pub fn _mm_maskz_min_epu32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm512_min_epu64(a: __m512i, b: __m512i) -> __m512i { - unsafe { - let a = a.as_u64x8(); - let b = b.as_u64x8(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_min_epu64(a: __m512i, b: __m512i) -> __m512i { + unsafe { simd_imin(a.as_u64x8(), b.as_u64x8()).as_m512i() } } /// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -3280,7 +3441,8 @@ pub fn _mm512_min_epu64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm512_mask_min_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_min_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu64(a, b).as_u64x8(); transmute(simd_select_bitmask(k, min, src.as_u64x8())) @@ -3294,7 +3456,8 @@ pub fn _mm512_mask_min_epu64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm512_maskz_min_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_min_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let min = _mm512_min_epu64(a, b).as_u64x8(); transmute(simd_select_bitmask(k, min, u64x8::ZERO)) @@ -3308,12 +3471,9 @@ pub fn _mm512_maskz_min_epu64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm256_min_epu64(a: __m256i, b: __m256i) -> __m256i { - unsafe { - let a = a.as_u64x4(); - let b = b.as_u64x4(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_min_epu64(a: __m256i, b: __m256i) -> __m256i { + unsafe { simd_imin(a.as_u64x4(), b.as_u64x4()).as_m256i() } } /// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -3323,7 +3483,8 @@ pub fn _mm256_min_epu64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm256_mask_min_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_min_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu64(a, b).as_u64x4(); transmute(simd_select_bitmask(k, min, src.as_u64x4())) @@ -3337,7 +3498,8 @@ pub fn _mm256_mask_min_epu64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm256_maskz_min_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_min_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let min = _mm256_min_epu64(a, b).as_u64x4(); transmute(simd_select_bitmask(k, min, u64x4::ZERO)) @@ -3351,12 +3513,9 @@ pub fn _mm256_maskz_min_epu64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm_min_epu64(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u64x2(); - let b = b.as_u64x2(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epu64(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_u64x2(), b.as_u64x2()).as_m128i() } } /// Compare packed unsigned 64-bit integers in a and b, and store packed minimum values in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). @@ -3366,7 +3525,8 @@ pub fn _mm_min_epu64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm_mask_min_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_min_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu64(a, b).as_u64x2(); transmute(simd_select_bitmask(k, min, src.as_u64x2())) @@ -3380,7 +3540,8 @@ pub fn _mm_mask_min_epu64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpminuq))] -pub fn _mm_maskz_min_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_min_epu64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let min = _mm_min_epu64(a, b).as_u64x2(); transmute(simd_select_bitmask(k, min, u64x2::ZERO)) @@ -3548,7 +3709,8 @@ pub fn _mm_maskz_sqrt_pd(k: __mmask8, a: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm512_fmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_fma(a, b, c) } } @@ -3559,7 +3721,8 @@ pub fn _mm512_fmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm512_mask_fmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmadd_ps(a, b, c), a) } } @@ -3570,7 +3733,8 @@ pub fn _mm512_mask_fmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm512_maskz_fmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmadd_ps(a, b, c), _mm512_setzero_ps()) } } @@ -3581,7 +3745,8 @@ pub fn _mm512_maskz_fmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm512_mask3_fmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmadd_ps(a, b, c), c) } } @@ -3592,7 +3757,8 @@ pub fn _mm512_mask3_fmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm256_mask_fmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmadd_ps(a, b, c), a) } } @@ -3603,7 +3769,8 @@ pub fn _mm256_mask_fmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm256_maskz_fmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmadd_ps(a, b, c), _mm256_setzero_ps()) } } @@ -3614,7 +3781,8 @@ pub fn _mm256_maskz_fmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm256_mask3_fmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmadd_ps(a, b, c), c) } } @@ -3625,7 +3793,8 @@ pub fn _mm256_mask3_fmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm_mask_fmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmadd_ps(a, b, c), a) } } @@ -3636,7 +3805,8 @@ pub fn _mm_mask_fmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm_maskz_fmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmadd_ps(a, b, c), _mm_setzero_ps()) } } @@ -3647,7 +3817,8 @@ pub fn _mm_maskz_fmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132ps or vfmadd213ps or vfmadd231ps -pub fn _mm_mask3_fmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmadd_ps(a, b, c), c) } } @@ -3658,7 +3829,8 @@ pub fn _mm_mask3_fmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm512_fmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_fma(a, b, c) } } @@ -3669,7 +3841,8 @@ pub fn _mm512_fmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm512_mask_fmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmadd_pd(a, b, c), a) } } @@ -3680,7 +3853,8 @@ pub fn _mm512_mask_fmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm512_maskz_fmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmadd_pd(a, b, c), _mm512_setzero_pd()) } } @@ -3691,7 +3865,8 @@ pub fn _mm512_maskz_fmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm512_mask3_fmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmadd_pd(a, b, c), c) } } @@ -3702,7 +3877,8 @@ pub fn _mm512_mask3_fmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm256_mask_fmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmadd_pd(a, b, c), a) } } @@ -3713,7 +3889,8 @@ pub fn _mm256_mask_fmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm256_maskz_fmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmadd_pd(a, b, c), _mm256_setzero_pd()) } } @@ -3724,7 +3901,8 @@ pub fn _mm256_maskz_fmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm256_mask3_fmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmadd_pd(a, b, c), c) } } @@ -3735,7 +3913,8 @@ pub fn _mm256_mask3_fmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm_mask_fmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmadd_pd(a, b, c), a) } } @@ -3746,7 +3925,8 @@ pub fn _mm_mask_fmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm_maskz_fmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmadd_pd(a, b, c), _mm_setzero_pd()) } } @@ -3757,7 +3937,8 @@ pub fn _mm_maskz_fmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] //vfmadd132pd or vfmadd213pd or vfmadd231pd -pub fn _mm_mask3_fmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmadd_pd(a, b, c), c) } } @@ -3768,7 +3949,8 @@ pub fn _mm_mask3_fmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm512_fmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -3779,7 +3961,8 @@ pub fn _mm512_fmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm512_mask_fmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmsub_ps(a, b, c), a) } } @@ -3790,7 +3973,8 @@ pub fn _mm512_mask_fmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm512_maskz_fmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmsub_ps(a, b, c), _mm512_setzero_ps()) } } @@ -3801,7 +3985,8 @@ pub fn _mm512_maskz_fmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm512_mask3_fmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmsub_ps(a, b, c), c) } } @@ -3812,7 +3997,8 @@ pub fn _mm512_mask3_fmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm256_mask_fmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmsub_ps(a, b, c), a) } } @@ -3823,7 +4009,8 @@ pub fn _mm256_mask_fmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm256_maskz_fmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmsub_ps(a, b, c), _mm256_setzero_ps()) } } @@ -3834,7 +4021,8 @@ pub fn _mm256_maskz_fmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm256_mask3_fmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmsub_ps(a, b, c), c) } } @@ -3845,7 +4033,8 @@ pub fn _mm256_mask3_fmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm_mask_fmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmsub_ps(a, b, c), a) } } @@ -3856,7 +4045,8 @@ pub fn _mm_mask_fmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm_maskz_fmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmsub_ps(a, b, c), _mm_setzero_ps()) } } @@ -3867,7 +4057,8 @@ pub fn _mm_maskz_fmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132ps or vfmsub213ps or vfmsub231ps, clang generate vfmadd, gcc generate vfmsub -pub fn _mm_mask3_fmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmsub_ps(a, b, c), c) } } @@ -3878,7 +4069,8 @@ pub fn _mm_mask3_fmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm512_fmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -3889,7 +4081,8 @@ pub fn _mm512_fmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm512_mask_fmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmsub_pd(a, b, c), a) } } @@ -3900,7 +4093,8 @@ pub fn _mm512_mask_fmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm512_maskz_fmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmsub_pd(a, b, c), _mm512_setzero_pd()) } } @@ -3911,7 +4105,8 @@ pub fn _mm512_maskz_fmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm512_mask3_fmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmsub_pd(a, b, c), c) } } @@ -3922,7 +4117,8 @@ pub fn _mm512_mask3_fmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm256_mask_fmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmsub_pd(a, b, c), a) } } @@ -3933,7 +4129,8 @@ pub fn _mm256_mask_fmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm256_maskz_fmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmsub_pd(a, b, c), _mm256_setzero_pd()) } } @@ -3944,7 +4141,8 @@ pub fn _mm256_maskz_fmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm256_mask3_fmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmsub_pd(a, b, c), c) } } @@ -3955,7 +4153,8 @@ pub fn _mm256_mask3_fmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm_mask_fmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmsub_pd(a, b, c), a) } } @@ -3966,7 +4165,8 @@ pub fn _mm_mask_fmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm_maskz_fmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmsub_pd(a, b, c), _mm_setzero_pd()) } } @@ -3977,7 +4177,8 @@ pub fn _mm_maskz_fmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] //vfmsub132pd or vfmsub213pd or vfmsub231pd. clang fmadd, gcc fmsub -pub fn _mm_mask3_fmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmsub_pd(a, b, c), c) } } @@ -3988,7 +4189,8 @@ pub fn _mm_mask3_fmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm512_fmaddsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmaddsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -4007,7 +4209,8 @@ pub fn _mm512_fmaddsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm512_mask_fmaddsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmaddsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_ps(a, b, c), a) } } @@ -4018,7 +4221,8 @@ pub fn _mm512_mask_fmaddsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm512_maskz_fmaddsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmaddsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_ps(a, b, c), _mm512_setzero_ps()) } } @@ -4029,7 +4233,8 @@ pub fn _mm512_maskz_fmaddsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) - #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm512_mask3_fmaddsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmaddsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_ps(a, b, c), c) } } @@ -4040,7 +4245,8 @@ pub fn _mm512_mask3_fmaddsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm256_mask_fmaddsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmaddsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_ps(a, b, c), a) } } @@ -4051,7 +4257,8 @@ pub fn _mm256_mask_fmaddsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm256_maskz_fmaddsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmaddsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_ps(a, b, c), _mm256_setzero_ps()) } } @@ -4062,7 +4269,8 @@ pub fn _mm256_maskz_fmaddsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm256_mask3_fmaddsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmaddsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_ps(a, b, c), c) } } @@ -4073,7 +4281,8 @@ pub fn _mm256_mask3_fmaddsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm_mask_fmaddsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmaddsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmaddsub_ps(a, b, c), a) } } @@ -4084,7 +4293,8 @@ pub fn _mm_mask_fmaddsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm_maskz_fmaddsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmaddsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmaddsub_ps(a, b, c), _mm_setzero_ps()) } } @@ -4095,7 +4305,8 @@ pub fn _mm_maskz_fmaddsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132ps or vfmaddsub213ps or vfmaddsub231ps -pub fn _mm_mask3_fmaddsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmaddsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmaddsub_ps(a, b, c), c) } } @@ -4106,7 +4317,8 @@ pub fn _mm_mask3_fmaddsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm512_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -4121,7 +4333,8 @@ pub fn _mm512_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm512_mask_fmaddsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmaddsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_pd(a, b, c), a) } } @@ -4132,7 +4345,8 @@ pub fn _mm512_mask_fmaddsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm512_maskz_fmaddsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmaddsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_pd(a, b, c), _mm512_setzero_pd()) } } @@ -4143,7 +4357,8 @@ pub fn _mm512_maskz_fmaddsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm512_mask3_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_pd(a, b, c), c) } } @@ -4154,7 +4369,8 @@ pub fn _mm512_mask3_fmaddsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm256_mask_fmaddsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmaddsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_pd(a, b, c), a) } } @@ -4165,7 +4381,8 @@ pub fn _mm256_mask_fmaddsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm256_maskz_fmaddsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmaddsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_pd(a, b, c), _mm256_setzero_pd()) } } @@ -4176,7 +4393,8 @@ pub fn _mm256_maskz_fmaddsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm256_mask3_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_pd(a, b, c), c) } } @@ -4187,7 +4405,8 @@ pub fn _mm256_mask3_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm_mask_fmaddsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmaddsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmaddsub_pd(a, b, c), a) } } @@ -4198,7 +4417,8 @@ pub fn _mm_mask_fmaddsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm_maskz_fmaddsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmaddsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmaddsub_pd(a, b, c), _mm_setzero_pd()) } } @@ -4209,7 +4429,8 @@ pub fn _mm_maskz_fmaddsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmaddsub))] //vfmaddsub132pd or vfmaddsub213pd or vfmaddsub231pd -pub fn _mm_mask3_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmaddsub_pd(a, b, c), c) } } @@ -4220,7 +4441,8 @@ pub fn _mm_mask3_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm512_fmsubadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmsubadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -4239,7 +4461,8 @@ pub fn _mm512_fmsubadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm512_mask_fmsubadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmsubadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_ps(a, b, c), a) } } @@ -4250,7 +4473,8 @@ pub fn _mm512_mask_fmsubadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm512_maskz_fmsubadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmsubadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_ps(a, b, c), _mm512_setzero_ps()) } } @@ -4261,7 +4485,8 @@ pub fn _mm512_maskz_fmsubadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) - #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm512_mask3_fmsubadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmsubadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_ps(a, b, c), c) } } @@ -4272,7 +4497,8 @@ pub fn _mm512_mask3_fmsubadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm256_mask_fmsubadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmsubadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_ps(a, b, c), a) } } @@ -4283,7 +4509,8 @@ pub fn _mm256_mask_fmsubadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm256_maskz_fmsubadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmsubadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_ps(a, b, c), _mm256_setzero_ps()) } } @@ -4294,7 +4521,8 @@ pub fn _mm256_maskz_fmsubadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm256_mask3_fmsubadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmsubadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_ps(a, b, c), c) } } @@ -4305,7 +4533,8 @@ pub fn _mm256_mask3_fmsubadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm_mask_fmsubadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsubadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmsubadd_ps(a, b, c), a) } } @@ -4316,7 +4545,8 @@ pub fn _mm_mask_fmsubadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm_maskz_fmsubadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsubadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmsubadd_ps(a, b, c), _mm_setzero_ps()) } } @@ -4327,7 +4557,8 @@ pub fn _mm_maskz_fmsubadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132ps or vfmsubadd213ps or vfmsubadd231ps -pub fn _mm_mask3_fmsubadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsubadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fmsubadd_ps(a, b, c), c) } } @@ -4338,7 +4569,8 @@ pub fn _mm_mask3_fmsubadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm512_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -4353,7 +4585,8 @@ pub fn _mm512_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm512_mask_fmsubadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmsubadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_pd(a, b, c), a) } } @@ -4364,7 +4597,8 @@ pub fn _mm512_mask_fmsubadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm512_maskz_fmsubadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmsubadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_pd(a, b, c), _mm512_setzero_pd()) } } @@ -4375,7 +4609,8 @@ pub fn _mm512_maskz_fmsubadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm512_mask3_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_pd(a, b, c), c) } } @@ -4386,7 +4621,8 @@ pub fn _mm512_mask3_fmsubadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm256_mask_fmsubadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmsubadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_pd(a, b, c), a) } } @@ -4397,7 +4633,8 @@ pub fn _mm256_mask_fmsubadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm256_maskz_fmsubadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmsubadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_pd(a, b, c), _mm256_setzero_pd()) } } @@ -4408,7 +4645,8 @@ pub fn _mm256_maskz_fmsubadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm256_mask3_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_pd(a, b, c), c) } } @@ -4419,7 +4657,8 @@ pub fn _mm256_mask3_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm_mask_fmsubadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsubadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmsubadd_pd(a, b, c), a) } } @@ -4430,7 +4669,8 @@ pub fn _mm_mask_fmsubadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm_maskz_fmsubadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsubadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmsubadd_pd(a, b, c), _mm_setzero_pd()) } } @@ -4441,7 +4681,8 @@ pub fn _mm_maskz_fmsubadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsubadd))] //vfmsubadd132pd or vfmsubadd213pd or vfmsubadd231pd -pub fn _mm_mask3_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fmsubadd_pd(a, b, c), c) } } @@ -4452,7 +4693,8 @@ pub fn _mm_mask3_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm512_fnmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fnmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -4463,7 +4705,8 @@ pub fn _mm512_fnmadd_ps(a: __m512, b: __m512, c: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm512_mask_fnmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fnmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fnmadd_ps(a, b, c), a) } } @@ -4474,7 +4717,8 @@ pub fn _mm512_mask_fnmadd_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm512_maskz_fnmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fnmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fnmadd_ps(a, b, c), _mm512_setzero_ps()) } } @@ -4485,7 +4729,8 @@ pub fn _mm512_maskz_fnmadd_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm512_mask3_fnmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fnmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fnmadd_ps(a, b, c), c) } } @@ -4496,7 +4741,8 @@ pub fn _mm512_mask3_fnmadd_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm256_mask_fnmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fnmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fnmadd_ps(a, b, c), a) } } @@ -4507,7 +4753,8 @@ pub fn _mm256_mask_fnmadd_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm256_maskz_fnmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fnmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fnmadd_ps(a, b, c), _mm256_setzero_ps()) } } @@ -4518,7 +4765,8 @@ pub fn _mm256_maskz_fnmadd_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm256_mask3_fnmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fnmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fnmadd_ps(a, b, c), c) } } @@ -4529,7 +4777,8 @@ pub fn _mm256_mask3_fnmadd_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm_mask_fnmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fnmadd_ps(a, b, c), a) } } @@ -4540,7 +4789,8 @@ pub fn _mm_mask_fnmadd_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm_maskz_fnmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fnmadd_ps(a, b, c), _mm_setzero_ps()) } } @@ -4551,7 +4801,8 @@ pub fn _mm_maskz_fnmadd_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m1 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132ps or vfnmadd213ps or vfnmadd231ps -pub fn _mm_mask3_fnmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fnmadd_ps(a, b, c), c) } } @@ -4562,7 +4813,8 @@ pub fn _mm_mask3_fnmadd_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm512_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -4573,7 +4825,8 @@ pub fn _mm512_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm512_mask_fnmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fnmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fnmadd_pd(a, b, c), a) } } @@ -4584,7 +4837,8 @@ pub fn _mm512_mask_fnmadd_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm512_maskz_fnmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fnmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fnmadd_pd(a, b, c), _mm512_setzero_pd()) } } @@ -4595,7 +4849,8 @@ pub fn _mm512_maskz_fnmadd_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) - #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm512_mask3_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fnmadd_pd(a, b, c), c) } } @@ -4606,7 +4861,8 @@ pub fn _mm512_mask3_fnmadd_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm256_mask_fnmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fnmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fnmadd_pd(a, b, c), a) } } @@ -4617,7 +4873,8 @@ pub fn _mm256_mask_fnmadd_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm256_maskz_fnmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fnmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fnmadd_pd(a, b, c), _mm256_setzero_pd()) } } @@ -4628,7 +4885,8 @@ pub fn _mm256_maskz_fnmadd_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm256_mask3_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fnmadd_pd(a, b, c), c) } } @@ -4639,7 +4897,8 @@ pub fn _mm256_mask3_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm_mask_fnmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fnmadd_pd(a, b, c), a) } } @@ -4650,7 +4909,8 @@ pub fn _mm_mask_fnmadd_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm_maskz_fnmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fnmadd_pd(a, b, c), _mm_setzero_pd()) } } @@ -4661,7 +4921,8 @@ pub fn _mm_maskz_fnmadd_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] //vfnmadd132pd or vfnmadd213pd or vfnmadd231pd -pub fn _mm_mask3_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fnmadd_pd(a, b, c), c) } } @@ -4672,7 +4933,8 @@ pub fn _mm_mask3_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm512_fnmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fnmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -4683,7 +4945,8 @@ pub fn _mm512_fnmsub_ps(a: __m512, b: __m512, c: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm512_mask_fnmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fnmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fnmsub_ps(a, b, c), a) } } @@ -4694,7 +4957,8 @@ pub fn _mm512_mask_fnmsub_ps(a: __m512, k: __mmask16, b: __m512, c: __m512) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm512_maskz_fnmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fnmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fnmsub_ps(a, b, c), _mm512_setzero_ps()) } } @@ -4705,7 +4969,8 @@ pub fn _mm512_maskz_fnmsub_ps(k: __mmask16, a: __m512, b: __m512, c: __m512) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm512_mask3_fnmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fnmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> __m512 { unsafe { simd_select_bitmask(k, _mm512_fnmsub_ps(a, b, c), c) } } @@ -4716,7 +4981,8 @@ pub fn _mm512_mask3_fnmsub_ps(a: __m512, b: __m512, c: __m512, k: __mmask16) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm256_mask_fnmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fnmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fnmsub_ps(a, b, c), a) } } @@ -4727,7 +4993,8 @@ pub fn _mm256_mask_fnmsub_ps(a: __m256, k: __mmask8, b: __m256, c: __m256) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm256_maskz_fnmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fnmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fnmsub_ps(a, b, c), _mm256_setzero_ps()) } } @@ -4738,7 +5005,8 @@ pub fn _mm256_maskz_fnmsub_ps(k: __mmask8, a: __m256, b: __m256, c: __m256) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm256_mask3_fnmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fnmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> __m256 { unsafe { simd_select_bitmask(k, _mm256_fnmsub_ps(a, b, c), c) } } @@ -4749,7 +5017,8 @@ pub fn _mm256_mask3_fnmsub_ps(a: __m256, b: __m256, c: __m256, k: __mmask8) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm_mask_fnmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fnmsub_ps(a, b, c), a) } } @@ -4760,7 +5029,8 @@ pub fn _mm_mask_fnmsub_ps(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm_maskz_fnmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fnmsub_ps(a, b, c), _mm_setzero_ps()) } } @@ -4771,7 +5041,8 @@ pub fn _mm_maskz_fnmsub_ps(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m1 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132ps or vfnmsub213ps or vfnmsub231ps -pub fn _mm_mask3_fnmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { simd_select_bitmask(k, _mm_fnmsub_ps(a, b, c), c) } } @@ -4782,7 +5053,8 @@ pub fn _mm_mask3_fnmsub_ps(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm512_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -4793,7 +5065,8 @@ pub fn _mm512_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm512_mask_fnmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fnmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fnmsub_pd(a, b, c), a) } } @@ -4804,7 +5077,8 @@ pub fn _mm512_mask_fnmsub_pd(a: __m512d, k: __mmask8, b: __m512d, c: __m512d) -> #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm512_maskz_fnmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fnmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fnmsub_pd(a, b, c), _mm512_setzero_pd()) } } @@ -4815,7 +5089,8 @@ pub fn _mm512_maskz_fnmsub_pd(k: __mmask8, a: __m512d, b: __m512d, c: __m512d) - #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm512_mask3_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) -> __m512d { unsafe { simd_select_bitmask(k, _mm512_fnmsub_pd(a, b, c), c) } } @@ -4826,7 +5101,8 @@ pub fn _mm512_mask3_fnmsub_pd(a: __m512d, b: __m512d, c: __m512d, k: __mmask8) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm256_mask_fnmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fnmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fnmsub_pd(a, b, c), a) } } @@ -4837,7 +5113,8 @@ pub fn _mm256_mask_fnmsub_pd(a: __m256d, k: __mmask8, b: __m256d, c: __m256d) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm256_maskz_fnmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fnmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fnmsub_pd(a, b, c), _mm256_setzero_pd()) } } @@ -4848,7 +5125,8 @@ pub fn _mm256_maskz_fnmsub_pd(k: __mmask8, a: __m256d, b: __m256d, c: __m256d) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm256_mask3_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) -> __m256d { unsafe { simd_select_bitmask(k, _mm256_fnmsub_pd(a, b, c), c) } } @@ -4859,7 +5137,8 @@ pub fn _mm256_mask3_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d, k: __mmask8) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm_mask_fnmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fnmsub_pd(a, b, c), a) } } @@ -4870,7 +5149,8 @@ pub fn _mm_mask_fnmsub_pd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm_maskz_fnmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fnmsub_pd(a, b, c), _mm_setzero_pd()) } } @@ -4881,7 +5161,8 @@ pub fn _mm_maskz_fnmsub_pd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] //vfnmsub132pd or vfnmsub213pd or vfnmsub231pd -pub fn _mm_mask3_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { simd_select_bitmask(k, _mm_fnmsub_pd(a, b, c), c) } } @@ -11213,10 +11494,7 @@ pub fn _mm256_maskz_cvtpd_ps(k: __mmask8, a: __m256d) -> __m128 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtpd2ps))] pub fn _mm_mask_cvtpd_ps(src: __m128, k: __mmask8, a: __m128d) -> __m128 { - unsafe { - let convert = _mm_cvtpd_ps(a); - transmute(simd_select_bitmask(k, convert.as_f32x4(), src.as_f32x4())) - } + unsafe { vcvtpd2ps128(a.as_f64x2(), src.as_f32x4(), k).as_m128() } } /// Convert packed double-precision (64-bit) floating-point elements in a to packed single-precision (32-bit) floating-point elements, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). @@ -11323,10 +11601,7 @@ pub fn _mm256_maskz_cvtpd_epi32(k: __mmask8, a: __m256d) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtpd2dq))] pub fn _mm_mask_cvtpd_epi32(src: __m128i, k: __mmask8, a: __m128d) -> __m128i { - unsafe { - let convert = _mm_cvtpd_epi32(a); - transmute(simd_select_bitmask(k, convert.as_i32x4(), src.as_i32x4())) - } + unsafe { vcvtpd2dq128(a.as_f64x2(), src.as_i32x4(), k).as_m128i() } } /// Convert packed double-precision (64-bit) floating-point elements in a to packed 32-bit integers, and store the results in dst using zeromask k (elements are zeroed out when the corresponding mask bit is not set). @@ -11516,7 +11791,8 @@ pub fn _mm512_mask_cvtpd_pslo(src: __m512, k: __mmask8, v2: __m512d) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm512_cvtepi8_epi32(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi8_epi32(a: __m128i) -> __m512i { unsafe { let a = a.as_i8x16(); transmute::(simd_cast(a)) @@ -11530,7 +11806,8 @@ pub fn _mm512_cvtepi8_epi32(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm512_mask_cvtepi8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepi8_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, src.as_i32x16())) @@ -11544,7 +11821,8 @@ pub fn _mm512_mask_cvtepi8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm512_maskz_cvtepi8_epi32(k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi8_epi32(k: __mmask16, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepi8_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, i32x16::ZERO)) @@ -11558,7 +11836,8 @@ pub fn _mm512_maskz_cvtepi8_epi32(k: __mmask16, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm256_mask_cvtepi8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi8_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, src.as_i32x8())) @@ -11572,7 +11851,8 @@ pub fn _mm256_mask_cvtepi8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm256_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi8_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, i32x8::ZERO)) @@ -11586,7 +11866,8 @@ pub fn _mm256_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm_mask_cvtepi8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi8_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, src.as_i32x4())) @@ -11600,7 +11881,8 @@ pub fn _mm_mask_cvtepi8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbd))] -pub fn _mm_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi8_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, i32x4::ZERO)) @@ -11614,7 +11896,8 @@ pub fn _mm_maskz_cvtepi8_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm512_cvtepi8_epi64(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi8_epi64(a: __m128i) -> __m512i { unsafe { let a = a.as_i8x16(); let v64: i8x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -11629,7 +11912,8 @@ pub fn _mm512_cvtepi8_epi64(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm512_mask_cvtepi8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepi8_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, src.as_i64x8())) @@ -11643,7 +11927,8 @@ pub fn _mm512_mask_cvtepi8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m51 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm512_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepi8_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, i64x8::ZERO)) @@ -11657,7 +11942,8 @@ pub fn _mm512_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm256_mask_cvtepi8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi8_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, src.as_i64x4())) @@ -11671,7 +11957,8 @@ pub fn _mm256_mask_cvtepi8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm256_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi8_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, i64x4::ZERO)) @@ -11685,7 +11972,8 @@ pub fn _mm256_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm_mask_cvtepi8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi8_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, src.as_i64x2())) @@ -11699,7 +11987,8 @@ pub fn _mm_mask_cvtepi8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxbq))] -pub fn _mm_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi8_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, i64x2::ZERO)) @@ -11713,7 +12002,8 @@ pub fn _mm_maskz_cvtepi8_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm512_cvtepu8_epi32(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu8_epi32(a: __m128i) -> __m512i { unsafe { let a = a.as_u8x16(); transmute::(simd_cast(a)) @@ -11727,7 +12017,8 @@ pub fn _mm512_cvtepu8_epi32(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm512_mask_cvtepu8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepu8_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, src.as_i32x16())) @@ -11741,7 +12032,8 @@ pub fn _mm512_mask_cvtepu8_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm512_maskz_cvtepu8_epi32(k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu8_epi32(k: __mmask16, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepu8_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, i32x16::ZERO)) @@ -11755,7 +12047,8 @@ pub fn _mm512_maskz_cvtepu8_epi32(k: __mmask16, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm256_mask_cvtepu8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu8_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, src.as_i32x8())) @@ -11769,7 +12062,8 @@ pub fn _mm256_mask_cvtepu8_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm256_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu8_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, i32x8::ZERO)) @@ -11783,7 +12077,8 @@ pub fn _mm256_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm_mask_cvtepu8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu8_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, src.as_i32x4())) @@ -11797,7 +12092,8 @@ pub fn _mm_mask_cvtepu8_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbd))] -pub fn _mm_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu8_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, i32x4::ZERO)) @@ -11811,7 +12107,8 @@ pub fn _mm_maskz_cvtepu8_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm512_cvtepu8_epi64(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu8_epi64(a: __m128i) -> __m512i { unsafe { let a = a.as_u8x16(); let v64: u8x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -11826,7 +12123,8 @@ pub fn _mm512_cvtepu8_epi64(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm512_mask_cvtepu8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepu8_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, src.as_i64x8())) @@ -11840,7 +12138,8 @@ pub fn _mm512_mask_cvtepu8_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m51 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm512_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepu8_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, i64x8::ZERO)) @@ -11854,7 +12153,8 @@ pub fn _mm512_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm256_mask_cvtepu8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu8_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, src.as_i64x4())) @@ -11868,7 +12168,8 @@ pub fn _mm256_mask_cvtepu8_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm256_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu8_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, i64x4::ZERO)) @@ -11882,7 +12183,8 @@ pub fn _mm256_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm_mask_cvtepu8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu8_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, src.as_i64x2())) @@ -11896,7 +12198,8 @@ pub fn _mm_mask_cvtepu8_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxbq))] -pub fn _mm_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu8_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, i64x2::ZERO)) @@ -11910,7 +12213,8 @@ pub fn _mm_maskz_cvtepu8_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm512_cvtepi16_epi32(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi16_epi32(a: __m256i) -> __m512i { unsafe { let a = a.as_i16x16(); transmute::(simd_cast(a)) @@ -11924,7 +12228,8 @@ pub fn _mm512_cvtepi16_epi32(a: __m256i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm512_mask_cvtepi16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepi16_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, src.as_i32x16())) @@ -11938,7 +12243,8 @@ pub fn _mm512_mask_cvtepi16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm512_maskz_cvtepi16_epi32(k: __mmask16, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi16_epi32(k: __mmask16, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepi16_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, i32x16::ZERO)) @@ -11952,7 +12258,8 @@ pub fn _mm512_maskz_cvtepi16_epi32(k: __mmask16, a: __m256i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm256_mask_cvtepi16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi16_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, src.as_i32x8())) @@ -11966,7 +12273,8 @@ pub fn _mm256_mask_cvtepi16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm256_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi16_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, i32x8::ZERO)) @@ -11980,7 +12288,8 @@ pub fn _mm256_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm_mask_cvtepi16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi16_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, src.as_i32x4())) @@ -11994,7 +12303,8 @@ pub fn _mm_mask_cvtepi16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwd))] -pub fn _mm_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi16_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, i32x4::ZERO)) @@ -12008,7 +12318,8 @@ pub fn _mm_maskz_cvtepi16_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm512_cvtepi16_epi64(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi16_epi64(a: __m128i) -> __m512i { unsafe { let a = a.as_i16x8(); transmute::(simd_cast(a)) @@ -12022,7 +12333,8 @@ pub fn _mm512_cvtepi16_epi64(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm512_mask_cvtepi16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepi16_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, src.as_i64x8())) @@ -12036,7 +12348,8 @@ pub fn _mm512_mask_cvtepi16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm512_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepi16_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, i64x8::ZERO)) @@ -12050,7 +12363,8 @@ pub fn _mm512_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm256_mask_cvtepi16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi16_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, src.as_i64x4())) @@ -12064,7 +12378,8 @@ pub fn _mm256_mask_cvtepi16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm256_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi16_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, i64x4::ZERO)) @@ -12078,7 +12393,8 @@ pub fn _mm256_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm_mask_cvtepi16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi16_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, src.as_i64x2())) @@ -12092,7 +12408,8 @@ pub fn _mm_mask_cvtepi16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxwq))] -pub fn _mm_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi16_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, i64x2::ZERO)) @@ -12106,7 +12423,8 @@ pub fn _mm_maskz_cvtepi16_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm512_cvtepu16_epi32(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu16_epi32(a: __m256i) -> __m512i { unsafe { let a = a.as_u16x16(); transmute::(simd_cast(a)) @@ -12120,7 +12438,8 @@ pub fn _mm512_cvtepu16_epi32(a: __m256i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm512_mask_cvtepu16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepu16_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, src.as_i32x16())) @@ -12134,7 +12453,8 @@ pub fn _mm512_mask_cvtepu16_epi32(src: __m512i, k: __mmask16, a: __m256i) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm512_maskz_cvtepu16_epi32(k: __mmask16, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu16_epi32(k: __mmask16, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepu16_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, convert, i32x16::ZERO)) @@ -12148,7 +12468,8 @@ pub fn _mm512_maskz_cvtepu16_epi32(k: __mmask16, a: __m256i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm256_mask_cvtepu16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu16_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, src.as_i32x8())) @@ -12162,7 +12483,8 @@ pub fn _mm256_mask_cvtepu16_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm256_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu16_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, i32x8::ZERO)) @@ -12176,7 +12498,8 @@ pub fn _mm256_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm_mask_cvtepu16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu16_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, src.as_i32x4())) @@ -12190,7 +12513,8 @@ pub fn _mm_mask_cvtepu16_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwd))] -pub fn _mm_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu16_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, i32x4::ZERO)) @@ -12204,7 +12528,8 @@ pub fn _mm_maskz_cvtepu16_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm512_cvtepu16_epi64(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu16_epi64(a: __m128i) -> __m512i { unsafe { let a = a.as_u16x8(); transmute::(simd_cast(a)) @@ -12218,7 +12543,8 @@ pub fn _mm512_cvtepu16_epi64(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm512_mask_cvtepu16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepu16_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, src.as_i64x8())) @@ -12232,7 +12558,8 @@ pub fn _mm512_mask_cvtepu16_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm512_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m512i { unsafe { let convert = _mm512_cvtepu16_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, i64x8::ZERO)) @@ -12246,7 +12573,8 @@ pub fn _mm512_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm256_mask_cvtepu16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu16_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, src.as_i64x4())) @@ -12260,7 +12588,8 @@ pub fn _mm256_mask_cvtepu16_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm256_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu16_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, i64x4::ZERO)) @@ -12274,7 +12603,8 @@ pub fn _mm256_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm_mask_cvtepu16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu16_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, src.as_i64x2())) @@ -12288,7 +12618,8 @@ pub fn _mm_mask_cvtepu16_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxwq))] -pub fn _mm_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu16_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, i64x2::ZERO)) @@ -12302,7 +12633,8 @@ pub fn _mm_maskz_cvtepu16_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm512_cvtepi32_epi64(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi32_epi64(a: __m256i) -> __m512i { unsafe { let a = a.as_i32x8(); transmute::(simd_cast(a)) @@ -12316,7 +12648,8 @@ pub fn _mm512_cvtepi32_epi64(a: __m256i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm512_mask_cvtepi32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepi32_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, src.as_i64x8())) @@ -12330,7 +12663,8 @@ pub fn _mm512_mask_cvtepi32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm512_maskz_cvtepi32_epi64(k: __mmask8, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi32_epi64(k: __mmask8, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepi32_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, i64x8::ZERO)) @@ -12344,7 +12678,8 @@ pub fn _mm512_maskz_cvtepi32_epi64(k: __mmask8, a: __m256i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm256_mask_cvtepi32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi32_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, src.as_i64x4())) @@ -12358,7 +12693,8 @@ pub fn _mm256_mask_cvtepi32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm256_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepi32_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, i64x4::ZERO)) @@ -12372,7 +12708,8 @@ pub fn _mm256_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm_mask_cvtepi32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi32_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, src.as_i64x2())) @@ -12386,7 +12723,8 @@ pub fn _mm_mask_cvtepi32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovsxdq))] -pub fn _mm_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepi32_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, i64x2::ZERO)) @@ -12400,7 +12738,8 @@ pub fn _mm_maskz_cvtepi32_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm512_cvtepu32_epi64(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu32_epi64(a: __m256i) -> __m512i { unsafe { let a = a.as_u32x8(); transmute::(simd_cast(a)) @@ -12414,7 +12753,8 @@ pub fn _mm512_cvtepu32_epi64(a: __m256i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm512_mask_cvtepu32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepu32_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, src.as_i64x8())) @@ -12428,7 +12768,8 @@ pub fn _mm512_mask_cvtepu32_epi64(src: __m512i, k: __mmask8, a: __m256i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm512_maskz_cvtepu32_epi64(k: __mmask8, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu32_epi64(k: __mmask8, a: __m256i) -> __m512i { unsafe { let convert = _mm512_cvtepu32_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, convert, i64x8::ZERO)) @@ -12442,7 +12783,8 @@ pub fn _mm512_maskz_cvtepu32_epi64(k: __mmask8, a: __m256i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm256_mask_cvtepu32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu32_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, src.as_i64x4())) @@ -12456,7 +12798,8 @@ pub fn _mm256_mask_cvtepu32_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm256_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let convert = _mm256_cvtepu32_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, convert, i64x4::ZERO)) @@ -12470,7 +12813,8 @@ pub fn _mm256_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm_mask_cvtepu32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu32_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, src.as_i64x2())) @@ -12484,7 +12828,8 @@ pub fn _mm_mask_cvtepu32_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovzxdq))] -pub fn _mm_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let convert = _mm_cvtepu32_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, convert, i64x2::ZERO)) @@ -12498,7 +12843,8 @@ pub fn _mm_maskz_cvtepu32_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm512_cvtepi32_ps(a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi32_ps(a: __m512i) -> __m512 { unsafe { let a = a.as_i32x16(); transmute::(simd_cast(a)) @@ -12512,7 +12858,8 @@ pub fn _mm512_cvtepi32_ps(a: __m512i) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm512_mask_cvtepi32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 { unsafe { let convert = _mm512_cvtepi32_ps(a).as_f32x16(); transmute(simd_select_bitmask(k, convert, src.as_f32x16())) @@ -12526,7 +12873,8 @@ pub fn _mm512_mask_cvtepi32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm512_maskz_cvtepi32_ps(k: __mmask16, a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi32_ps(k: __mmask16, a: __m512i) -> __m512 { unsafe { let convert = _mm512_cvtepi32_ps(a).as_f32x16(); transmute(simd_select_bitmask(k, convert, f32x16::ZERO)) @@ -12540,7 +12888,8 @@ pub fn _mm512_maskz_cvtepi32_ps(k: __mmask16, a: __m512i) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm256_mask_cvtepi32_ps(src: __m256, k: __mmask8, a: __m256i) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi32_ps(src: __m256, k: __mmask8, a: __m256i) -> __m256 { unsafe { let convert = _mm256_cvtepi32_ps(a).as_f32x8(); transmute(simd_select_bitmask(k, convert, src.as_f32x8())) @@ -12554,7 +12903,8 @@ pub fn _mm256_mask_cvtepi32_ps(src: __m256, k: __mmask8, a: __m256i) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm256_maskz_cvtepi32_ps(k: __mmask8, a: __m256i) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi32_ps(k: __mmask8, a: __m256i) -> __m256 { unsafe { let convert = _mm256_cvtepi32_ps(a).as_f32x8(); transmute(simd_select_bitmask(k, convert, f32x8::ZERO)) @@ -12568,7 +12918,8 @@ pub fn _mm256_maskz_cvtepi32_ps(k: __mmask8, a: __m256i) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm_mask_cvtepi32_ps(src: __m128, k: __mmask8, a: __m128i) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi32_ps(src: __m128, k: __mmask8, a: __m128i) -> __m128 { unsafe { let convert = _mm_cvtepi32_ps(a).as_f32x4(); transmute(simd_select_bitmask(k, convert, src.as_f32x4())) @@ -12582,7 +12933,8 @@ pub fn _mm_mask_cvtepi32_ps(src: __m128, k: __mmask8, a: __m128i) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2ps))] -pub fn _mm_maskz_cvtepi32_ps(k: __mmask8, a: __m128i) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi32_ps(k: __mmask8, a: __m128i) -> __m128 { unsafe { let convert = _mm_cvtepi32_ps(a).as_f32x4(); transmute(simd_select_bitmask(k, convert, f32x4::ZERO)) @@ -12596,7 +12948,8 @@ pub fn _mm_maskz_cvtepi32_ps(k: __mmask8, a: __m128i) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm512_cvtepi32_pd(a: __m256i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi32_pd(a: __m256i) -> __m512d { unsafe { let a = a.as_i32x8(); transmute::(simd_cast(a)) @@ -12610,7 +12963,8 @@ pub fn _mm512_cvtepi32_pd(a: __m256i) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm512_mask_cvtepi32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d { unsafe { let convert = _mm512_cvtepi32_pd(a).as_f64x8(); transmute(simd_select_bitmask(k, convert, src.as_f64x8())) @@ -12624,7 +12978,8 @@ pub fn _mm512_mask_cvtepi32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm512_maskz_cvtepi32_pd(k: __mmask8, a: __m256i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi32_pd(k: __mmask8, a: __m256i) -> __m512d { unsafe { let convert = _mm512_cvtepi32_pd(a).as_f64x8(); transmute(simd_select_bitmask(k, convert, f64x8::ZERO)) @@ -12638,7 +12993,8 @@ pub fn _mm512_maskz_cvtepi32_pd(k: __mmask8, a: __m256i) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm256_mask_cvtepi32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d { unsafe { let convert = _mm256_cvtepi32_pd(a).as_f64x4(); transmute(simd_select_bitmask(k, convert, src.as_f64x4())) @@ -12652,7 +13008,8 @@ pub fn _mm256_mask_cvtepi32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm256_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m256d { unsafe { let convert = _mm256_cvtepi32_pd(a).as_f64x4(); transmute(simd_select_bitmask(k, convert, f64x4::ZERO)) @@ -12666,7 +13023,8 @@ pub fn _mm256_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm_mask_cvtepi32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepi32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d { unsafe { let convert = _mm_cvtepi32_pd(a).as_f64x2(); transmute(simd_select_bitmask(k, convert, src.as_f64x2())) @@ -12680,7 +13038,8 @@ pub fn _mm_mask_cvtepi32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m128d { unsafe { let convert = _mm_cvtepi32_pd(a).as_f64x2(); transmute(simd_select_bitmask(k, convert, f64x2::ZERO)) @@ -12694,7 +13053,8 @@ pub fn _mm_maskz_cvtepi32_pd(k: __mmask8, a: __m128i) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2ps))] -pub fn _mm512_cvtepu32_ps(a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu32_ps(a: __m512i) -> __m512 { unsafe { let a = a.as_u32x16(); transmute::(simd_cast(a)) @@ -12708,7 +13068,8 @@ pub fn _mm512_cvtepu32_ps(a: __m512i) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2ps))] -pub fn _mm512_mask_cvtepu32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 { unsafe { let convert = _mm512_cvtepu32_ps(a).as_f32x16(); transmute(simd_select_bitmask(k, convert, src.as_f32x16())) @@ -12722,7 +13083,8 @@ pub fn _mm512_mask_cvtepu32_ps(src: __m512, k: __mmask16, a: __m512i) -> __m512 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2ps))] -pub fn _mm512_maskz_cvtepu32_ps(k: __mmask16, a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu32_ps(k: __mmask16, a: __m512i) -> __m512 { unsafe { let convert = _mm512_cvtepu32_ps(a).as_f32x16(); transmute(simd_select_bitmask(k, convert, f32x16::ZERO)) @@ -12736,7 +13098,8 @@ pub fn _mm512_maskz_cvtepu32_ps(k: __mmask16, a: __m512i) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm512_cvtepu32_pd(a: __m256i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu32_pd(a: __m256i) -> __m512d { unsafe { let a = a.as_u32x8(); transmute::(simd_cast(a)) @@ -12750,7 +13113,8 @@ pub fn _mm512_cvtepu32_pd(a: __m256i) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm512_mask_cvtepu32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d { unsafe { let convert = _mm512_cvtepu32_pd(a).as_f64x8(); transmute(simd_select_bitmask(k, convert, src.as_f64x8())) @@ -12764,7 +13128,8 @@ pub fn _mm512_mask_cvtepu32_pd(src: __m512d, k: __mmask8, a: __m256i) -> __m512d #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm512_maskz_cvtepu32_pd(k: __mmask8, a: __m256i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepu32_pd(k: __mmask8, a: __m256i) -> __m512d { unsafe { let convert = _mm512_cvtepu32_pd(a).as_f64x8(); transmute(simd_select_bitmask(k, convert, f64x8::ZERO)) @@ -12778,7 +13143,8 @@ pub fn _mm512_maskz_cvtepu32_pd(k: __mmask8, a: __m256i) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm256_cvtepu32_pd(a: __m128i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepu32_pd(a: __m128i) -> __m256d { unsafe { let a = a.as_u32x4(); transmute::(simd_cast(a)) @@ -12792,7 +13158,8 @@ pub fn _mm256_cvtepu32_pd(a: __m128i) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm256_mask_cvtepu32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepu32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d { unsafe { let convert = _mm256_cvtepu32_pd(a).as_f64x4(); transmute(simd_select_bitmask(k, convert, src.as_f64x4())) @@ -12806,7 +13173,8 @@ pub fn _mm256_mask_cvtepu32_pd(src: __m256d, k: __mmask8, a: __m128i) -> __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm256_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m256d { unsafe { let convert = _mm256_cvtepu32_pd(a).as_f64x4(); transmute(simd_select_bitmask(k, convert, f64x4::ZERO)) @@ -12820,7 +13188,8 @@ pub fn _mm256_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm_cvtepu32_pd(a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu32_pd(a: __m128i) -> __m128d { unsafe { let a = a.as_u32x4(); let u64: u32x2 = simd_shuffle!(a, a, [0, 1]); @@ -12835,7 +13204,8 @@ pub fn _mm_cvtepu32_pd(a: __m128i) -> __m128d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm_mask_cvtepu32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cvtepu32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d { unsafe { let convert = _mm_cvtepu32_pd(a).as_f64x2(); transmute(simd_select_bitmask(k, convert, src.as_f64x2())) @@ -12849,7 +13219,8 @@ pub fn _mm_mask_cvtepu32_pd(src: __m128d, k: __mmask8, a: __m128i) -> __m128d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m128d { unsafe { let convert = _mm_cvtepu32_pd(a).as_f64x2(); transmute(simd_select_bitmask(k, convert, f64x2::ZERO)) @@ -12863,7 +13234,8 @@ pub fn _mm_maskz_cvtepu32_pd(k: __mmask8, a: __m128i) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm512_cvtepi32lo_pd(v2: __m512i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi32lo_pd(v2: __m512i) -> __m512d { unsafe { let v2 = v2.as_i32x16(); let v256: i32x8 = simd_shuffle!(v2, v2, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -12878,7 +13250,8 @@ pub fn _mm512_cvtepi32lo_pd(v2: __m512i) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtdq2pd))] -pub fn _mm512_mask_cvtepi32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m512d { unsafe { let convert = _mm512_cvtepi32lo_pd(v2).as_f64x8(); transmute(simd_select_bitmask(k, convert, src.as_f64x8())) @@ -12892,7 +13265,8 @@ pub fn _mm512_mask_cvtepi32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm512_cvtepu32lo_pd(v2: __m512i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepu32lo_pd(v2: __m512i) -> __m512d { unsafe { let v2 = v2.as_u32x16(); let v256: u32x8 = simd_shuffle!(v2, v2, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -12907,7 +13281,8 @@ pub fn _mm512_cvtepu32lo_pd(v2: __m512i) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtudq2pd))] -pub fn _mm512_mask_cvtepu32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepu32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m512d { unsafe { let convert = _mm512_cvtepu32lo_pd(v2).as_f64x8(); transmute(simd_select_bitmask(k, convert, src.as_f64x8())) @@ -12921,7 +13296,8 @@ pub fn _mm512_mask_cvtepu32lo_pd(src: __m512d, k: __mmask8, v2: __m512i) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdw))] -pub fn _mm512_cvtepi32_epi16(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi32_epi16(a: __m512i) -> __m256i { unsafe { let a = a.as_i32x16(); transmute::(simd_cast(a)) @@ -12935,7 +13311,8 @@ pub fn _mm512_cvtepi32_epi16(a: __m512i) -> __m256i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdw))] -pub fn _mm512_mask_cvtepi32_epi16(src: __m256i, k: __mmask16, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi32_epi16(src: __m256i, k: __mmask16, a: __m512i) -> __m256i { unsafe { let convert = _mm512_cvtepi32_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, convert, src.as_i16x16())) @@ -12949,7 +13326,8 @@ pub fn _mm512_mask_cvtepi32_epi16(src: __m256i, k: __mmask16, a: __m512i) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdw))] -pub fn _mm512_maskz_cvtepi32_epi16(k: __mmask16, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi32_epi16(k: __mmask16, a: __m512i) -> __m256i { unsafe { let convert = _mm512_cvtepi32_epi16(a).as_i16x16(); transmute(simd_select_bitmask(k, convert, i16x16::ZERO)) @@ -12963,7 +13341,8 @@ pub fn _mm512_maskz_cvtepi32_epi16(k: __mmask16, a: __m512i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdw))] -pub fn _mm256_cvtepi32_epi16(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi32_epi16(a: __m256i) -> __m128i { unsafe { let a = a.as_i32x8(); transmute::(simd_cast(a)) @@ -12977,7 +13356,8 @@ pub fn _mm256_cvtepi32_epi16(a: __m256i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdw))] -pub fn _mm256_mask_cvtepi32_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi32_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m128i { unsafe { let convert = _mm256_cvtepi32_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, src.as_i16x8())) @@ -12991,7 +13371,8 @@ pub fn _mm256_mask_cvtepi32_epi16(src: __m128i, k: __mmask8, a: __m256i) -> __m1 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdw))] -pub fn _mm256_maskz_cvtepi32_epi16(k: __mmask8, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi32_epi16(k: __mmask8, a: __m256i) -> __m128i { unsafe { let convert = _mm256_cvtepi32_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, i16x8::ZERO)) @@ -13038,7 +13419,8 @@ pub fn _mm_maskz_cvtepi32_epi16(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdb))] -pub fn _mm512_cvtepi32_epi8(a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi32_epi8(a: __m512i) -> __m128i { unsafe { let a = a.as_i32x16(); transmute::(simd_cast(a)) @@ -13052,7 +13434,8 @@ pub fn _mm512_cvtepi32_epi8(a: __m512i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdb))] -pub fn _mm512_mask_cvtepi32_epi8(src: __m128i, k: __mmask16, a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi32_epi8(src: __m128i, k: __mmask16, a: __m512i) -> __m128i { unsafe { let convert = _mm512_cvtepi32_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, convert, src.as_i8x16())) @@ -13066,7 +13449,8 @@ pub fn _mm512_mask_cvtepi32_epi8(src: __m128i, k: __mmask16, a: __m512i) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovdb))] -pub fn _mm512_maskz_cvtepi32_epi8(k: __mmask16, a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi32_epi8(k: __mmask16, a: __m512i) -> __m128i { unsafe { let convert = _mm512_cvtepi32_epi8(a).as_i8x16(); transmute(simd_select_bitmask(k, convert, i8x16::ZERO)) @@ -13146,7 +13530,8 @@ pub fn _mm_maskz_cvtepi32_epi8(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqd))] -pub fn _mm512_cvtepi64_epi32(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi64_epi32(a: __m512i) -> __m256i { unsafe { let a = a.as_i64x8(); transmute::(simd_cast(a)) @@ -13160,7 +13545,8 @@ pub fn _mm512_cvtepi64_epi32(a: __m512i) -> __m256i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqd))] -pub fn _mm512_mask_cvtepi64_epi32(src: __m256i, k: __mmask8, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi64_epi32(src: __m256i, k: __mmask8, a: __m512i) -> __m256i { unsafe { let convert = _mm512_cvtepi64_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, src.as_i32x8())) @@ -13174,7 +13560,8 @@ pub fn _mm512_mask_cvtepi64_epi32(src: __m256i, k: __mmask8, a: __m512i) -> __m2 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqd))] -pub fn _mm512_maskz_cvtepi64_epi32(k: __mmask8, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi64_epi32(k: __mmask8, a: __m512i) -> __m256i { unsafe { let convert = _mm512_cvtepi64_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, convert, i32x8::ZERO)) @@ -13188,7 +13575,8 @@ pub fn _mm512_maskz_cvtepi64_epi32(k: __mmask8, a: __m512i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqd))] -pub fn _mm256_cvtepi64_epi32(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtepi64_epi32(a: __m256i) -> __m128i { unsafe { let a = a.as_i64x4(); transmute::(simd_cast(a)) @@ -13202,7 +13590,8 @@ pub fn _mm256_cvtepi64_epi32(a: __m256i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqd))] -pub fn _mm256_mask_cvtepi64_epi32(src: __m128i, k: __mmask8, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cvtepi64_epi32(src: __m128i, k: __mmask8, a: __m256i) -> __m128i { unsafe { let convert = _mm256_cvtepi64_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, src.as_i32x4())) @@ -13216,7 +13605,8 @@ pub fn _mm256_mask_cvtepi64_epi32(src: __m128i, k: __mmask8, a: __m256i) -> __m1 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqd))] -pub fn _mm256_maskz_cvtepi64_epi32(k: __mmask8, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_cvtepi64_epi32(k: __mmask8, a: __m256i) -> __m128i { unsafe { let convert = _mm256_cvtepi64_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, convert, i32x4::ZERO)) @@ -13263,7 +13653,8 @@ pub fn _mm_maskz_cvtepi64_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqw))] -pub fn _mm512_cvtepi64_epi16(a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtepi64_epi16(a: __m512i) -> __m128i { unsafe { let a = a.as_i64x8(); transmute::(simd_cast(a)) @@ -13277,7 +13668,8 @@ pub fn _mm512_cvtepi64_epi16(a: __m512i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqw))] -pub fn _mm512_mask_cvtepi64_epi16(src: __m128i, k: __mmask8, a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cvtepi64_epi16(src: __m128i, k: __mmask8, a: __m512i) -> __m128i { unsafe { let convert = _mm512_cvtepi64_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, src.as_i16x8())) @@ -13291,7 +13683,8 @@ pub fn _mm512_mask_cvtepi64_epi16(src: __m128i, k: __mmask8, a: __m512i) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpmovqw))] -pub fn _mm512_maskz_cvtepi64_epi16(k: __mmask8, a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_cvtepi64_epi16(k: __mmask8, a: __m512i) -> __m128i { unsafe { let convert = _mm512_cvtepi64_epi16(a).as_i16x8(); transmute(simd_select_bitmask(k, convert, i16x8::ZERO)) @@ -16248,7 +16641,8 @@ pub fn _mm_maskz_cvttpd_epu32(k: __mmask8, a: __m128d) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxorps))] -pub fn _mm512_setzero_pd() -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setzero_pd() -> __m512d { // All-0 is a properly initialized __m512d unsafe { const { mem::zeroed() } } } @@ -16260,7 +16654,8 @@ pub fn _mm512_setzero_pd() -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxorps))] -pub fn _mm512_setzero_ps() -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setzero_ps() -> __m512 { // All-0 is a properly initialized __m512 unsafe { const { mem::zeroed() } } } @@ -16272,7 +16667,8 @@ pub fn _mm512_setzero_ps() -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxorps))] -pub fn _mm512_setzero() -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setzero() -> __m512 { // All-0 is a properly initialized __m512 unsafe { const { mem::zeroed() } } } @@ -16284,7 +16680,8 @@ pub fn _mm512_setzero() -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxorps))] -pub fn _mm512_setzero_si512() -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setzero_si512() -> __m512i { // All-0 is a properly initialized __m512i unsafe { const { mem::zeroed() } } } @@ -16296,7 +16693,8 @@ pub fn _mm512_setzero_si512() -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxorps))] -pub fn _mm512_setzero_epi32() -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setzero_epi32() -> __m512i { // All-0 is a properly initialized __m512i unsafe { const { mem::zeroed() } } } @@ -16308,7 +16706,8 @@ pub fn _mm512_setzero_epi32() -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr_epi32( e15: i32, e14: i32, e13: i32, @@ -16340,7 +16739,8 @@ pub fn _mm512_setr_epi32( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_epi8( e63: i8, e62: i8, e61: i8, @@ -16423,7 +16823,8 @@ pub fn _mm512_set_epi8( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_epi16( e31: i16, e30: i16, e29: i16, @@ -16472,7 +16873,8 @@ pub fn _mm512_set_epi16( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i { _mm512_set_epi32(d, c, b, a, d, c, b, a, d, c, b, a, d, c, b, a) } @@ -16482,7 +16884,8 @@ pub fn _mm512_set4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 { _mm512_set_ps(d, c, b, a, d, c, b, a, d, c, b, a, d, c, b, a) } @@ -16492,7 +16895,8 @@ pub fn _mm512_set4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d { _mm512_set_pd(d, c, b, a, d, c, b, a) } @@ -16502,7 +16906,8 @@ pub fn _mm512_set4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i { _mm512_set_epi32(a, b, c, d, a, b, c, d, a, b, c, d, a, b, c, d) } @@ -16512,7 +16917,8 @@ pub fn _mm512_setr4_epi32(d: i32, c: i32, b: i32, a: i32) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 { _mm512_set_ps(a, b, c, d, a, b, c, d, a, b, c, d, a, b, c, d) } @@ -16522,7 +16928,8 @@ pub fn _mm512_setr4_ps(d: f32, c: f32, b: f32, a: f32) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d { _mm512_set_pd(a, b, c, d, a, b, c, d) } @@ -16532,7 +16939,8 @@ pub fn _mm512_setr4_pd(d: f64, c: f64, b: f64, a: f64) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_epi64( e0: i64, e1: i64, e2: i64, @@ -16551,7 +16959,8 @@ pub fn _mm512_set_epi64( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr_epi64( e0: i64, e1: i64, e2: i64, @@ -19076,7 +19485,8 @@ pub fn _mm_maskz_expand_pd(k: __mmask8, a: __m128d) -> __m128d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_rol_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_rol_epi32(a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_rolv_epi32(a, _mm512_set1_epi32(IMM8)) } @@ -19089,7 +19499,12 @@ pub fn _mm512_rol_epi32(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_rol_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_rol_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, +) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_rolv_epi32(src, k, a, _mm512_set1_epi32(IMM8)) } @@ -19102,7 +19517,8 @@ pub fn _mm512_mask_rol_epi32(src: __m512i, k: __mmask16, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_rol_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_rol_epi32(k: __mmask16, a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_maskz_rolv_epi32(k, a, _mm512_set1_epi32(IMM8)) } @@ -19115,7 +19531,8 @@ pub fn _mm512_maskz_rol_epi32(k: __mmask16, a: __m512i) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm256_rol_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_rol_epi32(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_rolv_epi32(a, _mm256_set1_epi32(IMM8)) } @@ -19128,7 +19545,12 @@ pub fn _mm256_rol_epi32(a: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_rol_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_rol_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_rolv_epi32(src, k, a, _mm256_set1_epi32(IMM8)) } @@ -19141,7 +19563,8 @@ pub fn _mm256_mask_rol_epi32(src: __m256i, k: __mmask8, a: __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_rol_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_rol_epi32(k: __mmask8, a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_maskz_rolv_epi32(k, a, _mm256_set1_epi32(IMM8)) } @@ -19154,7 +19577,8 @@ pub fn _mm256_maskz_rol_epi32(k: __mmask8, a: __m256i) -> __m25 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm_rol_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_rol_epi32(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_rolv_epi32(a, _mm_set1_epi32(IMM8)) } @@ -19167,7 +19591,8 @@ pub fn _mm_rol_epi32(a: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_rol_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_rol_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_mask_rolv_epi32(src, k, a, _mm_set1_epi32(IMM8)) } @@ -19180,7 +19605,8 @@ pub fn _mm_mask_rol_epi32(src: __m128i, k: __mmask8, a: __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_rol_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_rol_epi32(k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_maskz_rolv_epi32(k, a, _mm_set1_epi32(IMM8)) } @@ -19193,7 +19619,8 @@ pub fn _mm_maskz_rol_epi32(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_ror_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_ror_epi32(a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_rorv_epi32(a, _mm512_set1_epi32(IMM8)) } @@ -19206,7 +19633,12 @@ pub fn _mm512_ror_epi32(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 123))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_ror_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_ror_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, +) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_rorv_epi32(src, k, a, _mm512_set1_epi32(IMM8)) } @@ -19219,7 +19651,8 @@ pub fn _mm512_mask_ror_epi32(src: __m512i, k: __mmask16, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 123))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_ror_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_ror_epi32(k: __mmask16, a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_maskz_rorv_epi32(k, a, _mm512_set1_epi32(IMM8)) } @@ -19232,7 +19665,8 @@ pub fn _mm512_maskz_ror_epi32(k: __mmask16, a: __m512i) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm256_ror_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_ror_epi32(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_rorv_epi32(a, _mm256_set1_epi32(IMM8)) } @@ -19245,7 +19679,12 @@ pub fn _mm256_ror_epi32(a: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 123))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_ror_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_ror_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_rorv_epi32(src, k, a, _mm256_set1_epi32(IMM8)) } @@ -19258,7 +19697,8 @@ pub fn _mm256_mask_ror_epi32(src: __m256i, k: __mmask8, a: __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 123))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_ror_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_ror_epi32(k: __mmask8, a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_maskz_rorv_epi32(k, a, _mm256_set1_epi32(IMM8)) } @@ -19271,7 +19711,8 @@ pub fn _mm256_maskz_ror_epi32(k: __mmask8, a: __m256i) -> __m25 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm_ror_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_ror_epi32(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_rorv_epi32(a, _mm_set1_epi32(IMM8)) } @@ -19284,7 +19725,8 @@ pub fn _mm_ror_epi32(a: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 123))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_ror_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_ror_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_mask_rorv_epi32(src, k, a, _mm_set1_epi32(IMM8)) } @@ -19297,7 +19739,8 @@ pub fn _mm_mask_ror_epi32(src: __m128i, k: __mmask8, a: __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprold, IMM8 = 123))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_ror_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_ror_epi32(k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_maskz_rorv_epi32(k, a, _mm_set1_epi32(IMM8)) } @@ -19310,7 +19753,8 @@ pub fn _mm_maskz_ror_epi32(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_rol_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_rol_epi64(a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_rolv_epi64(a, _mm512_set1_epi64(IMM8 as i64)) } @@ -19323,7 +19767,12 @@ pub fn _mm512_rol_epi64(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_rol_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_rol_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, +) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_rolv_epi64(src, k, a, _mm512_set1_epi64(IMM8 as i64)) } @@ -19336,7 +19785,8 @@ pub fn _mm512_mask_rol_epi64(src: __m512i, k: __mmask8, a: __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_rol_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_rol_epi64(k: __mmask8, a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_maskz_rolv_epi64(k, a, _mm512_set1_epi64(IMM8 as i64)) } @@ -19349,7 +19799,8 @@ pub fn _mm512_maskz_rol_epi64(k: __mmask8, a: __m512i) -> __m51 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm256_rol_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_rol_epi64(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_rolv_epi64(a, _mm256_set1_epi64x(IMM8 as i64)) } @@ -19362,7 +19813,12 @@ pub fn _mm256_rol_epi64(a: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_rol_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_rol_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_rolv_epi64(src, k, a, _mm256_set1_epi64x(IMM8 as i64)) } @@ -19375,7 +19831,8 @@ pub fn _mm256_mask_rol_epi64(src: __m256i, k: __mmask8, a: __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_rol_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_rol_epi64(k: __mmask8, a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_maskz_rolv_epi64(k, a, _mm256_set1_epi64x(IMM8 as i64)) } @@ -19388,7 +19845,8 @@ pub fn _mm256_maskz_rol_epi64(k: __mmask8, a: __m256i) -> __m25 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm_rol_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_rol_epi64(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_rolv_epi64(a, _mm_set1_epi64x(IMM8 as i64)) } @@ -19401,7 +19859,8 @@ pub fn _mm_rol_epi64(a: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_rol_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_rol_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_mask_rolv_epi64(src, k, a, _mm_set1_epi64x(IMM8 as i64)) } @@ -19414,7 +19873,8 @@ pub fn _mm_mask_rol_epi64(src: __m128i, k: __mmask8, a: __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_rol_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_rol_epi64(k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_maskz_rolv_epi64(k, a, _mm_set1_epi64x(IMM8 as i64)) } @@ -19427,7 +19887,8 @@ pub fn _mm_maskz_rol_epi64(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_ror_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_ror_epi64(a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_rorv_epi64(a, _mm512_set1_epi64(IMM8 as i64)) } @@ -19440,7 +19901,12 @@ pub fn _mm512_ror_epi64(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_ror_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_ror_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, +) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_rorv_epi64(src, k, a, _mm512_set1_epi64(IMM8 as i64)) } @@ -19453,7 +19919,8 @@ pub fn _mm512_mask_ror_epi64(src: __m512i, k: __mmask8, a: __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_ror_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_ror_epi64(k: __mmask8, a: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_maskz_rorv_epi64(k, a, _mm512_set1_epi64(IMM8 as i64)) } @@ -19466,7 +19933,8 @@ pub fn _mm512_maskz_ror_epi64(k: __mmask8, a: __m512i) -> __m51 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(1)] -pub fn _mm256_ror_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_ror_epi64(a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_rorv_epi64(a, _mm256_set1_epi64x(IMM8 as i64)) } @@ -19479,7 +19947,12 @@ pub fn _mm256_ror_epi64(a: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_ror_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_ror_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_rorv_epi64(src, k, a, _mm256_set1_epi64x(IMM8 as i64)) } @@ -19492,7 +19965,8 @@ pub fn _mm256_mask_ror_epi64(src: __m256i, k: __mmask8, a: __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_ror_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_ror_epi64(k: __mmask8, a: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_maskz_rorv_epi64(k, a, _mm256_set1_epi64x(IMM8 as i64)) } @@ -19505,7 +19979,8 @@ pub fn _mm256_maskz_ror_epi64(k: __mmask8, a: __m256i) -> __m25 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(1)] -pub fn _mm_ror_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_ror_epi64(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_rorv_epi64(a, _mm_set1_epi64x(IMM8 as i64)) } @@ -19518,7 +19993,8 @@ pub fn _mm_ror_epi64(a: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_ror_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_ror_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_mask_rorv_epi64(src, k, a, _mm_set1_epi64x(IMM8 as i64)) } @@ -19531,7 +20007,8 @@ pub fn _mm_mask_ror_epi64(src: __m128i, k: __mmask8, a: __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolq, IMM8 = 15))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_ror_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_ror_epi64(k: __mmask8, a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_maskz_rorv_epi64(k, a, _mm_set1_epi64x(IMM8 as i64)) } @@ -19544,7 +20021,8 @@ pub fn _mm_maskz_ror_epi64(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_slli_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_slli_epi32(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19563,7 +20041,12 @@ pub fn _mm512_slli_epi32(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_slli_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_slli_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 32 { @@ -19583,7 +20066,8 @@ pub fn _mm512_mask_slli_epi32(src: __m512i, k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_slli_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_slli_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19603,7 +20087,12 @@ pub fn _mm512_maskz_slli_epi32(k: __mmask16, a: __m512i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_slli_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_slli_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 32 { @@ -19623,7 +20112,8 @@ pub fn _mm256_mask_slli_epi32(src: __m256i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_slli_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_slli_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19643,7 +20133,12 @@ pub fn _mm256_maskz_slli_epi32(k: __mmask8, a: __m256i) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_slli_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_slli_epi32( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 32 { @@ -19663,7 +20158,8 @@ pub fn _mm_mask_slli_epi32(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpslld, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_slli_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_slli_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19683,7 +20179,8 @@ pub fn _mm_maskz_slli_epi32(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_srli_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srli_epi32(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19702,7 +20199,12 @@ pub fn _mm512_srli_epi32(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_srli_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srli_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 32 { @@ -19722,7 +20224,8 @@ pub fn _mm512_mask_srli_epi32(src: __m512i, k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_srli_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srli_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19742,7 +20245,12 @@ pub fn _mm512_maskz_srli_epi32(k: __mmask16, a: __m512i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_srli_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srli_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 32 { @@ -19762,7 +20270,8 @@ pub fn _mm256_mask_srli_epi32(src: __m256i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_srli_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srli_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19782,7 +20291,12 @@ pub fn _mm256_maskz_srli_epi32(k: __mmask8, a: __m256i) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_srli_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srli_epi32( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 32 { @@ -19802,7 +20316,8 @@ pub fn _mm_mask_srli_epi32(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrld, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_srli_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srli_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 32 { @@ -19822,7 +20337,8 @@ pub fn _mm_maskz_srli_epi32(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_slli_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_slli_epi64(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -19841,7 +20357,12 @@ pub fn _mm512_slli_epi64(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_slli_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_slli_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 64 { @@ -19861,7 +20382,8 @@ pub fn _mm512_mask_slli_epi64(src: __m512i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_slli_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_slli_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -19881,7 +20403,12 @@ pub fn _mm512_maskz_slli_epi64(k: __mmask8, a: __m512i) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_slli_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_slli_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 64 { @@ -19901,7 +20428,8 @@ pub fn _mm256_mask_slli_epi64(src: __m256i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_slli_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_slli_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -19921,7 +20449,12 @@ pub fn _mm256_maskz_slli_epi64(k: __mmask8, a: __m256i) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_slli_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_slli_epi64( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 64 { @@ -19941,7 +20474,8 @@ pub fn _mm_mask_slli_epi64(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllq, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_slli_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_slli_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -19961,7 +20495,8 @@ pub fn _mm_maskz_slli_epi64(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_srli_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srli_epi64(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -19980,7 +20515,12 @@ pub fn _mm512_srli_epi64(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_srli_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srli_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = if IMM8 >= 64 { @@ -20000,7 +20540,8 @@ pub fn _mm512_mask_srli_epi64(src: __m512i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_srli_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srli_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -20020,7 +20561,12 @@ pub fn _mm512_maskz_srli_epi64(k: __mmask8, a: __m512i) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_srli_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srli_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 64 { @@ -20040,7 +20586,8 @@ pub fn _mm256_mask_srli_epi64(src: __m256i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_srli_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srli_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -20060,7 +20607,12 @@ pub fn _mm256_maskz_srli_epi64(k: __mmask8, a: __m256i) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_srli_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srli_epi64( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = if IMM8 >= 64 { @@ -20080,7 +20632,8 @@ pub fn _mm_mask_srli_epi64(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_srli_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srli_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); if IMM8 >= 64 { @@ -20692,7 +21245,8 @@ pub fn _mm_maskz_sra_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_srai_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srai_epi32(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); transmute(simd_shr(a.as_i32x16(), i32x16::splat(IMM8.min(31) as i32))) @@ -20707,7 +21261,12 @@ pub fn _mm512_srai_epi32(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_srai_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srai_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = simd_shr(a.as_i32x16(), i32x16::splat(IMM8.min(31) as i32)); @@ -20723,7 +21282,8 @@ pub fn _mm512_mask_srai_epi32(src: __m512i, k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_srai_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srai_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = simd_shr(a.as_i32x16(), i32x16::splat(IMM8.min(31) as i32)); @@ -20739,7 +21299,12 @@ pub fn _mm512_maskz_srai_epi32(k: __mmask16, a: __m512i) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_srai_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srai_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { let r = simd_shr(a.as_i32x8(), i32x8::splat(IMM8.min(31) as i32)); transmute(simd_select_bitmask(k, r, src.as_i32x8())) @@ -20754,7 +21319,8 @@ pub fn _mm256_mask_srai_epi32(src: __m256i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_srai_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srai_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { let r = simd_shr(a.as_i32x8(), i32x8::splat(IMM8.min(31) as i32)); transmute(simd_select_bitmask(k, r, i32x8::ZERO)) @@ -20769,7 +21335,12 @@ pub fn _mm256_maskz_srai_epi32(k: __mmask8, a: __m256i) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_srai_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srai_epi32( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { let r = simd_shr(a.as_i32x4(), i32x4::splat(IMM8.min(31) as i32)); transmute(simd_select_bitmask(k, r, src.as_i32x4())) @@ -20784,7 +21355,8 @@ pub fn _mm_mask_srai_epi32(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrad, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_srai_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srai_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let r = simd_shr(a.as_i32x4(), i32x4::splat(IMM8.min(31) as i32)); transmute(simd_select_bitmask(k, r, i32x4::ZERO)) @@ -20799,7 +21371,8 @@ pub fn _mm_maskz_srai_epi32(k: __mmask8, a: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_srai_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srai_epi64(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); transmute(simd_shr(a.as_i64x8(), i64x8::splat(IMM8.min(63) as i64))) @@ -20814,7 +21387,12 @@ pub fn _mm512_srai_epi64(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_srai_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srai_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i64x8(), i64x8::splat(IMM8.min(63) as i64)); @@ -20830,7 +21408,8 @@ pub fn _mm512_mask_srai_epi64(src: __m512i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_srai_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srai_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i64x8(), i64x8::splat(IMM8.min(63) as i64)); @@ -20846,7 +21425,8 @@ pub fn _mm512_maskz_srai_epi64(k: __mmask8, a: __m512i) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm256_srai_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srai_epi64(a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); transmute(simd_shr(a.as_i64x4(), i64x4::splat(IMM8.min(63) as i64))) @@ -20861,7 +21441,12 @@ pub fn _mm256_srai_epi64(a: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_srai_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srai_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i64x4(), i64x4::splat(IMM8.min(63) as i64)); @@ -20877,7 +21462,8 @@ pub fn _mm256_mask_srai_epi64(src: __m256i, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_srai_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srai_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i64x4(), i64x4::splat(IMM8.min(63) as i64)); @@ -20893,7 +21479,8 @@ pub fn _mm256_maskz_srai_epi64(k: __mmask8, a: __m256i) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm_srai_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srai_epi64(a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); transmute(simd_shr(a.as_i64x2(), i64x2::splat(IMM8.min(63) as i64))) @@ -20908,7 +21495,12 @@ pub fn _mm_srai_epi64(a: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_srai_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srai_epi64( + src: __m128i, + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i64x2(), i64x2::splat(IMM8.min(63) as i64)); @@ -20924,7 +21516,8 @@ pub fn _mm_mask_srai_epi64(src: __m128i, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsraq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_srai_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srai_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = simd_shr(a.as_i64x2(), i64x2::splat(IMM8.min(63) as i64)); @@ -20939,7 +21532,8 @@ pub fn _mm_maskz_srai_epi64(k: __mmask8, a: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm512_srav_epi32(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srav_epi32(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u32x16(); let no_overflow: u32x16 = simd_lt(count, u32x16::splat(u32::BITS)); @@ -20955,7 +21549,13 @@ pub fn _mm512_srav_epi32(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm512_mask_srav_epi32(src: __m512i, k: __mmask16, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srav_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_srav_epi32(a, count).as_i32x16(); transmute(simd_select_bitmask(k, shf, src.as_i32x16())) @@ -20969,7 +21569,8 @@ pub fn _mm512_mask_srav_epi32(src: __m512i, k: __mmask16, a: __m512i, count: __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm512_maskz_srav_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srav_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_srav_epi32(a, count).as_i32x16(); transmute(simd_select_bitmask(k, shf, i32x16::ZERO)) @@ -20983,7 +21584,13 @@ pub fn _mm512_maskz_srav_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m5 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm256_mask_srav_epi32(src: __m256i, k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srav_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_srav_epi32(a, count).as_i32x8(); transmute(simd_select_bitmask(k, shf, src.as_i32x8())) @@ -20997,7 +21604,8 @@ pub fn _mm256_mask_srav_epi32(src: __m256i, k: __mmask8, a: __m256i, count: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm256_maskz_srav_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srav_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_srav_epi32(a, count).as_i32x8(); transmute(simd_select_bitmask(k, shf, i32x8::ZERO)) @@ -21011,7 +21619,8 @@ pub fn _mm256_maskz_srav_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm_mask_srav_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srav_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srav_epi32(a, count).as_i32x4(); transmute(simd_select_bitmask(k, shf, src.as_i32x4())) @@ -21025,7 +21634,8 @@ pub fn _mm_mask_srav_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravd))] -pub fn _mm_maskz_srav_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srav_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srav_epi32(a, count).as_i32x4(); transmute(simd_select_bitmask(k, shf, i32x4::ZERO)) @@ -21039,7 +21649,8 @@ pub fn _mm_maskz_srav_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm512_srav_epi64(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srav_epi64(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u64x8(); let no_overflow: u64x8 = simd_lt(count, u64x8::splat(u64::BITS as u64)); @@ -21055,7 +21666,13 @@ pub fn _mm512_srav_epi64(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm512_mask_srav_epi64(src: __m512i, k: __mmask8, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srav_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_srav_epi64(a, count).as_i64x8(); transmute(simd_select_bitmask(k, shf, src.as_i64x8())) @@ -21069,7 +21686,8 @@ pub fn _mm512_mask_srav_epi64(src: __m512i, k: __mmask8, a: __m512i, count: __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm512_maskz_srav_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srav_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_srav_epi64(a, count).as_i64x8(); transmute(simd_select_bitmask(k, shf, i64x8::ZERO)) @@ -21083,7 +21701,8 @@ pub fn _mm512_maskz_srav_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m51 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm256_srav_epi64(a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_srav_epi64(a: __m256i, count: __m256i) -> __m256i { unsafe { let count = count.as_u64x4(); let no_overflow: u64x4 = simd_lt(count, u64x4::splat(u64::BITS as u64)); @@ -21099,7 +21718,13 @@ pub fn _mm256_srav_epi64(a: __m256i, count: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm256_mask_srav_epi64(src: __m256i, k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srav_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_srav_epi64(a, count).as_i64x4(); transmute(simd_select_bitmask(k, shf, src.as_i64x4())) @@ -21113,7 +21738,8 @@ pub fn _mm256_mask_srav_epi64(src: __m256i, k: __mmask8, a: __m256i, count: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm256_maskz_srav_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srav_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_srav_epi64(a, count).as_i64x4(); transmute(simd_select_bitmask(k, shf, i64x4::ZERO)) @@ -21127,7 +21753,8 @@ pub fn _mm256_maskz_srav_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm_srav_epi64(a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srav_epi64(a: __m128i, count: __m128i) -> __m128i { unsafe { let count = count.as_u64x2(); let no_overflow: u64x2 = simd_lt(count, u64x2::splat(u64::BITS as u64)); @@ -21143,7 +21770,8 @@ pub fn _mm_srav_epi64(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm_mask_srav_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srav_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srav_epi64(a, count).as_i64x2(); transmute(simd_select_bitmask(k, shf, src.as_i64x2())) @@ -21157,7 +21785,8 @@ pub fn _mm_mask_srav_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsravq))] -pub fn _mm_maskz_srav_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srav_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srav_epi64(a, count).as_i64x2(); transmute(simd_select_bitmask(k, shf, i64x2::ZERO)) @@ -21171,7 +21800,8 @@ pub fn _mm_maskz_srav_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm512_rolv_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_rolv_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shl( a.as_u32x16(), @@ -21188,7 +21818,8 @@ pub fn _mm512_rolv_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm512_mask_rolv_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_rolv_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let rol = _mm512_rolv_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, rol, src.as_i32x16())) @@ -21202,7 +21833,8 @@ pub fn _mm512_mask_rolv_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm512_maskz_rolv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_rolv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let rol = _mm512_rolv_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, rol, i32x16::ZERO)) @@ -21216,7 +21848,8 @@ pub fn _mm512_maskz_rolv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm256_rolv_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_rolv_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shl( a.as_u32x8(), @@ -21233,7 +21866,8 @@ pub fn _mm256_rolv_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm256_mask_rolv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_rolv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let rol = _mm256_rolv_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, rol, src.as_i32x8())) @@ -21247,7 +21881,8 @@ pub fn _mm256_mask_rolv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm256_maskz_rolv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_rolv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let rol = _mm256_rolv_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, rol, i32x8::ZERO)) @@ -21261,7 +21896,8 @@ pub fn _mm256_maskz_rolv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm_rolv_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_rolv_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shl( a.as_u32x4(), @@ -21278,7 +21914,8 @@ pub fn _mm_rolv_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm_mask_rolv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_rolv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let rol = _mm_rolv_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, rol, src.as_i32x4())) @@ -21292,7 +21929,8 @@ pub fn _mm_mask_rolv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvd))] -pub fn _mm_maskz_rolv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_rolv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let rol = _mm_rolv_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, rol, i32x4::ZERO)) @@ -21306,7 +21944,8 @@ pub fn _mm_maskz_rolv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm512_rorv_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_rorv_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shr( a.as_u32x16(), @@ -21323,7 +21962,8 @@ pub fn _mm512_rorv_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm512_mask_rorv_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_rorv_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let ror = _mm512_rorv_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, ror, src.as_i32x16())) @@ -21337,7 +21977,8 @@ pub fn _mm512_mask_rorv_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm512_maskz_rorv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_rorv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let ror = _mm512_rorv_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, ror, i32x16::ZERO)) @@ -21351,7 +21992,8 @@ pub fn _mm512_maskz_rorv_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm256_rorv_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_rorv_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shr( a.as_u32x8(), @@ -21368,7 +22010,8 @@ pub fn _mm256_rorv_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm256_mask_rorv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_rorv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let ror = _mm256_rorv_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, ror, src.as_i32x8())) @@ -21382,7 +22025,8 @@ pub fn _mm256_mask_rorv_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm256_maskz_rorv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_rorv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let ror = _mm256_rorv_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, ror, i32x8::ZERO)) @@ -21396,7 +22040,8 @@ pub fn _mm256_maskz_rorv_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm_rorv_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_rorv_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shr( a.as_u32x4(), @@ -21413,7 +22058,8 @@ pub fn _mm_rorv_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm_mask_rorv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_rorv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let ror = _mm_rorv_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, ror, src.as_i32x4())) @@ -21427,7 +22073,8 @@ pub fn _mm_mask_rorv_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvd))] -pub fn _mm_maskz_rorv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_rorv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let ror = _mm_rorv_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, ror, i32x4::ZERO)) @@ -21441,7 +22088,8 @@ pub fn _mm_maskz_rorv_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm512_rolv_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_rolv_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shl( a.as_u64x8(), @@ -21458,7 +22106,8 @@ pub fn _mm512_rolv_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm512_mask_rolv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_rolv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let rol = _mm512_rolv_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, rol, src.as_i64x8())) @@ -21472,7 +22121,8 @@ pub fn _mm512_mask_rolv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm512_maskz_rolv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_rolv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let rol = _mm512_rolv_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, rol, i64x8::ZERO)) @@ -21486,7 +22136,8 @@ pub fn _mm512_maskz_rolv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm256_rolv_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_rolv_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shl( a.as_u64x4(), @@ -21503,7 +22154,8 @@ pub fn _mm256_rolv_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm256_mask_rolv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_rolv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let rol = _mm256_rolv_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, rol, src.as_i64x4())) @@ -21517,7 +22169,8 @@ pub fn _mm256_mask_rolv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm256_maskz_rolv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_rolv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let rol = _mm256_rolv_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, rol, i64x4::ZERO)) @@ -21531,7 +22184,8 @@ pub fn _mm256_maskz_rolv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm_rolv_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_rolv_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shl( a.as_u64x2(), @@ -21548,7 +22202,8 @@ pub fn _mm_rolv_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm_mask_rolv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_rolv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let rol = _mm_rolv_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, rol, src.as_i64x2())) @@ -21562,7 +22217,8 @@ pub fn _mm_mask_rolv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprolvq))] -pub fn _mm_maskz_rolv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_rolv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let rol = _mm_rolv_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, rol, i64x2::ZERO)) @@ -21576,7 +22232,8 @@ pub fn _mm_maskz_rolv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm512_rorv_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_rorv_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shr( a.as_u64x8(), @@ -21593,7 +22250,8 @@ pub fn _mm512_rorv_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm512_mask_rorv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_rorv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let ror = _mm512_rorv_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, ror, src.as_i64x8())) @@ -21607,7 +22265,8 @@ pub fn _mm512_mask_rorv_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm512_maskz_rorv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_rorv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let ror = _mm512_rorv_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, ror, i64x8::ZERO)) @@ -21621,7 +22280,8 @@ pub fn _mm512_maskz_rorv_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm256_rorv_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_rorv_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shr( a.as_u64x4(), @@ -21638,7 +22298,8 @@ pub fn _mm256_rorv_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm256_mask_rorv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_rorv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let ror = _mm256_rorv_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, ror, src.as_i64x4())) @@ -21652,7 +22313,8 @@ pub fn _mm256_mask_rorv_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm256_maskz_rorv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_rorv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let ror = _mm256_rorv_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, ror, i64x4::ZERO)) @@ -21666,7 +22328,8 @@ pub fn _mm256_maskz_rorv_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm_rorv_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_rorv_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shr( a.as_u64x2(), @@ -21683,7 +22346,8 @@ pub fn _mm_rorv_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm_mask_rorv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_rorv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let ror = _mm_rorv_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, ror, src.as_i64x2())) @@ -21697,7 +22361,8 @@ pub fn _mm_mask_rorv_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vprorvq))] -pub fn _mm_maskz_rorv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_rorv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let ror = _mm_rorv_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, ror, i64x2::ZERO)) @@ -21711,7 +22376,8 @@ pub fn _mm_maskz_rorv_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm512_sllv_epi32(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sllv_epi32(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u32x16(); let no_overflow: u32x16 = simd_lt(count, u32x16::splat(u32::BITS)); @@ -21727,7 +22393,13 @@ pub fn _mm512_sllv_epi32(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm512_mask_sllv_epi32(src: __m512i, k: __mmask16, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sllv_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_sllv_epi32(a, count).as_i32x16(); transmute(simd_select_bitmask(k, shf, src.as_i32x16())) @@ -21741,7 +22413,8 @@ pub fn _mm512_mask_sllv_epi32(src: __m512i, k: __mmask16, a: __m512i, count: __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm512_maskz_sllv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sllv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_sllv_epi32(a, count).as_i32x16(); transmute(simd_select_bitmask(k, shf, i32x16::ZERO)) @@ -21755,7 +22428,13 @@ pub fn _mm512_maskz_sllv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m5 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm256_mask_sllv_epi32(src: __m256i, k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sllv_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_sllv_epi32(a, count).as_i32x8(); transmute(simd_select_bitmask(k, shf, src.as_i32x8())) @@ -21769,7 +22448,8 @@ pub fn _mm256_mask_sllv_epi32(src: __m256i, k: __mmask8, a: __m256i, count: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm256_maskz_sllv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sllv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_sllv_epi32(a, count).as_i32x8(); transmute(simd_select_bitmask(k, shf, i32x8::ZERO)) @@ -21783,7 +22463,8 @@ pub fn _mm256_maskz_sllv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm_mask_sllv_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sllv_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_sllv_epi32(a, count).as_i32x4(); transmute(simd_select_bitmask(k, shf, src.as_i32x4())) @@ -21797,7 +22478,8 @@ pub fn _mm_mask_sllv_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvd))] -pub fn _mm_maskz_sllv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sllv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_sllv_epi32(a, count).as_i32x4(); transmute(simd_select_bitmask(k, shf, i32x4::ZERO)) @@ -21811,7 +22493,8 @@ pub fn _mm_maskz_sllv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm512_srlv_epi32(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srlv_epi32(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u32x16(); let no_overflow: u32x16 = simd_lt(count, u32x16::splat(u32::BITS)); @@ -21827,7 +22510,13 @@ pub fn _mm512_srlv_epi32(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm512_mask_srlv_epi32(src: __m512i, k: __mmask16, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srlv_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_srlv_epi32(a, count).as_i32x16(); transmute(simd_select_bitmask(k, shf, src.as_i32x16())) @@ -21841,7 +22530,8 @@ pub fn _mm512_mask_srlv_epi32(src: __m512i, k: __mmask16, a: __m512i, count: __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm512_maskz_srlv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srlv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_srlv_epi32(a, count).as_i32x16(); transmute(simd_select_bitmask(k, shf, i32x16::ZERO)) @@ -21855,7 +22545,13 @@ pub fn _mm512_maskz_srlv_epi32(k: __mmask16, a: __m512i, count: __m512i) -> __m5 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm256_mask_srlv_epi32(src: __m256i, k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srlv_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_srlv_epi32(a, count).as_i32x8(); transmute(simd_select_bitmask(k, shf, src.as_i32x8())) @@ -21869,7 +22565,8 @@ pub fn _mm256_mask_srlv_epi32(src: __m256i, k: __mmask8, a: __m256i, count: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm256_maskz_srlv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srlv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_srlv_epi32(a, count).as_i32x8(); transmute(simd_select_bitmask(k, shf, i32x8::ZERO)) @@ -21883,7 +22580,8 @@ pub fn _mm256_maskz_srlv_epi32(k: __mmask8, a: __m256i, count: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm_mask_srlv_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srlv_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srlv_epi32(a, count).as_i32x4(); transmute(simd_select_bitmask(k, shf, src.as_i32x4())) @@ -21897,7 +22595,8 @@ pub fn _mm_mask_srlv_epi32(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvd))] -pub fn _mm_maskz_srlv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srlv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srlv_epi32(a, count).as_i32x4(); transmute(simd_select_bitmask(k, shf, i32x4::ZERO)) @@ -21911,7 +22610,8 @@ pub fn _mm_maskz_srlv_epi32(k: __mmask8, a: __m128i, count: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm512_sllv_epi64(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sllv_epi64(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u64x8(); let no_overflow: u64x8 = simd_lt(count, u64x8::splat(u64::BITS as u64)); @@ -21927,7 +22627,13 @@ pub fn _mm512_sllv_epi64(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm512_mask_sllv_epi64(src: __m512i, k: __mmask8, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sllv_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_sllv_epi64(a, count).as_i64x8(); transmute(simd_select_bitmask(k, shf, src.as_i64x8())) @@ -21941,7 +22647,8 @@ pub fn _mm512_mask_sllv_epi64(src: __m512i, k: __mmask8, a: __m512i, count: __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm512_maskz_sllv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sllv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_sllv_epi64(a, count).as_i64x8(); transmute(simd_select_bitmask(k, shf, i64x8::ZERO)) @@ -21955,7 +22662,13 @@ pub fn _mm512_maskz_sllv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m51 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm256_mask_sllv_epi64(src: __m256i, k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sllv_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_sllv_epi64(a, count).as_i64x4(); transmute(simd_select_bitmask(k, shf, src.as_i64x4())) @@ -21969,7 +22682,8 @@ pub fn _mm256_mask_sllv_epi64(src: __m256i, k: __mmask8, a: __m256i, count: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm256_maskz_sllv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sllv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_sllv_epi64(a, count).as_i64x4(); transmute(simd_select_bitmask(k, shf, i64x4::ZERO)) @@ -21983,7 +22697,8 @@ pub fn _mm256_maskz_sllv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm_mask_sllv_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sllv_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_sllv_epi64(a, count).as_i64x2(); transmute(simd_select_bitmask(k, shf, src.as_i64x2())) @@ -21997,7 +22712,8 @@ pub fn _mm_mask_sllv_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsllvq))] -pub fn _mm_maskz_sllv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sllv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_sllv_epi64(a, count).as_i64x2(); transmute(simd_select_bitmask(k, shf, i64x2::ZERO)) @@ -22011,7 +22727,8 @@ pub fn _mm_maskz_sllv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm512_srlv_epi64(a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_srlv_epi64(a: __m512i, count: __m512i) -> __m512i { unsafe { let count = count.as_u64x8(); let no_overflow: u64x8 = simd_lt(count, u64x8::splat(u64::BITS as u64)); @@ -22027,7 +22744,13 @@ pub fn _mm512_srlv_epi64(a: __m512i, count: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm512_mask_srlv_epi64(src: __m512i, k: __mmask8, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_srlv_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + count: __m512i, +) -> __m512i { unsafe { let shf = _mm512_srlv_epi64(a, count).as_i64x8(); transmute(simd_select_bitmask(k, shf, src.as_i64x8())) @@ -22041,7 +22764,8 @@ pub fn _mm512_mask_srlv_epi64(src: __m512i, k: __mmask8, a: __m512i, count: __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm512_maskz_srlv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_srlv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m512i { unsafe { let shf = _mm512_srlv_epi64(a, count).as_i64x8(); transmute(simd_select_bitmask(k, shf, i64x8::ZERO)) @@ -22055,7 +22779,13 @@ pub fn _mm512_maskz_srlv_epi64(k: __mmask8, a: __m512i, count: __m512i) -> __m51 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm256_mask_srlv_epi64(src: __m256i, k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_srlv_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, + count: __m256i, +) -> __m256i { unsafe { let shf = _mm256_srlv_epi64(a, count).as_i64x4(); transmute(simd_select_bitmask(k, shf, src.as_i64x4())) @@ -22069,7 +22799,8 @@ pub fn _mm256_mask_srlv_epi64(src: __m256i, k: __mmask8, a: __m256i, count: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm256_maskz_srlv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_srlv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m256i { unsafe { let shf = _mm256_srlv_epi64(a, count).as_i64x4(); transmute(simd_select_bitmask(k, shf, i64x4::ZERO)) @@ -22083,7 +22814,8 @@ pub fn _mm256_maskz_srlv_epi64(k: __mmask8, a: __m256i, count: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm_mask_srlv_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_srlv_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srlv_epi64(a, count).as_i64x2(); transmute(simd_select_bitmask(k, shf, src.as_i64x2())) @@ -22097,7 +22829,8 @@ pub fn _mm_mask_srlv_epi64(src: __m128i, k: __mmask8, a: __m128i, count: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpsrlvq))] -pub fn _mm_maskz_srlv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_srlv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i { unsafe { let shf = _mm_srlv_epi64(a, count).as_i64x2(); transmute(simd_select_bitmask(k, shf, i64x2::ZERO)) @@ -22112,7 +22845,8 @@ pub fn _mm_maskz_srlv_epi64(k: __mmask8, a: __m128i, count: __m128i) -> __m128i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_permute_ps(a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_permute_ps(a: __m512) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -22148,7 +22882,12 @@ pub fn _mm512_permute_ps(a: __m512) -> __m512 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_permute_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_permute_ps( + src: __m512, + k: __mmask16, + a: __m512, +) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_permute_ps::(a); @@ -22164,7 +22903,8 @@ pub fn _mm512_mask_permute_ps(src: __m512, k: __mmask16, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_permute_ps(k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_permute_ps(k: __mmask16, a: __m512) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_permute_ps::(a); @@ -22180,7 +22920,12 @@ pub fn _mm512_maskz_permute_ps(k: __mmask16, a: __m512) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_permute_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_permute_ps( + src: __m256, + k: __mmask8, + a: __m256, +) -> __m256 { unsafe { let r = _mm256_permute_ps::(a); transmute(simd_select_bitmask(k, r.as_f32x8(), src.as_f32x8())) @@ -22195,7 +22940,8 @@ pub fn _mm256_mask_permute_ps(src: __m256, k: __mmask8, a: __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_permute_ps(k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_permute_ps(k: __mmask8, a: __m256) -> __m256 { unsafe { let r = _mm256_permute_ps::(a); transmute(simd_select_bitmask(k, r.as_f32x8(), f32x8::ZERO)) @@ -22210,7 +22956,8 @@ pub fn _mm256_maskz_permute_ps(k: __mmask8, a: __m256) -> __m25 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_permute_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_permute_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { unsafe { let r = _mm_permute_ps::(a); transmute(simd_select_bitmask(k, r.as_f32x4(), src.as_f32x4())) @@ -22225,7 +22972,8 @@ pub fn _mm_mask_permute_ps(src: __m128, k: __mmask8, a: __m128) #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 0b11_00_01_11))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_permute_ps(k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_permute_ps(k: __mmask8, a: __m128) -> __m128 { unsafe { let r = _mm_permute_ps::(a); transmute(simd_select_bitmask(k, r.as_f32x4(), f32x4::ZERO)) @@ -22240,7 +22988,8 @@ pub fn _mm_maskz_permute_ps(k: __mmask8, a: __m128) -> __m128 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 0b11_01_10_01))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_permute_pd(a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_permute_pd(a: __m512d) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -22268,7 +23017,12 @@ pub fn _mm512_permute_pd(a: __m512d) -> __m512d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 0b11_01_10_01))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_permute_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_permute_pd( + src: __m512d, + k: __mmask8, + a: __m512d, +) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_permute_pd::(a); @@ -22284,7 +23038,8 @@ pub fn _mm512_mask_permute_pd(src: __m512d, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 0b11_01_10_01))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_permute_pd(k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_permute_pd(k: __mmask8, a: __m512d) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_permute_pd::(a); @@ -22300,7 +23055,12 @@ pub fn _mm512_maskz_permute_pd(k: __mmask8, a: __m512d) -> __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 0b11_01))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_permute_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_permute_pd( + src: __m256d, + k: __mmask8, + a: __m256d, +) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 4); let r = _mm256_permute_pd::(a); @@ -22316,7 +23076,8 @@ pub fn _mm256_mask_permute_pd(src: __m256d, k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 0b11_01))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_permute_pd(k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_permute_pd(k: __mmask8, a: __m256d) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 4); let r = _mm256_permute_pd::(a); @@ -22332,7 +23093,12 @@ pub fn _mm256_maskz_permute_pd(k: __mmask8, a: __m256d) -> __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, IMM2 = 0b01))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_permute_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_permute_pd( + src: __m128d, + k: __mmask8, + a: __m128d, +) -> __m128d { unsafe { static_assert_uimm_bits!(IMM2, 2); let r = _mm_permute_pd::(a); @@ -22348,7 +23114,8 @@ pub fn _mm_mask_permute_pd(src: __m128d, k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, IMM2 = 0b01))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_permute_pd(k: __mmask8, a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_permute_pd(k: __mmask8, a: __m128d) -> __m128d { unsafe { static_assert_uimm_bits!(IMM2, 2); let r = _mm_permute_pd::(a); @@ -22364,7 +23131,8 @@ pub fn _mm_maskz_permute_pd(k: __mmask8, a: __m128d) -> __m128d #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq #[rustc_legacy_const_generics(1)] -pub fn _mm512_permutex_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_permutex_epi64(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -22392,7 +23160,8 @@ pub fn _mm512_permutex_epi64(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_permutex_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_permutex_epi64( src: __m512i, k: __mmask8, a: __m512i, @@ -22412,7 +23181,8 @@ pub fn _mm512_mask_permutex_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_permutex_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_permutex_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_permutex_epi64::(a); @@ -22428,7 +23198,8 @@ pub fn _mm512_maskz_permutex_epi64(k: __mmask8, a: __m512i) -> #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq #[rustc_legacy_const_generics(1)] -pub fn _mm256_permutex_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permutex_epi64(a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -22452,7 +23223,8 @@ pub fn _mm256_permutex_epi64(a: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_permutex_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_permutex_epi64( src: __m256i, k: __mmask8, a: __m256i, @@ -22472,7 +23244,8 @@ pub fn _mm256_mask_permutex_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermq #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_permutex_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_permutex_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_permutex_epi64::(a); @@ -22488,7 +23261,8 @@ pub fn _mm256_maskz_permutex_epi64(k: __mmask8, a: __m256i) -> #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd #[rustc_legacy_const_generics(1)] -pub fn _mm512_permutex_pd(a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_permutex_pd(a: __m512d) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -22516,7 +23290,12 @@ pub fn _mm512_permutex_pd(a: __m512d) -> __m512d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_permutex_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_permutex_pd( + src: __m512d, + k: __mmask8, + a: __m512d, +) -> __m512d { unsafe { let r = _mm512_permutex_pd::(a); transmute(simd_select_bitmask(k, r.as_f64x8(), src.as_f64x8())) @@ -22531,7 +23310,8 @@ pub fn _mm512_mask_permutex_pd(src: __m512d, k: __mmask8, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_permutex_pd(k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_permutex_pd(k: __mmask8, a: __m512d) -> __m512d { unsafe { let r = _mm512_permutex_pd::(a); transmute(simd_select_bitmask(k, r.as_f64x8(), f64x8::ZERO)) @@ -22546,7 +23326,8 @@ pub fn _mm512_maskz_permutex_pd(k: __mmask8, a: __m512d) -> __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd #[rustc_legacy_const_generics(1)] -pub fn _mm256_permutex_pd(a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_permutex_pd(a: __m256d) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -22570,7 +23351,12 @@ pub fn _mm256_permutex_pd(a: __m256d) -> __m256d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_permutex_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_permutex_pd( + src: __m256d, + k: __mmask8, + a: __m256d, +) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_permutex_pd::(a); @@ -22586,7 +23372,8 @@ pub fn _mm256_mask_permutex_pd(src: __m256d, k: __mmask8, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b10_01_10_11))] //should be vpermpd #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_permutex_pd(k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_permutex_pd(k: __mmask8, a: __m256d) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_permutex_pd::(a); @@ -23856,7 +24643,8 @@ pub fn _mm_mask2_permutex2var_pd(a: __m128d, idx: __m128i, k: __mmask8, b: __m12 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 9))] //should be vpshufd #[rustc_legacy_const_generics(1)] -pub fn _mm512_shuffle_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_epi32(a: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); let r: i32x16 = simd_shuffle!( @@ -23893,7 +24681,8 @@ pub fn _mm512_shuffle_epi32(a: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufd, MASK = 9))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_shuffle_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_epi32( src: __m512i, k: __mmask16, a: __m512i, @@ -23913,7 +24702,11 @@ pub fn _mm512_mask_shuffle_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufd, MASK = 9))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_shuffle_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_epi32( + k: __mmask16, + a: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_shuffle_epi32::(a); @@ -23929,7 +24722,8 @@ pub fn _mm512_maskz_shuffle_epi32(k: __mmask16, a: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufd, MASK = 9))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_shuffle_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_epi32( src: __m256i, k: __mmask8, a: __m256i, @@ -23949,7 +24743,11 @@ pub fn _mm256_mask_shuffle_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufd, MASK = 9))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_shuffle_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_epi32( + k: __mmask8, + a: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_epi32::(a); @@ -23965,7 +24763,8 @@ pub fn _mm256_maskz_shuffle_epi32(k: __mmask8, a: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufd, MASK = 9))] #[rustc_legacy_const_generics(3)] -pub fn _mm_mask_shuffle_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shuffle_epi32( src: __m128i, k: __mmask8, a: __m128i, @@ -23985,7 +24784,11 @@ pub fn _mm_mask_shuffle_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshufd, MASK = 9))] #[rustc_legacy_const_generics(2)] -pub fn _mm_maskz_shuffle_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shuffle_epi32( + k: __mmask8, + a: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm_shuffle_epi32::(a); @@ -24001,7 +24804,8 @@ pub fn _mm_maskz_shuffle_epi32(k: __mmask8, a: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shuffle_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_ps(a: __m512, b: __m512) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -24037,7 +24841,8 @@ pub fn _mm512_shuffle_ps(a: __m512, b: __m512) -> __m512 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shuffle_ps( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_ps( src: __m512, k: __mmask16, a: __m512, @@ -24058,7 +24863,12 @@ pub fn _mm512_mask_shuffle_ps( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shuffle_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_ps( + k: __mmask16, + a: __m512, + b: __m512, +) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_shuffle_ps::(a, b); @@ -24074,7 +24884,8 @@ pub fn _mm512_maskz_shuffle_ps(k: __mmask16, a: __m512, b: __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shuffle_ps( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_ps( src: __m256, k: __mmask8, a: __m256, @@ -24095,7 +24906,8 @@ pub fn _mm256_mask_shuffle_ps( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shuffle_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_ps::(a, b); @@ -24111,7 +24923,8 @@ pub fn _mm256_maskz_shuffle_ps(k: __mmask8, a: __m256, b: __m25 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shuffle_ps( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shuffle_ps( src: __m128, k: __mmask8, a: __m128, @@ -24132,7 +24945,8 @@ pub fn _mm_mask_shuffle_ps( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufps, MASK = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shuffle_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shuffle_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm_shuffle_ps::(a, b); @@ -24148,7 +24962,8 @@ pub fn _mm_maskz_shuffle_ps(k: __mmask8, a: __m128, b: __m128) #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 3))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shuffle_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); simd_shuffle!( @@ -24176,7 +24991,8 @@ pub fn _mm512_shuffle_pd(a: __m512d, b: __m512d) -> __m512d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 3))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shuffle_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_pd( src: __m512d, k: __mmask8, a: __m512d, @@ -24197,7 +25013,12 @@ pub fn _mm512_mask_shuffle_pd( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shuffle_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_pd( + k: __mmask8, + a: __m512d, + b: __m512d, +) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_shuffle_pd::(a, b); @@ -24213,7 +25034,8 @@ pub fn _mm512_maskz_shuffle_pd(k: __mmask8, a: __m512d, b: __m5 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 3))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shuffle_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_pd( src: __m256d, k: __mmask8, a: __m256d, @@ -24234,7 +25056,12 @@ pub fn _mm256_mask_shuffle_pd( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shuffle_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_pd( + k: __mmask8, + a: __m256d, + b: __m256d, +) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_pd::(a, b); @@ -24250,7 +25077,8 @@ pub fn _mm256_maskz_shuffle_pd(k: __mmask8, a: __m256d, b: __m2 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shuffle_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shuffle_pd( src: __m128d, k: __mmask8, a: __m128d, @@ -24271,7 +25099,8 @@ pub fn _mm_mask_shuffle_pd( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufpd, MASK = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shuffle_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shuffle_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm_shuffle_pd::(a, b); @@ -24287,7 +25116,8 @@ pub fn _mm_maskz_shuffle_pd(k: __mmask8, a: __m128d, b: __m128d #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_01_01_01))] //should be vshufi32x4 #[rustc_legacy_const_generics(2)] -pub fn _mm512_shuffle_i32x4(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_i32x4(a: __m512i, b: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_i32x16(); @@ -24326,7 +25156,8 @@ pub fn _mm512_shuffle_i32x4(a: __m512i, b: __m512i) -> __m512i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b10_11_01_01))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shuffle_i32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_i32x4( src: __m512i, k: __mmask16, a: __m512i, @@ -24347,7 +25178,8 @@ pub fn _mm512_mask_shuffle_i32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b10_11_01_01))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shuffle_i32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_i32x4( k: __mmask16, a: __m512i, b: __m512i, @@ -24367,7 +25199,8 @@ pub fn _mm512_maskz_shuffle_i32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b11))] //should be vshufi32x4 #[rustc_legacy_const_generics(2)] -pub fn _mm256_shuffle_i32x4(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_i32x4(a: __m256i, b: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_i32x8(); @@ -24398,7 +25231,8 @@ pub fn _mm256_shuffle_i32x4(a: __m256i, b: __m256i) -> __m256i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b11))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shuffle_i32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_i32x4( src: __m256i, k: __mmask8, a: __m256i, @@ -24419,7 +25253,12 @@ pub fn _mm256_mask_shuffle_i32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi32x4, MASK = 0b11))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shuffle_i32x4(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_i32x4( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_i32x4::(a, b); @@ -24435,7 +25274,8 @@ pub fn _mm256_maskz_shuffle_i32x4(k: __mmask8, a: __m256i, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_11_11_11))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shuffle_i64x2(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_i64x2(a: __m512i, b: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_i64x8(); @@ -24466,7 +25306,8 @@ pub fn _mm512_shuffle_i64x2(a: __m512i, b: __m512i) -> __m512i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_11_11_11))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shuffle_i64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_i64x2( src: __m512i, k: __mmask8, a: __m512i, @@ -24487,7 +25328,12 @@ pub fn _mm512_mask_shuffle_i64x2( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b10_11_11_11))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shuffle_i64x2(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_i64x2( + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_shuffle_i64x2::(a, b); @@ -24503,7 +25349,8 @@ pub fn _mm512_maskz_shuffle_i64x2(k: __mmask8, a: __m512i, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b01))] //should be vshufi64x2 #[rustc_legacy_const_generics(2)] -pub fn _mm256_shuffle_i64x2(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_i64x2(a: __m256i, b: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_i64x4(); @@ -24530,7 +25377,8 @@ pub fn _mm256_shuffle_i64x2(a: __m256i, b: __m256i) -> __m256i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b11))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shuffle_i64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_i64x2( src: __m256i, k: __mmask8, a: __m256i, @@ -24551,7 +25399,12 @@ pub fn _mm256_mask_shuffle_i64x2( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshufi64x2, MASK = 0b11))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shuffle_i64x2(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_i64x2( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_i64x2::(a, b); @@ -24567,7 +25420,8 @@ pub fn _mm256_maskz_shuffle_i64x2(k: __mmask8, a: __m256i, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b1011))] //should be vshuff32x4, but generate vshuff64x2 #[rustc_legacy_const_generics(2)] -pub fn _mm512_shuffle_f32x4(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_f32x4(a: __m512, b: __m512) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_f32x16(); @@ -24606,7 +25460,8 @@ pub fn _mm512_shuffle_f32x4(a: __m512, b: __m512) -> __m512 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b1011))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shuffle_f32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_f32x4( src: __m512, k: __mmask16, a: __m512, @@ -24627,7 +25482,12 @@ pub fn _mm512_mask_shuffle_f32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b1011))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shuffle_f32x4(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_f32x4( + k: __mmask16, + a: __m512, + b: __m512, +) -> __m512 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_shuffle_f32x4::(a, b); @@ -24643,7 +25503,8 @@ pub fn _mm512_maskz_shuffle_f32x4(k: __mmask16, a: __m512, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b01))] //should be vshuff32x4 #[rustc_legacy_const_generics(2)] -pub fn _mm256_shuffle_f32x4(a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_f32x4(a: __m256, b: __m256) -> __m256 { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_f32x8(); @@ -24674,7 +25535,8 @@ pub fn _mm256_shuffle_f32x4(a: __m256, b: __m256) -> __m256 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b11))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shuffle_f32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_f32x4( src: __m256, k: __mmask8, a: __m256, @@ -24695,7 +25557,12 @@ pub fn _mm256_mask_shuffle_f32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff32x4, MASK = 0b11))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shuffle_f32x4(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_f32x4( + k: __mmask8, + a: __m256, + b: __m256, +) -> __m256 { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_f32x4::(a, b); @@ -24711,7 +25578,8 @@ pub fn _mm256_maskz_shuffle_f32x4(k: __mmask8, a: __m256, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b10_11_11_11))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shuffle_f64x2(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shuffle_f64x2(a: __m512d, b: __m512d) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_f64x8(); @@ -24742,7 +25610,8 @@ pub fn _mm512_shuffle_f64x2(a: __m512d, b: __m512d) -> __m512d #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b10_11_11_11))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shuffle_f64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shuffle_f64x2( src: __m512d, k: __mmask8, a: __m512d, @@ -24763,7 +25632,12 @@ pub fn _mm512_mask_shuffle_f64x2( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b10_11_11_11))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shuffle_f64x2(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shuffle_f64x2( + k: __mmask8, + a: __m512d, + b: __m512d, +) -> __m512d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm512_shuffle_f64x2::(a, b); @@ -24779,7 +25653,8 @@ pub fn _mm512_maskz_shuffle_f64x2(k: __mmask8, a: __m512d, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vperm, MASK = 0b01))] //should be vshuff64x2 #[rustc_legacy_const_generics(2)] -pub fn _mm256_shuffle_f64x2(a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shuffle_f64x2(a: __m256d, b: __m256d) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 8); let a = a.as_f64x4(); @@ -24806,7 +25681,8 @@ pub fn _mm256_shuffle_f64x2(a: __m256d, b: __m256d) -> __m256d #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b11))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shuffle_f64x2( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shuffle_f64x2( src: __m256d, k: __mmask8, a: __m256d, @@ -24827,7 +25703,12 @@ pub fn _mm256_mask_shuffle_f64x2( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vshuff64x2, MASK = 0b11))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shuffle_f64x2(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shuffle_f64x2( + k: __mmask8, + a: __m256d, + b: __m256d, +) -> __m256d { unsafe { static_assert_uimm_bits!(MASK, 8); let r = _mm256_shuffle_f64x2::(a, b); @@ -24843,7 +25724,8 @@ pub fn _mm256_maskz_shuffle_f64x2(k: __mmask8, a: __m256d, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf32x4, IMM8 = 3))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_extractf32x4_ps(a: __m512) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extractf32x4_ps(a: __m512) -> __m128 { unsafe { static_assert_uimm_bits!(IMM8, 2); match IMM8 & 0x3 { @@ -24863,7 +25745,12 @@ pub fn _mm512_extractf32x4_ps(a: __m512) -> __m128 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf32x4, IMM8 = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_extractf32x4_ps(src: __m128, k: __mmask8, a: __m512) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extractf32x4_ps( + src: __m128, + k: __mmask8, + a: __m512, +) -> __m128 { unsafe { static_assert_uimm_bits!(IMM8, 2); let r = _mm512_extractf32x4_ps::(a); @@ -24879,7 +25766,8 @@ pub fn _mm512_mask_extractf32x4_ps(src: __m128, k: __mmask8, a: #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf32x4, IMM8 = 3))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_extractf32x4_ps(k: __mmask8, a: __m512) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extractf32x4_ps(k: __mmask8, a: __m512) -> __m128 { unsafe { static_assert_uimm_bits!(IMM8, 2); let r = _mm512_extractf32x4_ps::(a); @@ -24898,7 +25786,8 @@ pub fn _mm512_maskz_extractf32x4_ps(k: __mmask8, a: __m512) -> assert_instr(vextract, IMM8 = 1) //should be vextractf32x4 )] #[rustc_legacy_const_generics(1)] -pub fn _mm256_extractf32x4_ps(a: __m256) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extractf32x4_ps(a: __m256) -> __m128 { unsafe { static_assert_uimm_bits!(IMM8, 1); match IMM8 & 0x1 { @@ -24916,7 +25805,12 @@ pub fn _mm256_extractf32x4_ps(a: __m256) -> __m128 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf32x4, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_extractf32x4_ps(src: __m128, k: __mmask8, a: __m256) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_extractf32x4_ps( + src: __m128, + k: __mmask8, + a: __m256, +) -> __m128 { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm256_extractf32x4_ps::(a); @@ -24932,7 +25826,8 @@ pub fn _mm256_mask_extractf32x4_ps(src: __m128, k: __mmask8, a: #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf32x4, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_extractf32x4_ps(k: __mmask8, a: __m256) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_extractf32x4_ps(k: __mmask8, a: __m256) -> __m128 { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm256_extractf32x4_ps::(a); @@ -24951,7 +25846,8 @@ pub fn _mm256_maskz_extractf32x4_ps(k: __mmask8, a: __m256) -> assert_instr(vextractf64x4, IMM1 = 1) //should be vextracti64x4 )] #[rustc_legacy_const_generics(1)] -pub fn _mm512_extracti64x4_epi64(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extracti64x4_epi64(a: __m512i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM1, 1); match IMM1 { @@ -24969,7 +25865,8 @@ pub fn _mm512_extracti64x4_epi64(a: __m512i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextracti64x4, IMM1 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_extracti64x4_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extracti64x4_epi64( src: __m256i, k: __mmask8, a: __m512i, @@ -24989,7 +25886,8 @@ pub fn _mm512_mask_extracti64x4_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextracti64x4, IMM1 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_extracti64x4_epi64(k: __mmask8, a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extracti64x4_epi64(k: __mmask8, a: __m512i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM1, 1); let r = _mm512_extracti64x4_epi64::(a); @@ -25005,7 +25903,8 @@ pub fn _mm512_maskz_extracti64x4_epi64(k: __mmask8, a: __m512i) #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf64x4, IMM8 = 1))] #[rustc_legacy_const_generics(1)] -pub fn _mm512_extractf64x4_pd(a: __m512d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extractf64x4_pd(a: __m512d) -> __m256d { unsafe { static_assert_uimm_bits!(IMM8, 1); match IMM8 & 0x1 { @@ -25023,7 +25922,8 @@ pub fn _mm512_extractf64x4_pd(a: __m512d) -> __m256d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf64x4, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_extractf64x4_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extractf64x4_pd( src: __m256d, k: __mmask8, a: __m512d, @@ -25043,7 +25943,8 @@ pub fn _mm512_mask_extractf64x4_pd( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextractf64x4, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_extractf64x4_pd(k: __mmask8, a: __m512d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extractf64x4_pd(k: __mmask8, a: __m512d) -> __m256d { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm512_extractf64x4_pd::(a); @@ -25062,7 +25963,8 @@ pub fn _mm512_maskz_extractf64x4_pd(k: __mmask8, a: __m512d) -> assert_instr(vextractf32x4, IMM2 = 3) //should be vextracti32x4 )] #[rustc_legacy_const_generics(1)] -pub fn _mm512_extracti32x4_epi32(a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_extracti32x4_epi32(a: __m512i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM2, 2); let a = a.as_i32x16(); @@ -25085,7 +25987,8 @@ pub fn _mm512_extracti32x4_epi32(a: __m512i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextracti32x4, IMM2 = 3))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_mask_extracti32x4_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_extracti32x4_epi32( src: __m128i, k: __mmask8, a: __m512i, @@ -25105,7 +26008,8 @@ pub fn _mm512_mask_extracti32x4_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextracti32x4, IMM2 = 3))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_maskz_extracti32x4_epi32(k: __mmask8, a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_extracti32x4_epi32(k: __mmask8, a: __m512i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM2, 2); let r = _mm512_extracti32x4_epi32::(a); @@ -25124,7 +26028,8 @@ pub fn _mm512_maskz_extracti32x4_epi32(k: __mmask8, a: __m512i) assert_instr(vextract, IMM1 = 1) //should be vextracti32x4 )] #[rustc_legacy_const_generics(1)] -pub fn _mm256_extracti32x4_epi32(a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extracti32x4_epi32(a: __m256i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM1, 1); let a = a.as_i32x8(); @@ -25145,7 +26050,8 @@ pub fn _mm256_extracti32x4_epi32(a: __m256i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextracti32x4, IMM1 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_mask_extracti32x4_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_extracti32x4_epi32( src: __m128i, k: __mmask8, a: __m256i, @@ -25165,7 +26071,8 @@ pub fn _mm256_mask_extracti32x4_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vextracti32x4, IMM1 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_maskz_extracti32x4_epi32(k: __mmask8, a: __m256i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_extracti32x4_epi32(k: __mmask8, a: __m256i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM1, 1); let r = _mm256_extracti32x4_epi32::(a); @@ -25180,7 +26087,8 @@ pub fn _mm256_maskz_extracti32x4_epi32(k: __mmask8, a: __m256i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm512_moveldup_ps(a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_moveldup_ps(a: __m512) -> __m512 { unsafe { let r: f32x16 = simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14]); transmute(r) @@ -25194,7 +26102,8 @@ pub fn _mm512_moveldup_ps(a: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm512_mask_moveldup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_moveldup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { unsafe { let mov: f32x16 = simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14]); @@ -25209,7 +26118,8 @@ pub fn _mm512_mask_moveldup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm512_maskz_moveldup_ps(k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_moveldup_ps(k: __mmask16, a: __m512) -> __m512 { unsafe { let mov: f32x16 = simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14]); @@ -25224,7 +26134,8 @@ pub fn _mm512_maskz_moveldup_ps(k: __mmask16, a: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm256_mask_moveldup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_moveldup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { unsafe { let mov = _mm256_moveldup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x8(), src.as_f32x8())) @@ -25238,7 +26149,8 @@ pub fn _mm256_mask_moveldup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm256_maskz_moveldup_ps(k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_moveldup_ps(k: __mmask8, a: __m256) -> __m256 { unsafe { let mov = _mm256_moveldup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x8(), f32x8::ZERO)) @@ -25252,7 +26164,8 @@ pub fn _mm256_maskz_moveldup_ps(k: __mmask8, a: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm_mask_moveldup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_moveldup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { unsafe { let mov = _mm_moveldup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x4(), src.as_f32x4())) @@ -25266,7 +26179,8 @@ pub fn _mm_mask_moveldup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsldup))] -pub fn _mm_maskz_moveldup_ps(k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_moveldup_ps(k: __mmask8, a: __m128) -> __m128 { unsafe { let mov = _mm_moveldup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x4(), f32x4::ZERO)) @@ -25280,7 +26194,8 @@ pub fn _mm_maskz_moveldup_ps(k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm512_movehdup_ps(a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movehdup_ps(a: __m512) -> __m512 { unsafe { let r: f32x16 = simd_shuffle!(a, a, [1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15]); transmute(r) @@ -25294,7 +26209,8 @@ pub fn _mm512_movehdup_ps(a: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm512_mask_movehdup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_movehdup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { unsafe { let mov: f32x16 = simd_shuffle!(a, a, [1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15]); @@ -25309,7 +26225,8 @@ pub fn _mm512_mask_movehdup_ps(src: __m512, k: __mmask16, a: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm512_maskz_movehdup_ps(k: __mmask16, a: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_movehdup_ps(k: __mmask16, a: __m512) -> __m512 { unsafe { let mov: f32x16 = simd_shuffle!(a, a, [1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15]); @@ -25324,7 +26241,8 @@ pub fn _mm512_maskz_movehdup_ps(k: __mmask16, a: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm256_mask_movehdup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_movehdup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { unsafe { let mov = _mm256_movehdup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x8(), src.as_f32x8())) @@ -25338,7 +26256,8 @@ pub fn _mm256_mask_movehdup_ps(src: __m256, k: __mmask8, a: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm256_maskz_movehdup_ps(k: __mmask8, a: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_movehdup_ps(k: __mmask8, a: __m256) -> __m256 { unsafe { let mov = _mm256_movehdup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x8(), f32x8::ZERO)) @@ -25352,7 +26271,8 @@ pub fn _mm256_maskz_movehdup_ps(k: __mmask8, a: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm_mask_movehdup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_movehdup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { unsafe { let mov = _mm_movehdup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x4(), src.as_f32x4())) @@ -25366,7 +26286,8 @@ pub fn _mm_mask_movehdup_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovshdup))] -pub fn _mm_maskz_movehdup_ps(k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_movehdup_ps(k: __mmask8, a: __m128) -> __m128 { unsafe { let mov = _mm_movehdup_ps(a); transmute(simd_select_bitmask(k, mov.as_f32x4(), f32x4::ZERO)) @@ -25380,7 +26301,8 @@ pub fn _mm_maskz_movehdup_ps(k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm512_movedup_pd(a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_movedup_pd(a: __m512d) -> __m512d { unsafe { let r: f64x8 = simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]); transmute(r) @@ -25394,7 +26316,8 @@ pub fn _mm512_movedup_pd(a: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm512_mask_movedup_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_movedup_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d { unsafe { let mov: f64x8 = simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]); transmute(simd_select_bitmask(k, mov, src.as_f64x8())) @@ -25408,7 +26331,8 @@ pub fn _mm512_mask_movedup_pd(src: __m512d, k: __mmask8, a: __m512d) -> __m512d #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm512_maskz_movedup_pd(k: __mmask8, a: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_movedup_pd(k: __mmask8, a: __m512d) -> __m512d { unsafe { let mov: f64x8 = simd_shuffle!(a, a, [0, 0, 2, 2, 4, 4, 6, 6]); transmute(simd_select_bitmask(k, mov, f64x8::ZERO)) @@ -25422,7 +26346,8 @@ pub fn _mm512_maskz_movedup_pd(k: __mmask8, a: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm256_mask_movedup_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_movedup_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d { unsafe { let mov = _mm256_movedup_pd(a); transmute(simd_select_bitmask(k, mov.as_f64x4(), src.as_f64x4())) @@ -25436,7 +26361,8 @@ pub fn _mm256_mask_movedup_pd(src: __m256d, k: __mmask8, a: __m256d) -> __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm256_maskz_movedup_pd(k: __mmask8, a: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_movedup_pd(k: __mmask8, a: __m256d) -> __m256d { unsafe { let mov = _mm256_movedup_pd(a); transmute(simd_select_bitmask(k, mov.as_f64x4(), f64x4::ZERO)) @@ -25450,7 +26376,8 @@ pub fn _mm256_maskz_movedup_pd(k: __mmask8, a: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm_mask_movedup_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_movedup_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { unsafe { let mov = _mm_movedup_pd(a); transmute(simd_select_bitmask(k, mov.as_f64x2(), src.as_f64x2())) @@ -25464,7 +26391,8 @@ pub fn _mm_mask_movedup_pd(src: __m128d, k: __mmask8, a: __m128d) -> __m128d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovddup))] -pub fn _mm_maskz_movedup_pd(k: __mmask8, a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_movedup_pd(k: __mmask8, a: __m128d) -> __m128d { unsafe { let mov = _mm_movedup_pd(a); transmute(simd_select_bitmask(k, mov.as_f64x2(), f64x2::ZERO)) @@ -25479,7 +26407,8 @@ pub fn _mm_maskz_movedup_pd(k: __mmask8, a: __m128d) -> __m128d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))] //should be vinserti32x4 #[rustc_legacy_const_generics(2)] -pub fn _mm512_inserti32x4(a: __m512i, b: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_inserti32x4(a: __m512i, b: __m128i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 2); let a = a.as_i32x16(); @@ -25522,7 +26451,8 @@ pub fn _mm512_inserti32x4(a: __m512i, b: __m128i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinserti32x4, IMM8 = 2))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_inserti32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_inserti32x4( src: __m512i, k: __mmask16, a: __m512i, @@ -25543,7 +26473,12 @@ pub fn _mm512_mask_inserti32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinserti32x4, IMM8 = 2))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_inserti32x4(k: __mmask16, a: __m512i, b: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_inserti32x4( + k: __mmask16, + a: __m512i, + b: __m128i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 2); let r = _mm512_inserti32x4::(a, b); @@ -25562,7 +26497,8 @@ pub fn _mm512_maskz_inserti32x4(k: __mmask16, a: __m512i, b: __ assert_instr(vinsert, IMM8 = 1) //should be vinserti32x4 )] #[rustc_legacy_const_generics(2)] -pub fn _mm256_inserti32x4(a: __m256i, b: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_inserti32x4(a: __m256i, b: __m128i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 1); let a = a.as_i32x8(); @@ -25583,7 +26519,8 @@ pub fn _mm256_inserti32x4(a: __m256i, b: __m128i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinserti32x4, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_inserti32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_inserti32x4( src: __m256i, k: __mmask8, a: __m256i, @@ -25604,7 +26541,12 @@ pub fn _mm256_mask_inserti32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinserti32x4, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_inserti32x4(k: __mmask8, a: __m256i, b: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_inserti32x4( + k: __mmask8, + a: __m256i, + b: __m128i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm256_inserti32x4::(a, b); @@ -25620,7 +26562,8 @@ pub fn _mm256_maskz_inserti32x4(k: __mmask8, a: __m256i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))] //should be vinserti64x4 #[rustc_legacy_const_generics(2)] -pub fn _mm512_inserti64x4(a: __m512i, b: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_inserti64x4(a: __m512i, b: __m256i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm512_castsi256_si512(b); @@ -25639,7 +26582,8 @@ pub fn _mm512_inserti64x4(a: __m512i, b: __m256i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinserti64x4, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_inserti64x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_inserti64x4( src: __m512i, k: __mmask8, a: __m512i, @@ -25660,7 +26604,12 @@ pub fn _mm512_mask_inserti64x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinserti64x4, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_inserti64x4(k: __mmask8, a: __m512i, b: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_inserti64x4( + k: __mmask8, + a: __m512i, + b: __m256i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm512_inserti64x4::(a, b); @@ -25676,7 +26625,8 @@ pub fn _mm512_maskz_inserti64x4(k: __mmask8, a: __m512i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_insertf32x4(a: __m512, b: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_insertf32x4(a: __m512, b: __m128) -> __m512 { unsafe { static_assert_uimm_bits!(IMM8, 2); let b = _mm512_castps128_ps512(b); @@ -25717,7 +26667,8 @@ pub fn _mm512_insertf32x4(a: __m512, b: __m128) -> __m512 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_insertf32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_insertf32x4( src: __m512, k: __mmask16, a: __m512, @@ -25738,7 +26689,12 @@ pub fn _mm512_mask_insertf32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 2))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_insertf32x4(k: __mmask16, a: __m512, b: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_insertf32x4( + k: __mmask16, + a: __m512, + b: __m128, +) -> __m512 { unsafe { static_assert_uimm_bits!(IMM8, 2); let r = _mm512_insertf32x4::(a, b); @@ -25757,7 +26713,8 @@ pub fn _mm512_maskz_insertf32x4(k: __mmask16, a: __m512, b: __m assert_instr(vinsert, IMM8 = 1) //should be vinsertf32x4 )] #[rustc_legacy_const_generics(2)] -pub fn _mm256_insertf32x4(a: __m256, b: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insertf32x4(a: __m256, b: __m128) -> __m256 { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm256_castps128_ps256(b); @@ -25776,7 +26733,8 @@ pub fn _mm256_insertf32x4(a: __m256, b: __m128) -> __m256 { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_insertf32x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_insertf32x4( src: __m256, k: __mmask8, a: __m256, @@ -25797,7 +26755,12 @@ pub fn _mm256_mask_insertf32x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf32x4, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_insertf32x4(k: __mmask8, a: __m256, b: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_insertf32x4( + k: __mmask8, + a: __m256, + b: __m128, +) -> __m256 { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm256_insertf32x4::(a, b); @@ -25813,7 +26776,8 @@ pub fn _mm256_maskz_insertf32x4(k: __mmask8, a: __m256, b: __m1 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_insertf64x4(a: __m512d, b: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_insertf64x4(a: __m512d, b: __m256d) -> __m512d { unsafe { static_assert_uimm_bits!(IMM8, 1); let b = _mm512_castpd256_pd512(b); @@ -25832,7 +26796,8 @@ pub fn _mm512_insertf64x4(a: __m512d, b: __m256d) -> __m512d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_insertf64x4( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_insertf64x4( src: __m512d, k: __mmask8, a: __m512d, @@ -25853,7 +26818,12 @@ pub fn _mm512_mask_insertf64x4( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vinsertf64x4, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_insertf64x4(k: __mmask8, a: __m512d, b: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_insertf64x4( + k: __mmask8, + a: __m512d, + b: __m256d, +) -> __m512d { unsafe { static_assert_uimm_bits!(IMM8, 1); let r = _mm512_insertf64x4::(a, b); @@ -25868,7 +26838,8 @@ pub fn _mm512_maskz_insertf64x4(k: __mmask8, a: __m512d, b: __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] //should be vpunpckhdq -pub fn _mm512_unpackhi_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpackhi_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_i32x16(); let b = b.as_i32x16(); @@ -25891,7 +26862,13 @@ pub fn _mm512_unpackhi_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhdq))] -pub fn _mm512_mask_unpackhi_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpackhi_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, unpackhi, src.as_i32x16())) @@ -25905,7 +26882,8 @@ pub fn _mm512_mask_unpackhi_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhdq))] -pub fn _mm512_maskz_unpackhi_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpackhi_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, unpackhi, i32x16::ZERO)) @@ -25919,7 +26897,13 @@ pub fn _mm512_maskz_unpackhi_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m5 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhdq))] -pub fn _mm256_mask_unpackhi_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpackhi_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, unpackhi, src.as_i32x8())) @@ -25933,7 +26917,8 @@ pub fn _mm256_mask_unpackhi_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhdq))] -pub fn _mm256_maskz_unpackhi_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpackhi_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, unpackhi, i32x8::ZERO)) @@ -25947,7 +26932,8 @@ pub fn _mm256_maskz_unpackhi_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhdq))] -pub fn _mm_mask_unpackhi_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpackhi_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, unpackhi, src.as_i32x4())) @@ -25961,7 +26947,8 @@ pub fn _mm_mask_unpackhi_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhdq))] -pub fn _mm_maskz_unpackhi_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpackhi_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, unpackhi, i32x4::ZERO)) @@ -25975,7 +26962,8 @@ pub fn _mm_maskz_unpackhi_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] //should be vpunpckhqdq -pub fn _mm512_unpackhi_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpackhi_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { simd_shuffle!(a, b, [1, 9, 1 + 2, 9 + 2, 1 + 4, 9 + 4, 1 + 6, 9 + 6]) } } @@ -25986,7 +26974,13 @@ pub fn _mm512_unpackhi_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhqdq))] -pub fn _mm512_mask_unpackhi_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpackhi_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, unpackhi, src.as_i64x8())) @@ -26000,7 +26994,8 @@ pub fn _mm512_mask_unpackhi_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhqdq))] -pub fn _mm512_maskz_unpackhi_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpackhi_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpackhi = _mm512_unpackhi_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, unpackhi, i64x8::ZERO)) @@ -26014,7 +27009,13 @@ pub fn _mm512_maskz_unpackhi_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m51 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhqdq))] -pub fn _mm256_mask_unpackhi_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpackhi_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, unpackhi, src.as_i64x4())) @@ -26028,7 +27029,8 @@ pub fn _mm256_mask_unpackhi_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhqdq))] -pub fn _mm256_maskz_unpackhi_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpackhi_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpackhi = _mm256_unpackhi_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, unpackhi, i64x4::ZERO)) @@ -26042,7 +27044,8 @@ pub fn _mm256_maskz_unpackhi_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhqdq))] -pub fn _mm_mask_unpackhi_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpackhi_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, unpackhi, src.as_i64x2())) @@ -26056,7 +27059,8 @@ pub fn _mm_mask_unpackhi_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckhqdq))] -pub fn _mm_maskz_unpackhi_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpackhi_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpackhi = _mm_unpackhi_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, unpackhi, i64x2::ZERO)) @@ -26070,7 +27074,8 @@ pub fn _mm_maskz_unpackhi_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm512_unpackhi_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpackhi_ps(a: __m512, b: __m512) -> __m512 { unsafe { #[rustfmt::skip] simd_shuffle!( @@ -26090,7 +27095,8 @@ pub fn _mm512_unpackhi_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm512_mask_unpackhi_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpackhi_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let unpackhi = _mm512_unpackhi_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, unpackhi, src.as_f32x16())) @@ -26104,7 +27110,8 @@ pub fn _mm512_mask_unpackhi_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm512_maskz_unpackhi_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpackhi_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let unpackhi = _mm512_unpackhi_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, unpackhi, f32x16::ZERO)) @@ -26118,7 +27125,8 @@ pub fn _mm512_maskz_unpackhi_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm256_mask_unpackhi_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpackhi_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let unpackhi = _mm256_unpackhi_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, unpackhi, src.as_f32x8())) @@ -26132,7 +27140,8 @@ pub fn _mm256_mask_unpackhi_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm256_maskz_unpackhi_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpackhi_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let unpackhi = _mm256_unpackhi_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, unpackhi, f32x8::ZERO)) @@ -26146,7 +27155,8 @@ pub fn _mm256_maskz_unpackhi_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm_mask_unpackhi_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpackhi_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let unpackhi = _mm_unpackhi_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, unpackhi, src.as_f32x4())) @@ -26160,7 +27170,8 @@ pub fn _mm_mask_unpackhi_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhps))] -pub fn _mm_maskz_unpackhi_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpackhi_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let unpackhi = _mm_unpackhi_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, unpackhi, f32x4::ZERO)) @@ -26174,7 +27185,8 @@ pub fn _mm_maskz_unpackhi_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm512_unpackhi_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpackhi_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { simd_shuffle!(a, b, [1, 9, 1 + 2, 9 + 2, 1 + 4, 9 + 4, 1 + 6, 9 + 6]) } } @@ -26185,7 +27197,8 @@ pub fn _mm512_unpackhi_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm512_mask_unpackhi_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpackhi_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let unpackhi = _mm512_unpackhi_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, unpackhi, src.as_f64x8())) @@ -26199,7 +27212,8 @@ pub fn _mm512_mask_unpackhi_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm512_maskz_unpackhi_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpackhi_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let unpackhi = _mm512_unpackhi_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, unpackhi, f64x8::ZERO)) @@ -26213,7 +27227,8 @@ pub fn _mm512_maskz_unpackhi_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm256_mask_unpackhi_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpackhi_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let unpackhi = _mm256_unpackhi_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, unpackhi, src.as_f64x4())) @@ -26227,7 +27242,8 @@ pub fn _mm256_mask_unpackhi_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm256_maskz_unpackhi_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpackhi_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let unpackhi = _mm256_unpackhi_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, unpackhi, f64x4::ZERO)) @@ -26241,7 +27257,8 @@ pub fn _mm256_maskz_unpackhi_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm_mask_unpackhi_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpackhi_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let unpackhi = _mm_unpackhi_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, unpackhi, src.as_f64x2())) @@ -26255,7 +27272,8 @@ pub fn _mm_mask_unpackhi_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpckhpd))] -pub fn _mm_maskz_unpackhi_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpackhi_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let unpackhi = _mm_unpackhi_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, unpackhi, f64x2::ZERO)) @@ -26269,7 +27287,8 @@ pub fn _mm_maskz_unpackhi_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] //should be vpunpckldq -pub fn _mm512_unpacklo_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpacklo_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { let a = a.as_i32x16(); let b = b.as_i32x16(); @@ -26292,7 +27311,13 @@ pub fn _mm512_unpacklo_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckldq))] -pub fn _mm512_mask_unpacklo_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpacklo_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, unpacklo, src.as_i32x16())) @@ -26306,7 +27331,8 @@ pub fn _mm512_mask_unpacklo_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckldq))] -pub fn _mm512_maskz_unpacklo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpacklo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, unpacklo, i32x16::ZERO)) @@ -26320,7 +27346,13 @@ pub fn _mm512_maskz_unpacklo_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m5 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckldq))] -pub fn _mm256_mask_unpacklo_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpacklo_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, unpacklo, src.as_i32x8())) @@ -26334,7 +27366,8 @@ pub fn _mm256_mask_unpacklo_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckldq))] -pub fn _mm256_maskz_unpacklo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpacklo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, unpacklo, i32x8::ZERO)) @@ -26348,7 +27381,8 @@ pub fn _mm256_maskz_unpacklo_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckldq))] -pub fn _mm_mask_unpacklo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpacklo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, unpacklo, src.as_i32x4())) @@ -26362,7 +27396,8 @@ pub fn _mm_mask_unpacklo_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpckldq))] -pub fn _mm_maskz_unpacklo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpacklo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, unpacklo, i32x4::ZERO)) @@ -26376,7 +27411,8 @@ pub fn _mm_maskz_unpacklo_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] //should be vpunpcklqdq -pub fn _mm512_unpacklo_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpacklo_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { simd_shuffle!(a, b, [0, 8, 0 + 2, 8 + 2, 0 + 4, 8 + 4, 0 + 6, 8 + 6]) } } @@ -26387,7 +27423,13 @@ pub fn _mm512_unpacklo_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklqdq))] -pub fn _mm512_mask_unpacklo_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpacklo_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, unpacklo, src.as_i64x8())) @@ -26401,7 +27443,8 @@ pub fn _mm512_mask_unpacklo_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklqdq))] -pub fn _mm512_maskz_unpacklo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpacklo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let unpacklo = _mm512_unpacklo_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, unpacklo, i64x8::ZERO)) @@ -26415,7 +27458,13 @@ pub fn _mm512_maskz_unpacklo_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m51 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklqdq))] -pub fn _mm256_mask_unpacklo_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpacklo_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, unpacklo, src.as_i64x4())) @@ -26429,7 +27478,8 @@ pub fn _mm256_mask_unpacklo_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklqdq))] -pub fn _mm256_maskz_unpacklo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpacklo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let unpacklo = _mm256_unpacklo_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, unpacklo, i64x4::ZERO)) @@ -26443,7 +27493,8 @@ pub fn _mm256_maskz_unpacklo_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m25 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklqdq))] -pub fn _mm_mask_unpacklo_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpacklo_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, unpacklo, src.as_i64x2())) @@ -26457,7 +27508,8 @@ pub fn _mm_mask_unpacklo_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpunpcklqdq))] -pub fn _mm_maskz_unpacklo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpacklo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let unpacklo = _mm_unpacklo_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, unpacklo, i64x2::ZERO)) @@ -26471,7 +27523,8 @@ pub fn _mm_maskz_unpacklo_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm512_unpacklo_ps(a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpacklo_ps(a: __m512, b: __m512) -> __m512 { unsafe { #[rustfmt::skip] simd_shuffle!(a, b, @@ -26490,7 +27543,8 @@ pub fn _mm512_unpacklo_ps(a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm512_mask_unpacklo_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpacklo_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let unpacklo = _mm512_unpacklo_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, unpacklo, src.as_f32x16())) @@ -26504,7 +27558,8 @@ pub fn _mm512_mask_unpacklo_ps(src: __m512, k: __mmask16, a: __m512, b: __m512) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm512_maskz_unpacklo_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpacklo_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { let unpacklo = _mm512_unpacklo_ps(a, b).as_f32x16(); transmute(simd_select_bitmask(k, unpacklo, f32x16::ZERO)) @@ -26518,7 +27573,8 @@ pub fn _mm512_maskz_unpacklo_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm256_mask_unpacklo_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpacklo_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let unpacklo = _mm256_unpacklo_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, unpacklo, src.as_f32x8())) @@ -26532,7 +27588,8 @@ pub fn _mm256_mask_unpacklo_ps(src: __m256, k: __mmask8, a: __m256, b: __m256) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm256_maskz_unpacklo_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpacklo_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { let unpacklo = _mm256_unpacklo_ps(a, b).as_f32x8(); transmute(simd_select_bitmask(k, unpacklo, f32x8::ZERO)) @@ -26546,7 +27603,8 @@ pub fn _mm256_maskz_unpacklo_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm_mask_unpacklo_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpacklo_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let unpacklo = _mm_unpacklo_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, unpacklo, src.as_f32x4())) @@ -26560,7 +27618,8 @@ pub fn _mm_mask_unpacklo_ps(src: __m128, k: __mmask8, a: __m128, b: __m128) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklps))] -pub fn _mm_maskz_unpacklo_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpacklo_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let unpacklo = _mm_unpacklo_ps(a, b).as_f32x4(); transmute(simd_select_bitmask(k, unpacklo, f32x4::ZERO)) @@ -26574,7 +27633,8 @@ pub fn _mm_maskz_unpacklo_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm512_unpacklo_pd(a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_unpacklo_pd(a: __m512d, b: __m512d) -> __m512d { unsafe { simd_shuffle!(a, b, [0, 8, 0 + 2, 8 + 2, 0 + 4, 8 + 4, 0 + 6, 8 + 6]) } } @@ -26585,7 +27645,8 @@ pub fn _mm512_unpacklo_pd(a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm512_mask_unpacklo_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_unpacklo_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let unpacklo = _mm512_unpacklo_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, unpacklo, src.as_f64x8())) @@ -26599,7 +27660,8 @@ pub fn _mm512_mask_unpacklo_pd(src: __m512d, k: __mmask8, a: __m512d, b: __m512d #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm512_maskz_unpacklo_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_unpacklo_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { let unpacklo = _mm512_unpacklo_pd(a, b).as_f64x8(); transmute(simd_select_bitmask(k, unpacklo, f64x8::ZERO)) @@ -26613,7 +27675,8 @@ pub fn _mm512_maskz_unpacklo_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm256_mask_unpacklo_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_unpacklo_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let unpacklo = _mm256_unpacklo_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, unpacklo, src.as_f64x4())) @@ -26627,7 +27690,8 @@ pub fn _mm256_mask_unpacklo_pd(src: __m256d, k: __mmask8, a: __m256d, b: __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm256_maskz_unpacklo_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_unpacklo_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { let unpacklo = _mm256_unpacklo_pd(a, b).as_f64x4(); transmute(simd_select_bitmask(k, unpacklo, f64x4::ZERO)) @@ -26641,7 +27705,8 @@ pub fn _mm256_maskz_unpacklo_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm_mask_unpacklo_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_unpacklo_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let unpacklo = _mm_unpacklo_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, unpacklo, src.as_f64x2())) @@ -26655,20 +27720,28 @@ pub fn _mm_mask_unpacklo_pd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vunpcklpd))] -pub fn _mm_maskz_unpacklo_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_unpacklo_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let unpacklo = _mm_unpacklo_pd(a, b).as_f64x2(); transmute(simd_select_bitmask(k, unpacklo, f64x2::ZERO)) } } -/// Cast vector of type __m128 to type __m512; the upper 384 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. +/// Cast vector of type __m128 to type __m512; the upper 384 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. +/// +/// This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_castps128_ps512&expand=621) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castps128_ps512(a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps128_ps512(a: __m128) -> __m512 { unsafe { simd_shuffle!( a, @@ -26678,13 +27751,20 @@ pub fn _mm512_castps128_ps512(a: __m128) -> __m512 { } } -/// Cast vector of type __m256 to type __m512; the upper 256 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. +/// Cast vector of type __m256 to type __m512; the upper 256 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. +/// +/// This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_castps256_ps512&expand=623) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castps256_ps512(a: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps256_ps512(a: __m256) -> __m512 { unsafe { simd_shuffle!( a, @@ -26700,7 +27780,8 @@ pub fn _mm512_castps256_ps512(a: __m256) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_zextps128_ps512(a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextps128_ps512(a: __m128) -> __m512 { unsafe { simd_shuffle!( a, @@ -26716,7 +27797,8 @@ pub fn _mm512_zextps128_ps512(a: __m128) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_zextps256_ps512(a: __m256) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextps256_ps512(a: __m256) -> __m512 { unsafe { simd_shuffle!( a, @@ -26732,7 +27814,8 @@ pub fn _mm512_zextps256_ps512(a: __m256) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castps512_ps128(a: __m512) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps512_ps128(a: __m512) -> __m128 { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3]) } } @@ -26742,7 +27825,8 @@ pub fn _mm512_castps512_ps128(a: __m512) -> __m128 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castps512_ps256(a: __m512) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps512_ps256(a: __m512) -> __m256 { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]) } } @@ -26752,7 +27836,8 @@ pub fn _mm512_castps512_ps256(a: __m512) -> __m256 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castps_pd(a: __m512) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps_pd(a: __m512) -> __m512d { unsafe { transmute(a) } } @@ -26762,27 +27847,42 @@ pub fn _mm512_castps_pd(a: __m512) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castps_si512(a: __m512) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps_si512(a: __m512) -> __m512i { unsafe { transmute(a) } } -/// Cast vector of type __m128d to type __m512d; the upper 384 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. +/// Cast vector of type __m128d to type __m512d; the upper 384 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. +/// +/// This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_castpd128_pd512&expand=609) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castpd128_pd512(a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd128_pd512(a: __m128d) -> __m512d { unsafe { simd_shuffle!(a, _mm_undefined_pd(), [0, 1, 2, 2, 2, 2, 2, 2]) } } -/// Cast vector of type __m256d to type __m512d; the upper 256 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. +/// Cast vector of type __m256d to type __m512d; the upper 256 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. +/// +/// This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_castpd256_pd512&expand=611) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castpd256_pd512(a: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd256_pd512(a: __m256d) -> __m512d { unsafe { simd_shuffle!(a, _mm256_undefined_pd(), [0, 1, 2, 3, 4, 4, 4, 4]) } } @@ -26792,7 +27892,8 @@ pub fn _mm512_castpd256_pd512(a: __m256d) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_zextpd128_pd512(a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextpd128_pd512(a: __m128d) -> __m512d { unsafe { simd_shuffle!(a, _mm_set1_pd(0.), [0, 1, 2, 2, 2, 2, 2, 2]) } } @@ -26802,7 +27903,8 @@ pub fn _mm512_zextpd128_pd512(a: __m128d) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_zextpd256_pd512(a: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextpd256_pd512(a: __m256d) -> __m512d { unsafe { simd_shuffle!(a, _mm256_set1_pd(0.), [0, 1, 2, 3, 4, 4, 4, 4]) } } @@ -26812,7 +27914,8 @@ pub fn _mm512_zextpd256_pd512(a: __m256d) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castpd512_pd128(a: __m512d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd512_pd128(a: __m512d) -> __m128d { unsafe { simd_shuffle!(a, a, [0, 1]) } } @@ -26822,7 +27925,8 @@ pub fn _mm512_castpd512_pd128(a: __m512d) -> __m128d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castpd512_pd256(a: __m512d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd512_pd256(a: __m512d) -> __m256d { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3]) } } @@ -26832,7 +27936,8 @@ pub fn _mm512_castpd512_pd256(a: __m512d) -> __m256d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castpd_ps(a: __m512d) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd_ps(a: __m512d) -> __m512 { unsafe { transmute(a) } } @@ -26842,27 +27947,42 @@ pub fn _mm512_castpd_ps(a: __m512d) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castpd_si512(a: __m512d) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd_si512(a: __m512d) -> __m512i { unsafe { transmute(a) } } -/// Cast vector of type __m128i to type __m512i; the upper 384 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. +/// Cast vector of type __m128i to type __m512i; the upper 384 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. +/// +/// This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_castsi128_si512&expand=629) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castsi128_si512(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi128_si512(a: __m128i) -> __m512i { unsafe { simd_shuffle!(a, _mm_undefined_si128(), [0, 1, 2, 2, 2, 2, 2, 2]) } } -/// Cast vector of type __m256i to type __m512i; the upper 256 bits of the result are undefined. This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. +/// Cast vector of type __m256i to type __m512i; the upper 256 bits of the result are indeterminate. +/// +/// In the Intel documentation, the upper bits are declared to be "undefined". +/// This is not equivalent to [`mem::MaybeUninit`]; instead, these bits are non-deterministically +/// set to some valid value. In practice, this is typically equivalent to [`mem::zeroed`]. +/// +/// This intrinsic is only used for compilation and does not generate any instructions, thus it has zero latency. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_castsi256_si512&expand=633) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castsi256_si512(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi256_si512(a: __m256i) -> __m512i { unsafe { simd_shuffle!(a, _mm256_undefined_si256(), [0, 1, 2, 3, 4, 4, 4, 4]) } } @@ -26872,7 +27992,8 @@ pub fn _mm512_castsi256_si512(a: __m256i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_zextsi128_si512(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextsi128_si512(a: __m128i) -> __m512i { unsafe { simd_shuffle!(a, _mm_setzero_si128(), [0, 1, 2, 2, 2, 2, 2, 2]) } } @@ -26882,7 +28003,8 @@ pub fn _mm512_zextsi128_si512(a: __m128i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_zextsi256_si512(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextsi256_si512(a: __m256i) -> __m512i { unsafe { simd_shuffle!(a, _mm256_setzero_si256(), [0, 1, 2, 3, 4, 4, 4, 4]) } } @@ -26892,7 +28014,8 @@ pub fn _mm512_zextsi256_si512(a: __m256i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castsi512_si128(a: __m512i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi512_si128(a: __m512i) -> __m128i { unsafe { simd_shuffle!(a, a, [0, 1]) } } @@ -26902,7 +28025,8 @@ pub fn _mm512_castsi512_si128(a: __m512i) -> __m128i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castsi512_si256(a: __m512i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi512_si256(a: __m512i) -> __m256i { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3]) } } @@ -26912,7 +28036,8 @@ pub fn _mm512_castsi512_si256(a: __m512i) -> __m256i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castsi512_ps(a: __m512i) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi512_ps(a: __m512i) -> __m512 { unsafe { transmute(a) } } @@ -26922,7 +28047,8 @@ pub fn _mm512_castsi512_ps(a: __m512i) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_castsi512_pd(a: __m512i) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi512_pd(a: __m512i) -> __m512d { unsafe { transmute(a) } } @@ -26933,7 +28059,8 @@ pub fn _mm512_castsi512_pd(a: __m512i) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovd))] -pub fn _mm512_cvtsi512_si32(a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtsi512_si32(a: __m512i) -> i32 { unsafe { simd_extract!(a.as_i32x16(), 0) } } @@ -26943,7 +28070,8 @@ pub fn _mm512_cvtsi512_si32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_cvtss_f32(a: __m512) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtss_f32(a: __m512) -> f32 { unsafe { simd_extract!(a, 0) } } @@ -26953,7 +28081,8 @@ pub fn _mm512_cvtss_f32(a: __m512) -> f32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_cvtsd_f64(a: __m512d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtsd_f64(a: __m512d) -> f64 { unsafe { simd_extract!(a, 0) } } @@ -26964,7 +28093,8 @@ pub fn _mm512_cvtsd_f64(a: __m512d) -> f64 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcast))] //should be vpbroadcastd -pub fn _mm512_broadcastd_epi32(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastd_epi32(a: __m128i) -> __m512i { unsafe { let a = _mm512_castsi128_si512(a).as_i32x16(); let ret: i32x16 = simd_shuffle!(a, a, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); @@ -26979,7 +28109,8 @@ pub fn _mm512_broadcastd_epi32(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd -pub fn _mm512_mask_broadcastd_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcastd_epi32(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastd_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, broadcast, src.as_i32x16())) @@ -26993,7 +28124,8 @@ pub fn _mm512_mask_broadcastd_epi32(src: __m512i, k: __mmask16, a: __m128i) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd -pub fn _mm512_maskz_broadcastd_epi32(k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcastd_epi32(k: __mmask16, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastd_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, broadcast, i32x16::ZERO)) @@ -27007,7 +28139,8 @@ pub fn _mm512_maskz_broadcastd_epi32(k: __mmask16, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd -pub fn _mm256_mask_broadcastd_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcastd_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastd_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, broadcast, src.as_i32x8())) @@ -27021,7 +28154,8 @@ pub fn _mm256_mask_broadcastd_epi32(src: __m256i, k: __mmask8, a: __m128i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd -pub fn _mm256_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastd_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, broadcast, i32x8::ZERO)) @@ -27035,7 +28169,8 @@ pub fn _mm256_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd -pub fn _mm_mask_broadcastd_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_broadcastd_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastd_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, broadcast, src.as_i32x4())) @@ -27049,7 +28184,8 @@ pub fn _mm_mask_broadcastd_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m12 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastd -pub fn _mm_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastd_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, broadcast, i32x4::ZERO)) @@ -27063,7 +28199,8 @@ pub fn _mm_maskz_broadcastd_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcast))] //should be vpbroadcastq -pub fn _mm512_broadcastq_epi64(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastq_epi64(a: __m128i) -> __m512i { unsafe { simd_shuffle!(a, a, [0, 0, 0, 0, 0, 0, 0, 0]) } } @@ -27074,7 +28211,8 @@ pub fn _mm512_broadcastq_epi64(a: __m128i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq -pub fn _mm512_mask_broadcastq_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcastq_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastq_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, broadcast, src.as_i64x8())) @@ -27088,7 +28226,8 @@ pub fn _mm512_mask_broadcastq_epi64(src: __m512i, k: __mmask8, a: __m128i) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq -pub fn _mm512_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcastq_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, broadcast, i64x8::ZERO)) @@ -27102,7 +28241,8 @@ pub fn _mm512_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq -pub fn _mm256_mask_broadcastq_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcastq_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastq_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, broadcast, src.as_i64x4())) @@ -27116,7 +28256,8 @@ pub fn _mm256_mask_broadcastq_epi64(src: __m256i, k: __mmask8, a: __m128i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq -pub fn _mm256_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcastq_epi64(a).as_i64x4(); transmute(simd_select_bitmask(k, broadcast, i64x4::ZERO)) @@ -27130,7 +28271,8 @@ pub fn _mm256_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq -pub fn _mm_mask_broadcastq_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_broadcastq_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastq_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, broadcast, src.as_i64x2())) @@ -27144,7 +28286,8 @@ pub fn _mm_mask_broadcastq_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m12 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcast))] //should be vpbroadcastq -pub fn _mm_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { let broadcast = _mm_broadcastq_epi64(a).as_i64x2(); transmute(simd_select_bitmask(k, broadcast, i64x2::ZERO)) @@ -27158,7 +28301,8 @@ pub fn _mm_maskz_broadcastq_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm512_broadcastss_ps(a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastss_ps(a: __m128) -> __m512 { unsafe { simd_shuffle!(a, a, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) } } @@ -27169,7 +28313,8 @@ pub fn _mm512_broadcastss_ps(a: __m128) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm512_mask_broadcastss_ps(src: __m512, k: __mmask16, a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcastss_ps(src: __m512, k: __mmask16, a: __m128) -> __m512 { unsafe { let broadcast = _mm512_broadcastss_ps(a).as_f32x16(); transmute(simd_select_bitmask(k, broadcast, src.as_f32x16())) @@ -27183,7 +28328,8 @@ pub fn _mm512_mask_broadcastss_ps(src: __m512, k: __mmask16, a: __m128) -> __m51 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm512_maskz_broadcastss_ps(k: __mmask16, a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcastss_ps(k: __mmask16, a: __m128) -> __m512 { unsafe { let broadcast = _mm512_broadcastss_ps(a).as_f32x16(); transmute(simd_select_bitmask(k, broadcast, f32x16::ZERO)) @@ -27197,7 +28343,8 @@ pub fn _mm512_maskz_broadcastss_ps(k: __mmask16, a: __m128) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm256_mask_broadcastss_ps(src: __m256, k: __mmask8, a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcastss_ps(src: __m256, k: __mmask8, a: __m128) -> __m256 { unsafe { let broadcast = _mm256_broadcastss_ps(a).as_f32x8(); transmute(simd_select_bitmask(k, broadcast, src.as_f32x8())) @@ -27211,7 +28358,8 @@ pub fn _mm256_mask_broadcastss_ps(src: __m256, k: __mmask8, a: __m128) -> __m256 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm256_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m256 { unsafe { let broadcast = _mm256_broadcastss_ps(a).as_f32x8(); transmute(simd_select_bitmask(k, broadcast, f32x8::ZERO)) @@ -27225,7 +28373,8 @@ pub fn _mm256_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm_mask_broadcastss_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_broadcastss_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { unsafe { let broadcast = _mm_broadcastss_ps(a).as_f32x4(); transmute(simd_select_bitmask(k, broadcast, src.as_f32x4())) @@ -27239,7 +28388,8 @@ pub fn _mm_mask_broadcastss_ps(src: __m128, k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastss))] -pub fn _mm_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m128 { unsafe { let broadcast = _mm_broadcastss_ps(a).as_f32x4(); transmute(simd_select_bitmask(k, broadcast, f32x4::ZERO)) @@ -27253,7 +28403,8 @@ pub fn _mm_maskz_broadcastss_ps(k: __mmask8, a: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastsd))] -pub fn _mm512_broadcastsd_pd(a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcastsd_pd(a: __m128d) -> __m512d { unsafe { simd_shuffle!(a, a, [0, 0, 0, 0, 0, 0, 0, 0]) } } @@ -27264,7 +28415,8 @@ pub fn _mm512_broadcastsd_pd(a: __m128d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastsd))] -pub fn _mm512_mask_broadcastsd_pd(src: __m512d, k: __mmask8, a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcastsd_pd(src: __m512d, k: __mmask8, a: __m128d) -> __m512d { unsafe { let broadcast = _mm512_broadcastsd_pd(a).as_f64x8(); transmute(simd_select_bitmask(k, broadcast, src.as_f64x8())) @@ -27278,7 +28430,8 @@ pub fn _mm512_mask_broadcastsd_pd(src: __m512d, k: __mmask8, a: __m128d) -> __m5 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastsd))] -pub fn _mm512_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m512d { unsafe { let broadcast = _mm512_broadcastsd_pd(a).as_f64x8(); transmute(simd_select_bitmask(k, broadcast, f64x8::ZERO)) @@ -27292,7 +28445,8 @@ pub fn _mm512_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastsd))] -pub fn _mm256_mask_broadcastsd_pd(src: __m256d, k: __mmask8, a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcastsd_pd(src: __m256d, k: __mmask8, a: __m128d) -> __m256d { unsafe { let broadcast = _mm256_broadcastsd_pd(a).as_f64x4(); transmute(simd_select_bitmask(k, broadcast, src.as_f64x4())) @@ -27306,7 +28460,8 @@ pub fn _mm256_mask_broadcastsd_pd(src: __m256d, k: __mmask8, a: __m128d) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vbroadcastsd))] -pub fn _mm256_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m256d { unsafe { let broadcast = _mm256_broadcastsd_pd(a).as_f64x4(); transmute(simd_select_bitmask(k, broadcast, f64x4::ZERO)) @@ -27319,7 +28474,8 @@ pub fn _mm256_maskz_broadcastsd_pd(k: __mmask8, a: __m128d) -> __m256d { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcasti32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_i32x4(a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_i32x4(a: __m128i) -> __m512i { unsafe { let a = a.as_i32x4(); let ret: i32x16 = simd_shuffle!(a, a, [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]); @@ -27333,7 +28489,8 @@ pub fn _mm512_broadcast_i32x4(a: __m128i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcasti32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_i32x4(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_i32x4(src: __m512i, k: __mmask16, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcast_i32x4(a).as_i32x16(); transmute(simd_select_bitmask(k, broadcast, src.as_i32x16())) @@ -27346,7 +28503,8 @@ pub fn _mm512_mask_broadcast_i32x4(src: __m512i, k: __mmask16, a: __m128i) -> __ #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcasti32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_i32x4(k: __mmask16, a: __m128i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_i32x4(k: __mmask16, a: __m128i) -> __m512i { unsafe { let broadcast = _mm512_broadcast_i32x4(a).as_i32x16(); transmute(simd_select_bitmask(k, broadcast, i32x16::ZERO)) @@ -27359,7 +28517,8 @@ pub fn _mm512_maskz_broadcast_i32x4(k: __mmask16, a: __m128i) -> __m512i { #[inline] #[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcasti32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_broadcast_i32x4(a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_i32x4(a: __m128i) -> __m256i { unsafe { let a = a.as_i32x4(); let ret: i32x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 0, 1, 2, 3]); @@ -27373,7 +28532,8 @@ pub fn _mm256_broadcast_i32x4(a: __m128i) -> __m256i { #[inline] #[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcasti32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_broadcast_i32x4(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcast_i32x4(src: __m256i, k: __mmask8, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcast_i32x4(a).as_i32x8(); transmute(simd_select_bitmask(k, broadcast, src.as_i32x8())) @@ -27386,7 +28546,8 @@ pub fn _mm256_mask_broadcast_i32x4(src: __m256i, k: __mmask8, a: __m128i) -> __m #[inline] #[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcasti32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_broadcast_i32x4(k: __mmask8, a: __m128i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcast_i32x4(k: __mmask8, a: __m128i) -> __m256i { unsafe { let broadcast = _mm256_broadcast_i32x4(a).as_i32x8(); transmute(simd_select_bitmask(k, broadcast, i32x8::ZERO)) @@ -27399,7 +28560,8 @@ pub fn _mm256_maskz_broadcast_i32x4(k: __mmask8, a: __m128i) -> __m256i { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcasti64x4, linux: vperm #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_i64x4(a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_i64x4(a: __m256i) -> __m512i { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 0, 1, 2, 3]) } } @@ -27409,7 +28571,8 @@ pub fn _mm512_broadcast_i64x4(a: __m256i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcasti64x4, linux: vperm #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_i64x4(src: __m512i, k: __mmask8, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_i64x4(src: __m512i, k: __mmask8, a: __m256i) -> __m512i { unsafe { let broadcast = _mm512_broadcast_i64x4(a).as_i64x8(); transmute(simd_select_bitmask(k, broadcast, src.as_i64x8())) @@ -27422,7 +28585,8 @@ pub fn _mm512_mask_broadcast_i64x4(src: __m512i, k: __mmask8, a: __m256i) -> __m #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcasti64x4, linux: vperm #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_i64x4(k: __mmask8, a: __m256i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_i64x4(k: __mmask8, a: __m256i) -> __m512i { unsafe { let broadcast = _mm512_broadcast_i64x4(a).as_i64x8(); transmute(simd_select_bitmask(k, broadcast, i64x8::ZERO)) @@ -27435,7 +28599,8 @@ pub fn _mm512_maskz_broadcast_i64x4(k: __mmask8, a: __m256i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcastf32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_f32x4(a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_f32x4(a: __m128) -> __m512 { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]) } } @@ -27445,7 +28610,8 @@ pub fn _mm512_broadcast_f32x4(a: __m128) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcastf32x4, linux: vshu #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_f32x4(src: __m512, k: __mmask16, a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_f32x4(src: __m512, k: __mmask16, a: __m128) -> __m512 { unsafe { let broadcast = _mm512_broadcast_f32x4(a).as_f32x16(); transmute(simd_select_bitmask(k, broadcast, src.as_f32x16())) @@ -27458,7 +28624,8 @@ pub fn _mm512_mask_broadcast_f32x4(src: __m512, k: __mmask16, a: __m128) -> __m5 #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcastf32x4, linux: vshu #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_f32x4(k: __mmask16, a: __m128) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_f32x4(k: __mmask16, a: __m128) -> __m512 { unsafe { let broadcast = _mm512_broadcast_f32x4(a).as_f32x16(); transmute(simd_select_bitmask(k, broadcast, f32x16::ZERO)) @@ -27471,7 +28638,8 @@ pub fn _mm512_maskz_broadcast_f32x4(k: __mmask16, a: __m128) -> __m512 { #[inline] #[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcastf32x4, linux: vshuf #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_broadcast_f32x4(a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_broadcast_f32x4(a: __m128) -> __m256 { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 0, 1, 2, 3]) } } @@ -27481,7 +28649,8 @@ pub fn _mm256_broadcast_f32x4(a: __m128) -> __m256 { #[inline] #[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcastf32x4, linux: vshu #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_mask_broadcast_f32x4(src: __m256, k: __mmask8, a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_broadcast_f32x4(src: __m256, k: __mmask8, a: __m128) -> __m256 { unsafe { let broadcast = _mm256_broadcast_f32x4(a).as_f32x8(); transmute(simd_select_bitmask(k, broadcast, src.as_f32x8())) @@ -27494,7 +28663,8 @@ pub fn _mm256_mask_broadcast_f32x4(src: __m256, k: __mmask8, a: __m128) -> __m25 #[inline] #[target_feature(enable = "avx512f,avx512vl")] //msvc: vbroadcastf32x4, linux: vshu #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm256_maskz_broadcast_f32x4(k: __mmask8, a: __m128) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_broadcast_f32x4(k: __mmask8, a: __m128) -> __m256 { unsafe { let broadcast = _mm256_broadcast_f32x4(a).as_f32x8(); transmute(simd_select_bitmask(k, broadcast, f32x8::ZERO)) @@ -27507,7 +28677,8 @@ pub fn _mm256_maskz_broadcast_f32x4(k: __mmask8, a: __m128) -> __m256 { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcastf64x4, linux: vperm #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_broadcast_f64x4(a: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_broadcast_f64x4(a: __m256d) -> __m512d { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 0, 1, 2, 3]) } } @@ -27517,7 +28688,8 @@ pub fn _mm512_broadcast_f64x4(a: __m256d) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcastf64x4, linux: vper #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_broadcast_f64x4(src: __m512d, k: __mmask8, a: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_broadcast_f64x4(src: __m512d, k: __mmask8, a: __m256d) -> __m512d { unsafe { let broadcast = _mm512_broadcast_f64x4(a).as_f64x8(); transmute(simd_select_bitmask(k, broadcast, src.as_f64x8())) @@ -27530,7 +28702,8 @@ pub fn _mm512_mask_broadcast_f64x4(src: __m512d, k: __mmask8, a: __m256d) -> __m #[inline] #[target_feature(enable = "avx512f")] //msvc: vbroadcastf64x4, linux: vper #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_maskz_broadcast_f64x4(k: __mmask8, a: __m256d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_broadcast_f64x4(k: __mmask8, a: __m256d) -> __m512d { unsafe { let broadcast = _mm512_broadcast_f64x4(a).as_f64x8(); transmute(simd_select_bitmask(k, broadcast, f64x8::ZERO)) @@ -27544,7 +28717,8 @@ pub fn _mm512_maskz_broadcast_f64x4(k: __mmask8, a: __m256d) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] //should be vpblendmd -pub fn _mm512_mask_blend_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask(k, b.as_i32x16(), a.as_i32x16())) } } @@ -27555,7 +28729,8 @@ pub fn _mm512_mask_blend_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] //should be vpblendmd -pub fn _mm256_mask_blend_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask(k, b.as_i32x8(), a.as_i32x8())) } } @@ -27566,7 +28741,8 @@ pub fn _mm256_mask_blend_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa32))] //should be vpblendmd -pub fn _mm_mask_blend_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask(k, b.as_i32x4(), a.as_i32x4())) } } @@ -27577,7 +28753,8 @@ pub fn _mm_mask_blend_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] //should be vpblendmq -pub fn _mm512_mask_blend_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask(k, b.as_i64x8(), a.as_i64x8())) } } @@ -27588,7 +28765,8 @@ pub fn _mm512_mask_blend_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] //should be vpblendmq -pub fn _mm256_mask_blend_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask(k, b.as_i64x4(), a.as_i64x4())) } } @@ -27599,7 +28777,8 @@ pub fn _mm256_mask_blend_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovdqa64))] //should be vpblendmq -pub fn _mm_mask_blend_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask(k, b.as_i64x2(), a.as_i64x2())) } } @@ -27610,7 +28789,8 @@ pub fn _mm_mask_blend_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] //should be vpblendmps -pub fn _mm512_mask_blend_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { unsafe { transmute(simd_select_bitmask(k, b.as_f32x16(), a.as_f32x16())) } } @@ -27621,7 +28801,8 @@ pub fn _mm512_mask_blend_ps(k: __mmask16, a: __m512, b: __m512) -> __m512 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] //should be vpblendmps -pub fn _mm256_mask_blend_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { unsafe { transmute(simd_select_bitmask(k, b.as_f32x8(), a.as_f32x8())) } } @@ -27632,7 +28813,8 @@ pub fn _mm256_mask_blend_ps(k: __mmask8, a: __m256, b: __m256) -> __m256 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovaps))] //should be vpblendmps -pub fn _mm_mask_blend_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { transmute(simd_select_bitmask(k, b.as_f32x4(), a.as_f32x4())) } } @@ -27643,7 +28825,8 @@ pub fn _mm_mask_blend_ps(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] //should be vpblendmpd -pub fn _mm512_mask_blend_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { unsafe { transmute(simd_select_bitmask(k, b.as_f64x8(), a.as_f64x8())) } } @@ -27654,7 +28837,8 @@ pub fn _mm512_mask_blend_pd(k: __mmask8, a: __m512d, b: __m512d) -> __m512d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] //should be vpblendmpd -pub fn _mm256_mask_blend_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { unsafe { transmute(simd_select_bitmask(k, b.as_f64x4(), a.as_f64x4())) } } @@ -27665,7 +28849,8 @@ pub fn _mm256_mask_blend_pd(k: __mmask8, a: __m256d, b: __m256d) -> __m256d { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovapd))] //should be vpblendmpd -pub fn _mm_mask_blend_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { transmute(simd_select_bitmask(k, b.as_f64x2(), a.as_f64x2())) } } @@ -27679,7 +28864,8 @@ pub fn _mm_mask_blend_pd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_alignr_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_alignr_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let a = a.as_i32x16(); @@ -27760,7 +28946,8 @@ pub fn _mm512_alignr_epi32(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_alignr_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_alignr_epi32( src: __m512i, k: __mmask16, a: __m512i, @@ -27781,7 +28968,12 @@ pub fn _mm512_mask_alignr_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_alignr_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_alignr_epi32( + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm512_alignr_epi32::(a, b); @@ -27799,7 +28991,8 @@ pub fn _mm512_maskz_alignr_epi32(k: __mmask16, a: __m512i, b: _ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_alignr_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_alignr_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let a = a.as_i32x8(); @@ -27828,7 +29021,8 @@ pub fn _mm256_alignr_epi32(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_alignr_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_alignr_epi32( src: __m256i, k: __mmask8, a: __m256i, @@ -27849,7 +29043,12 @@ pub fn _mm256_mask_alignr_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_alignr_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_alignr_epi32( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm256_alignr_epi32::(a, b); @@ -27867,7 +29066,8 @@ pub fn _mm256_maskz_alignr_epi32(k: __mmask8, a: __m256i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] //should be valignd #[rustc_legacy_const_generics(2)] -pub fn _mm_alignr_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_alignr_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let a = a.as_i32x4(); @@ -27892,7 +29092,8 @@ pub fn _mm_alignr_epi32(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_alignr_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_alignr_epi32( src: __m128i, k: __mmask8, a: __m128i, @@ -27913,7 +29114,12 @@ pub fn _mm_mask_alignr_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignd, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_alignr_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_alignr_epi32( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm_alignr_epi32::(a, b); @@ -27931,7 +29137,8 @@ pub fn _mm_maskz_alignr_epi32(k: __mmask8, a: __m128i, b: __m12 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_alignr_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_alignr_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let imm8: i32 = IMM8 % 8; @@ -27958,7 +29165,8 @@ pub fn _mm512_alignr_epi64(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_alignr_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_alignr_epi64( src: __m512i, k: __mmask8, a: __m512i, @@ -27979,7 +29187,12 @@ pub fn _mm512_mask_alignr_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_alignr_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_alignr_epi64( + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm512_alignr_epi64::(a, b); @@ -27997,7 +29210,8 @@ pub fn _mm512_maskz_alignr_epi64(k: __mmask8, a: __m512i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_alignr_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_alignr_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let imm8: i32 = IMM8 % 4; @@ -28020,7 +29234,8 @@ pub fn _mm256_alignr_epi64(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_alignr_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_alignr_epi64( src: __m256i, k: __mmask8, a: __m256i, @@ -28041,7 +29256,12 @@ pub fn _mm256_mask_alignr_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_alignr_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_alignr_epi64( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm256_alignr_epi64::(a, b); @@ -28059,7 +29279,8 @@ pub fn _mm256_maskz_alignr_epi64(k: __mmask8, a: __m256i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpalignr, IMM8 = 1))] //should be valignq #[rustc_legacy_const_generics(2)] -pub fn _mm_alignr_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_alignr_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let imm8: i32 = IMM8 % 2; @@ -28080,7 +29301,8 @@ pub fn _mm_alignr_epi64(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_alignr_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_alignr_epi64( src: __m128i, k: __mmask8, a: __m128i, @@ -28101,7 +29323,12 @@ pub fn _mm_mask_alignr_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(valignq, IMM8 = 1))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_alignr_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_alignr_epi64( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let r = _mm_alignr_epi64::(a, b); @@ -28116,7 +29343,8 @@ pub fn _mm_maskz_alignr_epi64(k: __mmask8, a: __m128i, b: __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] //should be vpandd, but generate vpandq -pub fn _mm512_and_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_and_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_and(a.as_i32x16(), b.as_i32x16())) } } @@ -28127,7 +29355,8 @@ pub fn _mm512_and_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm512_mask_and_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_and_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let and = _mm512_and_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, and, src.as_i32x16())) @@ -28141,7 +29370,8 @@ pub fn _mm512_mask_and_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm512_maskz_and_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_and_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let and = _mm512_and_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, and, i32x16::ZERO)) @@ -28155,7 +29385,8 @@ pub fn _mm512_maskz_and_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm256_mask_and_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_and_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let and = simd_and(a.as_i32x8(), b.as_i32x8()); transmute(simd_select_bitmask(k, and, src.as_i32x8())) @@ -28169,7 +29400,8 @@ pub fn _mm256_mask_and_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm256_maskz_and_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_and_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let and = simd_and(a.as_i32x8(), b.as_i32x8()); transmute(simd_select_bitmask(k, and, i32x8::ZERO)) @@ -28183,7 +29415,8 @@ pub fn _mm256_maskz_and_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm_mask_and_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_and_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let and = simd_and(a.as_i32x4(), b.as_i32x4()); transmute(simd_select_bitmask(k, and, src.as_i32x4())) @@ -28197,7 +29430,8 @@ pub fn _mm_mask_and_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandd))] -pub fn _mm_maskz_and_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_and_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let and = simd_and(a.as_i32x4(), b.as_i32x4()); transmute(simd_select_bitmask(k, and, i32x4::ZERO)) @@ -28211,7 +29445,8 @@ pub fn _mm_maskz_and_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm512_and_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_and_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_and(a.as_i64x8(), b.as_i64x8())) } } @@ -28222,7 +29457,8 @@ pub fn _mm512_and_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm512_mask_and_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_and_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let and = _mm512_and_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, and, src.as_i64x8())) @@ -28236,7 +29472,8 @@ pub fn _mm512_mask_and_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm512_maskz_and_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_and_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let and = _mm512_and_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, and, i64x8::ZERO)) @@ -28250,7 +29487,8 @@ pub fn _mm512_maskz_and_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm256_mask_and_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_and_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let and = simd_and(a.as_i64x4(), b.as_i64x4()); transmute(simd_select_bitmask(k, and, src.as_i64x4())) @@ -28264,7 +29502,8 @@ pub fn _mm256_mask_and_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm256_maskz_and_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_and_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let and = simd_and(a.as_i64x4(), b.as_i64x4()); transmute(simd_select_bitmask(k, and, i64x4::ZERO)) @@ -28278,7 +29517,8 @@ pub fn _mm256_maskz_and_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm_mask_and_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_and_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let and = simd_and(a.as_i64x2(), b.as_i64x2()); transmute(simd_select_bitmask(k, and, src.as_i64x2())) @@ -28292,7 +29532,8 @@ pub fn _mm_mask_and_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm_maskz_and_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_and_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let and = simd_and(a.as_i64x2(), b.as_i64x2()); transmute(simd_select_bitmask(k, and, i64x2::ZERO)) @@ -28306,7 +29547,8 @@ pub fn _mm_maskz_and_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandq))] -pub fn _mm512_and_si512(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_and_si512(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_and(a.as_i32x16(), b.as_i32x16())) } } @@ -28317,7 +29559,8 @@ pub fn _mm512_and_si512(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm512_or_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_or_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_or(a.as_i32x16(), b.as_i32x16())) } } @@ -28328,7 +29571,8 @@ pub fn _mm512_or_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpord))] -pub fn _mm512_mask_or_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_or_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let or = _mm512_or_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, or, src.as_i32x16())) @@ -28342,7 +29586,8 @@ pub fn _mm512_mask_or_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpord))] -pub fn _mm512_maskz_or_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_or_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let or = _mm512_or_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, or, i32x16::ZERO)) @@ -28356,7 +29601,8 @@ pub fn _mm512_maskz_or_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vor))] //should be vpord -pub fn _mm256_or_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_or_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_or(a.as_i32x8(), b.as_i32x8())) } } @@ -28367,7 +29613,8 @@ pub fn _mm256_or_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpord))] -pub fn _mm256_mask_or_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_or_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let or = _mm256_or_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, or, src.as_i32x8())) @@ -28381,7 +29628,8 @@ pub fn _mm256_mask_or_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpord))] -pub fn _mm256_maskz_or_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_or_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let or = _mm256_or_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, or, i32x8::ZERO)) @@ -28395,7 +29643,8 @@ pub fn _mm256_maskz_or_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vor))] //should be vpord -pub fn _mm_or_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_or_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_or(a.as_i32x4(), b.as_i32x4())) } } @@ -28406,7 +29655,8 @@ pub fn _mm_or_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpord))] -pub fn _mm_mask_or_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_or_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let or = _mm_or_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, or, src.as_i32x4())) @@ -28420,7 +29670,8 @@ pub fn _mm_mask_or_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpord))] -pub fn _mm_maskz_or_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_or_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let or = _mm_or_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, or, i32x4::ZERO)) @@ -28434,7 +29685,8 @@ pub fn _mm_maskz_or_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm512_or_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_or_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_or(a.as_i64x8(), b.as_i64x8())) } } @@ -28445,7 +29697,8 @@ pub fn _mm512_or_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm512_mask_or_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_or_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let or = _mm512_or_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, or, src.as_i64x8())) @@ -28459,7 +29712,8 @@ pub fn _mm512_mask_or_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) - #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm512_maskz_or_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_or_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let or = _mm512_or_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, or, i64x8::ZERO)) @@ -28473,7 +29727,8 @@ pub fn _mm512_maskz_or_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vor))] //should be vporq -pub fn _mm256_or_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_or_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_or(a.as_i64x4(), b.as_i64x4())) } } @@ -28484,7 +29739,8 @@ pub fn _mm256_or_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm256_mask_or_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_or_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let or = _mm256_or_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, or, src.as_i64x4())) @@ -28498,7 +29754,8 @@ pub fn _mm256_mask_or_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) - #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm256_maskz_or_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_or_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let or = _mm256_or_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, or, i64x4::ZERO)) @@ -28512,7 +29769,8 @@ pub fn _mm256_maskz_or_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vor))] //should be vporq -pub fn _mm_or_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_or_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_or(a.as_i64x2(), b.as_i64x2())) } } @@ -28523,7 +29781,8 @@ pub fn _mm_or_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm_mask_or_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_or_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let or = _mm_or_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, or, src.as_i64x2())) @@ -28537,7 +29796,8 @@ pub fn _mm_mask_or_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm_maskz_or_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_or_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let or = _mm_or_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, or, i64x2::ZERO)) @@ -28551,7 +29811,8 @@ pub fn _mm_maskz_or_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vporq))] -pub fn _mm512_or_si512(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_or_si512(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_or(a.as_i32x16(), b.as_i32x16())) } } @@ -28562,7 +29823,8 @@ pub fn _mm512_or_si512(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] //should be vpxord -pub fn _mm512_xor_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_xor_epi32(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_xor(a.as_i32x16(), b.as_i32x16())) } } @@ -28573,7 +29835,8 @@ pub fn _mm512_xor_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxord))] -pub fn _mm512_mask_xor_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_xor_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let xor = _mm512_xor_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, xor, src.as_i32x16())) @@ -28587,7 +29850,8 @@ pub fn _mm512_mask_xor_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxord))] -pub fn _mm512_maskz_xor_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_xor_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let xor = _mm512_xor_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, xor, i32x16::ZERO)) @@ -28601,7 +29865,8 @@ pub fn _mm512_maskz_xor_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxor))] //should be vpxord -pub fn _mm256_xor_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_xor_epi32(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_xor(a.as_i32x8(), b.as_i32x8())) } } @@ -28612,7 +29877,8 @@ pub fn _mm256_xor_epi32(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxord))] -pub fn _mm256_mask_xor_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_xor_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let xor = _mm256_xor_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, xor, src.as_i32x8())) @@ -28626,7 +29892,8 @@ pub fn _mm256_mask_xor_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxord))] -pub fn _mm256_maskz_xor_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_xor_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let xor = _mm256_xor_epi32(a, b).as_i32x8(); transmute(simd_select_bitmask(k, xor, i32x8::ZERO)) @@ -28640,7 +29907,8 @@ pub fn _mm256_maskz_xor_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxor))] //should be vpxord -pub fn _mm_xor_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_xor_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_xor(a.as_i32x4(), b.as_i32x4())) } } @@ -28651,7 +29919,8 @@ pub fn _mm_xor_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxord))] -pub fn _mm_mask_xor_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_xor_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let xor = _mm_xor_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, xor, src.as_i32x4())) @@ -28665,7 +29934,8 @@ pub fn _mm_mask_xor_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxord))] -pub fn _mm_maskz_xor_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_xor_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let xor = _mm_xor_epi32(a, b).as_i32x4(); transmute(simd_select_bitmask(k, xor, i32x4::ZERO)) @@ -28679,7 +29949,8 @@ pub fn _mm_maskz_xor_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm512_xor_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_xor_epi64(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_xor(a.as_i64x8(), b.as_i64x8())) } } @@ -28690,7 +29961,8 @@ pub fn _mm512_xor_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm512_mask_xor_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_xor_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let xor = _mm512_xor_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, xor, src.as_i64x8())) @@ -28704,7 +29976,8 @@ pub fn _mm512_mask_xor_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm512_maskz_xor_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_xor_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let xor = _mm512_xor_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, xor, i64x8::ZERO)) @@ -28718,7 +29991,8 @@ pub fn _mm512_maskz_xor_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxor))] //should be vpxorq -pub fn _mm256_xor_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_xor_epi64(a: __m256i, b: __m256i) -> __m256i { unsafe { transmute(simd_xor(a.as_i64x4(), b.as_i64x4())) } } @@ -28729,7 +30003,8 @@ pub fn _mm256_xor_epi64(a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm256_mask_xor_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_xor_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let xor = _mm256_xor_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, xor, src.as_i64x4())) @@ -28743,7 +30018,8 @@ pub fn _mm256_mask_xor_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm256_maskz_xor_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_xor_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let xor = _mm256_xor_epi64(a, b).as_i64x4(); transmute(simd_select_bitmask(k, xor, i64x4::ZERO)) @@ -28757,7 +30033,8 @@ pub fn _mm256_maskz_xor_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vxor))] //should be vpxorq -pub fn _mm_xor_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_xor_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_xor(a.as_i64x2(), b.as_i64x2())) } } @@ -28768,7 +30045,8 @@ pub fn _mm_xor_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm_mask_xor_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_xor_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let xor = _mm_xor_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, xor, src.as_i64x2())) @@ -28782,7 +30060,8 @@ pub fn _mm_mask_xor_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm_maskz_xor_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_xor_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let xor = _mm_xor_epi64(a, b).as_i64x2(); transmute(simd_select_bitmask(k, xor, i64x2::ZERO)) @@ -28796,7 +30075,8 @@ pub fn _mm_maskz_xor_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpxorq))] -pub fn _mm512_xor_si512(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_xor_si512(a: __m512i, b: __m512i) -> __m512i { unsafe { transmute(simd_xor(a.as_i32x16(), b.as_i32x16())) } } @@ -28807,7 +30087,8 @@ pub fn _mm512_xor_si512(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] //should be vpandnd -pub fn _mm512_andnot_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_andnot_epi32(a: __m512i, b: __m512i) -> __m512i { _mm512_and_epi32(_mm512_xor_epi32(a, _mm512_set1_epi32(u32::MAX as i32)), b) } @@ -28818,7 +30099,13 @@ pub fn _mm512_andnot_epi32(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnd))] -pub fn _mm512_mask_andnot_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_andnot_epi32( + src: __m512i, + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let andnot = _mm512_andnot_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, andnot, src.as_i32x16())) @@ -28832,7 +30119,8 @@ pub fn _mm512_mask_andnot_epi32(src: __m512i, k: __mmask16, a: __m512i, b: __m51 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnd))] -pub fn _mm512_maskz_andnot_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_andnot_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { unsafe { let andnot = _mm512_andnot_epi32(a, b).as_i32x16(); transmute(simd_select_bitmask(k, andnot, i32x16::ZERO)) @@ -28846,7 +30134,13 @@ pub fn _mm512_maskz_andnot_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnd))] -pub fn _mm256_mask_andnot_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_andnot_epi32( + src: __m256i, + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let not = _mm256_xor_epi32(a, _mm256_set1_epi32(u32::MAX as i32)); let andnot = simd_and(not.as_i32x8(), b.as_i32x8()); @@ -28861,7 +30155,8 @@ pub fn _mm256_mask_andnot_epi32(src: __m256i, k: __mmask8, a: __m256i, b: __m256 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnd))] -pub fn _mm256_maskz_andnot_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_andnot_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let not = _mm256_xor_epi32(a, _mm256_set1_epi32(u32::MAX as i32)); let andnot = simd_and(not.as_i32x8(), b.as_i32x8()); @@ -28876,7 +30171,8 @@ pub fn _mm256_maskz_andnot_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnd))] -pub fn _mm_mask_andnot_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_andnot_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let not = _mm_xor_epi32(a, _mm_set1_epi32(u32::MAX as i32)); let andnot = simd_and(not.as_i32x4(), b.as_i32x4()); @@ -28891,7 +30187,8 @@ pub fn _mm_mask_andnot_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnd))] -pub fn _mm_maskz_andnot_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_andnot_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let not = _mm_xor_epi32(a, _mm_set1_epi32(u32::MAX as i32)); let andnot = simd_and(not.as_i32x4(), b.as_i32x4()); @@ -28906,7 +30203,8 @@ pub fn _mm_maskz_andnot_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] //should be vpandnd -pub fn _mm512_andnot_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_andnot_epi64(a: __m512i, b: __m512i) -> __m512i { _mm512_and_epi64(_mm512_xor_epi64(a, _mm512_set1_epi64(u64::MAX as i64)), b) } @@ -28917,7 +30215,13 @@ pub fn _mm512_andnot_epi64(a: __m512i, b: __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm512_mask_andnot_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_andnot_epi64( + src: __m512i, + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { let andnot = _mm512_andnot_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, andnot, src.as_i64x8())) @@ -28931,7 +30235,8 @@ pub fn _mm512_mask_andnot_epi64(src: __m512i, k: __mmask8, a: __m512i, b: __m512 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm512_maskz_andnot_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_andnot_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { unsafe { let andnot = _mm512_andnot_epi64(a, b).as_i64x8(); transmute(simd_select_bitmask(k, andnot, i64x8::ZERO)) @@ -28945,7 +30250,13 @@ pub fn _mm512_maskz_andnot_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm256_mask_andnot_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_andnot_epi64( + src: __m256i, + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { let not = _mm256_xor_epi64(a, _mm256_set1_epi64x(u64::MAX as i64)); let andnot = simd_and(not.as_i64x4(), b.as_i64x4()); @@ -28960,7 +30271,8 @@ pub fn _mm256_mask_andnot_epi64(src: __m256i, k: __mmask8, a: __m256i, b: __m256 #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm256_maskz_andnot_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_andnot_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { unsafe { let not = _mm256_xor_epi64(a, _mm256_set1_epi64x(u64::MAX as i64)); let andnot = simd_and(not.as_i64x4(), b.as_i64x4()); @@ -28975,7 +30287,8 @@ pub fn _mm256_maskz_andnot_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm_mask_andnot_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_andnot_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let not = _mm_xor_epi64(a, _mm_set1_epi64x(u64::MAX as i64)); let andnot = simd_and(not.as_i64x2(), b.as_i64x2()); @@ -28990,7 +30303,8 @@ pub fn _mm_mask_andnot_epi64(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm_maskz_andnot_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_andnot_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { unsafe { let not = _mm_xor_epi64(a, _mm_set1_epi64x(u64::MAX as i64)); let andnot = simd_and(not.as_i64x2(), b.as_i64x2()); @@ -29005,7 +30319,8 @@ pub fn _mm_maskz_andnot_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpandnq))] -pub fn _mm512_andnot_si512(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_andnot_si512(a: __m512i, b: __m512i) -> __m512i { _mm512_and_epi64(_mm512_xor_epi64(a, _mm512_set1_epi64(u64::MAX as i64)), b) } @@ -29015,7 +30330,8 @@ pub fn _mm512_andnot_si512(a: __m512i, b: __m512i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtmask16_u32(a: __mmask16) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtmask16_u32(a: __mmask16) -> u32 { a as u32 } @@ -29025,7 +30341,8 @@ pub fn _cvtmask16_u32(a: __mmask16) -> u32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtu32_mask16(a: u32) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtu32_mask16(a: u32) -> __mmask16 { a as __mmask16 } @@ -29036,7 +30353,8 @@ pub fn _cvtu32_mask16(a: u32) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(and))] // generate normal and code instead of kandw -pub fn _kand_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kand_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { a & b } @@ -29047,7 +30365,8 @@ pub fn _kand_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(and))] // generate normal and code instead of kandw -pub fn _mm512_kand(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kand(a: __mmask16, b: __mmask16) -> __mmask16 { a & b } @@ -29058,7 +30377,8 @@ pub fn _mm512_kand(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(or))] // generate normal or code instead of korw -pub fn _kor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { a | b } @@ -29069,7 +30389,8 @@ pub fn _kor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(or))] // generate normal or code instead of korw -pub fn _mm512_kor(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kor(a: __mmask16, b: __mmask16) -> __mmask16 { a | b } @@ -29080,7 +30401,8 @@ pub fn _mm512_kor(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(xor))] // generate normal xor code instead of kxorw -pub fn _kxor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { a ^ b } @@ -29091,7 +30413,8 @@ pub fn _kxor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(xor))] // generate normal xor code instead of kxorw -pub fn _mm512_kxor(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kxor(a: __mmask16, b: __mmask16) -> __mmask16 { a ^ b } @@ -29101,7 +30424,8 @@ pub fn _mm512_kxor(a: __mmask16, b: __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _knot_mask16(a: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _knot_mask16(a: __mmask16) -> __mmask16 { a ^ 0b11111111_11111111 } @@ -29111,7 +30435,8 @@ pub fn _knot_mask16(a: __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_knot(a: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_knot(a: __mmask16) -> __mmask16 { a ^ 0b11111111_11111111 } @@ -29122,7 +30447,8 @@ pub fn _mm512_knot(a: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(not))] // generate normal and, not code instead of kandnw -pub fn _kandn_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kandn_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { _mm512_kand(_mm512_knot(a), b) } @@ -29133,7 +30459,8 @@ pub fn _kandn_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(not))] // generate normal and code instead of kandw -pub fn _mm512_kandn(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kandn(a: __mmask16, b: __mmask16) -> __mmask16 { _mm512_kand(_mm512_knot(a), b) } @@ -29144,7 +30471,8 @@ pub fn _mm512_kandn(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(xor))] // generate normal xor, not code instead of kxnorw -pub fn _kxnor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kxnor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { _mm512_knot(_mm512_kxor(a, b)) } @@ -29155,7 +30483,8 @@ pub fn _kxnor_mask16(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kandw -pub fn _mm512_kxnor(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kxnor(a: __mmask16, b: __mmask16) -> __mmask16 { _mm512_knot(_mm512_kxor(a, b)) } @@ -29166,7 +30495,8 @@ pub fn _mm512_kxnor(a: __mmask16, b: __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _kortest_mask16_u8(a: __mmask16, b: __mmask16, all_ones: *mut u8) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _kortest_mask16_u8(a: __mmask16, b: __mmask16, all_ones: *mut u8) -> u8 { let tmp = _kor_mask16(a, b); *all_ones = (tmp == 0xffff) as u8; (tmp == 0) as u8 @@ -29179,7 +30509,8 @@ pub unsafe fn _kortest_mask16_u8(a: __mmask16, b: __mmask16, all_ones: *mut u8) #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { (_kor_mask16(a, b) == 0xffff) as u8 } @@ -29190,7 +30521,8 @@ pub fn _kortestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kortestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kortestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { (_kor_mask16(a, b) == 0) as u8 } @@ -29201,7 +30533,8 @@ pub fn _kortestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 { #[target_feature(enable = "avx512f")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftli_mask16(a: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftli_mask16(a: __mmask16) -> __mmask16 { a.unbounded_shl(COUNT) } @@ -29212,7 +30545,8 @@ pub fn _kshiftli_mask16(a: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[rustc_legacy_const_generics(1)] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _kshiftri_mask16(a: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _kshiftri_mask16(a: __mmask16) -> __mmask16 { a.unbounded_shr(COUNT) } @@ -29222,7 +30556,8 @@ pub fn _kshiftri_mask16(a: __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _load_mask16(mem_addr: *const __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _load_mask16(mem_addr: *const __mmask16) -> __mmask16 { *mem_addr } @@ -29232,7 +30567,8 @@ pub unsafe fn _load_mask16(mem_addr: *const __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _store_mask16(mem_addr: *mut __mmask16, a: __mmask16) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _store_mask16(mem_addr: *mut __mmask16, a: __mmask16) { *mem_addr = a; } @@ -29243,7 +30579,8 @@ pub unsafe fn _store_mask16(mem_addr: *mut __mmask16, a: __mmask16) { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kmovw -pub fn _mm512_kmov(a: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kmov(a: __mmask16) -> __mmask16 { a } @@ -29253,7 +30590,8 @@ pub fn _mm512_kmov(a: __mmask16) -> __mmask16 { #[inline] #[target_feature(enable = "avx512f")] // generate normal and code instead of kmovw #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_int2mask(mask: i32) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_int2mask(mask: i32) -> __mmask16 { mask as u16 } @@ -29264,7 +30602,8 @@ pub fn _mm512_int2mask(mask: i32) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kmovw -pub fn _mm512_mask2int(k1: __mmask16) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask2int(k1: __mmask16) -> i32 { k1 as i32 } @@ -29275,7 +30614,8 @@ pub fn _mm512_mask2int(k1: __mmask16) -> i32 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kunpckbw -pub fn _mm512_kunpackb(a: __mmask16, b: __mmask16) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kunpackb(a: __mmask16, b: __mmask16) -> __mmask16 { ((a & 0xff) << 8) | (b & 0xff) } @@ -29286,7 +30626,8 @@ pub fn _mm512_kunpackb(a: __mmask16, b: __mmask16) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(cmp))] // generate normal and code instead of kortestw -pub fn _mm512_kortestc(a: __mmask16, b: __mmask16) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kortestc(a: __mmask16, b: __mmask16) -> i32 { let r = (a | b) == 0b11111111_11111111; r as i32 } @@ -29298,7 +30639,8 @@ pub fn _mm512_kortestc(a: __mmask16, b: __mmask16) -> i32 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kortestw -pub fn _mm512_kortestz(a: __mmask16, b: __mmask16) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_kortestz(a: __mmask16, b: __mmask16) -> i32 { let r = (a | b) == 0; r as i32 } @@ -29310,7 +30652,8 @@ pub fn _mm512_kortestz(a: __mmask16, b: __mmask16) -> i32 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmd))] -pub fn _mm512_test_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_test_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { let and = _mm512_and_epi32(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpneq_epi32_mask(and, zero) @@ -29323,7 +30666,8 @@ pub fn _mm512_test_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmd))] -pub fn _mm512_mask_test_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_test_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { let and = _mm512_and_epi32(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpneq_epi32_mask(k, and, zero) @@ -29336,7 +30680,8 @@ pub fn _mm512_mask_test_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mm #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmd))] -pub fn _mm256_test_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_test_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpneq_epi32_mask(and, zero) @@ -29349,7 +30694,8 @@ pub fn _mm256_test_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmd))] -pub fn _mm256_mask_test_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_test_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpneq_epi32_mask(k, and, zero) @@ -29362,7 +30708,8 @@ pub fn _mm256_mask_test_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mma #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmd))] -pub fn _mm_test_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_test_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpneq_epi32_mask(and, zero) @@ -29375,7 +30722,8 @@ pub fn _mm_test_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmd))] -pub fn _mm_mask_test_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_test_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpneq_epi32_mask(k, and, zero) @@ -29388,7 +30736,8 @@ pub fn _mm_mask_test_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmq))] -pub fn _mm512_test_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_test_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { let and = _mm512_and_epi64(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpneq_epi64_mask(and, zero) @@ -29401,7 +30750,8 @@ pub fn _mm512_test_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmq))] -pub fn _mm512_mask_test_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_test_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { let and = _mm512_and_epi64(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpneq_epi64_mask(k, and, zero) @@ -29414,7 +30764,8 @@ pub fn _mm512_mask_test_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mma #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmq))] -pub fn _mm256_test_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_test_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpneq_epi64_mask(and, zero) @@ -29427,7 +30778,8 @@ pub fn _mm256_test_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmq))] -pub fn _mm256_mask_test_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_test_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpneq_epi64_mask(k, and, zero) @@ -29440,7 +30792,8 @@ pub fn _mm256_mask_test_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mma #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmq))] -pub fn _mm_test_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_test_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpneq_epi64_mask(and, zero) @@ -29453,7 +30806,8 @@ pub fn _mm_test_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestmq))] -pub fn _mm_mask_test_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_test_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpneq_epi64_mask(k, and, zero) @@ -29466,7 +30820,8 @@ pub fn _mm_mask_test_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmd))] -pub fn _mm512_testn_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_testn_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { let and = _mm512_and_epi32(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpeq_epi32_mask(and, zero) @@ -29479,7 +30834,8 @@ pub fn _mm512_testn_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmd))] -pub fn _mm512_mask_testn_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_testn_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { let and = _mm512_and_epi32(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpeq_epi32_mask(k, and, zero) @@ -29492,7 +30848,8 @@ pub fn _mm512_mask_testn_epi32_mask(k: __mmask16, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmd))] -pub fn _mm256_testn_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_testn_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpeq_epi32_mask(and, zero) @@ -29505,7 +30862,8 @@ pub fn _mm256_testn_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmd))] -pub fn _mm256_mask_testn_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_testn_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpeq_epi32_mask(k, and, zero) @@ -29518,7 +30876,8 @@ pub fn _mm256_mask_testn_epi32_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mm #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmd))] -pub fn _mm_testn_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testn_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpeq_epi32_mask(and, zero) @@ -29531,7 +30890,8 @@ pub fn _mm_testn_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmd))] -pub fn _mm_mask_testn_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_testn_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpeq_epi32_mask(k, and, zero) @@ -29544,7 +30904,8 @@ pub fn _mm_mask_testn_epi32_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmq))] -pub fn _mm512_testn_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_testn_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { let and = _mm512_and_epi64(a, b); let zero = _mm512_setzero_si512(); _mm512_cmpeq_epi64_mask(and, zero) @@ -29557,7 +30918,8 @@ pub fn _mm512_testn_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmq))] -pub fn _mm512_mask_testn_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_testn_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { let and = _mm512_and_epi64(a, b); let zero = _mm512_setzero_si512(); _mm512_mask_cmpeq_epi64_mask(k, and, zero) @@ -29570,7 +30932,8 @@ pub fn _mm512_mask_testn_epi64_mask(k: __mmask8, a: __m512i, b: __m512i) -> __mm #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmq))] -pub fn _mm256_testn_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_testn_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_cmpeq_epi64_mask(and, zero) @@ -29583,7 +30946,8 @@ pub fn _mm256_testn_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmq))] -pub fn _mm256_mask_testn_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_testn_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { let and = _mm256_and_si256(a, b); let zero = _mm256_setzero_si256(); _mm256_mask_cmpeq_epi64_mask(k, and, zero) @@ -29596,7 +30960,8 @@ pub fn _mm256_mask_testn_epi64_mask(k: __mmask8, a: __m256i, b: __m256i) -> __mm #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmq))] -pub fn _mm_testn_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testn_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_cmpeq_epi64_mask(and, zero) @@ -29609,7 +30974,8 @@ pub fn _mm_testn_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vptestnmq))] -pub fn _mm_mask_testn_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_testn_epi64_mask(k: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { let and = _mm_and_si128(a, b); let zero = _mm_setzero_si128(); _mm_mask_cmpeq_epi64_mask(k, and, zero) @@ -29721,7 +31087,8 @@ pub unsafe fn _mm512_stream_load_si512(mem_addr: *const __m512i) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set_ps( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_ps( e0: f32, e1: f32, e2: f32, @@ -29751,7 +31118,8 @@ pub fn _mm512_set_ps( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr_ps( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr_ps( e0: f32, e1: f32, e2: f32, @@ -29783,7 +31151,8 @@ pub fn _mm512_setr_ps( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set1_pd(a: f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_pd(a: f64) -> __m512d { unsafe { transmute(f64x8::splat(a)) } } @@ -29793,7 +31162,8 @@ pub fn _mm512_set1_pd(a: f64) -> __m512d { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set1_ps(a: f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_ps(a: f32) -> __m512 { unsafe { transmute(f32x16::splat(a)) } } @@ -29803,7 +31173,8 @@ pub fn _mm512_set1_ps(a: f32) -> __m512 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_epi32( e15: i32, e14: i32, e13: i32, @@ -29832,7 +31203,8 @@ pub fn _mm512_set_epi32( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set1_epi8(a: i8) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_epi8(a: i8) -> __m512i { unsafe { transmute(i8x64::splat(a)) } } @@ -29842,7 +31214,8 @@ pub fn _mm512_set1_epi8(a: i8) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set1_epi16(a: i16) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_epi16(a: i16) -> __m512i { unsafe { transmute(i16x32::splat(a)) } } @@ -29852,7 +31225,8 @@ pub fn _mm512_set1_epi16(a: i16) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set1_epi32(a: i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_epi32(a: i32) -> __m512i { unsafe { transmute(i32x16::splat(a)) } } @@ -29863,7 +31237,8 @@ pub fn _mm512_set1_epi32(a: i32) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastd))] -pub fn _mm512_mask_set1_epi32(src: __m512i, k: __mmask16, a: i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_set1_epi32(src: __m512i, k: __mmask16, a: i32) -> __m512i { unsafe { let r = _mm512_set1_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, r, src.as_i32x16())) @@ -29877,7 +31252,8 @@ pub fn _mm512_mask_set1_epi32(src: __m512i, k: __mmask16, a: i32) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastd))] -pub fn _mm512_maskz_set1_epi32(k: __mmask16, a: i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_set1_epi32(k: __mmask16, a: i32) -> __m512i { unsafe { let r = _mm512_set1_epi32(a).as_i32x16(); transmute(simd_select_bitmask(k, r, i32x16::ZERO)) @@ -29891,7 +31267,8 @@ pub fn _mm512_maskz_set1_epi32(k: __mmask16, a: i32) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastd))] -pub fn _mm256_mask_set1_epi32(src: __m256i, k: __mmask8, a: i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_set1_epi32(src: __m256i, k: __mmask8, a: i32) -> __m256i { unsafe { let r = _mm256_set1_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, r, src.as_i32x8())) @@ -29905,7 +31282,8 @@ pub fn _mm256_mask_set1_epi32(src: __m256i, k: __mmask8, a: i32) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastd))] -pub fn _mm256_maskz_set1_epi32(k: __mmask8, a: i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_set1_epi32(k: __mmask8, a: i32) -> __m256i { unsafe { let r = _mm256_set1_epi32(a).as_i32x8(); transmute(simd_select_bitmask(k, r, i32x8::ZERO)) @@ -29919,7 +31297,8 @@ pub fn _mm256_maskz_set1_epi32(k: __mmask8, a: i32) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastd))] -pub fn _mm_mask_set1_epi32(src: __m128i, k: __mmask8, a: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_set1_epi32(src: __m128i, k: __mmask8, a: i32) -> __m128i { unsafe { let r = _mm_set1_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, r, src.as_i32x4())) @@ -29933,7 +31312,8 @@ pub fn _mm_mask_set1_epi32(src: __m128i, k: __mmask8, a: i32) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastd))] -pub fn _mm_maskz_set1_epi32(k: __mmask8, a: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_set1_epi32(k: __mmask8, a: i32) -> __m128i { unsafe { let r = _mm_set1_epi32(a).as_i32x4(); transmute(simd_select_bitmask(k, r, i32x4::ZERO)) @@ -29946,7 +31326,8 @@ pub fn _mm_maskz_set1_epi32(k: __mmask8, a: i32) -> __m128i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set1_epi64(a: i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_epi64(a: i64) -> __m512i { unsafe { transmute(i64x8::splat(a)) } } @@ -29957,7 +31338,8 @@ pub fn _mm512_set1_epi64(a: i64) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastq))] -pub fn _mm512_mask_set1_epi64(src: __m512i, k: __mmask8, a: i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_set1_epi64(src: __m512i, k: __mmask8, a: i64) -> __m512i { unsafe { let r = _mm512_set1_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, r, src.as_i64x8())) @@ -29971,7 +31353,8 @@ pub fn _mm512_mask_set1_epi64(src: __m512i, k: __mmask8, a: i64) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastq))] -pub fn _mm512_maskz_set1_epi64(k: __mmask8, a: i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_set1_epi64(k: __mmask8, a: i64) -> __m512i { unsafe { let r = _mm512_set1_epi64(a).as_i64x8(); transmute(simd_select_bitmask(k, r, i64x8::ZERO)) @@ -29985,7 +31368,8 @@ pub fn _mm512_maskz_set1_epi64(k: __mmask8, a: i64) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastq))] -pub fn _mm256_mask_set1_epi64(src: __m256i, k: __mmask8, a: i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_set1_epi64(src: __m256i, k: __mmask8, a: i64) -> __m256i { unsafe { let r = _mm256_set1_epi64x(a).as_i64x4(); transmute(simd_select_bitmask(k, r, src.as_i64x4())) @@ -29999,7 +31383,8 @@ pub fn _mm256_mask_set1_epi64(src: __m256i, k: __mmask8, a: i64) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastq))] -pub fn _mm256_maskz_set1_epi64(k: __mmask8, a: i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_set1_epi64(k: __mmask8, a: i64) -> __m256i { unsafe { let r = _mm256_set1_epi64x(a).as_i64x4(); transmute(simd_select_bitmask(k, r, i64x4::ZERO)) @@ -30013,7 +31398,8 @@ pub fn _mm256_maskz_set1_epi64(k: __mmask8, a: i64) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastq))] -pub fn _mm_mask_set1_epi64(src: __m128i, k: __mmask8, a: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_set1_epi64(src: __m128i, k: __mmask8, a: i64) -> __m128i { unsafe { let r = _mm_set1_epi64x(a).as_i64x2(); transmute(simd_select_bitmask(k, r, src.as_i64x2())) @@ -30027,7 +31413,8 @@ pub fn _mm_mask_set1_epi64(src: __m128i, k: __mmask8, a: i64) -> __m128i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpbroadcastq))] -pub fn _mm_maskz_set1_epi64(k: __mmask8, a: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_set1_epi64(k: __mmask8, a: i64) -> __m128i { unsafe { let r = _mm_set1_epi64x(a).as_i64x2(); transmute(simd_select_bitmask(k, r, i64x2::ZERO)) @@ -30040,7 +31427,8 @@ pub fn _mm_maskz_set1_epi64(k: __mmask8, a: i64) -> __m128i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i { _mm512_set_epi64(d, c, b, a, d, c, b, a) } @@ -30050,7 +31438,8 @@ pub fn _mm512_set4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr4_epi64(d: i64, c: i64, b: i64, a: i64) -> __m512i { _mm512_set_epi64(a, b, c, d, a, b, c, d) } @@ -30879,7 +32268,8 @@ pub fn _mm_mask_cmp_round_sd_mask( #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_cmplt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_lt(a.as_u32x16(), b.as_u32x16())) } } @@ -30890,7 +32280,8 @@ pub fn _mm512_cmplt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_mask_cmplt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -30901,7 +32292,8 @@ pub fn _mm512_mask_cmplt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_cmplt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_lt(a.as_u32x8(), b.as_u32x8())) } } @@ -30912,7 +32304,8 @@ pub fn _mm256_cmplt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_mask_cmplt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -30923,7 +32316,8 @@ pub fn _mm256_mask_cmplt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_cmplt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_lt(a.as_u32x4(), b.as_u32x4())) } } @@ -30934,7 +32328,8 @@ pub fn _mm_cmplt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_mask_cmplt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu32_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -30945,7 +32340,8 @@ pub fn _mm_mask_cmplt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_cmpgt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_gt(a.as_u32x16(), b.as_u32x16())) } } @@ -30956,7 +32352,8 @@ pub fn _mm512_cmpgt_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_mask_cmpgt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -30967,7 +32364,8 @@ pub fn _mm512_mask_cmpgt_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_cmpgt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_gt(a.as_u32x8(), b.as_u32x8())) } } @@ -30978,7 +32376,8 @@ pub fn _mm256_cmpgt_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -30989,7 +32388,8 @@ pub fn _mm256_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_cmpgt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_gt(a.as_u32x4(), b.as_u32x4())) } } @@ -31000,7 +32400,8 @@ pub fn _mm_cmpgt_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu32_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -31011,7 +32412,8 @@ pub fn _mm_mask_cmpgt_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_cmple_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_le(a.as_u32x16(), b.as_u32x16())) } } @@ -31022,7 +32424,8 @@ pub fn _mm512_cmple_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_mask_cmple_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -31033,7 +32436,8 @@ pub fn _mm512_mask_cmple_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_cmple_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_le(a.as_u32x8(), b.as_u32x8())) } } @@ -31044,7 +32448,8 @@ pub fn _mm256_cmple_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_mask_cmple_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -31055,7 +32460,8 @@ pub fn _mm256_mask_cmple_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_cmple_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_le(a.as_u32x4(), b.as_u32x4())) } } @@ -31066,7 +32472,8 @@ pub fn _mm_cmple_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_mask_cmple_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu32_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -31077,7 +32484,8 @@ pub fn _mm_mask_cmple_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_cmpge_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_ge(a.as_u32x16(), b.as_u32x16())) } } @@ -31088,7 +32496,8 @@ pub fn _mm512_cmpge_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_mask_cmpge_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -31099,7 +32508,8 @@ pub fn _mm512_mask_cmpge_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_cmpge_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_ge(a.as_u32x8(), b.as_u32x8())) } } @@ -31110,7 +32520,8 @@ pub fn _mm256_cmpge_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_mask_cmpge_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -31121,7 +32532,8 @@ pub fn _mm256_mask_cmpge_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_cmpge_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ge(a.as_u32x4(), b.as_u32x4())) } } @@ -31132,7 +32544,8 @@ pub fn _mm_cmpge_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_mask_cmpge_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu32_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -31143,7 +32556,8 @@ pub fn _mm_mask_cmpge_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_cmpeq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_eq(a.as_u32x16(), b.as_u32x16())) } } @@ -31154,7 +32568,8 @@ pub fn _mm512_cmpeq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_mask_cmpeq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -31165,7 +32580,8 @@ pub fn _mm512_mask_cmpeq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_cmpeq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_eq(a.as_u32x8(), b.as_u32x8())) } } @@ -31176,7 +32592,8 @@ pub fn _mm256_cmpeq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -31187,7 +32604,8 @@ pub fn _mm256_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_cmpeq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_eq(a.as_u32x4(), b.as_u32x4())) } } @@ -31198,7 +32616,8 @@ pub fn _mm_cmpeq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu32_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -31209,7 +32628,8 @@ pub fn _mm_mask_cmpeq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_cmpneq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_ne(a.as_u32x16(), b.as_u32x16())) } } @@ -31220,7 +32640,8 @@ pub fn _mm512_cmpneq_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm512_mask_cmpneq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epu32_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -31231,7 +32652,8 @@ pub fn _mm512_mask_cmpneq_epu32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_cmpneq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_ne(a.as_u32x8(), b.as_u32x8())) } } @@ -31242,7 +32664,8 @@ pub fn _mm256_cmpneq_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm256_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu32_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -31253,7 +32676,8 @@ pub fn _mm256_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_cmpneq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ne(a.as_u32x4(), b.as_u32x4())) } } @@ -31264,7 +32688,8 @@ pub fn _mm_cmpneq_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpud -pub fn _mm_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu32_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -31276,7 +32701,11 @@ pub fn _mm_mask_cmpneq_epu32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mma #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_cmp_epu32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epu32_mask( + a: __m512i, + b: __m512i, +) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_u32x16(); @@ -31303,7 +32732,8 @@ pub fn _mm512_cmp_epu32_mask(a: __m512i, b: __m512i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_mask_cmp_epu32_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epu32_mask( k1: __mmask16, a: __m512i, b: __m512i, @@ -31335,7 +32765,11 @@ pub fn _mm512_mask_cmp_epu32_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_cmp_epu32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epu32_mask( + a: __m256i, + b: __m256i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_u32x8(); @@ -31362,7 +32796,8 @@ pub fn _mm256_cmp_epu32_mask(a: __m256i, b: __m256i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_mask_cmp_epu32_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epu32_mask( k1: __mmask8, a: __m256i, b: __m256i, @@ -31394,7 +32829,8 @@ pub fn _mm256_mask_cmp_epu32_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_cmp_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epu32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_u32x4(); @@ -31421,7 +32857,8 @@ pub fn _mm_cmp_epu32_mask(a: __m128i, b: __m128i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_mask_cmp_epu32_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epu32_mask( k1: __mmask8, a: __m128i, b: __m128i, @@ -31452,7 +32889,8 @@ pub fn _mm_mask_cmp_epu32_mask( #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_cmplt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_lt(a.as_i32x16(), b.as_i32x16())) } } @@ -31463,7 +32901,8 @@ pub fn _mm512_cmplt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_mask_cmplt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -31474,7 +32913,8 @@ pub fn _mm512_mask_cmplt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_cmplt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_lt(a.as_i32x8(), b.as_i32x8())) } } @@ -31485,7 +32925,8 @@ pub fn _mm256_cmplt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_mask_cmplt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -31496,7 +32937,8 @@ pub fn _mm256_mask_cmplt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_cmplt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_lt(a.as_i32x4(), b.as_i32x4())) } } @@ -31507,7 +32949,8 @@ pub fn _mm_cmplt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_mask_cmplt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi32_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -31518,7 +32961,8 @@ pub fn _mm_mask_cmplt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_cmpgt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_gt(a.as_i32x16(), b.as_i32x16())) } } @@ -31529,7 +32973,8 @@ pub fn _mm512_cmpgt_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_mask_cmpgt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -31540,7 +32985,8 @@ pub fn _mm512_mask_cmpgt_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_cmpgt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_gt(a.as_i32x8(), b.as_i32x8())) } } @@ -31551,7 +32997,8 @@ pub fn _mm256_cmpgt_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -31562,7 +33009,8 @@ pub fn _mm256_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_cmpgt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_gt(a.as_i32x4(), b.as_i32x4())) } } @@ -31573,7 +33021,8 @@ pub fn _mm_cmpgt_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi32_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -31584,7 +33033,8 @@ pub fn _mm_mask_cmpgt_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_cmple_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_le(a.as_i32x16(), b.as_i32x16())) } } @@ -31595,7 +33045,8 @@ pub fn _mm512_cmple_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_mask_cmple_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -31606,7 +33057,8 @@ pub fn _mm512_mask_cmple_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_cmple_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_le(a.as_i32x8(), b.as_i32x8())) } } @@ -31617,7 +33069,8 @@ pub fn _mm256_cmple_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_mask_cmple_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -31628,7 +33081,8 @@ pub fn _mm256_mask_cmple_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_cmple_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_le(a.as_i32x4(), b.as_i32x4())) } } @@ -31639,7 +33093,8 @@ pub fn _mm_cmple_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_mask_cmple_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi32_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -31650,7 +33105,8 @@ pub fn _mm_mask_cmple_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_cmpge_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_ge(a.as_i32x16(), b.as_i32x16())) } } @@ -31661,7 +33117,8 @@ pub fn _mm512_cmpge_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_mask_cmpge_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -31672,7 +33129,8 @@ pub fn _mm512_mask_cmpge_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_cmpge_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_ge(a.as_i32x8(), b.as_i32x8())) } } @@ -31683,7 +33141,8 @@ pub fn _mm256_cmpge_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_mask_cmpge_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -31694,7 +33153,8 @@ pub fn _mm256_mask_cmpge_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_cmpge_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ge(a.as_i32x4(), b.as_i32x4())) } } @@ -31705,7 +33165,8 @@ pub fn _mm_cmpge_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_mask_cmpge_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi32_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -31716,7 +33177,8 @@ pub fn _mm_mask_cmpge_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_cmpeq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_eq(a.as_i32x16(), b.as_i32x16())) } } @@ -31727,7 +33189,8 @@ pub fn _mm512_cmpeq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_mask_cmpeq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -31738,7 +33201,8 @@ pub fn _mm512_mask_cmpeq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_cmpeq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_eq(a.as_i32x8(), b.as_i32x8())) } } @@ -31749,7 +33213,8 @@ pub fn _mm256_cmpeq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -31760,7 +33225,8 @@ pub fn _mm256_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_cmpeq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_eq(a.as_i32x4(), b.as_i32x4())) } } @@ -31771,7 +33237,8 @@ pub fn _mm_cmpeq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi32_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -31782,7 +33249,8 @@ pub fn _mm_mask_cmpeq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_cmpneq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { unsafe { simd_bitmask::(simd_ne(a.as_i32x16(), b.as_i32x16())) } } @@ -31793,7 +33261,8 @@ pub fn _mm512_cmpneq_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm512_mask_cmpneq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> __mmask16 { _mm512_mask_cmp_epi32_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -31804,7 +33273,8 @@ pub fn _mm512_mask_cmpneq_epi32_mask(k1: __mmask16, a: __m512i, b: __m512i) -> _ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_cmpneq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::(simd_ne(a.as_i32x8(), b.as_i32x8())) } } @@ -31815,7 +33285,8 @@ pub fn _mm256_cmpneq_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm256_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi32_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -31826,7 +33297,8 @@ pub fn _mm256_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_cmpneq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::(simd_ne(a.as_i32x4(), b.as_i32x4())) } } @@ -31837,7 +33309,8 @@ pub fn _mm_cmpneq_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpd -pub fn _mm_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi32_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -31849,7 +33322,11 @@ pub fn _mm_mask_cmpneq_epi32_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mma #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_cmp_epi32_mask(a: __m512i, b: __m512i) -> __mmask16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epi32_mask( + a: __m512i, + b: __m512i, +) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_i32x16(); @@ -31876,7 +33353,8 @@ pub fn _mm512_cmp_epi32_mask(a: __m512i, b: __m512i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_mask_cmp_epi32_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epi32_mask( k1: __mmask16, a: __m512i, b: __m512i, @@ -31908,7 +33386,11 @@ pub fn _mm512_mask_cmp_epi32_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_cmp_epi32_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epi32_mask( + a: __m256i, + b: __m256i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_i32x8(); @@ -31935,7 +33417,8 @@ pub fn _mm256_cmp_epi32_mask(a: __m256i, b: __m256i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_mask_cmp_epi32_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epi32_mask( k1: __mmask8, a: __m256i, b: __m256i, @@ -31967,7 +33450,8 @@ pub fn _mm256_mask_cmp_epi32_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_cmp_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epi32_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_i32x4(); @@ -31994,7 +33478,8 @@ pub fn _mm_cmp_epi32_mask(a: __m128i, b: __m128i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_mask_cmp_epi32_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epi32_mask( k1: __mmask8, a: __m128i, b: __m128i, @@ -32025,7 +33510,8 @@ pub fn _mm_mask_cmp_epi32_mask( #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_cmplt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_lt(a.as_u64x8(), b.as_u64x8())) } } @@ -32036,7 +33522,8 @@ pub fn _mm512_cmplt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_mask_cmplt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -32047,7 +33534,8 @@ pub fn _mm512_mask_cmplt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_cmplt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_lt(a.as_u64x4(), b.as_u64x4())) } } @@ -32058,7 +33546,8 @@ pub fn _mm256_cmplt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_mask_cmplt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -32069,7 +33558,8 @@ pub fn _mm256_mask_cmplt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_cmplt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_lt(a.as_u64x2(), b.as_u64x2())) } } @@ -32080,7 +33570,8 @@ pub fn _mm_cmplt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_mask_cmplt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu64_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -32091,7 +33582,8 @@ pub fn _mm_mask_cmplt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_cmpgt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_gt(a.as_u64x8(), b.as_u64x8())) } } @@ -32102,7 +33594,8 @@ pub fn _mm512_cmpgt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -32113,7 +33606,8 @@ pub fn _mm512_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_cmpgt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_gt(a.as_u64x4(), b.as_u64x4())) } } @@ -32124,7 +33618,8 @@ pub fn _mm256_cmpgt_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -32135,7 +33630,8 @@ pub fn _mm256_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_cmpgt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_gt(a.as_u64x2(), b.as_u64x2())) } } @@ -32146,7 +33642,8 @@ pub fn _mm_cmpgt_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu64_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -32157,7 +33654,8 @@ pub fn _mm_mask_cmpgt_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_cmple_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_le(a.as_u64x8(), b.as_u64x8())) } } @@ -32168,7 +33666,8 @@ pub fn _mm512_cmple_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_mask_cmple_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -32179,7 +33678,8 @@ pub fn _mm512_mask_cmple_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_cmple_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_le(a.as_u64x4(), b.as_u64x4())) } } @@ -32190,7 +33690,8 @@ pub fn _mm256_cmple_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_mask_cmple_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -32201,7 +33702,8 @@ pub fn _mm256_mask_cmple_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_cmple_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_le(a.as_u64x2(), b.as_u64x2())) } } @@ -32212,7 +33714,8 @@ pub fn _mm_cmple_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_mask_cmple_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu64_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -32223,7 +33726,8 @@ pub fn _mm_mask_cmple_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_cmpge_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_ge(a.as_u64x8(), b.as_u64x8())) } } @@ -32234,7 +33738,8 @@ pub fn _mm512_cmpge_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_mask_cmpge_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -32245,7 +33750,8 @@ pub fn _mm512_mask_cmpge_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_cmpge_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_ge(a.as_u64x4(), b.as_u64x4())) } } @@ -32256,7 +33762,8 @@ pub fn _mm256_cmpge_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_mask_cmpge_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -32267,7 +33774,8 @@ pub fn _mm256_mask_cmpge_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_cmpge_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_ge(a.as_u64x2(), b.as_u64x2())) } } @@ -32278,7 +33786,8 @@ pub fn _mm_cmpge_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_mask_cmpge_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu64_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -32289,7 +33798,8 @@ pub fn _mm_mask_cmpge_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_cmpeq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_eq(a.as_u64x8(), b.as_u64x8())) } } @@ -32300,7 +33810,8 @@ pub fn _mm512_cmpeq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -32311,7 +33822,8 @@ pub fn _mm512_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_cmpeq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_eq(a.as_u64x4(), b.as_u64x4())) } } @@ -32322,7 +33834,8 @@ pub fn _mm256_cmpeq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -32333,7 +33846,8 @@ pub fn _mm256_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_cmpeq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_eq(a.as_u64x2(), b.as_u64x2())) } } @@ -32344,7 +33858,8 @@ pub fn _mm_cmpeq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu64_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -32355,7 +33870,8 @@ pub fn _mm_mask_cmpeq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_cmpneq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_ne(a.as_u64x8(), b.as_u64x8())) } } @@ -32366,7 +33882,8 @@ pub fn _mm512_cmpneq_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm512_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epu64_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -32377,7 +33894,8 @@ pub fn _mm512_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_cmpneq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_ne(a.as_u64x4(), b.as_u64x4())) } } @@ -32388,7 +33906,8 @@ pub fn _mm256_cmpneq_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm256_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epu64_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -32399,7 +33918,8 @@ pub fn _mm256_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_cmpneq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_ne(a.as_u64x2(), b.as_u64x2())) } } @@ -32410,7 +33930,8 @@ pub fn _mm_cmpneq_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpuq -pub fn _mm_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epu64_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -32422,7 +33943,11 @@ pub fn _mm_mask_cmpneq_epu64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mma #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_cmp_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epu64_mask( + a: __m512i, + b: __m512i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_u64x8(); @@ -32449,7 +33974,8 @@ pub fn _mm512_cmp_epu64_mask(a: __m512i, b: __m512i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_mask_cmp_epu64_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epu64_mask( k1: __mmask8, a: __m512i, b: __m512i, @@ -32481,7 +34007,11 @@ pub fn _mm512_mask_cmp_epu64_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_cmp_epu64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epu64_mask( + a: __m256i, + b: __m256i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_u64x4(); @@ -32508,7 +34038,8 @@ pub fn _mm256_cmp_epu64_mask(a: __m256i, b: __m256i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_mask_cmp_epu64_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epu64_mask( k1: __mmask8, a: __m256i, b: __m256i, @@ -32540,7 +34071,8 @@ pub fn _mm256_mask_cmp_epu64_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_cmp_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epu64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_u64x2(); @@ -32567,7 +34099,8 @@ pub fn _mm_cmp_epu64_mask(a: __m128i, b: __m128i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_mask_cmp_epu64_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epu64_mask( k1: __mmask8, a: __m128i, b: __m128i, @@ -32598,7 +34131,8 @@ pub fn _mm_mask_cmp_epu64_mask( #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_cmplt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmplt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_lt(a.as_i64x8(), b.as_i64x8())) } } @@ -32609,7 +34143,8 @@ pub fn _mm512_cmplt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_mask_cmplt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmplt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -32620,7 +34155,8 @@ pub fn _mm512_mask_cmplt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_cmplt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmplt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_lt(a.as_i64x4(), b.as_i64x4())) } } @@ -32631,7 +34167,8 @@ pub fn _mm256_cmplt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_mask_cmplt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmplt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -32642,7 +34179,8 @@ pub fn _mm256_mask_cmplt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_cmplt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_lt(a.as_i64x2(), b.as_i64x2())) } } @@ -32653,7 +34191,8 @@ pub fn _mm_cmplt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_mask_cmplt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmplt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi64_mask::<_MM_CMPINT_LT>(k1, a, b) } @@ -32664,7 +34203,8 @@ pub fn _mm_mask_cmplt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_cmpgt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpgt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_gt(a.as_i64x8(), b.as_i64x8())) } } @@ -32675,7 +34215,8 @@ pub fn _mm512_cmpgt_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -32686,7 +34227,8 @@ pub fn _mm512_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_cmpgt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpgt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_gt(a.as_i64x4(), b.as_i64x4())) } } @@ -32697,7 +34239,8 @@ pub fn _mm256_cmpgt_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -32708,7 +34251,8 @@ pub fn _mm256_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_cmpgt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_gt(a.as_i64x2(), b.as_i64x2())) } } @@ -32719,7 +34263,8 @@ pub fn _mm_cmpgt_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi64_mask::<_MM_CMPINT_NLE>(k1, a, b) } @@ -32730,7 +34275,8 @@ pub fn _mm_mask_cmpgt_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_cmple_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmple_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_le(a.as_i64x8(), b.as_i64x8())) } } @@ -32741,7 +34287,8 @@ pub fn _mm512_cmple_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_mask_cmple_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmple_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -32752,7 +34299,8 @@ pub fn _mm512_mask_cmple_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_cmple_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmple_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_le(a.as_i64x4(), b.as_i64x4())) } } @@ -32763,7 +34311,8 @@ pub fn _mm256_cmple_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_mask_cmple_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmple_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -32774,7 +34323,8 @@ pub fn _mm256_mask_cmple_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_cmple_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmple_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_le(a.as_i64x2(), b.as_i64x2())) } } @@ -32785,7 +34335,8 @@ pub fn _mm_cmple_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_mask_cmple_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmple_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi64_mask::<_MM_CMPINT_LE>(k1, a, b) } @@ -32796,7 +34347,8 @@ pub fn _mm_mask_cmple_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_cmpge_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpge_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_ge(a.as_i64x8(), b.as_i64x8())) } } @@ -32807,7 +34359,8 @@ pub fn _mm512_cmpge_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_mask_cmpge_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpge_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -32818,7 +34371,8 @@ pub fn _mm512_mask_cmpge_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_cmpge_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpge_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_ge(a.as_i64x4(), b.as_i64x4())) } } @@ -32829,7 +34383,8 @@ pub fn _mm256_cmpge_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_mask_cmpge_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpge_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -32840,7 +34395,8 @@ pub fn _mm256_mask_cmpge_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_cmpge_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpge_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_ge(a.as_i64x2(), b.as_i64x2())) } } @@ -32851,7 +34407,8 @@ pub fn _mm_cmpge_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_mask_cmpge_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpge_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi64_mask::<_MM_CMPINT_NLT>(k1, a, b) } @@ -32862,7 +34419,8 @@ pub fn _mm_mask_cmpge_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_cmpeq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpeq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_eq(a.as_i64x8(), b.as_i64x8())) } } @@ -32873,7 +34431,8 @@ pub fn _mm512_cmpeq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -32884,7 +34443,8 @@ pub fn _mm512_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_cmpeq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpeq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_eq(a.as_i64x4(), b.as_i64x4())) } } @@ -32895,7 +34455,8 @@ pub fn _mm256_cmpeq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -32906,7 +34467,8 @@ pub fn _mm256_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_cmpeq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_eq(a.as_i64x2(), b.as_i64x2())) } } @@ -32917,7 +34479,8 @@ pub fn _mm_cmpeq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi64_mask::<_MM_CMPINT_EQ>(k1, a, b) } @@ -32928,7 +34491,8 @@ pub fn _mm_mask_cmpeq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmas #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_cmpneq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmpneq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { unsafe { simd_bitmask::<__m512i, _>(simd_ne(a.as_i64x8(), b.as_i64x8())) } } @@ -32939,7 +34503,8 @@ pub fn _mm512_cmpneq_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm512_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __mmask8 { _mm512_mask_cmp_epi64_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -32950,7 +34515,8 @@ pub fn _mm512_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m512i, b: __m512i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_cmpneq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmpneq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { unsafe { simd_bitmask::<__m256i, _>(simd_ne(a.as_i64x4(), b.as_i64x4())) } } @@ -32961,7 +34527,8 @@ pub fn _mm256_cmpneq_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm256_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __mmask8 { _mm256_mask_cmp_epi64_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -32972,7 +34539,8 @@ pub fn _mm256_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m256i, b: __m256i) -> __ #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_cmpneq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpneq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { simd_bitmask::<__m128i, _>(simd_ne(a.as_i64x2(), b.as_i64x2())) } } @@ -32983,7 +34551,8 @@ pub fn _mm_cmpneq_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpcmp))] //should be vpcmpq -pub fn _mm_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mmask8 { _mm_mask_cmp_epi64_mask::<_MM_CMPINT_NE>(k1, a, b) } @@ -32995,7 +34564,11 @@ pub fn _mm_mask_cmpneq_epi64_mask(k1: __mmask8, a: __m128i, b: __m128i) -> __mma #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_cmp_epi64_mask(a: __m512i, b: __m512i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cmp_epi64_mask( + a: __m512i, + b: __m512i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_i64x8(); @@ -33022,7 +34595,8 @@ pub fn _mm512_cmp_epi64_mask(a: __m512i, b: __m512i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm512_mask_cmp_epi64_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_cmp_epi64_mask( k1: __mmask8, a: __m512i, b: __m512i, @@ -33054,7 +34628,11 @@ pub fn _mm512_mask_cmp_epi64_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_cmp_epi64_mask(a: __m256i, b: __m256i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cmp_epi64_mask( + a: __m256i, + b: __m256i, +) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_i64x4(); @@ -33081,7 +34659,8 @@ pub fn _mm256_cmp_epi64_mask(a: __m256i, b: __m256i #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm256_mask_cmp_epi64_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_cmp_epi64_mask( k1: __mmask8, a: __m256i, b: __m256i, @@ -33113,7 +34692,8 @@ pub fn _mm256_mask_cmp_epi64_mask( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(2)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_cmp_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmp_epi64_mask(a: __m128i, b: __m128i) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM3, 3); let a = a.as_i64x2(); @@ -33140,7 +34720,8 @@ pub fn _mm_cmp_epi64_mask(a: __m128i, b: __m128i) - #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[rustc_legacy_const_generics(3)] #[cfg_attr(test, assert_instr(vpcmp, IMM3 = 0))] -pub fn _mm_mask_cmp_epi64_mask( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_cmp_epi64_mask( k1: __mmask8, a: __m128i, b: __m128i, @@ -33170,8 +34751,9 @@ pub fn _mm_mask_cmp_epi64_mask( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_add_epi32(a: __m512i) -> i32 { - unsafe { simd_reduce_add_unordered(a.as_i32x16()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_add_epi32(a: __m512i) -> i32 { + unsafe { simd_reduce_add_ordered(a.as_i32x16(), 0) } } /// Reduce the packed 32-bit integers in a by addition using mask k. Returns the sum of all active elements in a. @@ -33180,8 +34762,9 @@ pub fn _mm512_reduce_add_epi32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_add_epi32(k: __mmask16, a: __m512i) -> i32 { - unsafe { simd_reduce_add_unordered(simd_select_bitmask(k, a.as_i32x16(), i32x16::ZERO)) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_add_epi32(k: __mmask16, a: __m512i) -> i32 { + unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i32x16(), i32x16::ZERO), 0) } } /// Reduce the packed 64-bit integers in a by addition. Returns the sum of all elements in a. @@ -33190,8 +34773,9 @@ pub fn _mm512_mask_reduce_add_epi32(k: __mmask16, a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_add_epi64(a: __m512i) -> i64 { - unsafe { simd_reduce_add_unordered(a.as_i64x8()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_add_epi64(a: __m512i) -> i64 { + unsafe { simd_reduce_add_ordered(a.as_i64x8(), 0) } } /// Reduce the packed 64-bit integers in a by addition using mask k. Returns the sum of all active elements in a. @@ -33200,8 +34784,9 @@ pub fn _mm512_reduce_add_epi64(a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_add_epi64(k: __mmask8, a: __m512i) -> i64 { - unsafe { simd_reduce_add_unordered(simd_select_bitmask(k, a.as_i64x8(), i64x8::ZERO)) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_add_epi64(k: __mmask8, a: __m512i) -> i64 { + unsafe { simd_reduce_add_ordered(simd_select_bitmask(k, a.as_i64x8(), i64x8::ZERO), 0) } } /// Reduce the packed single-precision (32-bit) floating-point elements in a by addition. Returns the sum of all elements in a. @@ -33210,7 +34795,8 @@ pub fn _mm512_mask_reduce_add_epi64(k: __mmask8, a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_add_ps(a: __m512) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_add_ps(a: __m512) -> f32 { unsafe { // we have to use `simd_shuffle` here because `_mm512_extractf32x8_ps` is in AVX512DQ let a = _mm256_add_ps( @@ -33229,7 +34815,8 @@ pub fn _mm512_reduce_add_ps(a: __m512) -> f32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_add_ps(k: __mmask16, a: __m512) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_add_ps(k: __mmask16, a: __m512) -> f32 { unsafe { _mm512_reduce_add_ps(simd_select_bitmask(k, a, _mm512_setzero_ps())) } } @@ -33239,7 +34826,8 @@ pub fn _mm512_mask_reduce_add_ps(k: __mmask16, a: __m512) -> f32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_add_pd(a: __m512d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_add_pd(a: __m512d) -> f64 { unsafe { let a = _mm256_add_pd( _mm512_extractf64x4_pd::<0>(a), @@ -33256,7 +34844,8 @@ pub fn _mm512_reduce_add_pd(a: __m512d) -> f64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_add_pd(k: __mmask8, a: __m512d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_add_pd(k: __mmask8, a: __m512d) -> f64 { unsafe { _mm512_reduce_add_pd(simd_select_bitmask(k, a, _mm512_setzero_pd())) } } @@ -33266,8 +34855,9 @@ pub fn _mm512_mask_reduce_add_pd(k: __mmask8, a: __m512d) -> f64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_mul_epi32(a: __m512i) -> i32 { - unsafe { simd_reduce_mul_unordered(a.as_i32x16()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_mul_epi32(a: __m512i) -> i32 { + unsafe { simd_reduce_mul_ordered(a.as_i32x16(), 1) } } /// Reduce the packed 32-bit integers in a by multiplication using mask k. Returns the product of all active elements in a. @@ -33276,13 +34866,13 @@ pub fn _mm512_reduce_mul_epi32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_mul_epi32(k: __mmask16, a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_mul_epi32(k: __mmask16, a: __m512i) -> i32 { unsafe { - simd_reduce_mul_unordered(simd_select_bitmask( - k, - a.as_i32x16(), - _mm512_set1_epi32(1).as_i32x16(), - )) + simd_reduce_mul_ordered( + simd_select_bitmask(k, a.as_i32x16(), _mm512_set1_epi32(1).as_i32x16()), + 1, + ) } } @@ -33292,8 +34882,9 @@ pub fn _mm512_mask_reduce_mul_epi32(k: __mmask16, a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_mul_epi64(a: __m512i) -> i64 { - unsafe { simd_reduce_mul_unordered(a.as_i64x8()) } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_mul_epi64(a: __m512i) -> i64 { + unsafe { simd_reduce_mul_ordered(a.as_i64x8(), 1) } } /// Reduce the packed 64-bit integers in a by multiplication using mask k. Returns the product of all active elements in a. @@ -33302,13 +34893,13 @@ pub fn _mm512_reduce_mul_epi64(a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_mul_epi64(k: __mmask8, a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_mul_epi64(k: __mmask8, a: __m512i) -> i64 { unsafe { - simd_reduce_mul_unordered(simd_select_bitmask( - k, - a.as_i64x8(), - _mm512_set1_epi64(1).as_i64x8(), - )) + simd_reduce_mul_ordered( + simd_select_bitmask(k, a.as_i64x8(), _mm512_set1_epi64(1).as_i64x8()), + 1, + ) } } @@ -33318,7 +34909,8 @@ pub fn _mm512_mask_reduce_mul_epi64(k: __mmask8, a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_mul_ps(a: __m512) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_mul_ps(a: __m512) -> f32 { unsafe { // we have to use `simd_shuffle` here because `_mm512_extractf32x8_ps` is in AVX512DQ let a = _mm256_mul_ps( @@ -33337,7 +34929,8 @@ pub fn _mm512_reduce_mul_ps(a: __m512) -> f32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_mul_ps(k: __mmask16, a: __m512) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_mul_ps(k: __mmask16, a: __m512) -> f32 { unsafe { _mm512_reduce_mul_ps(simd_select_bitmask(k, a, _mm512_set1_ps(1.))) } } @@ -33347,7 +34940,8 @@ pub fn _mm512_mask_reduce_mul_ps(k: __mmask16, a: __m512) -> f32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_mul_pd(a: __m512d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_mul_pd(a: __m512d) -> f64 { unsafe { let a = _mm256_mul_pd( _mm512_extractf64x4_pd::<0>(a), @@ -33364,7 +34958,8 @@ pub fn _mm512_reduce_mul_pd(a: __m512d) -> f64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_mul_pd(k: __mmask8, a: __m512d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_mul_pd(k: __mmask8, a: __m512d) -> f64 { unsafe { _mm512_reduce_mul_pd(simd_select_bitmask(k, a, _mm512_set1_pd(1.))) } } @@ -33374,7 +34969,8 @@ pub fn _mm512_mask_reduce_mul_pd(k: __mmask8, a: __m512d) -> f64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_max_epi32(a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_max_epi32(a: __m512i) -> i32 { unsafe { simd_reduce_max(a.as_i32x16()) } } @@ -33384,7 +34980,8 @@ pub fn _mm512_reduce_max_epi32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_max_epi32(k: __mmask16, a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_max_epi32(k: __mmask16, a: __m512i) -> i32 { unsafe { simd_reduce_max(simd_select_bitmask( k, @@ -33400,7 +34997,8 @@ pub fn _mm512_mask_reduce_max_epi32(k: __mmask16, a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_max_epi64(a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_max_epi64(a: __m512i) -> i64 { unsafe { simd_reduce_max(a.as_i64x8()) } } @@ -33410,7 +35008,8 @@ pub fn _mm512_reduce_max_epi64(a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_max_epi64(k: __mmask8, a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_max_epi64(k: __mmask8, a: __m512i) -> i64 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_i64x8(), i64x8::splat(i64::MIN))) } } @@ -33420,7 +35019,8 @@ pub fn _mm512_mask_reduce_max_epi64(k: __mmask8, a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_max_epu32(a: __m512i) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_max_epu32(a: __m512i) -> u32 { unsafe { simd_reduce_max(a.as_u32x16()) } } @@ -33430,7 +35030,8 @@ pub fn _mm512_reduce_max_epu32(a: __m512i) -> u32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_max_epu32(k: __mmask16, a: __m512i) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_max_epu32(k: __mmask16, a: __m512i) -> u32 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u32x16(), u32x16::ZERO)) } } @@ -33440,7 +35041,8 @@ pub fn _mm512_mask_reduce_max_epu32(k: __mmask16, a: __m512i) -> u32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_max_epu64(a: __m512i) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_max_epu64(a: __m512i) -> u64 { unsafe { simd_reduce_max(a.as_u64x8()) } } @@ -33450,7 +35052,8 @@ pub fn _mm512_reduce_max_epu64(a: __m512i) -> u64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_max_epu64(k: __mmask8, a: __m512i) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_max_epu64(k: __mmask8, a: __m512i) -> u64 { unsafe { simd_reduce_max(simd_select_bitmask(k, a.as_u64x8(), u64x8::ZERO)) } } @@ -33515,7 +35118,8 @@ pub fn _mm512_mask_reduce_max_pd(k: __mmask8, a: __m512d) -> f64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_min_epi32(a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_min_epi32(a: __m512i) -> i32 { unsafe { simd_reduce_min(a.as_i32x16()) } } @@ -33525,7 +35129,8 @@ pub fn _mm512_reduce_min_epi32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_min_epi32(k: __mmask16, a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_min_epi32(k: __mmask16, a: __m512i) -> i32 { unsafe { simd_reduce_min(simd_select_bitmask( k, @@ -33541,7 +35146,8 @@ pub fn _mm512_mask_reduce_min_epi32(k: __mmask16, a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_min_epi64(a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_min_epi64(a: __m512i) -> i64 { unsafe { simd_reduce_min(a.as_i64x8()) } } @@ -33551,7 +35157,8 @@ pub fn _mm512_reduce_min_epi64(a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_min_epi64(k: __mmask8, a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_min_epi64(k: __mmask8, a: __m512i) -> i64 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_i64x8(), i64x8::splat(i64::MAX))) } } @@ -33561,7 +35168,8 @@ pub fn _mm512_mask_reduce_min_epi64(k: __mmask8, a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_min_epu32(a: __m512i) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_min_epu32(a: __m512i) -> u32 { unsafe { simd_reduce_min(a.as_u32x16()) } } @@ -33571,7 +35179,8 @@ pub fn _mm512_reduce_min_epu32(a: __m512i) -> u32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_min_epu32(k: __mmask16, a: __m512i) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_min_epu32(k: __mmask16, a: __m512i) -> u32 { unsafe { simd_reduce_min(simd_select_bitmask( k, @@ -33587,7 +35196,8 @@ pub fn _mm512_mask_reduce_min_epu32(k: __mmask16, a: __m512i) -> u32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_min_epu64(a: __m512i) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_min_epu64(a: __m512i) -> u64 { unsafe { simd_reduce_min(a.as_u64x8()) } } @@ -33597,7 +35207,8 @@ pub fn _mm512_reduce_min_epu64(a: __m512i) -> u64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_min_epu64(k: __mmask8, a: __m512i) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_min_epu64(k: __mmask8, a: __m512i) -> u64 { unsafe { simd_reduce_min(simd_select_bitmask(k, a.as_u64x8(), u64x8::splat(u64::MAX))) } } @@ -33662,7 +35273,8 @@ pub fn _mm512_mask_reduce_min_pd(k: __mmask8, a: __m512d) -> f64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_and_epi32(a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_and_epi32(a: __m512i) -> i32 { unsafe { simd_reduce_and(a.as_i32x16()) } } @@ -33672,7 +35284,8 @@ pub fn _mm512_reduce_and_epi32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_and_epi32(k: __mmask16, a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_and_epi32(k: __mmask16, a: __m512i) -> i32 { unsafe { simd_reduce_and(simd_select_bitmask(k, a.as_i32x16(), i32x16::splat(-1))) } } @@ -33682,7 +35295,8 @@ pub fn _mm512_mask_reduce_and_epi32(k: __mmask16, a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_and_epi64(a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_and_epi64(a: __m512i) -> i64 { unsafe { simd_reduce_and(a.as_i64x8()) } } @@ -33692,7 +35306,8 @@ pub fn _mm512_reduce_and_epi64(a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_and_epi64(k: __mmask8, a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_and_epi64(k: __mmask8, a: __m512i) -> i64 { unsafe { simd_reduce_and(simd_select_bitmask(k, a.as_i64x8(), i64x8::splat(-1))) } } @@ -33702,7 +35317,8 @@ pub fn _mm512_mask_reduce_and_epi64(k: __mmask8, a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_or_epi32(a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_or_epi32(a: __m512i) -> i32 { unsafe { simd_reduce_or(a.as_i32x16()) } } @@ -33712,7 +35328,8 @@ pub fn _mm512_reduce_or_epi32(a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_or_epi32(k: __mmask16, a: __m512i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_or_epi32(k: __mmask16, a: __m512i) -> i32 { unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i32x16(), i32x16::ZERO)) } } @@ -33722,7 +35339,8 @@ pub fn _mm512_mask_reduce_or_epi32(k: __mmask16, a: __m512i) -> i32 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_reduce_or_epi64(a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_or_epi64(a: __m512i) -> i64 { unsafe { simd_reduce_or(a.as_i64x8()) } } @@ -33732,7 +35350,8 @@ pub fn _mm512_reduce_or_epi64(a: __m512i) -> i64 { #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_mask_reduce_or_epi64(k: __mmask8, a: __m512i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_reduce_or_epi64(k: __mmask8, a: __m512i) -> i64 { unsafe { simd_reduce_or(simd_select_bitmask(k, a.as_i64x8(), i64x8::ZERO)) } } @@ -33746,7 +35365,8 @@ pub fn _mm512_mask_reduce_or_epi64(k: __mmask8, a: __m512i) -> i64 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] // This intrinsic has no corresponding instruction. -pub fn _mm512_undefined_pd() -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_undefined_pd() -> __m512d { unsafe { const { mem::zeroed() } } } @@ -33760,7 +35380,8 @@ pub fn _mm512_undefined_pd() -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] // This intrinsic has no corresponding instruction. -pub fn _mm512_undefined_ps() -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_undefined_ps() -> __m512 { unsafe { const { mem::zeroed() } } } @@ -33774,7 +35395,8 @@ pub fn _mm512_undefined_ps() -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] // This intrinsic has no corresponding instruction. -pub fn _mm512_undefined_epi32() -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_undefined_epi32() -> __m512i { unsafe { const { mem::zeroed() } } } @@ -33788,7 +35410,8 @@ pub fn _mm512_undefined_epi32() -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] // This intrinsic has no corresponding instruction. -pub fn _mm512_undefined() -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_undefined() -> __m512 { unsafe { const { mem::zeroed() } } } @@ -33799,7 +35422,8 @@ pub fn _mm512_undefined() -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm512_loadu_epi32(mem_addr: *const i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_epi32(mem_addr: *const i32) -> __m512i { ptr::read_unaligned(mem_addr as *const __m512i) } @@ -33810,7 +35434,8 @@ pub unsafe fn _mm512_loadu_epi32(mem_addr: *const i32) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm256_loadu_epi32(mem_addr: *const i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_epi32(mem_addr: *const i32) -> __m256i { ptr::read_unaligned(mem_addr as *const __m256i) } @@ -33821,7 +35446,8 @@ pub unsafe fn _mm256_loadu_epi32(mem_addr: *const i32) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm_loadu_epi32(mem_addr: *const i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_epi32(mem_addr: *const i32) -> __m128i { ptr::read_unaligned(mem_addr as *const __m128i) } @@ -34327,7 +35953,8 @@ pub unsafe fn _mm_mask_cvtusepi64_storeu_epi32(mem_addr: *mut i32, k: __mmask8, #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm512_storeu_epi32(mem_addr: *mut i32, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_epi32(mem_addr: *mut i32, a: __m512i) { ptr::write_unaligned(mem_addr as *mut __m512i, a); } @@ -34338,7 +35965,8 @@ pub unsafe fn _mm512_storeu_epi32(mem_addr: *mut i32, a: __m512i) { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm256_storeu_epi32(mem_addr: *mut i32, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_epi32(mem_addr: *mut i32, a: __m256i) { ptr::write_unaligned(mem_addr as *mut __m256i, a); } @@ -34349,7 +35977,8 @@ pub unsafe fn _mm256_storeu_epi32(mem_addr: *mut i32, a: __m256i) { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm_storeu_epi32(mem_addr: *mut i32, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_epi32(mem_addr: *mut i32, a: __m128i) { ptr::write_unaligned(mem_addr as *mut __m128i, a); } @@ -34360,7 +35989,8 @@ pub unsafe fn _mm_storeu_epi32(mem_addr: *mut i32, a: __m128i) { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64 -pub unsafe fn _mm512_loadu_epi64(mem_addr: *const i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_epi64(mem_addr: *const i64) -> __m512i { ptr::read_unaligned(mem_addr as *const __m512i) } @@ -34371,7 +36001,8 @@ pub unsafe fn _mm512_loadu_epi64(mem_addr: *const i64) -> __m512i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64 -pub unsafe fn _mm256_loadu_epi64(mem_addr: *const i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_epi64(mem_addr: *const i64) -> __m256i { ptr::read_unaligned(mem_addr as *const __m256i) } @@ -34382,7 +36013,8 @@ pub unsafe fn _mm256_loadu_epi64(mem_addr: *const i64) -> __m256i { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64 -pub unsafe fn _mm_loadu_epi64(mem_addr: *const i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_epi64(mem_addr: *const i64) -> __m128i { ptr::read_unaligned(mem_addr as *const __m128i) } @@ -34393,7 +36025,8 @@ pub unsafe fn _mm_loadu_epi64(mem_addr: *const i64) -> __m128i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64 -pub unsafe fn _mm512_storeu_epi64(mem_addr: *mut i64, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_epi64(mem_addr: *mut i64, a: __m512i) { ptr::write_unaligned(mem_addr as *mut __m512i, a); } @@ -34404,7 +36037,8 @@ pub unsafe fn _mm512_storeu_epi64(mem_addr: *mut i64, a: __m512i) { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64 -pub unsafe fn _mm256_storeu_epi64(mem_addr: *mut i64, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_epi64(mem_addr: *mut i64, a: __m256i) { ptr::write_unaligned(mem_addr as *mut __m256i, a); } @@ -34415,7 +36049,8 @@ pub unsafe fn _mm256_storeu_epi64(mem_addr: *mut i64, a: __m256i) { #[target_feature(enable = "avx512f,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu64 -pub unsafe fn _mm_storeu_epi64(mem_addr: *mut i64, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_epi64(mem_addr: *mut i64, a: __m128i) { ptr::write_unaligned(mem_addr as *mut __m128i, a); } @@ -34426,7 +36061,8 @@ pub unsafe fn _mm_storeu_epi64(mem_addr: *mut i64, a: __m128i) { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm512_loadu_si512(mem_addr: *const __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_si512(mem_addr: *const __m512i) -> __m512i { ptr::read_unaligned(mem_addr) } @@ -34437,7 +36073,8 @@ pub unsafe fn _mm512_loadu_si512(mem_addr: *const __m512i) -> __m512i { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32 -pub unsafe fn _mm512_storeu_si512(mem_addr: *mut __m512i, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_si512(mem_addr: *mut __m512i, a: __m512i) { ptr::write_unaligned(mem_addr, a); } @@ -34450,7 +36087,8 @@ pub unsafe fn _mm512_storeu_si512(mem_addr: *mut __m512i, a: __m512i) { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] -pub unsafe fn _mm512_loadu_pd(mem_addr: *const f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_pd(mem_addr: *const f64) -> __m512d { ptr::read_unaligned(mem_addr as *const __m512d) } @@ -34463,7 +36101,8 @@ pub unsafe fn _mm512_loadu_pd(mem_addr: *const f64) -> __m512d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] -pub unsafe fn _mm512_storeu_pd(mem_addr: *mut f64, a: __m512d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_pd(mem_addr: *mut f64, a: __m512d) { ptr::write_unaligned(mem_addr as *mut __m512d, a); } @@ -34476,7 +36115,8 @@ pub unsafe fn _mm512_storeu_pd(mem_addr: *mut f64, a: __m512d) { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] -pub unsafe fn _mm512_loadu_ps(mem_addr: *const f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_ps(mem_addr: *const f32) -> __m512 { ptr::read_unaligned(mem_addr as *const __m512) } @@ -34489,7 +36129,8 @@ pub unsafe fn _mm512_loadu_ps(mem_addr: *const f32) -> __m512 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovups))] -pub unsafe fn _mm512_storeu_ps(mem_addr: *mut f32, a: __m512) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_ps(mem_addr: *mut f32, a: __m512) { ptr::write_unaligned(mem_addr as *mut __m512, a); } @@ -34503,7 +36144,8 @@ pub unsafe fn _mm512_storeu_ps(mem_addr: *mut f32, a: __m512) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm512_load_si512(mem_addr: *const __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_load_si512(mem_addr: *const __m512i) -> __m512i { ptr::read(mem_addr) } @@ -34517,7 +36159,8 @@ pub unsafe fn _mm512_load_si512(mem_addr: *const __m512i) -> __m512i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm512_store_si512(mem_addr: *mut __m512i, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_store_si512(mem_addr: *mut __m512i, a: __m512i) { ptr::write(mem_addr, a); } @@ -34531,7 +36174,8 @@ pub unsafe fn _mm512_store_si512(mem_addr: *mut __m512i, a: __m512i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm512_load_epi32(mem_addr: *const i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_load_epi32(mem_addr: *const i32) -> __m512i { ptr::read(mem_addr as *const __m512i) } @@ -34545,7 +36189,8 @@ pub unsafe fn _mm512_load_epi32(mem_addr: *const i32) -> __m512i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm256_load_epi32(mem_addr: *const i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_load_epi32(mem_addr: *const i32) -> __m256i { ptr::read(mem_addr as *const __m256i) } @@ -34559,7 +36204,8 @@ pub unsafe fn _mm256_load_epi32(mem_addr: *const i32) -> __m256i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm_load_epi32(mem_addr: *const i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_epi32(mem_addr: *const i32) -> __m128i { ptr::read(mem_addr as *const __m128i) } @@ -34573,7 +36219,8 @@ pub unsafe fn _mm_load_epi32(mem_addr: *const i32) -> __m128i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm512_store_epi32(mem_addr: *mut i32, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_store_epi32(mem_addr: *mut i32, a: __m512i) { ptr::write(mem_addr as *mut __m512i, a); } @@ -34587,7 +36234,8 @@ pub unsafe fn _mm512_store_epi32(mem_addr: *mut i32, a: __m512i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm256_store_epi32(mem_addr: *mut i32, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_store_epi32(mem_addr: *mut i32, a: __m256i) { ptr::write(mem_addr as *mut __m256i, a); } @@ -34601,7 +36249,8 @@ pub unsafe fn _mm256_store_epi32(mem_addr: *mut i32, a: __m256i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa32 -pub unsafe fn _mm_store_epi32(mem_addr: *mut i32, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_epi32(mem_addr: *mut i32, a: __m128i) { ptr::write(mem_addr as *mut __m128i, a); } @@ -34615,7 +36264,8 @@ pub unsafe fn _mm_store_epi32(mem_addr: *mut i32, a: __m128i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa64 -pub unsafe fn _mm512_load_epi64(mem_addr: *const i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_load_epi64(mem_addr: *const i64) -> __m512i { ptr::read(mem_addr as *const __m512i) } @@ -34629,7 +36279,8 @@ pub unsafe fn _mm512_load_epi64(mem_addr: *const i64) -> __m512i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa64 -pub unsafe fn _mm256_load_epi64(mem_addr: *const i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_load_epi64(mem_addr: *const i64) -> __m256i { ptr::read(mem_addr as *const __m256i) } @@ -34643,7 +36294,8 @@ pub unsafe fn _mm256_load_epi64(mem_addr: *const i64) -> __m256i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa64 -pub unsafe fn _mm_load_epi64(mem_addr: *const i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_epi64(mem_addr: *const i64) -> __m128i { ptr::read(mem_addr as *const __m128i) } @@ -34657,7 +36309,8 @@ pub unsafe fn _mm_load_epi64(mem_addr: *const i64) -> __m128i { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa64 -pub unsafe fn _mm512_store_epi64(mem_addr: *mut i64, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_store_epi64(mem_addr: *mut i64, a: __m512i) { ptr::write(mem_addr as *mut __m512i, a); } @@ -34671,7 +36324,8 @@ pub unsafe fn _mm512_store_epi64(mem_addr: *mut i64, a: __m512i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa64 -pub unsafe fn _mm256_store_epi64(mem_addr: *mut i64, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_store_epi64(mem_addr: *mut i64, a: __m256i) { ptr::write(mem_addr as *mut __m256i, a); } @@ -34685,7 +36339,8 @@ pub unsafe fn _mm256_store_epi64(mem_addr: *mut i64, a: __m256i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovdqa64 -pub unsafe fn _mm_store_epi64(mem_addr: *mut i64, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_epi64(mem_addr: *mut i64, a: __m128i) { ptr::write(mem_addr as *mut __m128i, a); } @@ -34699,7 +36354,8 @@ pub unsafe fn _mm_store_epi64(mem_addr: *mut i64, a: __m128i) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] -pub unsafe fn _mm512_load_ps(mem_addr: *const f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_load_ps(mem_addr: *const f32) -> __m512 { ptr::read(mem_addr as *const __m512) } @@ -34713,7 +36369,8 @@ pub unsafe fn _mm512_load_ps(mem_addr: *const f32) -> __m512 { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] -pub unsafe fn _mm512_store_ps(mem_addr: *mut f32, a: __m512) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_store_ps(mem_addr: *mut f32, a: __m512) { ptr::write(mem_addr as *mut __m512, a); } @@ -34727,7 +36384,8 @@ pub unsafe fn _mm512_store_ps(mem_addr: *mut f32, a: __m512) { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovapd -pub unsafe fn _mm512_load_pd(mem_addr: *const f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_load_pd(mem_addr: *const f64) -> __m512d { ptr::read(mem_addr as *const __m512d) } @@ -34741,7 +36399,8 @@ pub unsafe fn _mm512_load_pd(mem_addr: *const f64) -> __m512d { all(test, not(all(target_arch = "x86", target_env = "msvc"))), assert_instr(vmovaps) )] //should be vmovapd -pub unsafe fn _mm512_store_pd(mem_addr: *mut f64, a: __m512d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_store_pd(mem_addr: *mut f64, a: __m512d) { ptr::write(mem_addr as *mut __m512d, a); } @@ -34754,7 +36413,12 @@ pub unsafe fn _mm512_store_pd(mem_addr: *mut f64, a: __m512d) { #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_loadu_epi32(src: __m512i, k: __mmask16, mem_addr: *const i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_loadu_epi32( + src: __m512i, + k: __mmask16, + mem_addr: *const i32, +) -> __m512i { let mask = simd_select_bitmask(k, i32x16::splat(!0), i32x16::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i32x16()).as_m512i() } @@ -34768,7 +36432,8 @@ pub unsafe fn _mm512_mask_loadu_epi32(src: __m512i, k: __mmask16, mem_addr: *con #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_loadu_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_loadu_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i { _mm512_mask_loadu_epi32(_mm512_setzero_si512(), k, mem_addr) } @@ -34781,7 +36446,12 @@ pub unsafe fn _mm512_maskz_loadu_epi32(k: __mmask16, mem_addr: *const i32) -> __ #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_loadu_epi64(src: __m512i, k: __mmask8, mem_addr: *const i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_loadu_epi64( + src: __m512i, + k: __mmask8, + mem_addr: *const i64, +) -> __m512i { let mask = simd_select_bitmask(k, i64x8::splat(!0), i64x8::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i64x8()).as_m512i() } @@ -34795,7 +36465,8 @@ pub unsafe fn _mm512_mask_loadu_epi64(src: __m512i, k: __mmask8, mem_addr: *cons #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i { _mm512_mask_loadu_epi64(_mm512_setzero_si512(), k, mem_addr) } @@ -34808,7 +36479,12 @@ pub unsafe fn _mm512_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_loadu_ps(src: __m512, k: __mmask16, mem_addr: *const f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_loadu_ps( + src: __m512, + k: __mmask16, + mem_addr: *const f32, +) -> __m512 { let mask = simd_select_bitmask(k, i32x16::splat(!0), i32x16::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_f32x16()).as_m512() } @@ -34822,7 +36498,8 @@ pub unsafe fn _mm512_mask_loadu_ps(src: __m512, k: __mmask16, mem_addr: *const f #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_loadu_ps(k: __mmask16, mem_addr: *const f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_loadu_ps(k: __mmask16, mem_addr: *const f32) -> __m512 { _mm512_mask_loadu_ps(_mm512_setzero_ps(), k, mem_addr) } @@ -34835,7 +36512,12 @@ pub unsafe fn _mm512_maskz_loadu_ps(k: __mmask16, mem_addr: *const f32) -> __m51 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_loadu_pd(src: __m512d, k: __mmask8, mem_addr: *const f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_loadu_pd( + src: __m512d, + k: __mmask8, + mem_addr: *const f64, +) -> __m512d { let mask = simd_select_bitmask(k, i64x8::splat(!0), i64x8::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_f64x8()).as_m512d() } @@ -34849,7 +36531,8 @@ pub unsafe fn _mm512_mask_loadu_pd(src: __m512d, k: __mmask8, mem_addr: *const f #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m512d { _mm512_mask_loadu_pd(_mm512_setzero_pd(), k, mem_addr) } @@ -34862,7 +36545,12 @@ pub unsafe fn _mm512_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m512 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_loadu_epi32(src: __m256i, k: __mmask8, mem_addr: *const i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_loadu_epi32( + src: __m256i, + k: __mmask8, + mem_addr: *const i32, +) -> __m256i { let mask = simd_select_bitmask(k, i32x8::splat(!0), i32x8::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i32x8()).as_m256i() } @@ -34876,7 +36564,8 @@ pub unsafe fn _mm256_mask_loadu_epi32(src: __m256i, k: __mmask8, mem_addr: *cons #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i { _mm256_mask_loadu_epi32(_mm256_setzero_si256(), k, mem_addr) } @@ -34889,7 +36578,12 @@ pub unsafe fn _mm256_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_loadu_epi64(src: __m256i, k: __mmask8, mem_addr: *const i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_loadu_epi64( + src: __m256i, + k: __mmask8, + mem_addr: *const i64, +) -> __m256i { let mask = simd_select_bitmask(k, i64x4::splat(!0), i64x4::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i64x4()).as_m256i() } @@ -34903,7 +36597,8 @@ pub unsafe fn _mm256_mask_loadu_epi64(src: __m256i, k: __mmask8, mem_addr: *cons #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i { _mm256_mask_loadu_epi64(_mm256_setzero_si256(), k, mem_addr) } @@ -34916,7 +36611,8 @@ pub unsafe fn _mm256_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_loadu_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_loadu_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 { let mask = simd_select_bitmask(k, i32x8::splat(!0), i32x8::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_f32x8()).as_m256() } @@ -34930,7 +36626,8 @@ pub unsafe fn _mm256_mask_loadu_ps(src: __m256, k: __mmask8, mem_addr: *const f3 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m256 { _mm256_mask_loadu_ps(_mm256_setzero_ps(), k, mem_addr) } @@ -34943,7 +36640,12 @@ pub unsafe fn _mm256_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m256 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_loadu_pd(src: __m256d, k: __mmask8, mem_addr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_loadu_pd( + src: __m256d, + k: __mmask8, + mem_addr: *const f64, +) -> __m256d { let mask = simd_select_bitmask(k, i64x4::splat(!0), i64x4::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_f64x4()).as_m256d() } @@ -34957,7 +36659,8 @@ pub unsafe fn _mm256_mask_loadu_pd(src: __m256d, k: __mmask8, mem_addr: *const f #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m256d { _mm256_mask_loadu_pd(_mm256_setzero_pd(), k, mem_addr) } @@ -34970,7 +36673,12 @@ pub unsafe fn _mm256_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m256 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_loadu_epi32(src: __m128i, k: __mmask8, mem_addr: *const i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_loadu_epi32( + src: __m128i, + k: __mmask8, + mem_addr: *const i32, +) -> __m128i { let mask = simd_select_bitmask(k, i32x4::splat(!0), i32x4::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i32x4()).as_m128i() } @@ -34984,7 +36692,8 @@ pub unsafe fn _mm_mask_loadu_epi32(src: __m128i, k: __mmask8, mem_addr: *const i #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i { _mm_mask_loadu_epi32(_mm_setzero_si128(), k, mem_addr) } @@ -34997,7 +36706,12 @@ pub unsafe fn _mm_maskz_loadu_epi32(k: __mmask8, mem_addr: *const i32) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_loadu_epi64(src: __m128i, k: __mmask8, mem_addr: *const i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_loadu_epi64( + src: __m128i, + k: __mmask8, + mem_addr: *const i64, +) -> __m128i { let mask = simd_select_bitmask(k, i64x2::splat(!0), i64x2::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_i64x2()).as_m128i() } @@ -35011,7 +36725,8 @@ pub unsafe fn _mm_mask_loadu_epi64(src: __m128i, k: __mmask8, mem_addr: *const i #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i { _mm_mask_loadu_epi64(_mm_setzero_si128(), k, mem_addr) } @@ -35024,7 +36739,8 @@ pub unsafe fn _mm_maskz_loadu_epi64(k: __mmask8, mem_addr: *const i64) -> __m128 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_loadu_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_loadu_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 { let mask = simd_select_bitmask(k, i32x4::splat(!0), i32x4::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_f32x4()).as_m128() } @@ -35038,7 +36754,8 @@ pub unsafe fn _mm_mask_loadu_ps(src: __m128, k: __mmask8, mem_addr: *const f32) #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m128 { _mm_mask_loadu_ps(_mm_setzero_ps(), k, mem_addr) } @@ -35051,7 +36768,8 @@ pub unsafe fn _mm_maskz_loadu_ps(k: __mmask8, mem_addr: *const f32) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_loadu_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_loadu_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d { let mask = simd_select_bitmask(k, i64x2::splat(!0), i64x2::ZERO); simd_masked_load!(SimdAlign::Unaligned, mask, mem_addr, src.as_f64x2()).as_m128d() } @@ -35065,7 +36783,8 @@ pub unsafe fn _mm_mask_loadu_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m128d { _mm_mask_loadu_pd(_mm_setzero_pd(), k, mem_addr) } @@ -35078,7 +36797,12 @@ pub unsafe fn _mm_maskz_loadu_pd(k: __mmask8, mem_addr: *const f64) -> __m128d { #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_load_epi32(src: __m512i, k: __mmask16, mem_addr: *const i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_load_epi32( + src: __m512i, + k: __mmask16, + mem_addr: *const i32, +) -> __m512i { let mask = simd_select_bitmask(k, i32x16::splat(!0), i32x16::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_i32x16()).as_m512i() } @@ -35092,7 +36816,8 @@ pub unsafe fn _mm512_mask_load_epi32(src: __m512i, k: __mmask16, mem_addr: *cons #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_load_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_load_epi32(k: __mmask16, mem_addr: *const i32) -> __m512i { _mm512_mask_load_epi32(_mm512_setzero_si512(), k, mem_addr) } @@ -35105,7 +36830,12 @@ pub unsafe fn _mm512_maskz_load_epi32(k: __mmask16, mem_addr: *const i32) -> __m #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_load_epi64(src: __m512i, k: __mmask8, mem_addr: *const i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_load_epi64( + src: __m512i, + k: __mmask8, + mem_addr: *const i64, +) -> __m512i { let mask = simd_select_bitmask(k, i64x8::splat(!0), i64x8::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_i64x8()).as_m512i() } @@ -35119,7 +36849,8 @@ pub unsafe fn _mm512_mask_load_epi64(src: __m512i, k: __mmask8, mem_addr: *const #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m512i { _mm512_mask_load_epi64(_mm512_setzero_si512(), k, mem_addr) } @@ -35132,7 +36863,8 @@ pub unsafe fn _mm512_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m5 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_load_ps(src: __m512, k: __mmask16, mem_addr: *const f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_load_ps(src: __m512, k: __mmask16, mem_addr: *const f32) -> __m512 { let mask = simd_select_bitmask(k, i32x16::splat(!0), i32x16::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_f32x16()).as_m512() } @@ -35146,7 +36878,8 @@ pub unsafe fn _mm512_mask_load_ps(src: __m512, k: __mmask16, mem_addr: *const f3 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_load_ps(k: __mmask16, mem_addr: *const f32) -> __m512 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_load_ps(k: __mmask16, mem_addr: *const f32) -> __m512 { _mm512_mask_load_ps(_mm512_setzero_ps(), k, mem_addr) } @@ -35159,7 +36892,12 @@ pub unsafe fn _mm512_maskz_load_ps(k: __mmask16, mem_addr: *const f32) -> __m512 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_load_pd(src: __m512d, k: __mmask8, mem_addr: *const f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_load_pd( + src: __m512d, + k: __mmask8, + mem_addr: *const f64, +) -> __m512d { let mask = simd_select_bitmask(k, i64x8::splat(!0), i64x8::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_f64x8()).as_m512d() } @@ -35173,7 +36911,8 @@ pub unsafe fn _mm512_mask_load_pd(src: __m512d, k: __mmask8, mem_addr: *const f6 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m512d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m512d { _mm512_mask_load_pd(_mm512_setzero_pd(), k, mem_addr) } @@ -35186,7 +36925,12 @@ pub unsafe fn _mm512_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m512d #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_load_epi32(src: __m256i, k: __mmask8, mem_addr: *const i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_load_epi32( + src: __m256i, + k: __mmask8, + mem_addr: *const i32, +) -> __m256i { let mask = simd_select_bitmask(k, i32x8::splat(!0), i32x8::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_i32x8()).as_m256i() } @@ -35200,7 +36944,8 @@ pub unsafe fn _mm256_mask_load_epi32(src: __m256i, k: __mmask8, mem_addr: *const #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m256i { _mm256_mask_load_epi32(_mm256_setzero_si256(), k, mem_addr) } @@ -35213,7 +36958,12 @@ pub unsafe fn _mm256_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_load_epi64(src: __m256i, k: __mmask8, mem_addr: *const i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_load_epi64( + src: __m256i, + k: __mmask8, + mem_addr: *const i64, +) -> __m256i { let mask = simd_select_bitmask(k, i64x4::splat(!0), i64x4::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_i64x4()).as_m256i() } @@ -35227,7 +36977,8 @@ pub unsafe fn _mm256_mask_load_epi64(src: __m256i, k: __mmask8, mem_addr: *const #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m256i { _mm256_mask_load_epi64(_mm256_setzero_si256(), k, mem_addr) } @@ -35240,7 +36991,8 @@ pub unsafe fn _mm256_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m2 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_load_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_load_ps(src: __m256, k: __mmask8, mem_addr: *const f32) -> __m256 { let mask = simd_select_bitmask(k, i32x8::splat(!0), i32x8::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_f32x8()).as_m256() } @@ -35254,7 +37006,8 @@ pub unsafe fn _mm256_mask_load_ps(src: __m256, k: __mmask8, mem_addr: *const f32 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m256 { _mm256_mask_load_ps(_mm256_setzero_ps(), k, mem_addr) } @@ -35267,7 +37020,12 @@ pub unsafe fn _mm256_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m256 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_load_pd(src: __m256d, k: __mmask8, mem_addr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_load_pd( + src: __m256d, + k: __mmask8, + mem_addr: *const f64, +) -> __m256d { let mask = simd_select_bitmask(k, i64x4::splat(!0), i64x4::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_f64x4()).as_m256d() } @@ -35281,7 +37039,8 @@ pub unsafe fn _mm256_mask_load_pd(src: __m256d, k: __mmask8, mem_addr: *const f6 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m256d { _mm256_mask_load_pd(_mm256_setzero_pd(), k, mem_addr) } @@ -35294,7 +37053,12 @@ pub unsafe fn _mm256_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m256d #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_load_epi32(src: __m128i, k: __mmask8, mem_addr: *const i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_load_epi32( + src: __m128i, + k: __mmask8, + mem_addr: *const i32, +) -> __m128i { let mask = simd_select_bitmask(k, i32x4::splat(!0), i32x4::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_i32x4()).as_m128i() } @@ -35308,7 +37072,8 @@ pub unsafe fn _mm_mask_load_epi32(src: __m128i, k: __mmask8, mem_addr: *const i3 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i { _mm_mask_load_epi32(_mm_setzero_si128(), k, mem_addr) } @@ -35321,7 +37086,12 @@ pub unsafe fn _mm_maskz_load_epi32(k: __mmask8, mem_addr: *const i32) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_load_epi64(src: __m128i, k: __mmask8, mem_addr: *const i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_load_epi64( + src: __m128i, + k: __mmask8, + mem_addr: *const i64, +) -> __m128i { let mask = simd_select_bitmask(k, i64x2::splat(!0), i64x2::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_i64x2()).as_m128i() } @@ -35335,7 +37105,8 @@ pub unsafe fn _mm_mask_load_epi64(src: __m128i, k: __mmask8, mem_addr: *const i6 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i { _mm_mask_load_epi64(_mm_setzero_si128(), k, mem_addr) } @@ -35348,7 +37119,8 @@ pub unsafe fn _mm_maskz_load_epi64(k: __mmask8, mem_addr: *const i64) -> __m128i #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_load_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_load_ps(src: __m128, k: __mmask8, mem_addr: *const f32) -> __m128 { let mask = simd_select_bitmask(k, i32x4::splat(!0), i32x4::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_f32x4()).as_m128() } @@ -35362,7 +37134,8 @@ pub unsafe fn _mm_mask_load_ps(src: __m128, k: __mmask8, mem_addr: *const f32) - #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m128 { _mm_mask_load_ps(_mm_setzero_ps(), k, mem_addr) } @@ -35375,7 +37148,8 @@ pub unsafe fn _mm_maskz_load_ps(k: __mmask8, mem_addr: *const f32) -> __m128 { #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_load_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_load_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) -> __m128d { let mask = simd_select_bitmask(k, i64x2::splat(!0), i64x2::ZERO); simd_masked_load!(SimdAlign::Vector, mask, mem_addr, src.as_f64x2()).as_m128d() } @@ -35389,7 +37163,8 @@ pub unsafe fn _mm_mask_load_pd(src: __m128d, k: __mmask8, mem_addr: *const f64) #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_maskz_load_pd(k: __mmask8, mem_addr: *const f64) -> __m128d { _mm_mask_load_pd(_mm_setzero_pd(), k, mem_addr) } @@ -35489,7 +37264,8 @@ pub unsafe fn _mm_maskz_load_sd(k: __mmask8, mem_addr: *const f64) -> __m128d { #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask16, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask16, a: __m512i) { let mask = simd_select_bitmask(mask, i32x16::splat(!0), i32x16::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i32x16()); } @@ -35502,7 +37278,8 @@ pub unsafe fn _mm512_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask16, a: _ #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m512i) { let mask = simd_select_bitmask(mask, i64x8::splat(!0), i64x8::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i64x8()); } @@ -35515,7 +37292,8 @@ pub unsafe fn _mm512_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __ #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask16, a: __m512) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask16, a: __m512) { let mask = simd_select_bitmask(mask, i32x16::splat(!0), i32x16::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_f32x16()); } @@ -35528,7 +37306,8 @@ pub unsafe fn _mm512_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask16, a: __m5 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512d) { let mask = simd_select_bitmask(mask, i64x8::splat(!0), i64x8::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_f64x8()); } @@ -35541,7 +37320,8 @@ pub unsafe fn _mm512_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m51 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m256i) { let mask = simd_select_bitmask(mask, i32x8::splat(!0), i32x8::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i32x8()); } @@ -35554,7 +37334,8 @@ pub unsafe fn _mm256_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __ #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m256i) { let mask = simd_select_bitmask(mask, i64x4::splat(!0), i64x4::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i64x4()); } @@ -35567,7 +37348,8 @@ pub unsafe fn _mm256_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __ #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256) { let mask = simd_select_bitmask(mask, i32x8::splat(!0), i32x8::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_f32x8()); } @@ -35580,7 +37362,8 @@ pub unsafe fn _mm256_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m25 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256d) { let mask = simd_select_bitmask(mask, i64x4::splat(!0), i64x4::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_f64x4()); } @@ -35593,7 +37376,8 @@ pub unsafe fn _mm256_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m25 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128i) { let mask = simd_select_bitmask(mask, i32x4::splat(!0), i32x4::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i32x4()); } @@ -35606,7 +37390,8 @@ pub unsafe fn _mm_mask_storeu_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m12 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqu64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128i) { let mask = simd_select_bitmask(mask, i64x2::splat(!0), i64x2::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_i64x2()); } @@ -35619,7 +37404,8 @@ pub unsafe fn _mm_mask_storeu_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m12 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovups))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) { let mask = simd_select_bitmask(mask, i32x4::splat(!0), i32x4::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_f32x4()); } @@ -35632,7 +37418,8 @@ pub unsafe fn _mm_mask_storeu_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovupd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) { let mask = simd_select_bitmask(mask, i64x2::splat(!0), i64x2::ZERO); simd_masked_store!(SimdAlign::Unaligned, mask, mem_addr, a.as_f64x2()); } @@ -35645,7 +37432,8 @@ pub unsafe fn _mm_mask_storeu_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_store_epi32(mem_addr: *mut i32, mask: __mmask16, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_store_epi32(mem_addr: *mut i32, mask: __mmask16, a: __m512i) { let mask = simd_select_bitmask(mask, i32x16::splat(!0), i32x16::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_i32x16()); } @@ -35658,7 +37446,8 @@ pub unsafe fn _mm512_mask_store_epi32(mem_addr: *mut i32, mask: __mmask16, a: __ #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m512i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m512i) { let mask = simd_select_bitmask(mask, i64x8::splat(!0), i64x8::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_i64x8()); } @@ -35671,7 +37460,8 @@ pub unsafe fn _mm512_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_store_ps(mem_addr: *mut f32, mask: __mmask16, a: __m512) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_store_ps(mem_addr: *mut f32, mask: __mmask16, a: __m512) { let mask = simd_select_bitmask(mask, i32x16::splat(!0), i32x16::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_f32x16()); } @@ -35684,7 +37474,8 @@ pub unsafe fn _mm512_mask_store_ps(mem_addr: *mut f32, mask: __mmask16, a: __m51 #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm512_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512d) { let mask = simd_select_bitmask(mask, i64x8::splat(!0), i64x8::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_f64x8()); } @@ -35697,7 +37488,8 @@ pub unsafe fn _mm512_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m512 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m256i) { let mask = simd_select_bitmask(mask, i32x8::splat(!0), i32x8::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_i32x8()); } @@ -35710,7 +37502,8 @@ pub unsafe fn _mm256_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m256i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m256i) { let mask = simd_select_bitmask(mask, i64x4::splat(!0), i64x4::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_i64x4()); } @@ -35723,7 +37516,8 @@ pub unsafe fn _mm256_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256) { let mask = simd_select_bitmask(mask, i32x8::splat(!0), i32x8::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_f32x8()); } @@ -35736,7 +37530,8 @@ pub unsafe fn _mm256_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m256 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm256_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256d) { let mask = simd_select_bitmask(mask, i64x4::splat(!0), i64x4::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_f64x4()); } @@ -35749,7 +37544,8 @@ pub unsafe fn _mm256_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m256 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa32))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128i) { let mask = simd_select_bitmask(mask, i32x4::splat(!0), i32x4::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_i32x4()); } @@ -35762,7 +37558,8 @@ pub unsafe fn _mm_mask_store_epi32(mem_addr: *mut i32, mask: __mmask8, a: __m128 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovdqa64))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128i) { let mask = simd_select_bitmask(mask, i64x2::splat(!0), i64x2::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_i64x2()); } @@ -35775,7 +37572,8 @@ pub unsafe fn _mm_mask_store_epi64(mem_addr: *mut i64, mask: __mmask8, a: __m128 #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovaps))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) { let mask = simd_select_bitmask(mask, i32x4::splat(!0), i32x4::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_f32x4()); } @@ -35788,7 +37586,8 @@ pub unsafe fn _mm_mask_store_ps(mem_addr: *mut f32, mask: __mmask8, a: __m128) { #[target_feature(enable = "avx512f,avx512vl")] #[cfg_attr(test, assert_instr(vmovapd))] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub unsafe fn _mm_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_mask_store_pd(mem_addr: *mut f64, mask: __mmask8, a: __m128d) { let mask = simd_select_bitmask(mask, i64x2::splat(!0), i64x2::ZERO); simd_masked_store!(SimdAlign::Vector, mask, mem_addr, a.as_f64x2()); } @@ -36135,7 +37934,8 @@ pub unsafe fn _mm_maskz_expandloadu_pd(k: __mmask8, mem_addr: *const f64) -> __m #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_setr_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr_pd( e0: f64, e1: f64, e2: f64, @@ -36157,7 +37957,8 @@ pub fn _mm512_setr_pd( #[inline] #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _mm512_set_pd( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_pd( e0: f64, e1: f64, e2: f64, @@ -36177,7 +37978,8 @@ pub fn _mm512_set_pd( #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovss))] -pub fn _mm_mask_move_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_move_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let extractsrc: f32 = simd_extract!(src, 0); let mut mov: f32 = extractsrc; @@ -36195,7 +37997,8 @@ pub fn _mm_mask_move_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovss))] -pub fn _mm_maskz_move_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_move_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mut mov: f32 = 0.; if (k & 0b00000001) != 0 { @@ -36212,7 +38015,8 @@ pub fn _mm_maskz_move_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsd))] -pub fn _mm_mask_move_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_move_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let extractsrc: f64 = simd_extract!(src, 0); let mut mov: f64 = extractsrc; @@ -36230,7 +38034,8 @@ pub fn _mm_mask_move_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmovsd))] -pub fn _mm_maskz_move_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_move_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mut mov: f64 = 0.; if (k & 0b00000001) != 0 { @@ -36247,7 +38052,8 @@ pub fn _mm_maskz_move_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddss))] -pub fn _mm_mask_add_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let extractsrc: f32 = simd_extract!(src, 0); let mut add: f32 = extractsrc; @@ -36267,7 +38073,8 @@ pub fn _mm_mask_add_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddss))] -pub fn _mm_maskz_add_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mut add: f32 = 0.; if (k & 0b00000001) != 0 { @@ -36286,7 +38093,8 @@ pub fn _mm_maskz_add_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddsd))] -pub fn _mm_mask_add_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let extractsrc: f64 = simd_extract!(src, 0); let mut add: f64 = extractsrc; @@ -36306,7 +38114,8 @@ pub fn _mm_mask_add_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vaddsd))] -pub fn _mm_maskz_add_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mut add: f64 = 0.; if (k & 0b00000001) != 0 { @@ -36325,7 +38134,8 @@ pub fn _mm_maskz_add_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubss))] -pub fn _mm_mask_sub_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let extractsrc: f32 = simd_extract!(src, 0); let mut add: f32 = extractsrc; @@ -36345,7 +38155,8 @@ pub fn _mm_mask_sub_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubss))] -pub fn _mm_maskz_sub_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mut add: f32 = 0.; if (k & 0b00000001) != 0 { @@ -36364,7 +38175,8 @@ pub fn _mm_maskz_sub_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubsd))] -pub fn _mm_mask_sub_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let extractsrc: f64 = simd_extract!(src, 0); let mut add: f64 = extractsrc; @@ -36384,7 +38196,8 @@ pub fn _mm_mask_sub_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vsubsd))] -pub fn _mm_maskz_sub_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mut add: f64 = 0.; if (k & 0b00000001) != 0 { @@ -36403,7 +38216,8 @@ pub fn _mm_maskz_sub_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulss))] -pub fn _mm_mask_mul_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let extractsrc: f32 = simd_extract!(src, 0); let mut add: f32 = extractsrc; @@ -36423,7 +38237,8 @@ pub fn _mm_mask_mul_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulss))] -pub fn _mm_maskz_mul_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mut add: f32 = 0.; if (k & 0b00000001) != 0 { @@ -36442,7 +38257,8 @@ pub fn _mm_maskz_mul_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulsd))] -pub fn _mm_mask_mul_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let extractsrc: f64 = simd_extract!(src, 0); let mut add: f64 = extractsrc; @@ -36462,7 +38278,8 @@ pub fn _mm_mask_mul_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vmulsd))] -pub fn _mm_maskz_mul_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mut add: f64 = 0.; if (k & 0b00000001) != 0 { @@ -36481,7 +38298,8 @@ pub fn _mm_maskz_mul_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivss))] -pub fn _mm_mask_div_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_div_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let extractsrc: f32 = simd_extract!(src, 0); let mut add: f32 = extractsrc; @@ -36501,7 +38319,8 @@ pub fn _mm_mask_div_ss(src: __m128, k: __mmask8, a: __m128, b: __m128) -> __m128 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivss))] -pub fn _mm_maskz_div_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_div_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { unsafe { let mut add: f32 = 0.; if (k & 0b00000001) != 0 { @@ -36520,7 +38339,8 @@ pub fn _mm_maskz_div_ss(k: __mmask8, a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivsd))] -pub fn _mm_mask_div_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_div_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let extractsrc: f64 = simd_extract!(src, 0); let mut add: f64 = extractsrc; @@ -36540,7 +38360,8 @@ pub fn _mm_mask_div_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128d) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vdivsd))] -pub fn _mm_maskz_div_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_div_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { unsafe { let mut add: f64 = 0.; if (k & 0b00000001) != 0 { @@ -37524,7 +39345,8 @@ pub fn _mm_maskz_scalef_sd(k: __mmask8, a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] -pub fn _mm_mask_fmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { let mut fmadd: f32 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37543,7 +39365,8 @@ pub fn _mm_mask_fmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] -pub fn _mm_maskz_fmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { let mut fmadd: f32 = 0.; if (k & 0b00000001) != 0 { @@ -37563,7 +39386,8 @@ pub fn _mm_maskz_fmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] -pub fn _mm_mask3_fmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { let mut fmadd: f32 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37582,7 +39406,8 @@ pub fn _mm_mask3_fmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] -pub fn _mm_mask_fmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fmadd: f64 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37601,7 +39426,8 @@ pub fn _mm_mask_fmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] -pub fn _mm_maskz_fmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fmadd: f64 = 0.; if (k & 0b00000001) != 0 { @@ -37621,7 +39447,8 @@ pub fn _mm_maskz_fmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmadd))] -pub fn _mm_mask3_fmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { let mut fmadd: f64 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37640,7 +39467,8 @@ pub fn _mm_mask3_fmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] -pub fn _mm_mask_fmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { let mut fmsub: f32 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37660,7 +39488,8 @@ pub fn _mm_mask_fmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] -pub fn _mm_maskz_fmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { let mut fmsub: f32 = 0.; if (k & 0b00000001) != 0 { @@ -37681,7 +39510,8 @@ pub fn _mm_maskz_fmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] -pub fn _mm_mask3_fmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { let mut fmsub: f32 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37701,7 +39531,8 @@ pub fn _mm_mask3_fmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] -pub fn _mm_mask_fmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fmsub: f64 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37721,7 +39552,8 @@ pub fn _mm_mask_fmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] -pub fn _mm_maskz_fmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fmsub: f64 = 0.; if (k & 0b00000001) != 0 { @@ -37742,7 +39574,8 @@ pub fn _mm_maskz_fmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfmsub))] -pub fn _mm_mask3_fmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { let mut fmsub: f64 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37762,7 +39595,8 @@ pub fn _mm_mask3_fmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] -pub fn _mm_mask_fnmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { let mut fnmadd: f32 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37782,7 +39616,8 @@ pub fn _mm_mask_fnmadd_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] -pub fn _mm_maskz_fnmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { let mut fnmadd: f32 = 0.; if (k & 0b00000001) != 0 { @@ -37803,7 +39638,8 @@ pub fn _mm_maskz_fnmadd_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] -pub fn _mm_mask3_fnmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { let mut fnmadd: f32 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37823,7 +39659,8 @@ pub fn _mm_mask3_fnmadd_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] -pub fn _mm_mask_fnmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fnmadd: f64 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37843,7 +39680,8 @@ pub fn _mm_mask_fnmadd_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] -pub fn _mm_maskz_fnmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fnmadd: f64 = 0.; if (k & 0b00000001) != 0 { @@ -37864,7 +39702,8 @@ pub fn _mm_maskz_fnmadd_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmadd))] -pub fn _mm_mask3_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { let mut fnmadd: f64 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37884,7 +39723,8 @@ pub fn _mm_mask3_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] -pub fn _mm_mask_fnmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m128 { unsafe { let mut fnmsub: f32 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37905,7 +39745,8 @@ pub fn _mm_mask_fnmsub_ss(a: __m128, k: __mmask8, b: __m128, c: __m128) -> __m12 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] -pub fn _mm_maskz_fnmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { let mut fnmsub: f32 = 0.; if (k & 0b00000001) != 0 { @@ -37927,7 +39768,8 @@ pub fn _mm_maskz_fnmsub_ss(k: __mmask8, a: __m128, b: __m128, c: __m128) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] -pub fn _mm_mask3_fnmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m128 { unsafe { let mut fnmsub: f32 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -37948,7 +39790,8 @@ pub fn _mm_mask3_fnmsub_ss(a: __m128, b: __m128, c: __m128, k: __mmask8) -> __m1 #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] -pub fn _mm_mask_fnmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fnmsub: f64 = simd_extract!(a, 0); if (k & 0b00000001) != 0 { @@ -37969,7 +39812,8 @@ pub fn _mm_mask_fnmsub_sd(a: __m128d, k: __mmask8, b: __m128d, c: __m128d) -> __ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] -pub fn _mm_maskz_fnmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { let mut fnmsub: f64 = 0.; if (k & 0b00000001) != 0 { @@ -37991,7 +39835,8 @@ pub fn _mm_maskz_fnmsub_sd(k: __mmask8, a: __m128d, b: __m128d, c: __m128d) -> _ #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vfnmsub))] -pub fn _mm_mask3_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d, k: __mmask8) -> __m128d { unsafe { let mut fnmsub: f64 = simd_extract!(c, 0); if (k & 0b00000001) != 0 { @@ -41571,7 +43416,8 @@ pub fn _mm_cvt_roundu32_ss(a: __m128, b: u32) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtsi2ss))] -pub fn _mm_cvti32_ss(a: __m128, b: i32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvti32_ss(a: __m128, b: i32) -> __m128 { unsafe { let b = b as f32; simd_insert!(a, 0, b) @@ -41585,7 +43431,8 @@ pub fn _mm_cvti32_ss(a: __m128, b: i32) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtsi2sd))] -pub fn _mm_cvti32_sd(a: __m128d, b: i32) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvti32_sd(a: __m128d, b: i32) -> __m128d { unsafe { let b = b as f64; simd_insert!(a, 0, b) @@ -41745,7 +43592,8 @@ pub fn _mm_cvttsd_u32(a: __m128d) -> u32 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtusi2ss))] -pub fn _mm_cvtu32_ss(a: __m128, b: u32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtu32_ss(a: __m128, b: u32) -> __m128 { unsafe { let b = b as f32; simd_insert!(a, 0, b) @@ -41759,7 +43607,8 @@ pub fn _mm_cvtu32_ss(a: __m128, b: u32) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtusi2sd))] -pub fn _mm_cvtu32_sd(a: __m128d, b: u32) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtu32_sd(a: __m128d, b: u32) -> __m128d { unsafe { let b = b as f64; simd_insert!(a, 0, b) @@ -42547,9 +44396,13 @@ unsafe extern "C" { #[link_name = "llvm.x86.avx512.mask.cvtps2pd.512"] fn vcvtps2pd(a: f32x8, src: f64x8, mask: u8, sae: i32) -> f64x8; + #[link_name = "llvm.x86.avx512.mask.cvtpd2ps"] + fn vcvtpd2ps128(a: f64x2, src: f32x4, mask: u8) -> f32x4; #[link_name = "llvm.x86.avx512.mask.cvtpd2ps.512"] fn vcvtpd2ps(a: f64x8, src: f32x8, mask: u8, rounding: i32) -> f32x8; + #[link_name = "llvm.x86.avx512.mask.cvtpd2dq.128"] + fn vcvtpd2dq128(a: f64x2, src: i32x4, k: u8) -> i32x4; #[link_name = "llvm.x86.avx512.mask.cvtpd2dq.512"] fn vcvtpd2dq(a: f64x8, src: i32x8, mask: u8, rounding: i32) -> i32x8; @@ -43207,6 +45060,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; @@ -43215,7 +45069,7 @@ mod tests { use crate::mem::{self}; #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_abs_epi32() { + const fn test_mm512_abs_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43235,7 +45089,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_abs_epi32() { + const fn test_mm512_mask_abs_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43257,7 +45111,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_abs_epi32() { + const fn test_mm512_maskz_abs_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43279,7 +45133,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_abs_epi32() { + const fn test_mm256_mask_abs_epi32() { #[rustfmt::skip] let a = _mm256_setr_epi32( 0, 1, -1, i32::MAX, @@ -43297,7 +45151,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_abs_epi32() { + const fn test_mm256_maskz_abs_epi32() { #[rustfmt::skip] let a = _mm256_setr_epi32( 0, 1, -1, i32::MAX, @@ -43315,7 +45169,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_abs_epi32() { + const fn test_mm_mask_abs_epi32() { let a = _mm_setr_epi32(i32::MIN, 100, -100, -32); let r = _mm_mask_abs_epi32(a, 0, a); assert_eq_m128i(r, a); @@ -43325,7 +45179,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_abs_epi32() { + const fn test_mm_maskz_abs_epi32() { let a = _mm_setr_epi32(i32::MIN, 100, -100, -32); let r = _mm_maskz_abs_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -43335,7 +45189,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_abs_ps() { + const fn test_mm512_abs_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43355,7 +45209,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_abs_ps() { + const fn test_mm512_mask_abs_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43377,7 +45231,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mov_epi32() { + const fn test_mm512_mask_mov_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(2); let r = _mm512_mask_mov_epi32(src, 0, a); @@ -43387,7 +45241,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mov_epi32() { + const fn test_mm512_maskz_mov_epi32() { let a = _mm512_set1_epi32(2); let r = _mm512_maskz_mov_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -43396,7 +45250,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mov_epi32() { + const fn test_mm256_mask_mov_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(2); let r = _mm256_mask_mov_epi32(src, 0, a); @@ -43406,7 +45260,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mov_epi32() { + const fn test_mm256_maskz_mov_epi32() { let a = _mm256_set1_epi32(2); let r = _mm256_maskz_mov_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -43415,7 +45269,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mov_epi32() { + const fn test_mm_mask_mov_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(2); let r = _mm_mask_mov_epi32(src, 0, a); @@ -43425,7 +45279,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mov_epi32() { + const fn test_mm_maskz_mov_epi32() { let a = _mm_set1_epi32(2); let r = _mm_maskz_mov_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -43434,7 +45288,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mov_ps() { + const fn test_mm512_mask_mov_ps() { let src = _mm512_set1_ps(1.); let a = _mm512_set1_ps(2.); let r = _mm512_mask_mov_ps(src, 0, a); @@ -43444,7 +45298,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mov_ps() { + const fn test_mm512_maskz_mov_ps() { let a = _mm512_set1_ps(2.); let r = _mm512_maskz_mov_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -43453,7 +45307,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mov_ps() { + const fn test_mm256_mask_mov_ps() { let src = _mm256_set1_ps(1.); let a = _mm256_set1_ps(2.); let r = _mm256_mask_mov_ps(src, 0, a); @@ -43463,7 +45317,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mov_ps() { + const fn test_mm256_maskz_mov_ps() { let a = _mm256_set1_ps(2.); let r = _mm256_maskz_mov_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -43472,7 +45326,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mov_ps() { + const fn test_mm_mask_mov_ps() { let src = _mm_set1_ps(1.); let a = _mm_set1_ps(2.); let r = _mm_mask_mov_ps(src, 0, a); @@ -43482,7 +45336,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mov_ps() { + const fn test_mm_maskz_mov_ps() { let a = _mm_set1_ps(2.); let r = _mm_maskz_mov_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -43491,7 +45345,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_add_epi32() { + const fn test_mm512_add_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43512,7 +45366,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_add_epi32() { + const fn test_mm512_mask_add_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43535,7 +45389,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_add_epi32() { + const fn test_mm512_maskz_add_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43558,7 +45412,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_add_epi32() { + const fn test_mm256_mask_add_epi32() { let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32); let b = _mm256_set1_epi32(1); let r = _mm256_mask_add_epi32(a, 0, a, b); @@ -43569,7 +45423,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_add_epi32() { + const fn test_mm256_maskz_add_epi32() { let a = _mm256_setr_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32); let b = _mm256_set1_epi32(1); let r = _mm256_maskz_add_epi32(0, a, b); @@ -43580,7 +45434,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_add_epi32() { + const fn test_mm_mask_add_epi32() { let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN); let b = _mm_set1_epi32(1); let r = _mm_mask_add_epi32(a, 0, a, b); @@ -43591,7 +45445,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_add_epi32() { + const fn test_mm_maskz_add_epi32() { let a = _mm_setr_epi32(1, -1, i32::MAX, i32::MIN); let b = _mm_set1_epi32(1); let r = _mm_maskz_add_epi32(0, a, b); @@ -43602,7 +45456,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_add_ps() { + const fn test_mm512_add_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43623,7 +45477,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_add_ps() { + const fn test_mm512_mask_add_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43646,7 +45500,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_add_ps() { + const fn test_mm512_maskz_add_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43669,7 +45523,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_add_ps() { + const fn test_mm256_mask_add_ps() { let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.); let b = _mm256_set1_ps(1.); let r = _mm256_mask_add_ps(a, 0, a, b); @@ -43680,7 +45534,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_add_ps() { + const fn test_mm256_maskz_add_ps() { let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.); let b = _mm256_set1_ps(1.); let r = _mm256_maskz_add_ps(0, a, b); @@ -43691,7 +45545,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_add_ps() { + const fn test_mm_mask_add_ps() { let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN); let b = _mm_set1_ps(1.); let r = _mm_mask_add_ps(a, 0, a, b); @@ -43702,7 +45556,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_add_ps() { + const fn test_mm_maskz_add_ps() { let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN); let b = _mm_set1_ps(1.); let r = _mm_maskz_add_ps(0, a, b); @@ -43713,7 +45567,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sub_epi32() { + const fn test_mm512_sub_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43734,7 +45588,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sub_epi32() { + const fn test_mm512_mask_sub_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43757,7 +45611,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sub_epi32() { + const fn test_mm512_maskz_sub_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43780,7 +45634,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sub_epi32() { + const fn test_mm256_mask_sub_epi32() { let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32); let b = _mm256_set1_epi32(1); let r = _mm256_mask_sub_epi32(a, 0, a, b); @@ -43791,7 +45645,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sub_epi32() { + const fn test_mm256_maskz_sub_epi32() { let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32); let b = _mm256_set1_epi32(1); let r = _mm256_maskz_sub_epi32(0, a, b); @@ -43802,7 +45656,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sub_epi32() { + const fn test_mm_mask_sub_epi32() { let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN); let b = _mm_set1_epi32(1); let r = _mm_mask_sub_epi32(a, 0, a, b); @@ -43813,7 +45667,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sub_epi32() { + const fn test_mm_maskz_sub_epi32() { let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN); let b = _mm_set1_epi32(1); let r = _mm_maskz_sub_epi32(0, a, b); @@ -43824,7 +45678,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sub_ps() { + const fn test_mm512_sub_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43845,7 +45699,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sub_ps() { + const fn test_mm512_mask_sub_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43868,7 +45722,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sub_ps() { + const fn test_mm512_maskz_sub_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -43891,7 +45745,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sub_ps() { + const fn test_mm256_mask_sub_ps() { let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.); let b = _mm256_set1_ps(1.); let r = _mm256_mask_sub_ps(a, 0, a, b); @@ -43902,7 +45756,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sub_ps() { + const fn test_mm256_maskz_sub_ps() { let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.); let b = _mm256_set1_ps(1.); let r = _mm256_maskz_sub_ps(0, a, b); @@ -43913,7 +45767,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sub_ps() { + const fn test_mm_mask_sub_ps() { let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN); let b = _mm_set1_ps(1.); let r = _mm_mask_sub_ps(a, 0, a, b); @@ -43924,7 +45778,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sub_ps() { + const fn test_mm_maskz_sub_ps() { let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN); let b = _mm_set1_ps(1.); let r = _mm_maskz_sub_ps(0, a, b); @@ -43935,7 +45789,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mullo_epi32() { + const fn test_mm512_mullo_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43952,7 +45806,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mullo_epi32() { + const fn test_mm512_mask_mullo_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43975,7 +45829,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mullo_epi32() { + const fn test_mm512_maskz_mullo_epi32() { #[rustfmt::skip] let a = _mm512_setr_epi32( 0, 1, -1, i32::MAX, @@ -43992,7 +45846,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mullo_epi32() { + const fn test_mm256_mask_mullo_epi32() { let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32); let b = _mm256_set1_epi32(2); let r = _mm256_mask_mullo_epi32(a, 0, a, b); @@ -44003,7 +45857,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mullo_epi32() { + const fn test_mm256_maskz_mullo_epi32() { let a = _mm256_set_epi32(0, 1, -1, i32::MAX, i32::MIN, 100, -100, -32); let b = _mm256_set1_epi32(2); let r = _mm256_maskz_mullo_epi32(0, a, b); @@ -44014,7 +45868,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mullo_epi32() { + const fn test_mm_mask_mullo_epi32() { let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN); let b = _mm_set1_epi32(2); let r = _mm_mask_mullo_epi32(a, 0, a, b); @@ -44025,7 +45879,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mullo_epi32() { + const fn test_mm_maskz_mullo_epi32() { let a = _mm_set_epi32(1, -1, i32::MAX, i32::MIN); let b = _mm_set1_epi32(2); let r = _mm_maskz_mullo_epi32(0, a, b); @@ -44036,7 +45890,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mul_ps() { + const fn test_mm512_mul_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -44058,7 +45912,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mul_ps() { + const fn test_mm512_mask_mul_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -44081,7 +45935,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mul_ps() { + const fn test_mm512_maskz_mul_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1., -1., f32::MAX, @@ -44104,7 +45958,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mul_ps() { + const fn test_mm256_mask_mul_ps() { let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.); let b = _mm256_set1_ps(2.); let r = _mm256_mask_mul_ps(a, 0, a, b); @@ -44119,7 +45973,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mul_ps() { + const fn test_mm256_maskz_mul_ps() { let a = _mm256_set_ps(0., 1., -1., f32::MAX, f32::MIN, 100., -100., -32.); let b = _mm256_set1_ps(2.); let r = _mm256_maskz_mul_ps(0, a, b); @@ -44134,7 +45988,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mul_ps() { + const fn test_mm_mask_mul_ps() { let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN); let b = _mm_set1_ps(2.); let r = _mm_mask_mul_ps(a, 0, a, b); @@ -44145,7 +45999,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mul_ps() { + const fn test_mm_maskz_mul_ps() { let a = _mm_set_ps(1., -1., f32::MAX, f32::MIN); let b = _mm_set1_ps(2.); let r = _mm_maskz_mul_ps(0, a, b); @@ -44156,7 +46010,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_div_ps() { + const fn test_mm512_div_ps() { let a = _mm512_setr_ps( 0., 1., -1., -2., 100., 100., -100., -32., 0., 1., -1., 1000., -131., 100., -100., -32., ); @@ -44175,7 +46029,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_div_ps() { + const fn test_mm512_mask_div_ps() { let a = _mm512_setr_ps( 0., 1., -1., -2., 100., 100., -100., -32., 0., 1., -1., 1000., -131., 100., -100., -32., ); @@ -44196,7 +46050,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_div_ps() { + const fn test_mm512_maskz_div_ps() { let a = _mm512_setr_ps( 0., 1., -1., -2., 100., 100., -100., -32., 0., 1., -1., 1000., -131., 100., -100., -32., ); @@ -44217,7 +46071,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_div_ps() { + const fn test_mm256_mask_div_ps() { let a = _mm256_set_ps(0., 1., -1., -2., 100., 100., -100., -32.); let b = _mm256_set_ps(2., 2., 2., 2., 2., 0., 2., 2.); let r = _mm256_mask_div_ps(a, 0, a, b); @@ -44228,7 +46082,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_div_ps() { + const fn test_mm256_maskz_div_ps() { let a = _mm256_set_ps(0., 1., -1., -2., 100., 100., -100., -32.); let b = _mm256_set_ps(2., 2., 2., 2., 2., 0., 2., 2.); let r = _mm256_maskz_div_ps(0, a, b); @@ -44239,7 +46093,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_div_ps() { + const fn test_mm_mask_div_ps() { let a = _mm_set_ps(100., 100., -100., -32.); let b = _mm_set_ps(2., 0., 2., 2.); let r = _mm_mask_div_ps(a, 0, a, b); @@ -44250,7 +46104,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_div_ps() { + const fn test_mm_maskz_div_ps() { let a = _mm_set_ps(100., 100., -100., -32.); let b = _mm_set_ps(2., 0., 2., 2.); let r = _mm_maskz_div_ps(0, a, b); @@ -44261,7 +46115,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_epi32() { + const fn test_mm512_max_epi32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_max_epi32(a, b); @@ -44270,7 +46124,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_epi32() { + const fn test_mm512_mask_max_epi32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_max_epi32(a, 0, a, b); @@ -44281,7 +46135,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_epi32() { + const fn test_mm512_maskz_max_epi32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_max_epi32(0, a, b); @@ -44292,7 +46146,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_max_epi32() { + const fn test_mm256_mask_max_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_max_epi32(a, 0, a, b); @@ -44303,7 +46157,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_max_epi32() { + const fn test_mm256_maskz_max_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_max_epi32(0, a, b); @@ -44314,7 +46168,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_max_epi32() { + const fn test_mm_mask_max_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_mask_max_epi32(a, 0, a, b); @@ -44325,7 +46179,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_max_epi32() { + const fn test_mm_maskz_max_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_maskz_max_epi32(0, a, b); @@ -44336,7 +46190,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_ps() { + fn test_mm512_max_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -44351,7 +46205,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_ps() { + fn test_mm512_mask_max_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -44368,7 +46222,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_ps() { + fn test_mm512_maskz_max_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -44385,7 +46239,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_max_ps() { + fn test_mm256_mask_max_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm256_mask_max_ps(a, 0, a, b); @@ -44396,7 +46250,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_max_ps() { + fn test_mm256_maskz_max_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm256_maskz_max_ps(0, a, b); @@ -44407,7 +46261,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_max_ps() { + fn test_mm_mask_max_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(3., 2., 1., 0.); let r = _mm_mask_max_ps(a, 0, a, b); @@ -44418,7 +46272,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_max_ps() { + fn test_mm_maskz_max_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(3., 2., 1., 0.); let r = _mm_maskz_max_ps(0, a, b); @@ -44429,7 +46283,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_epu32() { + const fn test_mm512_max_epu32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_max_epu32(a, b); @@ -44438,7 +46292,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_epu32() { + const fn test_mm512_mask_max_epu32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_max_epu32(a, 0, a, b); @@ -44449,7 +46303,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_epu32() { + const fn test_mm512_maskz_max_epu32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_max_epu32(0, a, b); @@ -44460,7 +46314,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_max_epu32() { + const fn test_mm256_mask_max_epu32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_max_epu32(a, 0, a, b); @@ -44471,7 +46325,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_max_epu32() { + const fn test_mm256_maskz_max_epu32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_max_epu32(0, a, b); @@ -44482,7 +46336,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_max_epu32() { + const fn test_mm_mask_max_epu32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_mask_max_epu32(a, 0, a, b); @@ -44493,7 +46347,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_max_epu32() { + const fn test_mm_maskz_max_epu32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_maskz_max_epu32(0, a, b); @@ -44504,7 +46358,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_epi32() { + const fn test_mm512_min_epi32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_min_epi32(a, b); @@ -44513,7 +46367,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_epi32() { + const fn test_mm512_mask_min_epi32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_min_epi32(a, 0, a, b); @@ -44524,7 +46378,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_epi32() { + const fn test_mm512_maskz_min_epi32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_min_epi32(0, a, b); @@ -44535,7 +46389,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_min_epi32() { + const fn test_mm256_mask_min_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_min_epi32(a, 0, a, b); @@ -44546,7 +46400,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_min_epi32() { + const fn test_mm256_maskz_min_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_min_epi32(0, a, b); @@ -44557,7 +46411,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_min_epi32() { + const fn test_mm_mask_min_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_mask_min_epi32(a, 0, a, b); @@ -44568,7 +46422,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_min_epi32() { + const fn test_mm_maskz_min_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_maskz_min_epi32(0, a, b); @@ -44579,7 +46433,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_ps() { + fn test_mm512_min_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -44594,7 +46448,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_ps() { + fn test_mm512_mask_min_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -44611,7 +46465,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_ps() { + fn test_mm512_maskz_min_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -44628,7 +46482,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_min_ps() { + fn test_mm256_mask_min_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm256_mask_min_ps(a, 0, a, b); @@ -44639,7 +46493,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_min_ps() { + fn test_mm256_maskz_min_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm256_set_ps(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm256_maskz_min_ps(0, a, b); @@ -44650,7 +46504,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_min_ps() { + fn test_mm_mask_min_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(3., 2., 1., 0.); let r = _mm_mask_min_ps(a, 0, a, b); @@ -44661,7 +46515,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_min_ps() { + fn test_mm_maskz_min_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(3., 2., 1., 0.); let r = _mm_maskz_min_ps(0, a, b); @@ -44672,7 +46526,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_epu32() { + const fn test_mm512_min_epu32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_min_epu32(a, b); @@ -44681,7 +46535,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_epu32() { + const fn test_mm512_mask_min_epu32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_min_epu32(a, 0, a, b); @@ -44692,7 +46546,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_epu32() { + const fn test_mm512_maskz_min_epu32() { let a = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm512_setr_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_min_epu32(0, a, b); @@ -44703,7 +46557,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_min_epu32() { + const fn test_mm256_mask_min_epu32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_mask_min_epu32(a, 0, a, b); @@ -44714,7 +46568,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_min_epu32() { + const fn test_mm256_maskz_min_epu32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm256_maskz_min_epu32(0, a, b); @@ -44725,7 +46579,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_min_epu32() { + const fn test_mm_mask_min_epu32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_mask_min_epu32(a, 0, a, b); @@ -44736,7 +46590,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_min_epu32() { + const fn test_mm_maskz_min_epu32() { let a = _mm_set_epi32(0, 1, 2, 3); let b = _mm_set_epi32(3, 2, 1, 0); let r = _mm_maskz_min_epu32(0, a, b); @@ -44747,7 +46601,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sqrt_ps() { + fn test_mm512_sqrt_ps() { let a = _mm512_setr_ps( 0., 1., 4., 9., 16., 25., 36., 49., 64., 81., 100., 121., 144., 169., 196., 225., ); @@ -44759,7 +46613,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sqrt_ps() { + fn test_mm512_mask_sqrt_ps() { let a = _mm512_setr_ps( 0., 1., 4., 9., 16., 25., 36., 49., 64., 81., 100., 121., 144., 169., 196., 225., ); @@ -44773,7 +46627,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sqrt_ps() { + fn test_mm512_maskz_sqrt_ps() { let a = _mm512_setr_ps( 0., 1., 4., 9., 16., 25., 36., 49., 64., 81., 100., 121., 144., 169., 196., 225., ); @@ -44787,7 +46641,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sqrt_ps() { + fn test_mm256_mask_sqrt_ps() { let a = _mm256_set_ps(0., 1., 4., 9., 16., 25., 36., 49.); let r = _mm256_mask_sqrt_ps(a, 0, a); assert_eq_m256(r, a); @@ -44797,7 +46651,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sqrt_ps() { + fn test_mm256_maskz_sqrt_ps() { let a = _mm256_set_ps(0., 1., 4., 9., 16., 25., 36., 49.); let r = _mm256_maskz_sqrt_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -44807,7 +46661,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sqrt_ps() { + fn test_mm_mask_sqrt_ps() { let a = _mm_set_ps(0., 1., 4., 9.); let r = _mm_mask_sqrt_ps(a, 0, a); assert_eq_m128(r, a); @@ -44817,7 +46671,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sqrt_ps() { + fn test_mm_maskz_sqrt_ps() { let a = _mm_set_ps(0., 1., 4., 9.); let r = _mm_maskz_sqrt_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -44827,7 +46681,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmadd_ps() { + const fn test_mm512_fmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -44841,7 +46695,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmadd_ps() { + const fn test_mm512_mask_fmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -44857,7 +46711,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmadd_ps() { + const fn test_mm512_maskz_fmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -44873,7 +46727,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmadd_ps() { + const fn test_mm512_mask3_fmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -44889,7 +46743,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmadd_ps() { + const fn test_mm256_mask_fmadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -44901,7 +46755,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmadd_ps() { + const fn test_mm256_maskz_fmadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -44913,7 +46767,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmadd_ps() { + const fn test_mm256_mask3_fmadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -44925,7 +46779,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmadd_ps() { + const fn test_mm_mask_fmadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -44937,7 +46791,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmadd_ps() { + const fn test_mm_maskz_fmadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -44949,7 +46803,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmadd_ps() { + const fn test_mm_mask3_fmadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -44961,7 +46815,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsub_ps() { + const fn test_mm512_fmsub_ps() { let a = _mm512_setr_ps( 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., ); @@ -44979,7 +46833,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsub_ps() { + const fn test_mm512_mask_fmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -44995,7 +46849,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsub_ps() { + const fn test_mm512_maskz_fmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45011,7 +46865,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsub_ps() { + const fn test_mm512_mask3_fmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45029,7 +46883,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmsub_ps() { + const fn test_mm256_mask_fmsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45041,7 +46895,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmsub_ps() { + const fn test_mm256_maskz_fmsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45053,7 +46907,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmsub_ps() { + const fn test_mm256_mask3_fmsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45065,7 +46919,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmsub_ps() { + const fn test_mm_mask_fmsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45077,7 +46931,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmsub_ps() { + const fn test_mm_maskz_fmsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45089,7 +46943,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmsub_ps() { + const fn test_mm_mask3_fmsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45101,7 +46955,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmaddsub_ps() { + const fn test_mm512_fmaddsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45115,7 +46969,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmaddsub_ps() { + const fn test_mm512_mask_fmaddsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45131,7 +46985,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmaddsub_ps() { + const fn test_mm512_maskz_fmaddsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45147,7 +47001,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmaddsub_ps() { + const fn test_mm512_mask3_fmaddsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45165,7 +47019,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmaddsub_ps() { + const fn test_mm256_mask_fmaddsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45177,7 +47031,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmaddsub_ps() { + const fn test_mm256_maskz_fmaddsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45189,7 +47043,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmaddsub_ps() { + const fn test_mm256_mask3_fmaddsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45201,7 +47055,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmaddsub_ps() { + const fn test_mm_mask_fmaddsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45213,7 +47067,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmaddsub_ps() { + const fn test_mm_maskz_fmaddsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45225,7 +47079,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmaddsub_ps() { + const fn test_mm_mask3_fmaddsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45237,7 +47091,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsubadd_ps() { + const fn test_mm512_fmsubadd_ps() { let a = _mm512_setr_ps( 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., ); @@ -45255,7 +47109,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsubadd_ps() { + const fn test_mm512_mask_fmsubadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45271,7 +47125,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsubadd_ps() { + const fn test_mm512_maskz_fmsubadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45287,7 +47141,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsubadd_ps() { + const fn test_mm512_mask3_fmsubadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45305,7 +47159,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmsubadd_ps() { + const fn test_mm256_mask_fmsubadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45317,7 +47171,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmsubadd_ps() { + const fn test_mm256_maskz_fmsubadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45329,7 +47183,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmsubadd_ps() { + const fn test_mm256_mask3_fmsubadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45341,7 +47195,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmsubadd_ps() { + const fn test_mm_mask_fmsubadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45353,7 +47207,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmsubadd_ps() { + const fn test_mm_maskz_fmsubadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45365,7 +47219,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmsubadd_ps() { + const fn test_mm_mask3_fmsubadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45377,7 +47231,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmadd_ps() { + const fn test_mm512_fnmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45391,7 +47245,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmadd_ps() { + const fn test_mm512_mask_fnmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45407,7 +47261,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmadd_ps() { + const fn test_mm512_maskz_fnmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45423,7 +47277,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmadd_ps() { + const fn test_mm512_mask3_fnmadd_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45441,7 +47295,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fnmadd_ps() { + const fn test_mm256_mask_fnmadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45453,7 +47307,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fnmadd_ps() { + const fn test_mm256_maskz_fnmadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45465,7 +47319,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fnmadd_ps() { + const fn test_mm256_mask3_fnmadd_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45477,7 +47331,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fnmadd_ps() { + const fn test_mm_mask_fnmadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45489,7 +47343,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fnmadd_ps() { + const fn test_mm_maskz_fnmadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45501,7 +47355,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fnmadd_ps() { + const fn test_mm_mask3_fnmadd_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45513,7 +47367,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmsub_ps() { + const fn test_mm512_fnmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45527,7 +47381,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmsub_ps() { + const fn test_mm512_mask_fnmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45543,7 +47397,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmsub_ps() { + const fn test_mm512_maskz_fnmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45559,7 +47413,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmsub_ps() { + const fn test_mm512_mask3_fnmsub_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -45577,7 +47431,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fnmsub_ps() { + const fn test_mm256_mask_fnmsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45589,7 +47443,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fnmsub_ps() { + const fn test_mm256_maskz_fnmsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45601,7 +47455,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fnmsub_ps() { + const fn test_mm256_mask3_fnmsub_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm256_set1_ps(1.); @@ -45613,7 +47467,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fnmsub_ps() { + const fn test_mm_mask_fnmsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45625,7 +47479,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fnmsub_ps() { + const fn test_mm_maskz_fnmsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45637,7 +47491,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fnmsub_ps() { + const fn test_mm_mask3_fnmsub_ps() { let a = _mm_set1_ps(1.); let b = _mm_set_ps(0., 1., 2., 3.); let c = _mm_set1_ps(1.); @@ -45649,7 +47503,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rcp14_ps() { + fn test_mm512_rcp14_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_rcp14_ps(a); let e = _mm512_set1_ps(0.33333206); @@ -45657,7 +47511,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rcp14_ps() { + fn test_mm512_mask_rcp14_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_mask_rcp14_ps(a, 0, a); assert_eq_m512(r, a); @@ -45670,7 +47524,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rcp14_ps() { + fn test_mm512_maskz_rcp14_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_maskz_rcp14_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -45683,7 +47537,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rcp14_ps() { + fn test_mm256_rcp14_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_rcp14_ps(a); let e = _mm256_set1_ps(0.33333206); @@ -45691,7 +47545,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rcp14_ps() { + fn test_mm256_mask_rcp14_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_mask_rcp14_ps(a, 0, a); assert_eq_m256(r, a); @@ -45701,7 +47555,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rcp14_ps() { + fn test_mm256_maskz_rcp14_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_maskz_rcp14_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -45711,7 +47565,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rcp14_ps() { + fn test_mm_rcp14_ps() { let a = _mm_set1_ps(3.); let r = _mm_rcp14_ps(a); let e = _mm_set1_ps(0.33333206); @@ -45719,7 +47573,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rcp14_ps() { + fn test_mm_mask_rcp14_ps() { let a = _mm_set1_ps(3.); let r = _mm_mask_rcp14_ps(a, 0, a); assert_eq_m128(r, a); @@ -45729,7 +47583,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rcp14_ps() { + fn test_mm_maskz_rcp14_ps() { let a = _mm_set1_ps(3.); let r = _mm_maskz_rcp14_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -45739,7 +47593,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rsqrt14_ps() { + fn test_mm512_rsqrt14_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_rsqrt14_ps(a); let e = _mm512_set1_ps(0.5773392); @@ -45747,7 +47601,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rsqrt14_ps() { + fn test_mm512_mask_rsqrt14_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_mask_rsqrt14_ps(a, 0, a); assert_eq_m512(r, a); @@ -45760,7 +47614,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rsqrt14_ps() { + fn test_mm512_maskz_rsqrt14_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_maskz_rsqrt14_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -45773,7 +47627,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rsqrt14_ps() { + fn test_mm256_rsqrt14_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_rsqrt14_ps(a); let e = _mm256_set1_ps(0.5773392); @@ -45781,7 +47635,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rsqrt14_ps() { + fn test_mm256_mask_rsqrt14_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_mask_rsqrt14_ps(a, 0, a); assert_eq_m256(r, a); @@ -45791,7 +47645,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rsqrt14_ps() { + fn test_mm256_maskz_rsqrt14_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_maskz_rsqrt14_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -45801,7 +47655,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rsqrt14_ps() { + fn test_mm_rsqrt14_ps() { let a = _mm_set1_ps(3.); let r = _mm_rsqrt14_ps(a); let e = _mm_set1_ps(0.5773392); @@ -45809,7 +47663,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rsqrt14_ps() { + fn test_mm_mask_rsqrt14_ps() { let a = _mm_set1_ps(3.); let r = _mm_mask_rsqrt14_ps(a, 0, a); assert_eq_m128(r, a); @@ -45819,7 +47673,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rsqrt14_ps() { + fn test_mm_maskz_rsqrt14_ps() { let a = _mm_set1_ps(3.); let r = _mm_maskz_rsqrt14_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -45829,7 +47683,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getexp_ps() { + fn test_mm512_getexp_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_getexp_ps(a); let e = _mm512_set1_ps(1.); @@ -45837,7 +47691,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getexp_ps() { + fn test_mm512_mask_getexp_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_mask_getexp_ps(a, 0, a); assert_eq_m512(r, a); @@ -45849,7 +47703,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getexp_ps() { + fn test_mm512_maskz_getexp_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_maskz_getexp_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -45861,7 +47715,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_getexp_ps() { + fn test_mm256_getexp_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_getexp_ps(a); let e = _mm256_set1_ps(1.); @@ -45869,7 +47723,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_getexp_ps() { + fn test_mm256_mask_getexp_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_mask_getexp_ps(a, 0, a); assert_eq_m256(r, a); @@ -45879,7 +47733,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_getexp_ps() { + fn test_mm256_maskz_getexp_ps() { let a = _mm256_set1_ps(3.); let r = _mm256_maskz_getexp_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -45889,7 +47743,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_getexp_ps() { + fn test_mm_getexp_ps() { let a = _mm_set1_ps(3.); let r = _mm_getexp_ps(a); let e = _mm_set1_ps(1.); @@ -45897,7 +47751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_getexp_ps() { + fn test_mm_mask_getexp_ps() { let a = _mm_set1_ps(3.); let r = _mm_mask_getexp_ps(a, 0, a); assert_eq_m128(r, a); @@ -45907,7 +47761,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_getexp_ps() { + fn test_mm_maskz_getexp_ps() { let a = _mm_set1_ps(3.); let r = _mm_maskz_getexp_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -45917,7 +47771,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_roundscale_ps() { + fn test_mm512_roundscale_ps() { let a = _mm512_set1_ps(1.1); let r = _mm512_roundscale_ps::<0b00_00_00_00>(a); let e = _mm512_set1_ps(1.0); @@ -45925,7 +47779,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_roundscale_ps() { + fn test_mm512_mask_roundscale_ps() { let a = _mm512_set1_ps(1.1); let r = _mm512_mask_roundscale_ps::<0b00_00_00_00>(a, 0, a); let e = _mm512_set1_ps(1.1); @@ -45936,7 +47790,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_roundscale_ps() { + fn test_mm512_maskz_roundscale_ps() { let a = _mm512_set1_ps(1.1); let r = _mm512_maskz_roundscale_ps::<0b00_00_00_00>(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -45946,7 +47800,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_roundscale_ps() { + fn test_mm256_roundscale_ps() { let a = _mm256_set1_ps(1.1); let r = _mm256_roundscale_ps::<0b00_00_00_00>(a); let e = _mm256_set1_ps(1.0); @@ -45954,7 +47808,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_roundscale_ps() { + fn test_mm256_mask_roundscale_ps() { let a = _mm256_set1_ps(1.1); let r = _mm256_mask_roundscale_ps::<0b00_00_00_00>(a, 0, a); let e = _mm256_set1_ps(1.1); @@ -45965,7 +47819,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_roundscale_ps() { + fn test_mm256_maskz_roundscale_ps() { let a = _mm256_set1_ps(1.1); let r = _mm256_maskz_roundscale_ps::<0b00_00_00_00>(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -45975,7 +47829,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_roundscale_ps() { + fn test_mm_roundscale_ps() { let a = _mm_set1_ps(1.1); let r = _mm_roundscale_ps::<0b00_00_00_00>(a); let e = _mm_set1_ps(1.0); @@ -45983,7 +47837,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_roundscale_ps() { + fn test_mm_mask_roundscale_ps() { let a = _mm_set1_ps(1.1); let r = _mm_mask_roundscale_ps::<0b00_00_00_00>(a, 0, a); let e = _mm_set1_ps(1.1); @@ -45994,7 +47848,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_roundscale_ps() { + fn test_mm_maskz_roundscale_ps() { let a = _mm_set1_ps(1.1); let r = _mm_maskz_roundscale_ps::<0b00_00_00_00>(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -46004,7 +47858,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_scalef_ps() { + fn test_mm512_scalef_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_scalef_ps(a, b); @@ -46013,7 +47867,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_scalef_ps() { + fn test_mm512_mask_scalef_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_mask_scalef_ps(a, 0, a, b); @@ -46026,7 +47880,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_scalef_ps() { + fn test_mm512_maskz_scalef_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_maskz_scalef_ps(0, a, b); @@ -46039,7 +47893,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_scalef_ps() { + fn test_mm256_scalef_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set1_ps(3.); let r = _mm256_scalef_ps(a, b); @@ -46048,7 +47902,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_scalef_ps() { + fn test_mm256_mask_scalef_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set1_ps(3.); let r = _mm256_mask_scalef_ps(a, 0, a, b); @@ -46059,7 +47913,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_scalef_ps() { + fn test_mm256_maskz_scalef_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set1_ps(3.); let r = _mm256_maskz_scalef_ps(0, a, b); @@ -46070,7 +47924,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_scalef_ps() { + fn test_mm_scalef_ps() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_scalef_ps(a, b); @@ -46079,7 +47933,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_scalef_ps() { + fn test_mm_mask_scalef_ps() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_mask_scalef_ps(a, 0, a, b); @@ -46090,7 +47944,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_scalef_ps() { + fn test_mm_maskz_scalef_ps() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_maskz_scalef_ps(0, a, b); @@ -46101,7 +47955,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fixupimm_ps() { + fn test_mm512_fixupimm_ps() { let a = _mm512_set1_ps(f32::NAN); let b = _mm512_set1_ps(f32::MAX); let c = _mm512_set1_epi32(i32::MAX); @@ -46112,7 +47966,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fixupimm_ps() { + fn test_mm512_mask_fixupimm_ps() { #[rustfmt::skip] let a = _mm512_set_ps( f32::NAN, f32::NAN, f32::NAN, f32::NAN, @@ -46130,7 +47984,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fixupimm_ps() { + fn test_mm512_maskz_fixupimm_ps() { #[rustfmt::skip] let a = _mm512_set_ps( f32::NAN, f32::NAN, f32::NAN, f32::NAN, @@ -46148,7 +48002,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_fixupimm_ps() { + fn test_mm256_fixupimm_ps() { let a = _mm256_set1_ps(f32::NAN); let b = _mm256_set1_ps(f32::MAX); let c = _mm256_set1_epi32(i32::MAX); @@ -46158,7 +48012,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fixupimm_ps() { + fn test_mm256_mask_fixupimm_ps() { let a = _mm256_set1_ps(f32::NAN); let b = _mm256_set1_ps(f32::MAX); let c = _mm256_set1_epi32(i32::MAX); @@ -46168,7 +48022,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fixupimm_ps() { + fn test_mm256_maskz_fixupimm_ps() { let a = _mm256_set1_ps(f32::NAN); let b = _mm256_set1_ps(f32::MAX); let c = _mm256_set1_epi32(i32::MAX); @@ -46178,7 +48032,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_fixupimm_ps() { + fn test_mm_fixupimm_ps() { let a = _mm_set1_ps(f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -46188,7 +48042,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fixupimm_ps() { + fn test_mm_mask_fixupimm_ps() { let a = _mm_set1_ps(f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -46198,7 +48052,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fixupimm_ps() { + fn test_mm_maskz_fixupimm_ps() { let a = _mm_set1_ps(f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -46232,7 +48086,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_ternarylogic_epi32() { + fn test_mm512_mask_ternarylogic_epi32() { let src = _mm512_set1_epi32(1 << 2); let a = _mm512_set1_epi32(1 << 1); let b = _mm512_set1_epi32(1 << 0); @@ -46244,7 +48098,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_ternarylogic_epi32() { + fn test_mm512_maskz_ternarylogic_epi32() { let a = _mm512_set1_epi32(1 << 2); let b = _mm512_set1_epi32(1 << 1); let c = _mm512_set1_epi32(1 << 0); @@ -46282,7 +48136,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_ternarylogic_epi32() { + fn test_mm256_mask_ternarylogic_epi32() { let src = _mm256_set1_epi32(1 << 2); let a = _mm256_set1_epi32(1 << 1); let b = _mm256_set1_epi32(1 << 0); @@ -46294,7 +48148,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_ternarylogic_epi32() { + fn test_mm256_maskz_ternarylogic_epi32() { let a = _mm256_set1_epi32(1 << 2); let b = _mm256_set1_epi32(1 << 1); let c = _mm256_set1_epi32(1 << 0); @@ -46330,7 +48184,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_ternarylogic_epi32() { + fn test_mm_mask_ternarylogic_epi32() { let src = _mm_set1_epi32(1 << 2); let a = _mm_set1_epi32(1 << 1); let b = _mm_set1_epi32(1 << 0); @@ -46342,7 +48196,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_ternarylogic_epi32() { + fn test_mm_maskz_ternarylogic_epi32() { let a = _mm_set1_epi32(1 << 2); let b = _mm_set1_epi32(1 << 1); let c = _mm_set1_epi32(1 << 0); @@ -46354,7 +48208,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getmant_ps() { + fn test_mm512_getmant_ps() { let a = _mm512_set1_ps(10.); let r = _mm512_getmant_ps::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a); let e = _mm512_set1_ps(1.25); @@ -46362,7 +48216,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getmant_ps() { + fn test_mm512_mask_getmant_ps() { let a = _mm512_set1_ps(10.); let r = _mm512_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a); assert_eq_m512(r, a); @@ -46378,7 +48232,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getmant_ps() { + fn test_mm512_maskz_getmant_ps() { let a = _mm512_set1_ps(10.); let r = _mm512_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -46391,7 +48245,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_getmant_ps() { + fn test_mm256_getmant_ps() { let a = _mm256_set1_ps(10.); let r = _mm256_getmant_ps::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a); let e = _mm256_set1_ps(1.25); @@ -46399,7 +48253,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_getmant_ps() { + fn test_mm256_mask_getmant_ps() { let a = _mm256_set1_ps(10.); let r = _mm256_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a); assert_eq_m256(r, a); @@ -46409,7 +48263,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_getmant_ps() { + fn test_mm256_maskz_getmant_ps() { let a = _mm256_set1_ps(10.); let r = _mm256_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -46419,7 +48273,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_getmant_ps() { + fn test_mm_getmant_ps() { let a = _mm_set1_ps(10.); let r = _mm_getmant_ps::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a); let e = _mm_set1_ps(1.25); @@ -46427,7 +48281,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_getmant_ps() { + fn test_mm_mask_getmant_ps() { let a = _mm_set1_ps(10.); let r = _mm_mask_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a); assert_eq_m128(r, a); @@ -46437,7 +48291,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_getmant_ps() { + fn test_mm_maskz_getmant_ps() { let a = _mm_set1_ps(10.); let r = _mm_maskz_getmant_ps::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -46447,7 +48301,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_add_round_ps() { + fn test_mm512_add_round_ps() { let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007, ); @@ -46469,7 +48323,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_add_round_ps() { + fn test_mm512_mask_add_round_ps() { let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007, ); @@ -46493,7 +48347,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_add_round_ps() { + fn test_mm512_maskz_add_round_ps() { let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007, ); @@ -46516,7 +48370,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sub_round_ps() { + fn test_mm512_sub_round_ps() { let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007, ); @@ -46538,7 +48392,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sub_round_ps() { + fn test_mm512_mask_sub_round_ps() { let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007, ); @@ -46564,7 +48418,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sub_round_ps() { + fn test_mm512_maskz_sub_round_ps() { let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 0.00000007, ); @@ -46588,7 +48442,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mul_round_ps() { + fn test_mm512_mul_round_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, @@ -46618,7 +48472,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mul_round_ps() { + fn test_mm512_mask_mul_round_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, @@ -46648,7 +48502,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mul_round_ps() { + fn test_mm512_maskz_mul_round_ps() { #[rustfmt::skip] let a = _mm512_setr_ps( 0., 1.5, 2., 3.5, @@ -46676,7 +48530,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_div_round_ps() { + fn test_mm512_div_round_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -46688,7 +48542,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_div_round_ps() { + fn test_mm512_mask_div_round_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_mask_div_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -46709,7 +48563,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_div_round_ps() { + fn test_mm512_maskz_div_round_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = @@ -46728,7 +48582,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sqrt_round_ps() { + fn test_mm512_sqrt_round_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set1_ps(1.7320508); @@ -46739,7 +48593,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sqrt_round_ps() { + fn test_mm512_mask_sqrt_round_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_mask_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 0, a); @@ -46757,7 +48611,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sqrt_round_ps() { + fn test_mm512_maskz_sqrt_round_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_maskz_sqrt_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a); @@ -46774,7 +48628,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmadd_round_ps() { + fn test_mm512_fmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -46787,7 +48641,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmadd_round_ps() { + fn test_mm512_mask_fmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -46812,7 +48666,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmadd_round_ps() { + fn test_mm512_maskz_fmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -46838,7 +48692,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmadd_round_ps() { + fn test_mm512_mask3_fmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -46863,7 +48717,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsub_round_ps() { + fn test_mm512_fmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -46876,7 +48730,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsub_round_ps() { + fn test_mm512_mask_fmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -46901,7 +48755,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsub_round_ps() { + fn test_mm512_maskz_fmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -46926,7 +48780,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsub_round_ps() { + fn test_mm512_mask3_fmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -46951,7 +48805,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmaddsub_round_ps() { + fn test_mm512_fmaddsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -46974,7 +48828,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmaddsub_round_ps() { + fn test_mm512_mask_fmaddsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -46999,7 +48853,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmaddsub_round_ps() { + fn test_mm512_maskz_fmaddsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47024,7 +48878,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmaddsub_round_ps() { + fn test_mm512_mask3_fmaddsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47049,7 +48903,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsubadd_round_ps() { + fn test_mm512_fmsubadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47072,7 +48926,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsubadd_round_ps() { + fn test_mm512_mask_fmsubadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47097,7 +48951,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsubadd_round_ps() { + fn test_mm512_maskz_fmsubadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47122,7 +48976,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsubadd_round_ps() { + fn test_mm512_mask3_fmsubadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47147,7 +49001,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmadd_round_ps() { + fn test_mm512_fnmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -47161,7 +49015,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmadd_round_ps() { + fn test_mm512_mask_fnmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -47184,7 +49038,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmadd_round_ps() { + fn test_mm512_maskz_fnmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -47206,7 +49060,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmadd_round_ps() { + fn test_mm512_mask3_fnmadd_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(1.); @@ -47228,7 +49082,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmsub_round_ps() { + fn test_mm512_fnmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47242,7 +49096,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmsub_round_ps() { + fn test_mm512_mask_fnmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47265,7 +49119,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmsub_round_ps() { + fn test_mm512_maskz_fnmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47287,7 +49141,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmsub_round_ps() { + fn test_mm512_mask3_fnmsub_round_ps() { let a = _mm512_set1_ps(0.00000007); let b = _mm512_set1_ps(1.); let c = _mm512_set1_ps(-1.); @@ -47309,7 +49163,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_round_ps() { + fn test_mm512_max_round_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -47324,7 +49178,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_round_ps() { + fn test_mm512_mask_max_round_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -47341,7 +49195,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_round_ps() { + fn test_mm512_maskz_max_round_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -47358,7 +49212,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_round_ps() { + fn test_mm512_min_round_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -47373,7 +49227,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_round_ps() { + fn test_mm512_mask_min_round_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -47390,7 +49244,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_round_ps() { + fn test_mm512_maskz_min_round_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -47407,7 +49261,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getexp_round_ps() { + fn test_mm512_getexp_round_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm512_set1_ps(1.); @@ -47415,7 +49269,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getexp_round_ps() { + fn test_mm512_mask_getexp_round_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_mask_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(a, 0, a); assert_eq_m512(r, a); @@ -47427,7 +49281,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getexp_round_ps() { + fn test_mm512_maskz_getexp_round_ps() { let a = _mm512_set1_ps(3.); let r = _mm512_maskz_getexp_round_ps::<_MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -47439,7 +49293,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_roundscale_round_ps() { + fn test_mm512_roundscale_round_ps() { let a = _mm512_set1_ps(1.1); let r = _mm512_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(a); let e = _mm512_set1_ps(1.0); @@ -47447,7 +49301,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_roundscale_round_ps() { + fn test_mm512_mask_roundscale_round_ps() { let a = _mm512_set1_ps(1.1); let r = _mm512_mask_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a); let e = _mm512_set1_ps(1.1); @@ -47462,7 +49316,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_roundscale_round_ps() { + fn test_mm512_maskz_roundscale_round_ps() { let a = _mm512_set1_ps(1.1); let r = _mm512_maskz_roundscale_round_ps::<0, _MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -47473,7 +49327,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_scalef_round_ps() { + fn test_mm512_scalef_round_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -47482,7 +49336,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_scalef_round_ps() { + fn test_mm512_mask_scalef_round_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_mask_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -47502,7 +49356,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_scalef_round_ps() { + fn test_mm512_maskz_scalef_round_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(3.); let r = _mm512_maskz_scalef_round_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -47521,7 +49375,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fixupimm_round_ps() { + fn test_mm512_fixupimm_round_ps() { let a = _mm512_set1_ps(f32::NAN); let b = _mm512_set1_ps(f32::MAX); let c = _mm512_set1_epi32(i32::MAX); @@ -47531,7 +49385,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fixupimm_round_ps() { + fn test_mm512_mask_fixupimm_round_ps() { #[rustfmt::skip] let a = _mm512_set_ps( f32::NAN, f32::NAN, f32::NAN, f32::NAN, @@ -47554,7 +49408,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fixupimm_round_ps() { + fn test_mm512_maskz_fixupimm_round_ps() { #[rustfmt::skip] let a = _mm512_set_ps( f32::NAN, f32::NAN, f32::NAN, f32::NAN, @@ -47577,7 +49431,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getmant_round_ps() { + fn test_mm512_getmant_round_ps() { let a = _mm512_set1_ps(10.); let r = _mm512_getmant_round_ps::< _MM_MANT_NORM_1_2, @@ -47589,7 +49443,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getmant_round_ps() { + fn test_mm512_mask_getmant_round_ps() { let a = _mm512_set1_ps(10.); let r = _mm512_mask_getmant_round_ps::< _MM_MANT_NORM_1_2, @@ -47609,7 +49463,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getmant_round_ps() { + fn test_mm512_maskz_getmant_round_ps() { let a = _mm512_set1_ps(10.); let r = _mm512_maskz_getmant_round_ps::< _MM_MANT_NORM_1_2, @@ -47629,7 +49483,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtps_epi32() { + fn test_mm512_cvtps_epi32() { let a = _mm512_setr_ps( 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -47639,7 +49493,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtps_epi32() { + fn test_mm512_mask_cvtps_epi32() { let a = _mm512_setr_ps( 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -47652,7 +49506,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtps_epi32() { + fn test_mm512_maskz_cvtps_epi32() { let a = _mm512_setr_ps( 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -47664,7 +49518,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtps_epi32() { + fn test_mm256_mask_cvtps_epi32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let src = _mm256_set1_epi32(0); let r = _mm256_mask_cvtps_epi32(src, 0, a); @@ -47675,7 +49529,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtps_epi32() { + fn test_mm256_maskz_cvtps_epi32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let r = _mm256_maskz_cvtps_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -47685,7 +49539,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtps_epi32() { + fn test_mm_mask_cvtps_epi32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtps_epi32(src, 0, a); @@ -47696,7 +49550,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtps_epi32() { + fn test_mm_maskz_cvtps_epi32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let r = _mm_maskz_cvtps_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -47706,7 +49560,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtps_epu32() { + fn test_mm512_cvtps_epu32() { let a = _mm512_setr_ps( 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -47716,7 +49570,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtps_epu32() { + fn test_mm512_mask_cvtps_epu32() { let a = _mm512_setr_ps( 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -47729,7 +49583,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtps_epu32() { + fn test_mm512_maskz_cvtps_epu32() { let a = _mm512_setr_ps( 0., -1.4, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -47741,7 +49595,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtps_epu32() { + fn test_mm256_cvtps_epu32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let r = _mm256_cvtps_epu32(a); let e = _mm256_set_epi32(8, 10, 10, 12, 12, 14, 14, 16); @@ -47749,7 +49603,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtps_epu32() { + fn test_mm256_mask_cvtps_epu32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let src = _mm256_set1_epi32(0); let r = _mm256_mask_cvtps_epu32(src, 0, a); @@ -47760,7 +49614,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtps_epu32() { + fn test_mm256_maskz_cvtps_epu32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let r = _mm256_maskz_cvtps_epu32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -47770,7 +49624,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtps_epu32() { + fn test_mm_cvtps_epu32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let r = _mm_cvtps_epu32(a); let e = _mm_set_epi32(12, 14, 14, 16); @@ -47778,7 +49632,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtps_epu32() { + fn test_mm_mask_cvtps_epu32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtps_epu32(src, 0, a); @@ -47789,7 +49643,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtps_epu32() { + fn test_mm_maskz_cvtps_epu32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let r = _mm_maskz_cvtps_epu32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -47799,7 +49653,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi8_epi32() { + const fn test_mm512_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi8_epi32(a); let e = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -47807,7 +49661,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi8_epi32() { + const fn test_mm512_mask_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi32(-1); let r = _mm512_mask_cvtepi8_epi32(src, 0, a); @@ -47818,7 +49672,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi8_epi32() { + const fn test_mm512_maskz_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi8_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -47828,7 +49682,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi8_epi32() { + const fn test_mm256_mask_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi32(-1); let r = _mm256_mask_cvtepi8_epi32(src, 0, a); @@ -47839,7 +49693,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi8_epi32() { + const fn test_mm256_maskz_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepi8_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -47849,7 +49703,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi8_epi32() { + const fn test_mm_mask_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi32(-1); let r = _mm_mask_cvtepi8_epi32(src, 0, a); @@ -47860,7 +49714,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi8_epi32() { + const fn test_mm_maskz_cvtepi8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepi8_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -47870,7 +49724,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu8_epi32() { + const fn test_mm512_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu8_epi32(a); let e = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -47878,7 +49732,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu8_epi32() { + const fn test_mm512_mask_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi32(-1); let r = _mm512_mask_cvtepu8_epi32(src, 0, a); @@ -47889,7 +49743,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu8_epi32() { + const fn test_mm512_maskz_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu8_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -47899,7 +49753,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepu8_epi32() { + const fn test_mm256_mask_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi32(-1); let r = _mm256_mask_cvtepu8_epi32(src, 0, a); @@ -47910,7 +49764,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu8_epi32() { + const fn test_mm256_maskz_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepu8_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -47920,7 +49774,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepu8_epi32() { + const fn test_mm_mask_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi32(-1); let r = _mm_mask_cvtepu8_epi32(src, 0, a); @@ -47931,7 +49785,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepu8_epi32() { + const fn test_mm_maskz_cvtepu8_epi32() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepu8_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -47941,7 +49795,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi16_epi32() { + const fn test_mm512_cvtepi16_epi32() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi16_epi32(a); let e = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -47949,7 +49803,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi16_epi32() { + const fn test_mm512_mask_cvtepi16_epi32() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi32(-1); let r = _mm512_mask_cvtepi16_epi32(src, 0, a); @@ -47960,7 +49814,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi16_epi32() { + const fn test_mm512_maskz_cvtepi16_epi32() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi16_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -47970,7 +49824,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi16_epi32() { + const fn test_mm256_mask_cvtepi16_epi32() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let src = _mm256_set1_epi32(-1); let r = _mm256_mask_cvtepi16_epi32(src, 0, a); @@ -47981,7 +49835,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi16_epi32() { + const fn test_mm256_maskz_cvtepi16_epi32() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_cvtepi16_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -47991,7 +49845,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi16_epi32() { + const fn test_mm_mask_cvtepi16_epi32() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let src = _mm_set1_epi32(-1); let r = _mm_mask_cvtepi16_epi32(src, 0, a); @@ -48002,7 +49856,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi16_epi32() { + const fn test_mm_maskz_cvtepi16_epi32() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_maskz_cvtepi16_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48012,7 +49866,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu16_epi32() { + const fn test_mm512_cvtepu16_epi32() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu16_epi32(a); let e = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -48020,7 +49874,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu16_epi32() { + const fn test_mm512_mask_cvtepu16_epi32() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi32(-1); let r = _mm512_mask_cvtepu16_epi32(src, 0, a); @@ -48031,7 +49885,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu16_epi32() { + const fn test_mm512_maskz_cvtepu16_epi32() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu16_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -48041,7 +49895,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepu16_epi32() { + const fn test_mm256_mask_cvtepu16_epi32() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi32(-1); let r = _mm256_mask_cvtepu16_epi32(src, 0, a); @@ -48052,7 +49906,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu16_epi32() { + const fn test_mm256_maskz_cvtepu16_epi32() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepu16_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -48062,7 +49916,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepu16_epi32() { + const fn test_mm_mask_cvtepu16_epi32() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi32(-1); let r = _mm_mask_cvtepu16_epi32(src, 0, a); @@ -48073,7 +49927,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepu16_epi32() { + const fn test_mm_maskz_cvtepu16_epi32() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepu16_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48083,7 +49937,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi32_ps() { + const fn test_mm512_cvtepi32_ps() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi32_ps(a); let e = _mm512_set_ps( @@ -48093,7 +49947,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi32_ps() { + const fn test_mm512_mask_cvtepi32_ps() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_ps(-1.); let r = _mm512_mask_cvtepi32_ps(src, 0, a); @@ -48106,7 +49960,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi32_ps() { + const fn test_mm512_maskz_cvtepi32_ps() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi32_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -48118,7 +49972,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi32_ps() { + const fn test_mm256_mask_cvtepi32_ps() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm256_set1_ps(-1.); let r = _mm256_mask_cvtepi32_ps(src, 0, a); @@ -48129,7 +49983,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi32_ps() { + const fn test_mm256_maskz_cvtepi32_ps() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_cvtepi32_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -48139,7 +49993,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi32_ps() { + const fn test_mm_mask_cvtepi32_ps() { let a = _mm_set_epi32(1, 2, 3, 4); let src = _mm_set1_ps(-1.); let r = _mm_mask_cvtepi32_ps(src, 0, a); @@ -48150,7 +50004,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi32_ps() { + const fn test_mm_maskz_cvtepi32_ps() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_maskz_cvtepi32_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -48160,7 +50014,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu32_ps() { + const fn test_mm512_cvtepu32_ps() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu32_ps(a); let e = _mm512_set_ps( @@ -48170,7 +50024,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu32_ps() { + const fn test_mm512_mask_cvtepu32_ps() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_ps(-1.); let r = _mm512_mask_cvtepu32_ps(src, 0, a); @@ -48183,7 +50037,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu32_ps() { + const fn test_mm512_maskz_cvtepu32_ps() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu32_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -48195,7 +50049,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi32_epi16() { + const fn test_mm512_cvtepi32_epi16() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi32_epi16(a); let e = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -48203,7 +50057,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi32_epi16() { + const fn test_mm512_mask_cvtepi32_epi16() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi16(-1); let r = _mm512_mask_cvtepi32_epi16(src, 0, a); @@ -48214,7 +50068,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi32_epi16() { + const fn test_mm512_maskz_cvtepi32_epi16() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi32_epi16(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -48224,7 +50078,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtepi32_epi16() { + const fn test_mm256_cvtepi32_epi16() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_cvtepi32_epi16(a); let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); @@ -48232,7 +50086,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi32_epi16() { + const fn test_mm256_mask_cvtepi32_epi16() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let src = _mm_set1_epi16(-1); let r = _mm256_mask_cvtepi32_epi16(src, 0, a); @@ -48243,7 +50097,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi32_epi16() { + const fn test_mm256_maskz_cvtepi32_epi16() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_cvtepi32_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48253,7 +50107,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtepi32_epi16() { + fn test_mm_cvtepi32_epi16() { let a = _mm_set_epi32(4, 5, 6, 7); let r = _mm_cvtepi32_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7); @@ -48261,7 +50115,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi32_epi16() { + fn test_mm_mask_cvtepi32_epi16() { let a = _mm_set_epi32(4, 5, 6, 7); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtepi32_epi16(src, 0, a); @@ -48272,7 +50126,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi32_epi16() { + fn test_mm_maskz_cvtepi32_epi16() { let a = _mm_set_epi32(4, 5, 6, 7); let r = _mm_maskz_cvtepi32_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48282,7 +50136,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi32_epi8() { + const fn test_mm512_cvtepi32_epi8() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi32_epi8(a); let e = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); @@ -48290,7 +50144,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi32_epi8() { + const fn test_mm512_mask_cvtepi32_epi8() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi8(-1); let r = _mm512_mask_cvtepi32_epi8(src, 0, a); @@ -48301,7 +50155,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi32_epi8() { + const fn test_mm512_maskz_cvtepi32_epi8() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48311,7 +50165,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtepi32_epi8() { + fn test_mm256_cvtepi32_epi8() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_cvtepi32_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7); @@ -48319,7 +50173,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi32_epi8() { + fn test_mm256_mask_cvtepi32_epi8() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let src = _mm_set1_epi8(0); let r = _mm256_mask_cvtepi32_epi8(src, 0, a); @@ -48330,7 +50184,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi32_epi8() { + fn test_mm256_maskz_cvtepi32_epi8() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_cvtepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48340,7 +50194,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtepi32_epi8() { + fn test_mm_cvtepi32_epi8() { let a = _mm_set_epi32(4, 5, 6, 7); let r = _mm_cvtepi32_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7); @@ -48348,7 +50202,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi32_epi8() { + fn test_mm_mask_cvtepi32_epi8() { let a = _mm_set_epi32(4, 5, 6, 7); let src = _mm_set1_epi8(0); let r = _mm_mask_cvtepi32_epi8(src, 0, a); @@ -48359,7 +50213,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi32_epi8() { + fn test_mm_maskz_cvtepi32_epi8() { let a = _mm_set_epi32(4, 5, 6, 7); let r = _mm_maskz_cvtepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48369,7 +50223,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsepi32_epi16() { + fn test_mm512_cvtsepi32_epi16() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48389,7 +50243,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtsepi32_epi16() { + fn test_mm512_mask_cvtsepi32_epi16() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48412,7 +50266,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtsepi32_epi16() { + fn test_mm512_maskz_cvtsepi32_epi16() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48434,7 +50288,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtsepi32_epi16() { + fn test_mm256_cvtsepi32_epi16() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_cvtsepi32_epi16(a); let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); @@ -48442,7 +50296,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtsepi32_epi16() { + fn test_mm256_mask_cvtsepi32_epi16() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let src = _mm_set1_epi16(-1); let r = _mm256_mask_cvtsepi32_epi16(src, 0, a); @@ -48453,7 +50307,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtsepi32_epi16() { + fn test_mm256_maskz_cvtsepi32_epi16() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_cvtsepi32_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48463,7 +50317,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtsepi32_epi16() { + fn test_mm_cvtsepi32_epi16() { let a = _mm_set_epi32(4, 5, 6, 7); let r = _mm_cvtsepi32_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, 7); @@ -48471,7 +50325,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtsepi32_epi16() { + fn test_mm_mask_cvtsepi32_epi16() { let a = _mm_set_epi32(4, 5, 6, 7); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtsepi32_epi16(src, 0, a); @@ -48482,7 +50336,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtsepi32_epi16() { + fn test_mm_maskz_cvtsepi32_epi16() { let a = _mm_set_epi32(4, 5, 6, 7); let r = _mm_maskz_cvtsepi32_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48492,7 +50346,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsepi32_epi8() { + fn test_mm512_cvtsepi32_epi8() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48512,7 +50366,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtsepi32_epi8() { + fn test_mm512_mask_cvtsepi32_epi8() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48535,7 +50389,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtsepi32_epi8() { + fn test_mm512_maskz_cvtsepi32_epi8() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48557,7 +50411,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtsepi32_epi8() { + fn test_mm256_cvtsepi32_epi8() { let a = _mm256_set_epi32(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm256_cvtsepi32_epi8(a); #[rustfmt::skip] @@ -48571,7 +50425,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtsepi32_epi8() { + fn test_mm256_mask_cvtsepi32_epi8() { let a = _mm256_set_epi32(9, 10, 11, 12, 13, 14, 15, 16); let src = _mm_set1_epi8(0); let r = _mm256_mask_cvtsepi32_epi8(src, 0, a); @@ -48588,7 +50442,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtsepi32_epi8() { + fn test_mm256_maskz_cvtsepi32_epi8() { let a = _mm256_set_epi32(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm256_maskz_cvtsepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48604,7 +50458,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtsepi32_epi8() { + fn test_mm_cvtsepi32_epi8() { let a = _mm_set_epi32(13, 14, 15, 16); let r = _mm_cvtsepi32_epi8(a); #[rustfmt::skip] @@ -48618,7 +50472,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtsepi32_epi8() { + fn test_mm_mask_cvtsepi32_epi8() { let a = _mm_set_epi32(13, 14, 15, 16); let src = _mm_set1_epi8(0); let r = _mm_mask_cvtsepi32_epi8(src, 0, a); @@ -48635,7 +50489,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtsepi32_epi8() { + fn test_mm_maskz_cvtsepi32_epi8() { let a = _mm_set_epi32(13, 14, 15, 16); let r = _mm_maskz_cvtsepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48651,7 +50505,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtusepi32_epi16() { + fn test_mm512_cvtusepi32_epi16() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48665,7 +50519,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtusepi32_epi16() { + fn test_mm512_mask_cvtusepi32_epi16() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48682,7 +50536,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtusepi32_epi16() { + fn test_mm512_maskz_cvtusepi32_epi16() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48698,7 +50552,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtusepi32_epi16() { + fn test_mm256_cvtusepi32_epi16() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_cvtusepi32_epi16(a); let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); @@ -48706,7 +50560,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtusepi32_epi16() { + fn test_mm256_mask_cvtusepi32_epi16() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set1_epi16(0); let r = _mm256_mask_cvtusepi32_epi16(src, 0, a); @@ -48717,7 +50571,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtusepi32_epi16() { + fn test_mm256_maskz_cvtusepi32_epi16() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_cvtusepi32_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48727,7 +50581,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtusepi32_epi16() { + fn test_mm_cvtusepi32_epi16() { let a = _mm_set_epi32(5, 6, 7, 8); let r = _mm_cvtusepi32_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 5, 6, 7, 8); @@ -48735,7 +50589,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtusepi32_epi16() { + fn test_mm_mask_cvtusepi32_epi16() { let a = _mm_set_epi32(5, 6, 7, 8); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtusepi32_epi16(src, 0, a); @@ -48746,7 +50600,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtusepi32_epi16() { + fn test_mm_maskz_cvtusepi32_epi16() { let a = _mm_set_epi32(5, 6, 7, 8); let r = _mm_maskz_cvtusepi32_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48756,7 +50610,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtusepi32_epi8() { + fn test_mm512_cvtusepi32_epi8() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48770,7 +50624,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtusepi32_epi8() { + fn test_mm512_mask_cvtusepi32_epi8() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48787,7 +50641,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtusepi32_epi8() { + fn test_mm512_maskz_cvtusepi32_epi8() { #[rustfmt::skip] let a = _mm512_set_epi32( 0, 1, 2, 3, @@ -48803,7 +50657,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtusepi32_epi8() { + fn test_mm256_cvtusepi32_epi8() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, i32::MAX); let r = _mm256_cvtusepi32_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, u8::MAX as i8); @@ -48811,7 +50665,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtusepi32_epi8() { + fn test_mm256_mask_cvtusepi32_epi8() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, i32::MAX); let src = _mm_set1_epi8(0); let r = _mm256_mask_cvtusepi32_epi8(src, 0, a); @@ -48822,7 +50676,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtusepi32_epi8() { + fn test_mm256_maskz_cvtusepi32_epi8() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, i32::MAX); let r = _mm256_maskz_cvtusepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48832,7 +50686,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtusepi32_epi8() { + fn test_mm_cvtusepi32_epi8() { let a = _mm_set_epi32(5, 6, 7, i32::MAX); let r = _mm_cvtusepi32_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, u8::MAX as i8); @@ -48840,7 +50694,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtusepi32_epi8() { + fn test_mm_mask_cvtusepi32_epi8() { let a = _mm_set_epi32(5, 6, 7, i32::MAX); let src = _mm_set1_epi8(0); let r = _mm_mask_cvtusepi32_epi8(src, 0, a); @@ -48851,7 +50705,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtusepi32_epi8() { + fn test_mm_maskz_cvtusepi32_epi8() { let a = _mm_set_epi32(5, 6, 7, i32::MAX); let r = _mm_maskz_cvtusepi32_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -48861,7 +50715,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundps_epi32() { + fn test_mm512_cvt_roundps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -48874,7 +50728,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundps_epi32() { + fn test_mm512_mask_cvt_roundps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -48893,7 +50747,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundps_epi32() { + fn test_mm512_maskz_cvt_roundps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -48910,7 +50764,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundps_epu32() { + fn test_mm512_cvt_roundps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -48923,7 +50777,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundps_epu32() { + fn test_mm512_mask_cvt_roundps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -48942,7 +50796,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundps_epu32() { + fn test_mm512_maskz_cvt_roundps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -48959,7 +50813,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundepi32_ps() { + fn test_mm512_cvt_roundepi32_ps() { let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16); let r = _mm512_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_setr_ps( @@ -48969,7 +50823,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundepi32_ps() { + fn test_mm512_mask_cvt_roundepi32_ps() { let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16); let src = _mm512_set1_ps(0.); let r = _mm512_mask_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -48988,7 +50842,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundepi32_ps() { + fn test_mm512_maskz_cvt_roundepi32_ps() { let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16); let r = _mm512_maskz_cvt_roundepi32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0, a, @@ -49005,7 +50859,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundepu32_ps() { + fn test_mm512_cvt_roundepu32_ps() { let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16); let r = _mm512_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); #[rustfmt::skip] @@ -49019,7 +50873,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundepu32_ps() { + fn test_mm512_mask_cvt_roundepu32_ps() { let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16); let src = _mm512_set1_ps(0.); let r = _mm512_mask_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -49042,7 +50896,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundepu32_ps() { + fn test_mm512_maskz_cvt_roundepu32_ps() { let a = _mm512_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8, 8, 10, 10, 12, 12, 14, 14, 16); let r = _mm512_maskz_cvt_roundepu32_ps::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0, a, @@ -49063,7 +50917,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundps_ph() { + fn test_mm512_cvt_roundps_ph() { let a = _mm512_set1_ps(1.); let r = _mm512_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(a); let e = _mm256_setr_epi64x( @@ -49076,7 +50930,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundps_ph() { + fn test_mm512_mask_cvt_roundps_ph() { let a = _mm512_set1_ps(1.); let src = _mm256_set1_epi16(0); let r = _mm512_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -49087,7 +50941,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundps_ph() { + fn test_mm512_maskz_cvt_roundps_ph() { let a = _mm512_set1_ps(1.); let r = _mm512_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -49097,7 +50951,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvt_roundps_ph() { + fn test_mm256_mask_cvt_roundps_ph() { let a = _mm256_set1_ps(1.); let src = _mm_set1_epi16(0); let r = _mm256_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -49108,7 +50962,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvt_roundps_ph() { + fn test_mm256_maskz_cvt_roundps_ph() { let a = _mm256_set1_ps(1.); let r = _mm256_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -49118,7 +50972,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvt_roundps_ph() { + fn test_mm_mask_cvt_roundps_ph() { let a = _mm_set1_ps(1.); let src = _mm_set1_epi16(0); let r = _mm_mask_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -49129,7 +50983,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvt_roundps_ph() { + fn test_mm_maskz_cvt_roundps_ph() { let a = _mm_set1_ps(1.); let r = _mm_maskz_cvt_roundps_ph::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -49139,7 +50993,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtps_ph() { + fn test_mm512_cvtps_ph() { let a = _mm512_set1_ps(1.); let r = _mm512_cvtps_ph::<_MM_FROUND_NO_EXC>(a); let e = _mm256_setr_epi64x( @@ -49152,7 +51006,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtps_ph() { + fn test_mm512_mask_cvtps_ph() { let a = _mm512_set1_ps(1.); let src = _mm256_set1_epi16(0); let r = _mm512_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -49163,7 +51017,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtps_ph() { + fn test_mm512_maskz_cvtps_ph() { let a = _mm512_set1_ps(1.); let r = _mm512_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -49173,7 +51027,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtps_ph() { + fn test_mm256_mask_cvtps_ph() { let a = _mm256_set1_ps(1.); let src = _mm_set1_epi16(0); let r = _mm256_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -49184,7 +51038,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtps_ph() { + fn test_mm256_maskz_cvtps_ph() { let a = _mm256_set1_ps(1.); let r = _mm256_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -49194,7 +51048,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtps_ph() { + fn test_mm_mask_cvtps_ph() { let a = _mm_set1_ps(1.); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtps_ph::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -49205,7 +51059,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtps_ph() { + fn test_mm_maskz_cvtps_ph() { let a = _mm_set1_ps(1.); let r = _mm_maskz_cvtps_ph::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -49215,7 +51069,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundph_ps() { + fn test_mm512_cvt_roundph_ps() { let a = _mm256_setr_epi64x( 4323521613979991040, 4323521613979991040, @@ -49228,7 +51082,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundph_ps() { + fn test_mm512_mask_cvt_roundph_ps() { let a = _mm256_setr_epi64x( 4323521613979991040, 4323521613979991040, @@ -49246,7 +51100,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundph_ps() { + fn test_mm512_maskz_cvt_roundph_ps() { let a = _mm256_setr_epi64x( 4323521613979991040, 4323521613979991040, @@ -49263,7 +51117,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtph_ps() { + fn test_mm512_cvtph_ps() { let a = _mm256_setr_epi64x( 4323521613979991040, 4323521613979991040, @@ -49276,7 +51130,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtph_ps() { + fn test_mm512_mask_cvtph_ps() { let a = _mm256_setr_epi64x( 4323521613979991040, 4323521613979991040, @@ -49294,7 +51148,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtph_ps() { + fn test_mm512_maskz_cvtph_ps() { let a = _mm256_setr_epi64x( 4323521613979991040, 4323521613979991040, @@ -49311,7 +51165,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtph_ps() { + fn test_mm256_mask_cvtph_ps() { let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040); let src = _mm256_set1_ps(0.); let r = _mm256_mask_cvtph_ps(src, 0, a); @@ -49322,7 +51176,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_ps() { + fn test_mm256_maskz_cvtph_ps() { let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040); let r = _mm256_maskz_cvtph_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -49332,7 +51186,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtph_ps() { + fn test_mm_mask_cvtph_ps() { let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040); let src = _mm_set1_ps(0.); let r = _mm_mask_cvtph_ps(src, 0, a); @@ -49343,7 +51197,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtph_ps() { + fn test_mm_maskz_cvtph_ps() { let a = _mm_setr_epi64x(4323521613979991040, 4323521613979991040); let r = _mm_maskz_cvtph_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -49353,7 +51207,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtt_roundps_epi32() { + fn test_mm512_cvtt_roundps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49363,7 +51217,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtt_roundps_epi32() { + fn test_mm512_mask_cvtt_roundps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49376,7 +51230,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtt_roundps_epi32() { + fn test_mm512_maskz_cvtt_roundps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49388,7 +51242,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtt_roundps_epu32() { + fn test_mm512_cvtt_roundps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49398,7 +51252,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtt_roundps_epu32() { + fn test_mm512_mask_cvtt_roundps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49411,7 +51265,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtt_roundps_epu32() { + fn test_mm512_maskz_cvtt_roundps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49423,7 +51277,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvttps_epi32() { + fn test_mm512_cvttps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49433,7 +51287,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvttps_epi32() { + fn test_mm512_mask_cvttps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49446,7 +51300,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvttps_epi32() { + fn test_mm512_maskz_cvttps_epi32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49458,7 +51312,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvttps_epi32() { + fn test_mm256_mask_cvttps_epi32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let src = _mm256_set1_epi32(0); let r = _mm256_mask_cvttps_epi32(src, 0, a); @@ -49469,7 +51323,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvttps_epi32() { + fn test_mm256_maskz_cvttps_epi32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let r = _mm256_maskz_cvttps_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -49479,7 +51333,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvttps_epi32() { + fn test_mm_mask_cvttps_epi32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvttps_epi32(src, 0, a); @@ -49490,7 +51344,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvttps_epi32() { + fn test_mm_maskz_cvttps_epi32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let r = _mm_maskz_cvttps_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -49500,7 +51354,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvttps_epu32() { + fn test_mm512_cvttps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49510,7 +51364,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvttps_epu32() { + fn test_mm512_mask_cvttps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49523,7 +51377,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvttps_epu32() { + fn test_mm512_maskz_cvttps_epu32() { let a = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5, ); @@ -49535,7 +51389,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvttps_epu32() { + fn test_mm256_cvttps_epu32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let r = _mm256_cvttps_epu32(a); let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); @@ -49543,7 +51397,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvttps_epu32() { + fn test_mm256_mask_cvttps_epu32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let src = _mm256_set1_epi32(0); let r = _mm256_mask_cvttps_epu32(src, 0, a); @@ -49554,7 +51408,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvttps_epu32() { + fn test_mm256_maskz_cvttps_epu32() { let a = _mm256_set_ps(8., 9.5, 10., 11.5, 12., 13.5, 14., 15.5); let r = _mm256_maskz_cvttps_epu32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -49564,7 +51418,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvttps_epu32() { + fn test_mm_cvttps_epu32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let r = _mm_cvttps_epu32(a); let e = _mm_set_epi32(12, 13, 14, 15); @@ -49572,7 +51426,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvttps_epu32() { + fn test_mm_mask_cvttps_epu32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvttps_epu32(src, 0, a); @@ -49583,7 +51437,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvttps_epu32() { + fn test_mm_maskz_cvttps_epu32() { let a = _mm_set_ps(12., 13.5, 14., 15.5); let r = _mm_maskz_cvttps_epu32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -49721,7 +51575,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmplt_ps_mask() { + fn test_mm512_cmplt_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49731,7 +51585,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmplt_ps_mask() { + fn test_mm512_mask_cmplt_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49742,7 +51596,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpnlt_ps_mask() { + fn test_mm512_cmpnlt_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49751,7 +51605,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpnlt_ps_mask() { + fn test_mm512_mask_cmpnlt_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49761,7 +51615,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpnle_ps_mask() { + fn test_mm512_cmpnle_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49771,7 +51625,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpnle_ps_mask() { + fn test_mm512_mask_cmpnle_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49782,7 +51636,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmple_ps_mask() { + fn test_mm512_cmple_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49791,7 +51645,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmple_ps_mask() { + fn test_mm512_mask_cmple_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100., 0., 1., -1., f32::MAX, f32::NAN, f32::MIN, 100., -100.); @@ -49801,7 +51655,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpeq_ps_mask() { + fn test_mm512_cmpeq_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100., 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.); @@ -49813,7 +51667,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpeq_ps_mask() { + fn test_mm512_mask_cmpeq_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100., 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.); @@ -49826,7 +51680,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpneq_ps_mask() { + fn test_mm512_cmpneq_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100., 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.); @@ -49838,7 +51692,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpneq_ps_mask() { + fn test_mm512_mask_cmpneq_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100., 0., 1., -1., 13., f32::MAX, f32::MIN, f32::NAN, -100.); @@ -49851,7 +51705,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_ps_mask() { + fn test_mm512_cmp_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100., 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.); @@ -49861,7 +51715,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_ps_mask() { + fn test_mm512_mask_cmp_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100., 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.); @@ -49872,7 +51726,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmp_ps_mask() { + fn test_mm256_cmp_ps_mask() { let a = _mm256_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.); let b = _mm256_set1_ps(-1.); let m = _mm256_cmp_ps_mask::<_CMP_LT_OQ>(a, b); @@ -49880,7 +51734,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmp_ps_mask() { + fn test_mm256_mask_cmp_ps_mask() { let a = _mm256_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.); let b = _mm256_set1_ps(-1.); let mask = 0b01100110; @@ -49889,7 +51743,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmp_ps_mask() { + fn test_mm_cmp_ps_mask() { let a = _mm_set_ps(0., 1., -1., 13.); let b = _mm_set1_ps(1.); let m = _mm_cmp_ps_mask::<_CMP_LT_OQ>(a, b); @@ -49897,7 +51751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmp_ps_mask() { + fn test_mm_mask_cmp_ps_mask() { let a = _mm_set_ps(0., 1., -1., 13.); let b = _mm_set1_ps(1.); let mask = 0b11111111; @@ -49906,7 +51760,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_round_ps_mask() { + fn test_mm512_cmp_round_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100., 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.); @@ -49916,7 +51770,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_round_ps_mask() { + fn test_mm512_mask_cmp_round_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100., 0., 1., -1., 13., f32::MAX, f32::MIN, 100., -100.); @@ -49927,7 +51781,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpord_ps_mask() { + fn test_mm512_cmpord_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0., f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.); @@ -49939,7 +51793,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpord_ps_mask() { + fn test_mm512_mask_cmpord_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0., f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.); @@ -49952,7 +51806,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpunord_ps_mask() { + fn test_mm512_cmpunord_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0., f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.); @@ -49965,7 +51819,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpunord_ps_mask() { + fn test_mm512_mask_cmpunord_ps_mask() { #[rustfmt::skip] let a = _mm512_set_ps(f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, -1., f32::NAN, 0., f32::NAN, f32::MAX, f32::NAN, f32::MIN, f32::NAN, 1., f32::NAN, 2.); @@ -49978,7 +51832,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cmp_ss_mask() { + fn test_mm_cmp_ss_mask() { let a = _mm_setr_ps(2., 1., 1., 1.); let b = _mm_setr_ps(1., 2., 2., 2.); let m = _mm_cmp_ss_mask::<_CMP_GE_OS>(a, b); @@ -49986,7 +51840,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cmp_ss_mask() { + fn test_mm_mask_cmp_ss_mask() { let a = _mm_setr_ps(2., 1., 1., 1.); let b = _mm_setr_ps(1., 2., 2., 2.); let m = _mm_mask_cmp_ss_mask::<_CMP_GE_OS>(0b10, a, b); @@ -49996,7 +51850,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cmp_round_ss_mask() { + fn test_mm_cmp_round_ss_mask() { let a = _mm_setr_ps(2., 1., 1., 1.); let b = _mm_setr_ps(1., 2., 2., 2.); let m = _mm_cmp_round_ss_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(a, b); @@ -50004,7 +51858,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cmp_round_ss_mask() { + fn test_mm_mask_cmp_round_ss_mask() { let a = _mm_setr_ps(2., 1., 1., 1.); let b = _mm_setr_ps(1., 2., 2., 2.); let m = _mm_mask_cmp_round_ss_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(0b10, a, b); @@ -50014,7 +51868,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cmp_sd_mask() { + fn test_mm_cmp_sd_mask() { let a = _mm_setr_pd(2., 1.); let b = _mm_setr_pd(1., 2.); let m = _mm_cmp_sd_mask::<_CMP_GE_OS>(a, b); @@ -50022,7 +51876,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cmp_sd_mask() { + fn test_mm_mask_cmp_sd_mask() { let a = _mm_setr_pd(2., 1.); let b = _mm_setr_pd(1., 2.); let m = _mm_mask_cmp_sd_mask::<_CMP_GE_OS>(0b10, a, b); @@ -50032,7 +51886,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cmp_round_sd_mask() { + fn test_mm_cmp_round_sd_mask() { let a = _mm_setr_pd(2., 1.); let b = _mm_setr_pd(1., 2.); let m = _mm_cmp_round_sd_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(a, b); @@ -50040,7 +51894,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cmp_round_sd_mask() { + fn test_mm_mask_cmp_round_sd_mask() { let a = _mm_setr_pd(2., 1.); let b = _mm_setr_pd(1., 2.); let m = _mm_mask_cmp_round_sd_mask::<_CMP_GE_OS, _MM_FROUND_CUR_DIRECTION>(0b10, a, b); @@ -50050,7 +51904,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmplt_epu32_mask() { + const fn test_mm512_cmplt_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50060,7 +51914,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmplt_epu32_mask() { + const fn test_mm512_mask_cmplt_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50071,7 +51925,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmplt_epu32_mask() { + const fn test_mm256_cmplt_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 101, 100, 99); let b = _mm256_set1_epi32(1); let r = _mm256_cmplt_epu32_mask(a, b); @@ -50079,7 +51933,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epu32_mask() { + const fn test_mm256_mask_cmplt_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 101, 100, 99); let b = _mm256_set1_epi32(1); let mask = 0b11111111; @@ -50088,7 +51942,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmplt_epu32_mask() { + const fn test_mm_cmplt_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let r = _mm_cmplt_epu32_mask(a, b); @@ -50096,7 +51950,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmplt_epu32_mask() { + const fn test_mm_mask_cmplt_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let mask = 0b11111111; @@ -50105,7 +51959,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpgt_epu32_mask() { + const fn test_mm512_cmpgt_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50115,7 +51969,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpgt_epu32_mask() { + const fn test_mm512_mask_cmpgt_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50126,7 +51980,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpgt_epu32_mask() { + const fn test_mm256_cmpgt_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 99, 100, 101); let b = _mm256_set1_epi32(1); let r = _mm256_cmpgt_epu32_mask(a, b); @@ -50134,7 +51988,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epu32_mask() { + const fn test_mm256_mask_cmpgt_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 99, 100, 101); let b = _mm256_set1_epi32(1); let mask = 0b11111111; @@ -50143,7 +51997,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpgt_epu32_mask() { + const fn test_mm_cmpgt_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let r = _mm_cmpgt_epu32_mask(a, b); @@ -50151,7 +52005,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epu32_mask() { + const fn test_mm_mask_cmpgt_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let mask = 0b11111111; @@ -50160,7 +52014,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmple_epu32_mask() { + const fn test_mm512_cmple_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50172,7 +52026,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmple_epu32_mask() { + const fn test_mm512_mask_cmple_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50185,7 +52039,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmple_epu32_mask() { + const fn test_mm256_cmple_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 200, 100, 101); let b = _mm256_set1_epi32(1); let r = _mm256_cmple_epu32_mask(a, b); @@ -50193,7 +52047,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmple_epu32_mask() { + const fn test_mm256_mask_cmple_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 200, 100, 101); let b = _mm256_set1_epi32(1); let mask = 0b11111111; @@ -50202,7 +52056,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmple_epu32_mask() { + const fn test_mm_cmple_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let r = _mm_cmple_epu32_mask(a, b); @@ -50210,7 +52064,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmple_epu32_mask() { + const fn test_mm_mask_cmple_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let mask = 0b11111111; @@ -50219,7 +52073,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpge_epu32_mask() { + const fn test_mm512_cmpge_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50231,7 +52085,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpge_epu32_mask() { + const fn test_mm512_mask_cmpge_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50241,7 +52095,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpge_epu32_mask() { + const fn test_mm256_cmpge_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 300, 100, 200); let b = _mm256_set1_epi32(1); let r = _mm256_cmpge_epu32_mask(a, b); @@ -50249,7 +52103,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epu32_mask() { + const fn test_mm256_mask_cmpge_epu32_mask() { let a = _mm256_set_epi32(0, 1, 2, u32::MAX as i32, i32::MAX, 300, 100, 200); let b = _mm256_set1_epi32(1); let mask = 0b11111111; @@ -50258,7 +52112,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpge_epu32_mask() { + const fn test_mm_cmpge_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let r = _mm_cmpge_epu32_mask(a, b); @@ -50266,7 +52120,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpge_epu32_mask() { + const fn test_mm_mask_cmpge_epu32_mask() { let a = _mm_set_epi32(0, 1, 2, u32::MAX as i32); let b = _mm_set1_epi32(1); let mask = 0b11111111; @@ -50275,7 +52129,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpeq_epu32_mask() { + const fn test_mm512_cmpeq_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50287,7 +52141,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpeq_epu32_mask() { + const fn test_mm512_mask_cmpeq_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50300,7 +52154,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpeq_epu32_mask() { + const fn test_mm256_cmpeq_epu32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100); let m = _mm256_cmpeq_epu32_mask(b, a); @@ -50308,7 +52162,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epu32_mask() { + const fn test_mm256_mask_cmpeq_epu32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100); let mask = 0b01111010; @@ -50317,7 +52171,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpeq_epu32_mask() { + const fn test_mm_cmpeq_epu32_mask() { let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32); let b = _mm_set_epi32(0, 1, 13, 42); let m = _mm_cmpeq_epu32_mask(b, a); @@ -50325,7 +52179,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epu32_mask() { + const fn test_mm_mask_cmpeq_epu32_mask() { let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32); let b = _mm_set_epi32(0, 1, 13, 42); let mask = 0b11111111; @@ -50334,7 +52188,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpneq_epu32_mask() { + const fn test_mm512_cmpneq_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50346,7 +52200,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpneq_epu32_mask() { + const fn test_mm512_mask_cmpneq_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100); @@ -50359,7 +52213,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpneq_epu32_mask() { + const fn test_mm256_cmpneq_epu32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, -100, 100); let r = _mm256_cmpneq_epu32_mask(b, a); @@ -50367,7 +52221,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epu32_mask() { + const fn test_mm256_mask_cmpneq_epu32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, -100, 100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, -100, 100); let mask = 0b11111111; @@ -50376,7 +52230,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpneq_epu32_mask() { + const fn test_mm_cmpneq_epu32_mask() { let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32); let b = _mm_set_epi32(0, 1, 13, 42); let r = _mm_cmpneq_epu32_mask(b, a); @@ -50384,7 +52238,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epu32_mask() { + const fn test_mm_mask_cmpneq_epu32_mask() { let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32); let b = _mm_set_epi32(0, 1, 13, 42); let mask = 0b11111111; @@ -50393,7 +52247,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_epu32_mask() { + const fn test_mm512_cmp_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50403,7 +52257,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_epu32_mask() { + const fn test_mm512_mask_cmp_epu32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50414,7 +52268,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmp_epu32_mask() { + const fn test_mm256_cmp_epu32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let m = _mm256_cmp_epu32_mask::<_MM_CMPINT_LT>(a, b); @@ -50422,7 +52276,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmp_epu32_mask() { + const fn test_mm256_mask_cmp_epu32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let mask = 0b11111111; @@ -50431,7 +52285,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmp_epu32_mask() { + const fn test_mm_cmp_epu32_mask() { let a = _mm_set_epi32(0, 1, -1, i32::MAX); let b = _mm_set1_epi32(1); let m = _mm_cmp_epu32_mask::<_MM_CMPINT_LT>(a, b); @@ -50439,7 +52293,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmp_epu32_mask() { + const fn test_mm_mask_cmp_epu32_mask() { let a = _mm_set_epi32(0, 1, -1, i32::MAX); let b = _mm_set1_epi32(1); let mask = 0b11111111; @@ -50448,7 +52302,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmplt_epi32_mask() { + const fn test_mm512_cmplt_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50458,7 +52312,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmplt_epi32_mask() { + const fn test_mm512_mask_cmplt_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50469,7 +52323,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmplt_epi32_mask() { + const fn test_mm256_cmplt_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 101, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let r = _mm256_cmplt_epi32_mask(a, b); @@ -50477,7 +52331,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epi32_mask() { + const fn test_mm256_mask_cmplt_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 101, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let mask = 0b11111111; @@ -50486,7 +52340,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmplt_epi32_mask() { + const fn test_mm_cmplt_epi32_mask() { let a = _mm_set_epi32(i32::MAX, i32::MIN, 100, -100); let b = _mm_set1_epi32(-1); let r = _mm_cmplt_epi32_mask(a, b); @@ -50494,7 +52348,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmplt_epi32_mask() { + const fn test_mm_mask_cmplt_epi32_mask() { let a = _mm_set_epi32(i32::MAX, i32::MIN, 100, -100); let b = _mm_set1_epi32(-1); let mask = 0b11111111; @@ -50503,7 +52357,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpgt_epi32_mask() { + const fn test_mm512_cmpgt_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50513,7 +52367,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpgt_epi32_mask() { + const fn test_mm512_mask_cmpgt_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50524,7 +52378,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpgt_epi32_mask() { + const fn test_mm256_cmpgt_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let r = _mm256_cmpgt_epi32_mask(a, b); @@ -50532,7 +52386,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epi32_mask() { + const fn test_mm256_mask_cmpgt_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let mask = 0b11111111; @@ -50541,7 +52395,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpgt_epi32_mask() { + const fn test_mm_cmpgt_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set1_epi32(-1); let r = _mm_cmpgt_epi32_mask(a, b); @@ -50549,7 +52403,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epi32_mask() { + const fn test_mm_mask_cmpgt_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set1_epi32(-1); let mask = 0b11111111; @@ -50558,7 +52412,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmple_epi32_mask() { + const fn test_mm512_cmple_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50570,7 +52424,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmple_epi32_mask() { + const fn test_mm512_mask_cmple_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50580,7 +52434,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmple_epi32_mask() { + const fn test_mm256_cmple_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 200, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let r = _mm256_cmple_epi32_mask(a, b); @@ -50588,7 +52442,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmple_epi32_mask() { + const fn test_mm256_mask_cmple_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 200, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let mask = 0b11111111; @@ -50597,7 +52451,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmple_epi32_mask() { + const fn test_mm_cmple_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 200); let b = _mm_set1_epi32(-1); let r = _mm_cmple_epi32_mask(a, b); @@ -50605,7 +52459,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmple_epi32_mask() { + const fn test_mm_mask_cmple_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 200); let b = _mm_set1_epi32(-1); let mask = 0b11111111; @@ -50614,7 +52468,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpge_epi32_mask() { + const fn test_mm512_cmpge_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50626,7 +52480,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpge_epi32_mask() { + const fn test_mm512_mask_cmpge_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); @@ -50639,7 +52493,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpge_epi32_mask() { + const fn test_mm256_cmpge_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let r = _mm256_cmpge_epi32_mask(a, b); @@ -50647,7 +52501,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epi32_mask() { + const fn test_mm256_mask_cmpge_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, u32::MAX as i32, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let mask = 0b11111111; @@ -50656,7 +52510,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpge_epi32_mask() { + const fn test_mm_cmpge_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32); let b = _mm_set1_epi32(-1); let r = _mm_cmpge_epi32_mask(a, b); @@ -50664,7 +52518,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpge_epi32_mask() { + const fn test_mm_mask_cmpge_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, u32::MAX as i32); let b = _mm_set1_epi32(-1); let mask = 0b11111111; @@ -50673,7 +52527,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpeq_epi32_mask() { + const fn test_mm512_cmpeq_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50685,7 +52539,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpeq_epi32_mask() { + const fn test_mm512_mask_cmpeq_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50698,7 +52552,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpeq_epi32_mask() { + const fn test_mm256_cmpeq_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100); let m = _mm256_cmpeq_epi32_mask(b, a); @@ -50706,7 +52560,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epi32_mask() { + const fn test_mm256_mask_cmpeq_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100); let mask = 0b01111010; @@ -50715,7 +52569,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpeq_epi32_mask() { + const fn test_mm_cmpeq_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set_epi32(0, 1, 13, 42); let m = _mm_cmpeq_epi32_mask(b, a); @@ -50723,7 +52577,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epi32_mask() { + const fn test_mm_mask_cmpeq_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set_epi32(0, 1, 13, 42); let mask = 0b11111111; @@ -50732,7 +52586,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpneq_epi32_mask() { + const fn test_mm512_cmpneq_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50744,7 +52598,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpneq_epi32_mask() { + const fn test_mm512_mask_cmpneq_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, -100, 100, 0, 1, -1, 13, i32::MAX, i32::MIN, -100, 100); @@ -50757,7 +52611,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpneq_epi32_mask() { + const fn test_mm256_cmpneq_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100); let m = _mm256_cmpneq_epi32_mask(b, a); @@ -50765,7 +52619,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epi32_mask() { + const fn test_mm256_mask_cmpneq_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, -100, 100); let b = _mm256_set_epi32(0, 1, 13, 42, i32::MAX, i32::MIN, 100, -100); let mask = 0b11111111; @@ -50774,7 +52628,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpneq_epi32_mask() { + const fn test_mm_cmpneq_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set_epi32(0, 1, 13, 42); let r = _mm_cmpneq_epi32_mask(b, a); @@ -50782,7 +52636,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epi32_mask() { + const fn test_mm_mask_cmpneq_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set_epi32(0, 1, 13, 42); let mask = 0b11111111; @@ -50791,7 +52645,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_epi32_mask() { + const fn test_mm512_cmp_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50801,7 +52655,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_epi32_mask() { + const fn test_mm512_mask_cmp_epi32_mask() { #[rustfmt::skip] let a = _mm512_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100, 0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); @@ -50812,7 +52666,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmp_epi32_mask() { + const fn test_mm256_cmp_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let m = _mm256_cmp_epi32_mask::<_MM_CMPINT_LT>(a, b); @@ -50820,7 +52674,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmp_epi32_mask() { + const fn test_mm256_mask_cmp_epi32_mask() { let a = _mm256_set_epi32(0, 1, -1, 13, i32::MAX, i32::MIN, 100, -100); let b = _mm256_set1_epi32(-1); let mask = 0b01100110; @@ -50829,7 +52683,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmp_epi32_mask() { + const fn test_mm_cmp_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set1_epi32(1); let m = _mm_cmp_epi32_mask::<_MM_CMPINT_LT>(a, b); @@ -50837,7 +52691,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmp_epi32_mask() { + const fn test_mm_mask_cmp_epi32_mask() { let a = _mm_set_epi32(0, 1, -1, 13); let b = _mm_set1_epi32(1); let mask = 0b11111111; @@ -50846,7 +52700,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set_epi8() { + const fn test_mm512_set_epi8() { let r = _mm512_set1_epi8(2); assert_eq_m512i( r, @@ -50859,7 +52713,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set_epi16() { + const fn test_mm512_set_epi16() { let r = _mm512_set1_epi16(2); assert_eq_m512i( r, @@ -50871,7 +52725,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set_epi32() { + const fn test_mm512_set_epi32() { let r = _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); assert_eq_m512i( r, @@ -50880,7 +52734,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr_epi32() { + const fn test_mm512_setr_epi32() { let r = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); assert_eq_m512i( r, @@ -50889,7 +52743,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set1_epi8() { + const fn test_mm512_set1_epi8() { let r = _mm512_set_epi8( 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -50899,7 +52753,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set1_epi16() { + const fn test_mm512_set1_epi16() { let r = _mm512_set_epi16( 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -50908,23 +52762,23 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set1_epi32() { + const fn test_mm512_set1_epi32() { let r = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); assert_eq_m512i(r, _mm512_set1_epi32(2)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setzero_si512() { + const fn test_mm512_setzero_si512() { assert_eq_m512i(_mm512_set1_epi32(0), _mm512_setzero_si512()); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setzero_epi32() { + const fn test_mm512_setzero_epi32() { assert_eq_m512i(_mm512_set1_epi32(0), _mm512_setzero_epi32()); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set_ps() { + const fn test_mm512_set_ps() { let r = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -50937,7 +52791,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr_ps() { + const fn test_mm512_setr_ps() { let r = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -50950,7 +52804,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set1_ps() { + const fn test_mm512_set1_ps() { #[rustfmt::skip] let expected = _mm512_set_ps(2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.); @@ -50958,13 +52812,13 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set4_epi32() { + const fn test_mm512_set4_epi32() { let r = _mm512_set_epi32(4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1); assert_eq_m512i(r, _mm512_set4_epi32(4, 3, 2, 1)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set4_ps() { + const fn test_mm512_set4_ps() { let r = _mm512_set_ps( 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1., ); @@ -50972,13 +52826,13 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr4_epi32() { + const fn test_mm512_setr4_epi32() { let r = _mm512_set_epi32(4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1); assert_eq_m512i(r, _mm512_setr4_epi32(1, 2, 3, 4)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr4_ps() { + const fn test_mm512_setr4_ps() { let r = _mm512_set_ps( 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1., 4., 3., 2., 1., ); @@ -50986,17 +52840,17 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setzero_ps() { + const fn test_mm512_setzero_ps() { assert_eq_m512(_mm512_setzero_ps(), _mm512_set1_ps(0.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setzero() { + const fn test_mm512_setzero() { assert_eq_m512(_mm512_setzero(), _mm512_set1_ps(0.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_loadu_pd() { + const unsafe fn test_mm512_loadu_pd() { let a = &[4., 3., 2., 5., 8., 9., 64., 50.]; let p = a.as_ptr(); let r = _mm512_loadu_pd(black_box(p)); @@ -51005,7 +52859,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_storeu_pd() { + const unsafe fn test_mm512_storeu_pd() { let a = _mm512_set1_pd(9.); let mut r = _mm512_undefined_pd(); _mm512_storeu_pd(&mut r as *mut _ as *mut f64, a); @@ -51013,7 +52867,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_loadu_ps() { + const unsafe fn test_mm512_loadu_ps() { let a = &[ 4., 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50., ]; @@ -51026,7 +52880,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_storeu_ps() { + const unsafe fn test_mm512_storeu_ps() { let a = _mm512_set1_ps(9.); let mut r = _mm512_undefined_ps(); _mm512_storeu_ps(&mut r as *mut _ as *mut f32, a); @@ -51034,7 +52888,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_loadu_epi32() { + const unsafe fn test_mm512_mask_loadu_epi32() { let src = _mm512_set1_epi32(42); let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let p = a.as_ptr(); @@ -51045,7 +52899,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_loadu_epi32() { + const unsafe fn test_mm512_maskz_loadu_epi32() { let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let p = a.as_ptr(); let m = 0b11101000_11001010; @@ -51055,7 +52909,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_load_epi32() { + const unsafe fn test_mm512_mask_load_epi32() { #[repr(align(64))] struct Align { data: [i32; 16], // 64 bytes @@ -51072,7 +52926,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_load_epi32() { + const unsafe fn test_mm512_maskz_load_epi32() { #[repr(align(64))] struct Align { data: [i32; 16], // 64 bytes @@ -51088,7 +52942,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_storeu_epi32() { + const unsafe fn test_mm512_mask_storeu_epi32() { let mut r = [42_i32; 16]; let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let m = 0b11101000_11001010; @@ -51098,7 +52952,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_store_epi32() { + const unsafe fn test_mm512_mask_store_epi32() { #[repr(align(64))] struct Align { data: [i32; 16], @@ -51112,7 +52966,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_loadu_epi64() { + const unsafe fn test_mm512_mask_loadu_epi64() { let src = _mm512_set1_epi64(42); let a = &[1_i64, 2, 3, 4, 5, 6, 7, 8]; let p = a.as_ptr(); @@ -51123,7 +52977,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_loadu_epi64() { + const unsafe fn test_mm512_maskz_loadu_epi64() { let a = &[1_i64, 2, 3, 4, 5, 6, 7, 8]; let p = a.as_ptr(); let m = 0b11001010; @@ -51133,7 +52987,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_load_epi64() { + const unsafe fn test_mm512_mask_load_epi64() { #[repr(align(64))] struct Align { data: [i64; 8], // 64 bytes @@ -51150,7 +53004,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_load_epi64() { + const unsafe fn test_mm512_maskz_load_epi64() { #[repr(align(64))] struct Align { data: [i64; 8], // 64 bytes @@ -51166,7 +53020,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_storeu_epi64() { + const unsafe fn test_mm512_mask_storeu_epi64() { let mut r = [42_i64; 8]; let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let m = 0b11001010; @@ -51176,7 +53030,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_store_epi64() { + const unsafe fn test_mm512_mask_store_epi64() { #[repr(align(64))] struct Align { data: [i64; 8], @@ -51191,7 +53045,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_loadu_ps() { + const unsafe fn test_mm512_mask_loadu_ps() { let src = _mm512_set1_ps(42.0); let a = &[ 1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, @@ -51208,7 +53062,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_loadu_ps() { + const unsafe fn test_mm512_maskz_loadu_ps() { let a = &[ 1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, @@ -51223,7 +53077,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_load_ps() { + const unsafe fn test_mm512_mask_load_ps() { #[repr(align(64))] struct Align { data: [f32; 16], // 64 bytes @@ -51246,7 +53100,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_load_ps() { + const unsafe fn test_mm512_maskz_load_ps() { #[repr(align(64))] struct Align { data: [f32; 16], // 64 bytes @@ -51267,7 +53121,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_storeu_ps() { + const unsafe fn test_mm512_mask_storeu_ps() { let mut r = [42_f32; 16]; let a = _mm512_setr_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, @@ -51282,7 +53136,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_store_ps() { + const unsafe fn test_mm512_mask_store_ps() { #[repr(align(64))] struct Align { data: [f32; 16], @@ -51301,7 +53155,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_loadu_pd() { + const unsafe fn test_mm512_mask_loadu_pd() { let src = _mm512_set1_pd(42.0); let a = &[1.0_f64, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let p = a.as_ptr(); @@ -51312,7 +53166,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_loadu_pd() { + const unsafe fn test_mm512_maskz_loadu_pd() { let a = &[1.0_f64, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let p = a.as_ptr(); let m = 0b11001010; @@ -51322,7 +53176,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_load_pd() { + const unsafe fn test_mm512_mask_load_pd() { #[repr(align(64))] struct Align { data: [f64; 8], // 64 bytes @@ -51339,7 +53193,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_load_pd() { + const unsafe fn test_mm512_maskz_load_pd() { #[repr(align(64))] struct Align { data: [f64; 8], // 64 bytes @@ -51355,7 +53209,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_storeu_pd() { + const unsafe fn test_mm512_mask_storeu_pd() { let mut r = [42_f64; 8]; let a = _mm512_setr_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let m = 0b11001010; @@ -51365,7 +53219,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_store_pd() { + const unsafe fn test_mm512_mask_store_pd() { #[repr(align(64))] struct Align { data: [f64; 8], @@ -51379,7 +53233,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_loadu_epi32() { + const unsafe fn test_mm256_mask_loadu_epi32() { let src = _mm256_set1_epi32(42); let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8]; let p = a.as_ptr(); @@ -51390,7 +53244,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_loadu_epi32() { + const unsafe fn test_mm256_maskz_loadu_epi32() { let a = &[1_i32, 2, 3, 4, 5, 6, 7, 8]; let p = a.as_ptr(); let m = 0b11001010; @@ -51400,7 +53254,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_load_epi32() { + const unsafe fn test_mm256_mask_load_epi32() { #[repr(align(32))] struct Align { data: [i32; 8], // 32 bytes @@ -51417,7 +53271,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_load_epi32() { + const unsafe fn test_mm256_maskz_load_epi32() { #[repr(align(32))] struct Align { data: [i32; 8], // 32 bytes @@ -51433,7 +53287,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_storeu_epi32() { + const unsafe fn test_mm256_mask_storeu_epi32() { let mut r = [42_i32; 8]; let a = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8); let m = 0b11001010; @@ -51443,7 +53297,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_store_epi32() { + const unsafe fn test_mm256_mask_store_epi32() { #[repr(align(64))] struct Align { data: [i32; 8], @@ -51457,7 +53311,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_loadu_epi64() { + const unsafe fn test_mm256_mask_loadu_epi64() { let src = _mm256_set1_epi64x(42); let a = &[1_i64, 2, 3, 4]; let p = a.as_ptr(); @@ -51468,7 +53322,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_loadu_epi64() { + const unsafe fn test_mm256_maskz_loadu_epi64() { let a = &[1_i64, 2, 3, 4]; let p = a.as_ptr(); let m = 0b1010; @@ -51478,7 +53332,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_load_epi64() { + const unsafe fn test_mm256_mask_load_epi64() { #[repr(align(32))] struct Align { data: [i64; 4], // 32 bytes @@ -51495,7 +53349,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_load_epi64() { + const unsafe fn test_mm256_maskz_load_epi64() { #[repr(align(32))] struct Align { data: [i64; 4], // 32 bytes @@ -51511,7 +53365,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_storeu_epi64() { + const unsafe fn test_mm256_mask_storeu_epi64() { let mut r = [42_i64; 4]; let a = _mm256_setr_epi64x(1, 2, 3, 4); let m = 0b1010; @@ -51521,7 +53375,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_store_epi64() { + const unsafe fn test_mm256_mask_store_epi64() { #[repr(align(32))] struct Align { data: [i64; 4], @@ -51535,7 +53389,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_loadu_ps() { + const unsafe fn test_mm256_mask_loadu_ps() { let src = _mm256_set1_ps(42.0); let a = &[1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let p = a.as_ptr(); @@ -51546,7 +53400,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_loadu_ps() { + const unsafe fn test_mm256_maskz_loadu_ps() { let a = &[1.0_f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let p = a.as_ptr(); let m = 0b11001010; @@ -51556,7 +53410,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_load_ps() { + const unsafe fn test_mm256_mask_load_ps() { #[repr(align(32))] struct Align { data: [f32; 8], // 32 bytes @@ -51573,7 +53427,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_load_ps() { + const unsafe fn test_mm256_maskz_load_ps() { #[repr(align(32))] struct Align { data: [f32; 8], // 32 bytes @@ -51589,7 +53443,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_storeu_ps() { + const unsafe fn test_mm256_mask_storeu_ps() { let mut r = [42_f32; 8]; let a = _mm256_setr_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let m = 0b11001010; @@ -51599,7 +53453,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_store_ps() { + const unsafe fn test_mm256_mask_store_ps() { #[repr(align(32))] struct Align { data: [f32; 8], @@ -51613,7 +53467,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_loadu_pd() { + const unsafe fn test_mm256_mask_loadu_pd() { let src = _mm256_set1_pd(42.0); let a = &[1.0_f64, 2.0, 3.0, 4.0]; let p = a.as_ptr(); @@ -51624,7 +53478,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_loadu_pd() { + const unsafe fn test_mm256_maskz_loadu_pd() { let a = &[1.0_f64, 2.0, 3.0, 4.0]; let p = a.as_ptr(); let m = 0b1010; @@ -51634,7 +53488,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_load_pd() { + const unsafe fn test_mm256_mask_load_pd() { #[repr(align(32))] struct Align { data: [f64; 4], // 32 bytes @@ -51651,7 +53505,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_load_pd() { + const unsafe fn test_mm256_maskz_load_pd() { #[repr(align(32))] struct Align { data: [f64; 4], // 32 bytes @@ -51667,7 +53521,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_storeu_pd() { + const unsafe fn test_mm256_mask_storeu_pd() { let mut r = [42_f64; 4]; let a = _mm256_setr_pd(1.0, 2.0, 3.0, 4.0); let m = 0b1010; @@ -51677,7 +53531,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_store_pd() { + const unsafe fn test_mm256_mask_store_pd() { #[repr(align(32))] struct Align { data: [f64; 4], @@ -51691,7 +53545,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_loadu_epi32() { + const unsafe fn test_mm_mask_loadu_epi32() { let src = _mm_set1_epi32(42); let a = &[1_i32, 2, 3, 4]; let p = a.as_ptr(); @@ -51702,7 +53556,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_loadu_epi32() { + const unsafe fn test_mm_maskz_loadu_epi32() { let a = &[1_i32, 2, 3, 4]; let p = a.as_ptr(); let m = 0b1010; @@ -51712,7 +53566,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_load_epi32() { + const unsafe fn test_mm_mask_load_epi32() { #[repr(align(16))] struct Align { data: [i32; 4], // 32 bytes @@ -51729,7 +53583,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_load_epi32() { + const unsafe fn test_mm_maskz_load_epi32() { #[repr(align(16))] struct Align { data: [i32; 4], // 16 bytes @@ -51745,7 +53599,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_storeu_epi32() { + const unsafe fn test_mm_mask_storeu_epi32() { let mut r = [42_i32; 4]; let a = _mm_setr_epi32(1, 2, 3, 4); let m = 0b1010; @@ -51755,7 +53609,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_store_epi32() { + const unsafe fn test_mm_mask_store_epi32() { #[repr(align(16))] struct Align { data: [i32; 4], // 16 bytes @@ -51769,7 +53623,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_loadu_epi64() { + const unsafe fn test_mm_mask_loadu_epi64() { let src = _mm_set1_epi64x(42); let a = &[1_i64, 2]; let p = a.as_ptr(); @@ -51780,7 +53634,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_loadu_epi64() { + const unsafe fn test_mm_maskz_loadu_epi64() { let a = &[1_i64, 2]; let p = a.as_ptr(); let m = 0b10; @@ -51790,7 +53644,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_load_epi64() { + const unsafe fn test_mm_mask_load_epi64() { #[repr(align(16))] struct Align { data: [i64; 2], // 16 bytes @@ -51805,7 +53659,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_load_epi64() { + const unsafe fn test_mm_maskz_load_epi64() { #[repr(align(16))] struct Align { data: [i64; 2], // 16 bytes @@ -51819,7 +53673,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_storeu_epi64() { + const unsafe fn test_mm_mask_storeu_epi64() { let mut r = [42_i64; 2]; let a = _mm_setr_epi64x(1, 2); let m = 0b10; @@ -51829,7 +53683,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_store_epi64() { + const unsafe fn test_mm_mask_store_epi64() { #[repr(align(16))] struct Align { data: [i64; 2], // 16 bytes @@ -51843,7 +53697,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_loadu_ps() { + const unsafe fn test_mm_mask_loadu_ps() { let src = _mm_set1_ps(42.0); let a = &[1.0_f32, 2.0, 3.0, 4.0]; let p = a.as_ptr(); @@ -51854,7 +53708,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_loadu_ps() { + const unsafe fn test_mm_maskz_loadu_ps() { let a = &[1.0_f32, 2.0, 3.0, 4.0]; let p = a.as_ptr(); let m = 0b1010; @@ -51864,7 +53718,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_load_ps() { + const unsafe fn test_mm_mask_load_ps() { #[repr(align(16))] struct Align { data: [f32; 4], // 16 bytes @@ -51881,7 +53735,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_load_ps() { + const unsafe fn test_mm_maskz_load_ps() { #[repr(align(16))] struct Align { data: [f32; 4], // 16 bytes @@ -51897,7 +53751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_storeu_ps() { + const unsafe fn test_mm_mask_storeu_ps() { let mut r = [42_f32; 4]; let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let m = 0b1010; @@ -51907,7 +53761,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_store_ps() { + const unsafe fn test_mm_mask_store_ps() { #[repr(align(16))] struct Align { data: [f32; 4], // 16 bytes @@ -51921,7 +53775,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_loadu_pd() { + const unsafe fn test_mm_mask_loadu_pd() { let src = _mm_set1_pd(42.0); let a = &[1.0_f64, 2.0]; let p = a.as_ptr(); @@ -51932,7 +53786,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_loadu_pd() { + const unsafe fn test_mm_maskz_loadu_pd() { let a = &[1.0_f64, 2.0]; let p = a.as_ptr(); let m = 0b10; @@ -51942,7 +53796,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_load_pd() { + const unsafe fn test_mm_mask_load_pd() { #[repr(align(16))] struct Align { data: [f64; 2], // 16 bytes @@ -51959,7 +53813,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_load_pd() { + const unsafe fn test_mm_maskz_load_pd() { #[repr(align(16))] struct Align { data: [f64; 2], // 16 bytes @@ -52029,7 +53883,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_storeu_pd() { + const unsafe fn test_mm_mask_storeu_pd() { let mut r = [42_f64; 2]; let a = _mm_setr_pd(1.0, 2.0); let m = 0b10; @@ -52039,7 +53893,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_store_pd() { + const unsafe fn test_mm_mask_store_pd() { #[repr(align(16))] struct Align { data: [f64; 2], // 16 bytes @@ -52081,19 +53935,19 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr_pd() { + const fn test_mm512_setr_pd() { let r = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); assert_eq_m512d(r, _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set_pd() { + const fn test_mm512_set_pd() { let r = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); assert_eq_m512d(r, _mm512_set_pd(7., 6., 5., 4., 3., 2., 1., 0.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rol_epi32() { + const fn test_mm512_rol_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let r = _mm512_rol_epi32::<1>(a); let e = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); @@ -52101,7 +53955,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rol_epi32() { + const fn test_mm512_mask_rol_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let r = _mm512_mask_rol_epi32::<1>(a, 0, a); assert_eq_m512i(r, a); @@ -52111,7 +53965,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rol_epi32() { + const fn test_mm512_maskz_rol_epi32() { let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31); let r = _mm512_maskz_rol_epi32::<1>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -52121,7 +53975,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rol_epi32() { + const fn test_mm256_rol_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let r = _mm256_rol_epi32::<1>(a); let e = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); @@ -52129,7 +53983,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rol_epi32() { + const fn test_mm256_mask_rol_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let r = _mm256_mask_rol_epi32::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -52139,7 +53993,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rol_epi32() { + const fn test_mm256_maskz_rol_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let r = _mm256_maskz_rol_epi32::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -52149,7 +54003,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rol_epi32() { + const fn test_mm_rol_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let r = _mm_rol_epi32::<1>(a); let e = _mm_set_epi32(1 << 0, 2, 2, 2); @@ -52157,7 +54011,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rol_epi32() { + const fn test_mm_mask_rol_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let r = _mm_mask_rol_epi32::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -52167,7 +54021,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rol_epi32() { + const fn test_mm_maskz_rol_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let r = _mm_maskz_rol_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -52177,7 +54031,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_ror_epi32() { + const fn test_mm512_ror_epi32() { let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let r = _mm512_ror_epi32::<1>(a); let e = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); @@ -52185,7 +54039,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_ror_epi32() { + const fn test_mm512_mask_ror_epi32() { let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let r = _mm512_mask_ror_epi32::<1>(a, 0, a); assert_eq_m512i(r, a); @@ -52195,7 +54049,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_ror_epi32() { + const fn test_mm512_maskz_ror_epi32() { let a = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 << 0); let r = _mm512_maskz_ror_epi32::<1>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -52205,7 +54059,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_ror_epi32() { + const fn test_mm256_ror_epi32() { let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); let r = _mm256_ror_epi32::<1>(a); let e = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); @@ -52213,7 +54067,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_ror_epi32() { + const fn test_mm256_mask_ror_epi32() { let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); let r = _mm256_mask_ror_epi32::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -52223,7 +54077,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_ror_epi32() { + const fn test_mm256_maskz_ror_epi32() { let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); let r = _mm256_maskz_ror_epi32::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -52233,7 +54087,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_ror_epi32() { + const fn test_mm_ror_epi32() { let a = _mm_set_epi32(1 << 0, 2, 2, 2); let r = _mm_ror_epi32::<1>(a); let e = _mm_set_epi32(1 << 31, 1, 1, 1); @@ -52241,7 +54095,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_ror_epi32() { + const fn test_mm_mask_ror_epi32() { let a = _mm_set_epi32(1 << 0, 2, 2, 2); let r = _mm_mask_ror_epi32::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -52251,7 +54105,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_ror_epi32() { + const fn test_mm_maskz_ror_epi32() { let a = _mm_set_epi32(1 << 0, 2, 2, 2); let r = _mm_maskz_ror_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -52261,7 +54115,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_slli_epi32() { + const fn test_mm512_slli_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let r = _mm512_slli_epi32::<1>(a); let e = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); @@ -52269,7 +54123,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_slli_epi32() { + const fn test_mm512_mask_slli_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let r = _mm512_mask_slli_epi32::<1>(a, 0, a); assert_eq_m512i(r, a); @@ -52279,7 +54133,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_slli_epi32() { + const fn test_mm512_maskz_slli_epi32() { let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31); let r = _mm512_maskz_slli_epi32::<1>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -52289,7 +54143,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_slli_epi32() { + const fn test_mm256_mask_slli_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let r = _mm256_mask_slli_epi32::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -52299,7 +54153,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_slli_epi32() { + const fn test_mm256_maskz_slli_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let r = _mm256_maskz_slli_epi32::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -52309,7 +54163,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_slli_epi32() { + const fn test_mm_mask_slli_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let r = _mm_mask_slli_epi32::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -52319,7 +54173,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_slli_epi32() { + const fn test_mm_maskz_slli_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let r = _mm_maskz_slli_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -52329,7 +54183,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srli_epi32() { + const fn test_mm512_srli_epi32() { let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let r = _mm512_srli_epi32::<1>(a); let e = _mm512_set_epi32(0 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); @@ -52337,7 +54191,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srli_epi32() { + const fn test_mm512_mask_srli_epi32() { let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let r = _mm512_mask_srli_epi32::<1>(a, 0, a); assert_eq_m512i(r, a); @@ -52347,7 +54201,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srli_epi32() { + const fn test_mm512_maskz_srli_epi32() { let a = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0); let r = _mm512_maskz_srli_epi32::<1>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -52357,7 +54211,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srli_epi32() { + const fn test_mm256_mask_srli_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let r = _mm256_mask_srli_epi32::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -52367,7 +54221,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srli_epi32() { + const fn test_mm256_maskz_srli_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let r = _mm256_maskz_srli_epi32::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -52377,7 +54231,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srli_epi32() { + const fn test_mm_mask_srli_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let r = _mm_mask_srli_epi32::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -52387,7 +54241,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srli_epi32() { + const fn test_mm_maskz_srli_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let r = _mm_maskz_srli_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -52397,7 +54251,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rolv_epi32() { + const fn test_mm512_rolv_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let b = _mm512_set1_epi32(1); let r = _mm512_rolv_epi32(a, b); @@ -52406,7 +54260,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rolv_epi32() { + const fn test_mm512_mask_rolv_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let b = _mm512_set1_epi32(1); let r = _mm512_mask_rolv_epi32(a, 0, a, b); @@ -52417,7 +54271,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rolv_epi32() { + const fn test_mm512_maskz_rolv_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31); let b = _mm512_set1_epi32(1); let r = _mm512_maskz_rolv_epi32(0, a, b); @@ -52428,7 +54282,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rolv_epi32() { + const fn test_mm256_rolv_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let b = _mm256_set1_epi32(1); let r = _mm256_rolv_epi32(a, b); @@ -52437,7 +54291,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rolv_epi32() { + const fn test_mm256_mask_rolv_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let b = _mm256_set1_epi32(1); let r = _mm256_mask_rolv_epi32(a, 0, a, b); @@ -52448,7 +54302,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rolv_epi32() { + const fn test_mm256_maskz_rolv_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let b = _mm256_set1_epi32(1); let r = _mm256_maskz_rolv_epi32(0, a, b); @@ -52459,7 +54313,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rolv_epi32() { + const fn test_mm_rolv_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let b = _mm_set1_epi32(1); let r = _mm_rolv_epi32(a, b); @@ -52468,7 +54322,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rolv_epi32() { + const fn test_mm_mask_rolv_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let b = _mm_set1_epi32(1); let r = _mm_mask_rolv_epi32(a, 0, a, b); @@ -52479,7 +54333,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rolv_epi32() { + const fn test_mm_maskz_rolv_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let b = _mm_set1_epi32(1); let r = _mm_maskz_rolv_epi32(0, a, b); @@ -52490,7 +54344,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rorv_epi32() { + const fn test_mm512_rorv_epi32() { let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let b = _mm512_set1_epi32(1); let r = _mm512_rorv_epi32(a, b); @@ -52499,7 +54353,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rorv_epi32() { + const fn test_mm512_mask_rorv_epi32() { let a = _mm512_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let b = _mm512_set1_epi32(1); let r = _mm512_mask_rorv_epi32(a, 0, a, b); @@ -52510,7 +54364,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rorv_epi32() { + const fn test_mm512_maskz_rorv_epi32() { let a = _mm512_set_epi32(3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 << 0); let b = _mm512_set1_epi32(1); let r = _mm512_maskz_rorv_epi32(0, a, b); @@ -52521,7 +54375,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rorv_epi32() { + const fn test_mm256_rorv_epi32() { let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); let b = _mm256_set1_epi32(1); let r = _mm256_rorv_epi32(a, b); @@ -52530,7 +54384,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rorv_epi32() { + const fn test_mm256_mask_rorv_epi32() { let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); let b = _mm256_set1_epi32(1); let r = _mm256_mask_rorv_epi32(a, 0, a, b); @@ -52541,7 +54395,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rorv_epi32() { + const fn test_mm256_maskz_rorv_epi32() { let a = _mm256_set_epi32(1 << 0, 2, 2, 2, 2, 2, 2, 2); let b = _mm256_set1_epi32(1); let r = _mm256_maskz_rorv_epi32(0, a, b); @@ -52552,7 +54406,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rorv_epi32() { + const fn test_mm_rorv_epi32() { let a = _mm_set_epi32(1 << 0, 2, 2, 2); let b = _mm_set1_epi32(1); let r = _mm_rorv_epi32(a, b); @@ -52561,7 +54415,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rorv_epi32() { + const fn test_mm_mask_rorv_epi32() { let a = _mm_set_epi32(1 << 0, 2, 2, 2); let b = _mm_set1_epi32(1); let r = _mm_mask_rorv_epi32(a, 0, a, b); @@ -52572,7 +54426,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rorv_epi32() { + const fn test_mm_maskz_rorv_epi32() { let a = _mm_set_epi32(1 << 0, 2, 2, 2); let b = _mm_set1_epi32(1); let r = _mm_maskz_rorv_epi32(0, a, b); @@ -52583,7 +54437,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sllv_epi32() { + const fn test_mm512_sllv_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let count = _mm512_set1_epi32(1); let r = _mm512_sllv_epi32(a, count); @@ -52592,7 +54446,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sllv_epi32() { + const fn test_mm512_mask_sllv_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let count = _mm512_set1_epi32(1); let r = _mm512_mask_sllv_epi32(a, 0, a, count); @@ -52603,7 +54457,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sllv_epi32() { + const fn test_mm512_maskz_sllv_epi32() { let a = _mm512_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 << 31); let count = _mm512_set_epi32(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let r = _mm512_maskz_sllv_epi32(0, a, count); @@ -52614,7 +54468,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sllv_epi32() { + const fn test_mm256_mask_sllv_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let count = _mm256_set1_epi32(1); let r = _mm256_mask_sllv_epi32(a, 0, a, count); @@ -52625,7 +54479,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sllv_epi32() { + const fn test_mm256_maskz_sllv_epi32() { let a = _mm256_set_epi32(1 << 31, 1, 1, 1, 1, 1, 1, 1); let count = _mm256_set1_epi32(1); let r = _mm256_maskz_sllv_epi32(0, a, count); @@ -52636,7 +54490,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sllv_epi32() { + const fn test_mm_mask_sllv_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let count = _mm_set1_epi32(1); let r = _mm_mask_sllv_epi32(a, 0, a, count); @@ -52647,7 +54501,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sllv_epi32() { + const fn test_mm_maskz_sllv_epi32() { let a = _mm_set_epi32(1 << 31, 1, 1, 1); let count = _mm_set1_epi32(1); let r = _mm_maskz_sllv_epi32(0, a, count); @@ -52658,7 +54512,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srlv_epi32() { + const fn test_mm512_srlv_epi32() { let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let count = _mm512_set1_epi32(1); let r = _mm512_srlv_epi32(a, count); @@ -52667,7 +54521,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srlv_epi32() { + const fn test_mm512_mask_srlv_epi32() { let a = _mm512_set_epi32(0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); let count = _mm512_set1_epi32(1); let r = _mm512_mask_srlv_epi32(a, 0, a, count); @@ -52678,7 +54532,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srlv_epi32() { + const fn test_mm512_maskz_srlv_epi32() { let a = _mm512_set_epi32(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0); let count = _mm512_set_epi32(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); let r = _mm512_maskz_srlv_epi32(0, a, count); @@ -52689,7 +54543,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srlv_epi32() { + const fn test_mm256_mask_srlv_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm256_set1_epi32(1); let r = _mm256_mask_srlv_epi32(a, 0, a, count); @@ -52700,7 +54554,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srlv_epi32() { + const fn test_mm256_maskz_srlv_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm256_set1_epi32(1); let r = _mm256_maskz_srlv_epi32(0, a, count); @@ -52711,7 +54565,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srlv_epi32() { + const fn test_mm_mask_srlv_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set1_epi32(1); let r = _mm_mask_srlv_epi32(a, 0, a, count); @@ -52722,7 +54576,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srlv_epi32() { + const fn test_mm_maskz_srlv_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set1_epi32(1); let r = _mm_maskz_srlv_epi32(0, a, count); @@ -52733,7 +54587,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sll_epi32() { + fn test_mm512_sll_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 31, 1 << 0, 1 << 1, 1 << 2, @@ -52754,7 +54608,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sll_epi32() { + fn test_mm512_mask_sll_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 31, 1 << 0, 1 << 1, 1 << 2, @@ -52777,7 +54631,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sll_epi32() { + fn test_mm512_maskz_sll_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 31, 1 << 0, 1 << 1, 1 << 2, @@ -52794,7 +54648,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sll_epi32() { + fn test_mm256_mask_sll_epi32() { let a = _mm256_set_epi32(1 << 13, 0, 0, 0, 0, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm256_mask_sll_epi32(a, 0, a, count); @@ -52805,7 +54659,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sll_epi32() { + fn test_mm256_maskz_sll_epi32() { let a = _mm256_set_epi32(1 << 13, 0, 0, 0, 0, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm256_maskz_sll_epi32(0, a, count); @@ -52816,7 +54670,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sll_epi32() { + fn test_mm_mask_sll_epi32() { let a = _mm_set_epi32(1 << 13, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm_mask_sll_epi32(a, 0, a, count); @@ -52827,7 +54681,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sll_epi32() { + fn test_mm_maskz_sll_epi32() { let a = _mm_set_epi32(1 << 13, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm_maskz_sll_epi32(0, a, count); @@ -52838,7 +54692,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srl_epi32() { + fn test_mm512_srl_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 31, 1 << 0, 1 << 1, 1 << 2, @@ -52853,7 +54707,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srl_epi32() { + fn test_mm512_mask_srl_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 31, 1 << 0, 1 << 1, 1 << 2, @@ -52870,7 +54724,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srl_epi32() { + fn test_mm512_maskz_srl_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 31, 1 << 0, 1 << 1, 1 << 2, @@ -52887,7 +54741,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srl_epi32() { + fn test_mm256_mask_srl_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm256_mask_srl_epi32(a, 0, a, count); @@ -52898,7 +54752,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srl_epi32() { + fn test_mm256_maskz_srl_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm256_maskz_srl_epi32(0, a, count); @@ -52909,7 +54763,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srl_epi32() { + fn test_mm_mask_srl_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm_mask_srl_epi32(a, 0, a, count); @@ -52920,7 +54774,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srl_epi32() { + fn test_mm_maskz_srl_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm_maskz_srl_epi32(0, a, count); @@ -52931,7 +54785,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sra_epi32() { + fn test_mm512_sra_epi32() { let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); let count = _mm_set_epi32(1, 0, 0, 2); let r = _mm512_sra_epi32(a, count); @@ -52940,7 +54794,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sra_epi32() { + fn test_mm512_mask_sra_epi32() { let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16); let count = _mm_set_epi32(0, 0, 0, 2); let r = _mm512_mask_sra_epi32(a, 0, a, count); @@ -52951,7 +54805,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sra_epi32() { + fn test_mm512_maskz_sra_epi32() { let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -14); let count = _mm_set_epi32(2, 0, 0, 2); let r = _mm512_maskz_sra_epi32(0, a, count); @@ -52962,7 +54816,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sra_epi32() { + fn test_mm256_mask_sra_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm256_mask_sra_epi32(a, 0, a, count); @@ -52973,7 +54827,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sra_epi32() { + fn test_mm256_maskz_sra_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm256_maskz_sra_epi32(0, a, count); @@ -52984,7 +54838,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sra_epi32() { + fn test_mm_mask_sra_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm_mask_sra_epi32(a, 0, a, count); @@ -52995,7 +54849,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sra_epi32() { + fn test_mm_maskz_sra_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set_epi32(0, 0, 0, 1); let r = _mm_maskz_sra_epi32(0, a, count); @@ -53006,7 +54860,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srav_epi32() { + const fn test_mm512_srav_epi32() { let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); let count = _mm512_set_epi32(2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); let r = _mm512_srav_epi32(a, count); @@ -53015,7 +54869,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srav_epi32() { + const fn test_mm512_mask_srav_epi32() { let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16); let count = _mm512_set_epi32(2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); let r = _mm512_mask_srav_epi32(a, 0, a, count); @@ -53026,7 +54880,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srav_epi32() { + const fn test_mm512_maskz_srav_epi32() { let a = _mm512_set_epi32(8, -8, 16, -15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, -14); let count = _mm512_set_epi32(2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); let r = _mm512_maskz_srav_epi32(0, a, count); @@ -53037,7 +54891,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srav_epi32() { + const fn test_mm256_mask_srav_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm256_set1_epi32(1); let r = _mm256_mask_srav_epi32(a, 0, a, count); @@ -53048,7 +54902,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srav_epi32() { + const fn test_mm256_maskz_srav_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let count = _mm256_set1_epi32(1); let r = _mm256_maskz_srav_epi32(0, a, count); @@ -53059,7 +54913,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srav_epi32() { + const fn test_mm_mask_srav_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set1_epi32(1); let r = _mm_mask_srav_epi32(a, 0, a, count); @@ -53070,7 +54924,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srav_epi32() { + const fn test_mm_maskz_srav_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let count = _mm_set1_epi32(1); let r = _mm_maskz_srav_epi32(0, a, count); @@ -53081,7 +54935,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srai_epi32() { + const fn test_mm512_srai_epi32() { let a = _mm512_set_epi32(8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, -15); let r = _mm512_srai_epi32::<2>(a); let e = _mm512_set_epi32(2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, -4); @@ -53089,7 +54943,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srai_epi32() { + const fn test_mm512_mask_srai_epi32() { let a = _mm512_set_epi32(8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, -15); let r = _mm512_mask_srai_epi32::<2>(a, 0, a); assert_eq_m512i(r, a); @@ -53099,7 +54953,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srai_epi32() { + const fn test_mm512_maskz_srai_epi32() { let a = _mm512_set_epi32(8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, -15); let r = _mm512_maskz_srai_epi32::<2>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -53109,7 +54963,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srai_epi32() { + const fn test_mm256_mask_srai_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let r = _mm256_mask_srai_epi32::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -53119,7 +54973,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srai_epi32() { + const fn test_mm256_maskz_srai_epi32() { let a = _mm256_set_epi32(1 << 5, 0, 0, 0, 0, 0, 0, 0); let r = _mm256_maskz_srai_epi32::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -53129,7 +54983,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srai_epi32() { + const fn test_mm_mask_srai_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let r = _mm_mask_srai_epi32::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -53139,7 +54993,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srai_epi32() { + const fn test_mm_maskz_srai_epi32() { let a = _mm_set_epi32(1 << 5, 0, 0, 0); let r = _mm_maskz_srai_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -53149,7 +55003,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permute_ps() { + const fn test_mm512_permute_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53161,7 +55015,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permute_ps() { + const fn test_mm512_mask_permute_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53175,7 +55029,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permute_ps() { + const fn test_mm512_maskz_permute_ps() { let a = _mm512_setr_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53189,7 +55043,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permute_ps() { + const fn test_mm256_mask_permute_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_mask_permute_ps::<0b11_11_11_11>(a, 0, a); assert_eq_m256(r, a); @@ -53199,7 +55053,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permute_ps() { + const fn test_mm256_maskz_permute_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_maskz_permute_ps::<0b11_11_11_11>(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -53209,7 +55063,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permute_ps() { + const fn test_mm_mask_permute_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let r = _mm_mask_permute_ps::<0b11_11_11_11>(a, 0, a); assert_eq_m128(r, a); @@ -53219,7 +55073,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permute_ps() { + const fn test_mm_maskz_permute_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let r = _mm_maskz_permute_ps::<0b11_11_11_11>(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -53229,7 +55083,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutevar_epi32() { + fn test_mm512_permutevar_epi32() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_permutevar_epi32(idx, a); @@ -53238,7 +55092,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutevar_epi32() { + fn test_mm512_mask_permutevar_epi32() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_mask_permutevar_epi32(a, 0, idx, a); @@ -53249,7 +55103,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutevar_ps() { + fn test_mm512_permutevar_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53262,7 +55116,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutevar_ps() { + fn test_mm512_mask_permutevar_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53277,7 +55131,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutevar_ps() { + fn test_mm512_maskz_permutevar_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53292,7 +55146,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutevar_ps() { + fn test_mm256_mask_permutevar_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm256_set1_epi32(0b01); let r = _mm256_mask_permutevar_ps(a, 0, a, b); @@ -53303,7 +55157,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutevar_ps() { + fn test_mm256_maskz_permutevar_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm256_set1_epi32(0b01); let r = _mm256_maskz_permutevar_ps(0, a, b); @@ -53314,7 +55168,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permutevar_ps() { + fn test_mm_mask_permutevar_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set1_epi32(0b01); let r = _mm_mask_permutevar_ps(a, 0, a, b); @@ -53325,7 +55179,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permutevar_ps() { + fn test_mm_maskz_permutevar_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set1_epi32(0b01); let r = _mm_maskz_permutevar_ps(0, a, b); @@ -53336,7 +55190,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutexvar_epi32() { + fn test_mm512_permutexvar_epi32() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_permutexvar_epi32(idx, a); @@ -53345,7 +55199,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutexvar_epi32() { + fn test_mm512_mask_permutexvar_epi32() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_mask_permutexvar_epi32(a, 0, idx, a); @@ -53356,7 +55210,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutexvar_epi32() { + fn test_mm512_maskz_permutexvar_epi32() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_permutexvar_epi32(0, idx, a); @@ -53367,7 +55221,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutexvar_epi32() { + fn test_mm256_permutexvar_epi32() { let idx = _mm256_set1_epi32(1); let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_permutexvar_epi32(idx, a); @@ -53376,7 +55230,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutexvar_epi32() { + fn test_mm256_mask_permutexvar_epi32() { let idx = _mm256_set1_epi32(1); let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_mask_permutexvar_epi32(a, 0, idx, a); @@ -53387,7 +55241,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutexvar_epi32() { + fn test_mm256_maskz_permutexvar_epi32() { let idx = _mm256_set1_epi32(1); let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_permutexvar_epi32(0, idx, a); @@ -53398,7 +55252,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutexvar_ps() { + fn test_mm512_permutexvar_ps() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -53409,7 +55263,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutexvar_ps() { + fn test_mm512_mask_permutexvar_ps() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -53422,7 +55276,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutexvar_ps() { + fn test_mm512_maskz_permutexvar_ps() { let idx = _mm512_set1_epi32(1); let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -53437,7 +55291,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutexvar_ps() { + fn test_mm256_permutexvar_ps() { let idx = _mm256_set1_epi32(1); let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_permutexvar_ps(idx, a); @@ -53446,7 +55300,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutexvar_ps() { + fn test_mm256_mask_permutexvar_ps() { let idx = _mm256_set1_epi32(1); let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_mask_permutexvar_ps(a, 0, idx, a); @@ -53457,7 +55311,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutexvar_ps() { + fn test_mm256_maskz_permutexvar_ps() { let idx = _mm256_set1_epi32(1); let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_maskz_permutexvar_ps(0, idx, a); @@ -53468,7 +55322,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutex2var_epi32() { + fn test_mm512_permutex2var_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm512_set_epi32( @@ -53486,7 +55340,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutex2var_epi32() { + fn test_mm512_mask_permutex2var_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm512_set_epi32( @@ -53506,7 +55360,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutex2var_epi32() { + fn test_mm512_maskz_permutex2var_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm512_set_epi32( @@ -53524,7 +55378,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask2_permutex2var_epi32() { + fn test_mm512_mask2_permutex2var_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm512_set_epi32( @@ -53548,7 +55402,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutex2var_epi32() { + fn test_mm256_permutex2var_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_epi32(100); @@ -53558,7 +55412,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutex2var_epi32() { + fn test_mm256_mask_permutex2var_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_epi32(100); @@ -53570,7 +55424,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutex2var_epi32() { + fn test_mm256_maskz_permutex2var_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_epi32(100); @@ -53582,7 +55436,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask2_permutex2var_epi32() { + fn test_mm256_mask2_permutex2var_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_epi32(100); @@ -53594,7 +55448,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_permutex2var_epi32() { + fn test_mm_permutex2var_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_epi32(100); @@ -53604,7 +55458,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permutex2var_epi32() { + fn test_mm_mask_permutex2var_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_epi32(100); @@ -53616,7 +55470,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permutex2var_epi32() { + fn test_mm_maskz_permutex2var_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_epi32(100); @@ -53628,7 +55482,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask2_permutex2var_epi32() { + fn test_mm_mask2_permutex2var_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_epi32(100); @@ -53640,7 +55494,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutex2var_ps() { + fn test_mm512_permutex2var_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53660,7 +55514,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutex2var_ps() { + fn test_mm512_mask_permutex2var_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53682,7 +55536,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutex2var_ps() { + fn test_mm512_maskz_permutex2var_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53704,7 +55558,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask2_permutex2var_ps() { + fn test_mm512_mask2_permutex2var_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -53726,7 +55580,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutex2var_ps() { + fn test_mm256_permutex2var_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_ps(100.); @@ -53736,7 +55590,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutex2var_ps() { + fn test_mm256_mask_permutex2var_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_ps(100.); @@ -53748,7 +55602,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutex2var_ps() { + fn test_mm256_maskz_permutex2var_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_ps(100.); @@ -53760,7 +55614,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask2_permutex2var_ps() { + fn test_mm256_mask2_permutex2var_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm256_set_epi32(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm256_set1_ps(100.); @@ -53772,7 +55626,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_permutex2var_ps() { + fn test_mm_permutex2var_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_ps(100.); @@ -53782,7 +55636,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permutex2var_ps() { + fn test_mm_mask_permutex2var_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_ps(100.); @@ -53794,7 +55648,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permutex2var_ps() { + fn test_mm_maskz_permutex2var_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_ps(100.); @@ -53806,7 +55660,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask2_permutex2var_ps() { + fn test_mm_mask2_permutex2var_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let idx = _mm_set_epi32(1, 1 << 2, 2, 1 << 2); let b = _mm_set1_ps(100.); @@ -53818,7 +55672,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_epi32() { + const fn test_mm512_shuffle_epi32() { let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16); let r = _mm512_shuffle_epi32::<_MM_PERM_AADD>(a); let e = _mm512_setr_epi32(8, 8, 1, 1, 16, 16, 9, 9, 8, 8, 1, 1, 16, 16, 9, 9); @@ -53826,7 +55680,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_epi32() { + const fn test_mm512_mask_shuffle_epi32() { let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16); let r = _mm512_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0, a); assert_eq_m512i(r, a); @@ -53836,7 +55690,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_epi32() { + const fn test_mm512_maskz_shuffle_epi32() { let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16); let r = _mm512_maskz_shuffle_epi32::<_MM_PERM_AADD>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -53846,7 +55700,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_epi32() { + const fn test_mm256_mask_shuffle_epi32() { let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16); let r = _mm256_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0, a); assert_eq_m256i(r, a); @@ -53856,7 +55710,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_epi32() { + const fn test_mm256_maskz_shuffle_epi32() { let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16); let r = _mm256_maskz_shuffle_epi32::<_MM_PERM_AADD>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -53866,7 +55720,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_shuffle_epi32() { + const fn test_mm_mask_shuffle_epi32() { let a = _mm_set_epi32(1, 4, 5, 8); let r = _mm_mask_shuffle_epi32::<_MM_PERM_AADD>(a, 0, a); assert_eq_m128i(r, a); @@ -53876,7 +55730,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_shuffle_epi32() { + const fn test_mm_maskz_shuffle_epi32() { let a = _mm_set_epi32(1, 4, 5, 8); let r = _mm_maskz_shuffle_epi32::<_MM_PERM_AADD>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -53886,7 +55740,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_ps() { + const fn test_mm512_shuffle_ps() { let a = _mm512_setr_ps( 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16., ); @@ -53901,7 +55755,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_ps() { + const fn test_mm512_mask_shuffle_ps() { let a = _mm512_setr_ps( 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16., ); @@ -53918,7 +55772,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_ps() { + const fn test_mm512_maskz_shuffle_ps() { let a = _mm512_setr_ps( 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16., ); @@ -53935,7 +55789,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_ps() { + const fn test_mm256_mask_shuffle_ps() { let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_mask_shuffle_ps::<0b11_11_11_11>(a, 0, a, b); @@ -53946,7 +55800,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_ps() { + const fn test_mm256_maskz_shuffle_ps() { let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_maskz_shuffle_ps::<0b11_11_11_11>(0, a, b); @@ -53957,7 +55811,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_shuffle_ps() { + const fn test_mm_mask_shuffle_ps() { let a = _mm_set_ps(1., 4., 5., 8.); let b = _mm_set_ps(2., 3., 6., 7.); let r = _mm_mask_shuffle_ps::<0b11_11_11_11>(a, 0, a, b); @@ -53968,7 +55822,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_shuffle_ps() { + const fn test_mm_maskz_shuffle_ps() { let a = _mm_set_ps(1., 4., 5., 8.); let b = _mm_set_ps(2., 3., 6., 7.); let r = _mm_maskz_shuffle_ps::<0b11_11_11_11>(0, a, b); @@ -53979,7 +55833,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_i32x4() { + const fn test_mm512_shuffle_i32x4() { let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16); let b = _mm512_setr_epi32(2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 10, 11, 14, 15); let r = _mm512_shuffle_i32x4::<0b00_00_00_00>(a, b); @@ -53988,7 +55842,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_i32x4() { + const fn test_mm512_mask_shuffle_i32x4() { let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16); let b = _mm512_setr_epi32(2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 10, 11, 14, 15); let r = _mm512_mask_shuffle_i32x4::<0b00_00_00_00>(a, 0, a, b); @@ -53999,7 +55853,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_i32x4() { + const fn test_mm512_maskz_shuffle_i32x4() { let a = _mm512_setr_epi32(1, 4, 5, 8, 9, 12, 13, 16, 1, 4, 5, 8, 9, 12, 13, 16); let b = _mm512_setr_epi32(2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 10, 11, 14, 15); let r = _mm512_maskz_shuffle_i32x4::<0b00_00_00_00>(0, a, b); @@ -54010,7 +55864,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_shuffle_i32x4() { + const fn test_mm256_shuffle_i32x4() { let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm256_set_epi32(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm256_shuffle_i32x4::<0b00>(a, b); @@ -54019,7 +55873,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_i32x4() { + const fn test_mm256_mask_shuffle_i32x4() { let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm256_set_epi32(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm256_mask_shuffle_i32x4::<0b00>(a, 0, a, b); @@ -54030,7 +55884,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_i32x4() { + const fn test_mm256_maskz_shuffle_i32x4() { let a = _mm256_set_epi32(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm256_set_epi32(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm256_maskz_shuffle_i32x4::<0b00>(0, a, b); @@ -54041,7 +55895,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_f32x4() { + const fn test_mm512_shuffle_f32x4() { let a = _mm512_setr_ps( 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16., ); @@ -54056,7 +55910,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_f32x4() { + const fn test_mm512_mask_shuffle_f32x4() { let a = _mm512_setr_ps( 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16., ); @@ -54073,7 +55927,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_f32x4() { + const fn test_mm512_maskz_shuffle_f32x4() { let a = _mm512_setr_ps( 1., 4., 5., 8., 9., 12., 13., 16., 1., 4., 5., 8., 9., 12., 13., 16., ); @@ -54090,7 +55944,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_shuffle_f32x4() { + const fn test_mm256_shuffle_f32x4() { let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_shuffle_f32x4::<0b00>(a, b); @@ -54099,7 +55953,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_f32x4() { + const fn test_mm256_mask_shuffle_f32x4() { let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_mask_shuffle_f32x4::<0b00>(a, 0, a, b); @@ -54110,7 +55964,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_f32x4() { + const fn test_mm256_maskz_shuffle_f32x4() { let a = _mm256_set_ps(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm256_set_ps(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm256_maskz_shuffle_f32x4::<0b00>(0, a, b); @@ -54121,7 +55975,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_extractf32x4_ps() { + const fn test_mm512_extractf32x4_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54131,7 +55985,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_extractf32x4_ps() { + const fn test_mm512_mask_extractf32x4_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54144,7 +55998,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_extractf32x4_ps() { + const fn test_mm512_maskz_extractf32x4_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54156,7 +56010,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_extractf32x4_ps() { + const fn test_mm256_extractf32x4_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_extractf32x4_ps::<1>(a); let e = _mm_set_ps(1., 2., 3., 4.); @@ -54164,7 +56018,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_extractf32x4_ps() { + const fn test_mm256_mask_extractf32x4_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let src = _mm_set1_ps(100.); let r = _mm256_mask_extractf32x4_ps::<1>(src, 0, a); @@ -54175,7 +56029,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_extractf32x4_ps() { + const fn test_mm256_maskz_extractf32x4_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_maskz_extractf32x4_ps::<1>(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -54185,7 +56039,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_extracti32x4_epi32() { + const fn test_mm512_extracti32x4_epi32() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_extracti32x4_epi32::<1>(a); let e = _mm_setr_epi32(5, 6, 7, 8); @@ -54193,7 +56047,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_extracti32x4_epi32() { + const fn test_mm512_mask_extracti32x4_epi32() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm_set1_epi32(100); let r = _mm512_mask_extracti32x4_epi32::<1>(src, 0, a); @@ -54204,7 +56058,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm512_maskz_extracti32x4_epi32() { + const fn test_mm512_maskz_extracti32x4_epi32() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_extracti32x4_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -54214,7 +56068,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_extracti32x4_epi32() { + const fn test_mm256_extracti32x4_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_extracti32x4_epi32::<1>(a); let e = _mm_set_epi32(1, 2, 3, 4); @@ -54222,7 +56076,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_extracti32x4_epi32() { + const fn test_mm256_mask_extracti32x4_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set1_epi32(100); let r = _mm256_mask_extracti32x4_epi32::<1>(src, 0, a); @@ -54233,7 +56087,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_extracti32x4_epi32() { + const fn test_mm256_maskz_extracti32x4_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_extracti32x4_epi32::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -54243,7 +56097,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_moveldup_ps() { + const fn test_mm512_moveldup_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54255,7 +56109,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_moveldup_ps() { + const fn test_mm512_mask_moveldup_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54269,7 +56123,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_moveldup_ps() { + const fn test_mm512_maskz_moveldup_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54283,7 +56137,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_moveldup_ps() { + const fn test_mm256_mask_moveldup_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_mask_moveldup_ps(a, 0, a); assert_eq_m256(r, a); @@ -54293,7 +56147,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_moveldup_ps() { + const fn test_mm256_maskz_moveldup_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_maskz_moveldup_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -54303,7 +56157,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_moveldup_ps() { + const fn test_mm_mask_moveldup_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_mask_moveldup_ps(a, 0, a); assert_eq_m128(r, a); @@ -54313,7 +56167,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_moveldup_ps() { + const fn test_mm_maskz_moveldup_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_maskz_moveldup_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -54323,7 +56177,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_movehdup_ps() { + const fn test_mm512_movehdup_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54335,7 +56189,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_movehdup_ps() { + const fn test_mm512_mask_movehdup_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54349,7 +56203,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_movehdup_ps() { + const fn test_mm512_maskz_movehdup_ps() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54363,7 +56217,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_movehdup_ps() { + const fn test_mm256_mask_movehdup_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_mask_movehdup_ps(a, 0, a); assert_eq_m256(r, a); @@ -54373,7 +56227,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_movehdup_ps() { + const fn test_mm256_maskz_movehdup_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_maskz_movehdup_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -54383,7 +56237,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_movehdup_ps() { + const fn test_mm_mask_movehdup_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_mask_movehdup_ps(a, 0, a); assert_eq_m128(r, a); @@ -54393,7 +56247,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_movehdup_ps() { + const fn test_mm_maskz_movehdup_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let r = _mm_maskz_movehdup_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -54403,7 +56257,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_inserti32x4() { + const fn test_mm512_inserti32x4() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_setr_epi32(17, 18, 19, 20); let r = _mm512_inserti32x4::<0>(a, b); @@ -54412,7 +56266,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_inserti32x4() { + const fn test_mm512_mask_inserti32x4() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_setr_epi32(17, 18, 19, 20); let r = _mm512_mask_inserti32x4::<0>(a, 0, a, b); @@ -54423,7 +56277,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_inserti32x4() { + const fn test_mm512_maskz_inserti32x4() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm_setr_epi32(17, 18, 19, 20); let r = _mm512_maskz_inserti32x4::<0>(0, a, b); @@ -54434,7 +56288,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_inserti32x4() { + const fn test_mm256_inserti32x4() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_inserti32x4::<1>(a, b); @@ -54443,7 +56297,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_inserti32x4() { + const fn test_mm256_mask_inserti32x4() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_mask_inserti32x4::<0>(a, 0, a, b); @@ -54454,7 +56308,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_inserti32x4() { + const fn test_mm256_maskz_inserti32x4() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_maskz_inserti32x4::<0>(0, a, b); @@ -54465,7 +56319,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_insertf32x4() { + const fn test_mm512_insertf32x4() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54478,7 +56332,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_insertf32x4() { + const fn test_mm512_mask_insertf32x4() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54493,7 +56347,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_insertf32x4() { + const fn test_mm512_maskz_insertf32x4() { let a = _mm512_setr_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -54508,7 +56362,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_insertf32x4() { + const fn test_mm256_insertf32x4() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_insertf32x4::<1>(a, b); @@ -54517,7 +56371,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_insertf32x4() { + const fn test_mm256_mask_insertf32x4() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_mask_insertf32x4::<0>(a, 0, a, b); @@ -54528,7 +56382,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_insertf32x4() { + const fn test_mm256_maskz_insertf32x4() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_maskz_insertf32x4::<0>(0, a, b); @@ -54539,21 +56393,21 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castps128_ps512() { + const fn test_mm512_castps128_ps512() { let a = _mm_setr_ps(17., 18., 19., 20.); let r = _mm512_castps128_ps512(a); assert_eq_m128(_mm512_castps512_ps128(r), a); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castps256_ps512() { + const fn test_mm512_castps256_ps512() { let a = _mm256_setr_ps(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_castps256_ps512(a); assert_eq_m256(_mm512_castps512_ps256(r), a); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_zextps128_ps512() { + const fn test_mm512_zextps128_ps512() { let a = _mm_setr_ps(17., 18., 19., 20.); let r = _mm512_zextps128_ps512(a); let e = _mm512_setr_ps( @@ -54563,7 +56417,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_zextps256_ps512() { + const fn test_mm512_zextps256_ps512() { let a = _mm256_setr_ps(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_zextps256_ps512(a); let e = _mm512_setr_ps( @@ -54573,7 +56427,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castps512_ps128() { + const fn test_mm512_castps512_ps128() { let a = _mm512_setr_ps( 17., 18., 19., 20., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., ); @@ -54583,7 +56437,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castps512_ps256() { + const fn test_mm512_castps512_ps256() { let a = _mm512_setr_ps( 17., 18., 19., 20., 21., 22., 23., 24., -1., -1., -1., -1., -1., -1., -1., -1., ); @@ -54593,7 +56447,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castps_pd() { + const fn test_mm512_castps_pd() { let a = _mm512_set1_ps(1.); let r = _mm512_castps_pd(a); let e = _mm512_set1_pd(0.007812501848093234); @@ -54601,7 +56455,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castps_si512() { + const fn test_mm512_castps_si512() { let a = _mm512_set1_ps(1.); let r = _mm512_castps_si512(a); let e = _mm512_set1_epi32(1065353216); @@ -54609,7 +56463,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcastd_epi32() { + const fn test_mm512_broadcastd_epi32() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm512_broadcastd_epi32(a); let e = _mm512_set1_epi32(20); @@ -54617,7 +56471,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcastd_epi32() { + const fn test_mm512_mask_broadcastd_epi32() { let src = _mm512_set1_epi32(20); let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm512_mask_broadcastd_epi32(src, 0, a); @@ -54628,7 +56482,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcastd_epi32() { + const fn test_mm512_maskz_broadcastd_epi32() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm512_maskz_broadcastd_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -54638,7 +56492,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_broadcastd_epi32() { + const fn test_mm256_mask_broadcastd_epi32() { let src = _mm256_set1_epi32(20); let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_mask_broadcastd_epi32(src, 0, a); @@ -54649,7 +56503,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_broadcastd_epi32() { + const fn test_mm256_maskz_broadcastd_epi32() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_maskz_broadcastd_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -54659,7 +56513,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_broadcastd_epi32() { + const fn test_mm_mask_broadcastd_epi32() { let src = _mm_set1_epi32(20); let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm_mask_broadcastd_epi32(src, 0, a); @@ -54670,7 +56524,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_broadcastd_epi32() { + const fn test_mm_maskz_broadcastd_epi32() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm_maskz_broadcastd_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -54680,7 +56534,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcastss_ps() { + const fn test_mm512_broadcastss_ps() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm512_broadcastss_ps(a); let e = _mm512_set1_ps(20.); @@ -54688,7 +56542,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcastss_ps() { + const fn test_mm512_mask_broadcastss_ps() { let src = _mm512_set1_ps(20.); let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm512_mask_broadcastss_ps(src, 0, a); @@ -54699,7 +56553,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcastss_ps() { + const fn test_mm512_maskz_broadcastss_ps() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm512_maskz_broadcastss_ps(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -54711,7 +56565,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_broadcastss_ps() { + const fn test_mm256_mask_broadcastss_ps() { let src = _mm256_set1_ps(20.); let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_mask_broadcastss_ps(src, 0, a); @@ -54722,7 +56576,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_broadcastss_ps() { + const fn test_mm256_maskz_broadcastss_ps() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_maskz_broadcastss_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -54732,7 +56586,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_broadcastss_ps() { + const fn test_mm_mask_broadcastss_ps() { let src = _mm_set1_ps(20.); let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm_mask_broadcastss_ps(src, 0, a); @@ -54743,7 +56597,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_broadcastss_ps() { + const fn test_mm_maskz_broadcastss_ps() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm_maskz_broadcastss_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -54753,7 +56607,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcast_i32x4() { + const fn test_mm512_broadcast_i32x4() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm512_broadcast_i32x4(a); let e = _mm512_set_epi32( @@ -54763,7 +56617,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcast_i32x4() { + const fn test_mm512_mask_broadcast_i32x4() { let src = _mm512_set1_epi32(20); let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm512_mask_broadcast_i32x4(src, 0, a); @@ -54776,7 +56630,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcast_i32x4() { + const fn test_mm512_maskz_broadcast_i32x4() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm512_maskz_broadcast_i32x4(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -54786,7 +56640,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_broadcast_i32x4() { + const fn test_mm256_broadcast_i32x4() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_broadcast_i32x4(a); let e = _mm256_set_epi32(17, 18, 19, 20, 17, 18, 19, 20); @@ -54794,7 +56648,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_broadcast_i32x4() { + const fn test_mm256_mask_broadcast_i32x4() { let src = _mm256_set1_epi32(20); let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_mask_broadcast_i32x4(src, 0, a); @@ -54805,7 +56659,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_broadcast_i32x4() { + const fn test_mm256_maskz_broadcast_i32x4() { let a = _mm_set_epi32(17, 18, 19, 20); let r = _mm256_maskz_broadcast_i32x4(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -54815,7 +56669,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcast_f32x4() { + const fn test_mm512_broadcast_f32x4() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm512_broadcast_f32x4(a); let e = _mm512_set_ps( @@ -54825,7 +56679,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcast_f32x4() { + const fn test_mm512_mask_broadcast_f32x4() { let src = _mm512_set1_ps(20.); let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm512_mask_broadcast_f32x4(src, 0, a); @@ -54838,7 +56692,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcast_f32x4() { + const fn test_mm512_maskz_broadcast_f32x4() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm512_maskz_broadcast_f32x4(0, a); assert_eq_m512(r, _mm512_setzero_ps()); @@ -54850,7 +56704,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_broadcast_f32x4() { + const fn test_mm256_broadcast_f32x4() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_broadcast_f32x4(a); let e = _mm256_set_ps(17., 18., 19., 20., 17., 18., 19., 20.); @@ -54858,7 +56712,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_broadcast_f32x4() { + const fn test_mm256_mask_broadcast_f32x4() { let src = _mm256_set1_ps(20.); let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_mask_broadcast_f32x4(src, 0, a); @@ -54869,7 +56723,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_broadcast_f32x4() { + const fn test_mm256_maskz_broadcast_f32x4() { let a = _mm_set_ps(17., 18., 19., 20.); let r = _mm256_maskz_broadcast_f32x4(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -54879,7 +56733,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_blend_epi32() { + const fn test_mm512_mask_blend_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(2); let r = _mm512_mask_blend_epi32(0b11111111_00000000, a, b); @@ -54888,7 +56742,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_blend_epi32() { + const fn test_mm256_mask_blend_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(2); let r = _mm256_mask_blend_epi32(0b11111111, a, b); @@ -54897,7 +56751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_blend_epi32() { + const fn test_mm_mask_blend_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(2); let r = _mm_mask_blend_epi32(0b00001111, a, b); @@ -54906,7 +56760,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_blend_ps() { + const fn test_mm512_mask_blend_ps() { let a = _mm512_set1_ps(1.); let b = _mm512_set1_ps(2.); let r = _mm512_mask_blend_ps(0b11111111_00000000, a, b); @@ -54917,7 +56771,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_blend_ps() { + const fn test_mm256_mask_blend_ps() { let a = _mm256_set1_ps(1.); let b = _mm256_set1_ps(2.); let r = _mm256_mask_blend_ps(0b11111111, a, b); @@ -54926,7 +56780,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_blend_ps() { + const fn test_mm_mask_blend_ps() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let r = _mm_mask_blend_ps(0b00001111, a, b); @@ -54935,7 +56789,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpackhi_epi32() { + const fn test_mm512_unpackhi_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm512_set_epi32( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -54946,7 +56800,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpackhi_epi32() { + const fn test_mm512_mask_unpackhi_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm512_set_epi32( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -54959,7 +56813,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpackhi_epi32() { + const fn test_mm512_maskz_unpackhi_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm512_set_epi32( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -54972,7 +56826,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpackhi_epi32() { + const fn test_mm256_mask_unpackhi_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm256_mask_unpackhi_epi32(a, 0, a, b); @@ -54983,7 +56837,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpackhi_epi32() { + const fn test_mm256_maskz_unpackhi_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm256_maskz_unpackhi_epi32(0, a, b); @@ -54994,7 +56848,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpackhi_epi32() { + const fn test_mm_mask_unpackhi_epi32() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm_mask_unpackhi_epi32(a, 0, a, b); @@ -55005,7 +56859,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpackhi_epi32() { + const fn test_mm_maskz_unpackhi_epi32() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm_maskz_unpackhi_epi32(0, a, b); @@ -55016,7 +56870,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpackhi_ps() { + const fn test_mm512_unpackhi_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -55031,7 +56885,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpackhi_ps() { + const fn test_mm512_mask_unpackhi_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -55048,7 +56902,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpackhi_ps() { + const fn test_mm512_maskz_unpackhi_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -55065,7 +56919,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpackhi_ps() { + const fn test_mm256_mask_unpackhi_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm256_mask_unpackhi_ps(a, 0, a, b); @@ -55076,7 +56930,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpackhi_ps() { + const fn test_mm256_maskz_unpackhi_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm256_maskz_unpackhi_ps(0, a, b); @@ -55087,7 +56941,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpackhi_ps() { + const fn test_mm_mask_unpackhi_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm_mask_unpackhi_ps(a, 0, a, b); @@ -55098,7 +56952,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpackhi_ps() { + const fn test_mm_maskz_unpackhi_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm_maskz_unpackhi_ps(0, a, b); @@ -55109,7 +56963,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpacklo_epi32() { + const fn test_mm512_unpacklo_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm512_set_epi32( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -55120,7 +56974,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpacklo_epi32() { + const fn test_mm512_mask_unpacklo_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm512_set_epi32( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -55133,7 +56987,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpacklo_epi32() { + const fn test_mm512_maskz_unpacklo_epi32() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let b = _mm512_set_epi32( 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -55146,7 +57000,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpacklo_epi32() { + const fn test_mm256_mask_unpacklo_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm256_mask_unpacklo_epi32(a, 0, a, b); @@ -55157,7 +57011,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpacklo_epi32() { + const fn test_mm256_maskz_unpacklo_epi32() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_set_epi32(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm256_maskz_unpacklo_epi32(0, a, b); @@ -55168,7 +57022,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpacklo_epi32() { + const fn test_mm_mask_unpacklo_epi32() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm_mask_unpacklo_epi32(a, 0, a, b); @@ -55179,7 +57033,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpacklo_epi32() { + const fn test_mm_maskz_unpacklo_epi32() { let a = _mm_set_epi32(1, 2, 3, 4); let b = _mm_set_epi32(17, 18, 19, 20); let r = _mm_maskz_unpacklo_epi32(0, a, b); @@ -55190,7 +57044,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpacklo_ps() { + const fn test_mm512_unpacklo_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -55205,7 +57059,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpacklo_ps() { + const fn test_mm512_mask_unpacklo_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -55222,7 +57076,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpacklo_ps() { + const fn test_mm512_maskz_unpacklo_ps() { let a = _mm512_set_ps( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -55239,7 +57093,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpacklo_ps() { + const fn test_mm256_mask_unpacklo_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm256_mask_unpacklo_ps(a, 0, a, b); @@ -55250,7 +57104,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpacklo_ps() { + const fn test_mm256_maskz_unpacklo_ps() { let a = _mm256_set_ps(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_set_ps(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm256_maskz_unpacklo_ps(0, a, b); @@ -55261,7 +57115,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpacklo_ps() { + const fn test_mm_mask_unpacklo_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm_mask_unpacklo_ps(a, 0, a, b); @@ -55272,7 +57126,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpacklo_ps() { + const fn test_mm_maskz_unpacklo_ps() { let a = _mm_set_ps(1., 2., 3., 4.); let b = _mm_set_ps(17., 18., 19., 20.); let r = _mm_maskz_unpacklo_ps(0, a, b); @@ -55283,7 +57137,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_alignr_epi32() { + const fn test_mm512_alignr_epi32() { let a = _mm512_set_epi32(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1); let b = _mm512_set_epi32( 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, @@ -55300,7 +57154,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_alignr_epi32() { + const fn test_mm512_mask_alignr_epi32() { let a = _mm512_set_epi32(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1); let b = _mm512_set_epi32( 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, @@ -55315,7 +57169,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_alignr_epi32() { + const fn test_mm512_maskz_alignr_epi32() { let a = _mm512_set_epi32(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1); let b = _mm512_set_epi32( 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, @@ -55328,7 +57182,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_alignr_epi32() { + const fn test_mm256_alignr_epi32() { let a = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1); let b = _mm256_set_epi32(16, 15, 14, 13, 12, 11, 10, 9); let r = _mm256_alignr_epi32::<0>(a, b); @@ -55339,7 +57193,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_alignr_epi32() { + const fn test_mm256_mask_alignr_epi32() { let a = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1); let b = _mm256_set_epi32(16, 15, 14, 13, 12, 11, 10, 9); let r = _mm256_mask_alignr_epi32::<1>(a, 0, a, b); @@ -55350,7 +57204,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_alignr_epi32() { + const fn test_mm256_maskz_alignr_epi32() { let a = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1); let b = _mm256_set_epi32(16, 15, 14, 13, 12, 11, 10, 9); let r = _mm256_maskz_alignr_epi32::<1>(0, a, b); @@ -55361,7 +57215,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_alignr_epi32() { + const fn test_mm_alignr_epi32() { let a = _mm_set_epi32(4, 3, 2, 1); let b = _mm_set_epi32(8, 7, 6, 5); let r = _mm_alignr_epi32::<0>(a, b); @@ -55372,7 +57226,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_alignr_epi32() { + const fn test_mm_mask_alignr_epi32() { let a = _mm_set_epi32(4, 3, 2, 1); let b = _mm_set_epi32(8, 7, 6, 5); let r = _mm_mask_alignr_epi32::<1>(a, 0, a, b); @@ -55383,7 +57237,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_alignr_epi32() { + const fn test_mm_maskz_alignr_epi32() { let a = _mm_set_epi32(4, 3, 2, 1); let b = _mm_set_epi32(8, 7, 6, 5); let r = _mm_maskz_alignr_epi32::<1>(0, a, b); @@ -55394,7 +57248,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_and_epi32() { + const fn test_mm512_and_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55415,7 +57269,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_and_epi32() { + const fn test_mm512_mask_and_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55444,7 +57298,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_and_epi32() { + const fn test_mm512_maskz_and_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55467,7 +57321,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_and_epi32() { + const fn test_mm256_mask_and_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_mask_and_epi32(a, 0, a, b); @@ -55478,7 +57332,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_and_epi32() { + const fn test_mm256_maskz_and_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_maskz_and_epi32(0, a, b); @@ -55489,7 +57343,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_and_epi32() { + const fn test_mm_mask_and_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_mask_and_epi32(a, 0, a, b); @@ -55500,7 +57354,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_and_epi32() { + const fn test_mm_maskz_and_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_maskz_and_epi32(0, a, b); @@ -55511,7 +57365,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_and_si512() { + const fn test_mm512_and_si512() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55526,13 +57380,13 @@ mod tests { 0, 0, 0, 0, 0, 0, 0, 1 << 3 | 1 << 4, ); - let r = _mm512_and_epi32(a, b); + let r = _mm512_and_si512(a, b); let e = _mm512_set_epi32(1 << 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 << 3); assert_eq_m512i(r, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_or_epi32() { + const fn test_mm512_or_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55559,7 +57413,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_or_epi32() { + const fn test_mm512_mask_or_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55588,7 +57442,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_or_epi32() { + const fn test_mm512_maskz_or_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55617,7 +57471,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_or_epi32() { + const fn test_mm256_or_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_or_epi32(a, b); @@ -55626,7 +57480,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_or_epi32() { + const fn test_mm256_mask_or_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_mask_or_epi32(a, 0, a, b); @@ -55637,7 +57491,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_or_epi32() { + const fn test_mm256_maskz_or_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_maskz_or_epi32(0, a, b); @@ -55648,7 +57502,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_or_epi32() { + const fn test_mm_or_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_or_epi32(a, b); @@ -55657,7 +57511,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_or_epi32() { + const fn test_mm_mask_or_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_mask_or_epi32(a, 0, a, b); @@ -55668,7 +57522,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_or_epi32() { + const fn test_mm_maskz_or_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_maskz_or_epi32(0, a, b); @@ -55679,7 +57533,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_or_si512() { + const fn test_mm512_or_si512() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55694,7 +57548,7 @@ mod tests { 0, 0, 0, 0, 0, 0, 0, 1 << 3 | 1 << 4, ); - let r = _mm512_or_epi32(a, b); + let r = _mm512_or_si512(a, b); #[rustfmt::skip] let e = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55706,7 +57560,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_xor_epi32() { + const fn test_mm512_xor_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55733,7 +57587,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_xor_epi32() { + const fn test_mm512_mask_xor_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55762,7 +57616,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_xor_epi32() { + const fn test_mm512_maskz_xor_epi32() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55785,7 +57639,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_xor_epi32() { + const fn test_mm256_xor_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_xor_epi32(a, b); @@ -55794,7 +57648,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_xor_epi32() { + const fn test_mm256_mask_xor_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_mask_xor_epi32(a, 0, a, b); @@ -55805,7 +57659,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_xor_epi32() { + const fn test_mm256_maskz_xor_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_maskz_xor_epi32(0, a, b); @@ -55816,7 +57670,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_xor_epi32() { + const fn test_mm_xor_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_xor_epi32(a, b); @@ -55825,7 +57679,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_xor_epi32() { + const fn test_mm_mask_xor_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_mask_xor_epi32(a, 0, a, b); @@ -55836,7 +57690,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_xor_epi32() { + const fn test_mm_maskz_xor_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 1); let r = _mm_maskz_xor_epi32(0, a, b); @@ -55847,7 +57701,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_xor_si512() { + const fn test_mm512_xor_si512() { #[rustfmt::skip] let a = _mm512_set_epi32( 1 << 1 | 1 << 2, 0, 0, 0, @@ -55862,7 +57716,7 @@ mod tests { 0, 0, 0, 0, 0, 0, 0, 1 << 3 | 1 << 4, ); - let r = _mm512_xor_epi32(a, b); + let r = _mm512_xor_si512(a, b); #[rustfmt::skip] let e = _mm512_set_epi32( 1 << 2, 0, 0, 0, @@ -55874,7 +57728,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_andnot_epi32() { + const fn test_mm512_andnot_epi32() { let a = _mm512_set1_epi32(0); let b = _mm512_set1_epi32(1 << 3 | 1 << 4); let r = _mm512_andnot_epi32(a, b); @@ -55883,7 +57737,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_andnot_epi32() { + const fn test_mm512_mask_andnot_epi32() { let a = _mm512_set1_epi32(1 << 1 | 1 << 2); let b = _mm512_set1_epi32(1 << 3 | 1 << 4); let r = _mm512_mask_andnot_epi32(a, 0, a, b); @@ -55894,7 +57748,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_andnot_epi32() { + const fn test_mm512_maskz_andnot_epi32() { let a = _mm512_set1_epi32(1 << 1 | 1 << 2); let b = _mm512_set1_epi32(1 << 3 | 1 << 4); let r = _mm512_maskz_andnot_epi32(0, a, b); @@ -55911,7 +57765,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_andnot_epi32() { + const fn test_mm256_mask_andnot_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 3 | 1 << 4); let r = _mm256_mask_andnot_epi32(a, 0, a, b); @@ -55922,7 +57776,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_andnot_epi32() { + const fn test_mm256_maskz_andnot_epi32() { let a = _mm256_set1_epi32(1 << 1 | 1 << 2); let b = _mm256_set1_epi32(1 << 3 | 1 << 4); let r = _mm256_maskz_andnot_epi32(0, a, b); @@ -55933,7 +57787,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_andnot_epi32() { + const fn test_mm_mask_andnot_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 3 | 1 << 4); let r = _mm_mask_andnot_epi32(a, 0, a, b); @@ -55944,7 +57798,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_andnot_epi32() { + const fn test_mm_maskz_andnot_epi32() { let a = _mm_set1_epi32(1 << 1 | 1 << 2); let b = _mm_set1_epi32(1 << 3 | 1 << 4); let r = _mm_maskz_andnot_epi32(0, a, b); @@ -55955,7 +57809,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_cvtmask16_u32() { + const fn test_cvtmask16_u32() { let a: __mmask16 = 0b11001100_00110011; let r = _cvtmask16_u32(a); let e: u32 = 0b11001100_00110011; @@ -55963,7 +57817,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_cvtu32_mask16() { + const fn test_cvtu32_mask16() { let a: u32 = 0b11001100_00110011; let r = _cvtu32_mask16(a); let e: __mmask16 = 0b11001100_00110011; @@ -55971,7 +57825,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kand() { + const fn test_mm512_kand() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b11001100_00110011; let r = _mm512_kand(a, b); @@ -55980,7 +57834,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kand_mask16() { + const fn test_kand_mask16() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b11001100_00110011; let r = _kand_mask16(a, b); @@ -55989,7 +57843,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kor() { + const fn test_mm512_kor() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kor(a, b); @@ -55998,7 +57852,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kor_mask16() { + const fn test_kor_mask16() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _kor_mask16(a, b); @@ -56007,7 +57861,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kxor() { + const fn test_mm512_kxor() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kxor(a, b); @@ -56016,7 +57870,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kxor_mask16() { + const fn test_kxor_mask16() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _kxor_mask16(a, b); @@ -56025,7 +57879,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_knot() { + const fn test_mm512_knot() { let a: u16 = 0b11001100_00110011; let r = _mm512_knot(a); let e: u16 = 0b00110011_11001100; @@ -56033,7 +57887,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_knot_mask16() { + const fn test_knot_mask16() { let a: u16 = 0b11001100_00110011; let r = _knot_mask16(a); let e: u16 = 0b00110011_11001100; @@ -56041,7 +57895,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kandn() { + const fn test_mm512_kandn() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kandn(a, b); @@ -56050,7 +57904,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kandn_mask16() { + const fn test_kandn_mask16() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _kandn_mask16(a, b); @@ -56059,7 +57913,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kxnor() { + const fn test_mm512_kxnor() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kxnor(a, b); @@ -56068,7 +57922,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kxnor_mask16() { + const fn test_kxnor_mask16() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _kxnor_mask16(a, b); @@ -56077,7 +57931,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kortest_mask16_u8() { + const unsafe fn test_kortest_mask16_u8() { let a: __mmask16 = 0b0110100101101001; let b: __mmask16 = 0b1011011010110110; let mut all_ones: u8 = 0; @@ -56087,7 +57941,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kortestc_mask16_u8() { + const fn test_kortestc_mask16_u8() { let a: __mmask16 = 0b0110100101101001; let b: __mmask16 = 0b1011011010110110; let r = _kortestc_mask16_u8(a, b); @@ -56095,7 +57949,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kortestz_mask16_u8() { + const fn test_kortestz_mask16_u8() { let a: __mmask16 = 0b0110100101101001; let b: __mmask16 = 0b1011011010110110; let r = _kortestz_mask16_u8(a, b); @@ -56103,7 +57957,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kshiftli_mask16() { + const fn test_kshiftli_mask16() { let a: __mmask16 = 0b1001011011000011; let r = _kshiftli_mask16::<3>(a); let e: __mmask16 = 0b1011011000011000; @@ -56123,7 +57977,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_kshiftri_mask16() { + const fn test_kshiftri_mask16() { let a: __mmask16 = 0b1010100100111100; let r = _kshiftri_mask16::<3>(a); let e: __mmask16 = 0b0001010100100111; @@ -56143,7 +57997,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_load_mask16() { + const unsafe fn test_load_mask16() { let a: __mmask16 = 0b1001011011000011; let r = _load_mask16(&a); let e: __mmask16 = 0b1001011011000011; @@ -56151,7 +58005,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_store_mask16() { + const unsafe fn test_store_mask16() { let a: __mmask16 = 0b0110100100111100; let mut r = 0; _store_mask16(&mut r, a); @@ -56160,7 +58014,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kmov() { + const fn test_mm512_kmov() { let a: u16 = 0b11001100_00110011; let r = _mm512_kmov(a); let e: u16 = 0b11001100_00110011; @@ -56168,7 +58022,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_int2mask() { + const fn test_mm512_int2mask() { let a: i32 = 0b11001100_00110011; let r = _mm512_int2mask(a); let e: u16 = 0b11001100_00110011; @@ -56176,7 +58030,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask2int() { + const fn test_mm512_mask2int() { let k1: __mmask16 = 0b11001100_00110011; let r = _mm512_mask2int(k1); let e: i32 = 0b11001100_00110011; @@ -56184,7 +58038,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kunpackb() { + const fn test_mm512_kunpackb() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kunpackb(a, b); @@ -56193,7 +58047,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kortestc() { + const fn test_mm512_kortestc() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kortestc(a, b); @@ -56204,7 +58058,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_kortestz() { + const fn test_mm512_kortestz() { let a: u16 = 0b11001100_00110011; let b: u16 = 0b00101110_00001011; let r = _mm512_kortestz(a, b); @@ -56214,7 +58068,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_test_epi32_mask() { + const fn test_mm512_test_epi32_mask() { let a = _mm512_set1_epi32(1 << 0); let b = _mm512_set1_epi32(1 << 0 | 1 << 1); let r = _mm512_test_epi32_mask(a, b); @@ -56223,7 +58077,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_test_epi32_mask() { + const fn test_mm512_mask_test_epi32_mask() { let a = _mm512_set1_epi32(1 << 0); let b = _mm512_set1_epi32(1 << 0 | 1 << 1); let r = _mm512_mask_test_epi32_mask(0, a, b); @@ -56234,7 +58088,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_test_epi32_mask() { + const fn test_mm256_test_epi32_mask() { let a = _mm256_set1_epi32(1 << 0); let b = _mm256_set1_epi32(1 << 0 | 1 << 1); let r = _mm256_test_epi32_mask(a, b); @@ -56243,7 +58097,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_test_epi32_mask() { + const fn test_mm256_mask_test_epi32_mask() { let a = _mm256_set1_epi32(1 << 0); let b = _mm256_set1_epi32(1 << 0 | 1 << 1); let r = _mm256_mask_test_epi32_mask(0, a, b); @@ -56254,7 +58108,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_test_epi32_mask() { + const fn test_mm_test_epi32_mask() { let a = _mm_set1_epi32(1 << 0); let b = _mm_set1_epi32(1 << 0 | 1 << 1); let r = _mm_test_epi32_mask(a, b); @@ -56263,7 +58117,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_test_epi32_mask() { + const fn test_mm_mask_test_epi32_mask() { let a = _mm_set1_epi32(1 << 0); let b = _mm_set1_epi32(1 << 0 | 1 << 1); let r = _mm_mask_test_epi32_mask(0, a, b); @@ -56274,7 +58128,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_testn_epi32_mask() { + const fn test_mm512_testn_epi32_mask() { let a = _mm512_set1_epi32(1 << 0); let b = _mm512_set1_epi32(1 << 0 | 1 << 1); let r = _mm512_testn_epi32_mask(a, b); @@ -56283,7 +58137,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_testn_epi32_mask() { + const fn test_mm512_mask_testn_epi32_mask() { let a = _mm512_set1_epi32(1 << 0); let b = _mm512_set1_epi32(1 << 1); let r = _mm512_mask_test_epi32_mask(0, a, b); @@ -56294,7 +58148,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_testn_epi32_mask() { + const fn test_mm256_testn_epi32_mask() { let a = _mm256_set1_epi32(1 << 0); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_testn_epi32_mask(a, b); @@ -56303,7 +58157,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_testn_epi32_mask() { + const fn test_mm256_mask_testn_epi32_mask() { let a = _mm256_set1_epi32(1 << 0); let b = _mm256_set1_epi32(1 << 1); let r = _mm256_mask_test_epi32_mask(0, a, b); @@ -56314,7 +58168,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_testn_epi32_mask() { + const fn test_mm_testn_epi32_mask() { let a = _mm_set1_epi32(1 << 0); let b = _mm_set1_epi32(1 << 1); let r = _mm_testn_epi32_mask(a, b); @@ -56323,7 +58177,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_testn_epi32_mask() { + const fn test_mm_mask_testn_epi32_mask() { let a = _mm_set1_epi32(1 << 0); let b = _mm_set1_epi32(1 << 1); let r = _mm_mask_test_epi32_mask(0, a, b); @@ -56392,91 +58246,91 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_add_epi32() { + const fn test_mm512_reduce_add_epi32() { let a = _mm512_set1_epi32(1); let e: i32 = _mm512_reduce_add_epi32(a); assert_eq!(16, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_add_epi32() { + const fn test_mm512_mask_reduce_add_epi32() { let a = _mm512_set1_epi32(1); let e: i32 = _mm512_mask_reduce_add_epi32(0b11111111_00000000, a); assert_eq!(8, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_add_ps() { + const fn test_mm512_reduce_add_ps() { let a = _mm512_set1_ps(1.); let e: f32 = _mm512_reduce_add_ps(a); assert_eq!(16., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_add_ps() { + const fn test_mm512_mask_reduce_add_ps() { let a = _mm512_set1_ps(1.); let e: f32 = _mm512_mask_reduce_add_ps(0b11111111_00000000, a); assert_eq!(8., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_mul_epi32() { + const fn test_mm512_reduce_mul_epi32() { let a = _mm512_set1_epi32(2); let e: i32 = _mm512_reduce_mul_epi32(a); assert_eq!(65536, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_mul_epi32() { + const fn test_mm512_mask_reduce_mul_epi32() { let a = _mm512_set1_epi32(2); let e: i32 = _mm512_mask_reduce_mul_epi32(0b11111111_00000000, a); assert_eq!(256, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_mul_ps() { + const fn test_mm512_reduce_mul_ps() { let a = _mm512_set1_ps(2.); let e: f32 = _mm512_reduce_mul_ps(a); assert_eq!(65536., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_mul_ps() { + const fn test_mm512_mask_reduce_mul_ps() { let a = _mm512_set1_ps(2.); let e: f32 = _mm512_mask_reduce_mul_ps(0b11111111_00000000, a); assert_eq!(256., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_max_epi32() { + const fn test_mm512_reduce_max_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i32 = _mm512_reduce_max_epi32(a); assert_eq!(15, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_max_epi32() { + const fn test_mm512_mask_reduce_max_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i32 = _mm512_mask_reduce_max_epi32(0b11111111_00000000, a); assert_eq!(7, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_max_epu32() { + const fn test_mm512_reduce_max_epu32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u32 = _mm512_reduce_max_epu32(a); assert_eq!(15, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_max_epu32() { + const fn test_mm512_mask_reduce_max_epu32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u32 = _mm512_mask_reduce_max_epu32(0b11111111_00000000, a); assert_eq!(7, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_max_ps() { + fn test_mm512_reduce_max_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -56485,7 +58339,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_max_ps() { + fn test_mm512_mask_reduce_max_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -56494,35 +58348,35 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_min_epi32() { + const fn test_mm512_reduce_min_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i32 = _mm512_reduce_min_epi32(a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_min_epi32() { + const fn test_mm512_mask_reduce_min_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: i32 = _mm512_mask_reduce_min_epi32(0b11111111_00000000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_min_epu32() { + const fn test_mm512_reduce_min_epu32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u32 = _mm512_reduce_min_epu32(a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_min_epu32() { + const fn test_mm512_mask_reduce_min_epu32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let e: u32 = _mm512_mask_reduce_min_epu32(0b11111111_00000000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_min_ps() { + fn test_mm512_reduce_min_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -56531,7 +58385,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_min_ps() { + fn test_mm512_mask_reduce_min_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -56540,35 +58394,35 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_and_epi32() { + const fn test_mm512_reduce_and_epi32() { let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e: i32 = _mm512_reduce_and_epi32(a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_and_epi32() { + const fn test_mm512_mask_reduce_and_epi32() { let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e: i32 = _mm512_mask_reduce_and_epi32(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_or_epi32() { + const fn test_mm512_reduce_or_epi32() { let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e: i32 = _mm512_reduce_or_epi32(a); assert_eq!(3, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_or_epi32() { + const fn test_mm512_mask_reduce_or_epi32() { let a = _mm512_set_epi32(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2); let e: i32 = _mm512_mask_reduce_and_epi32(0b11111111_00000000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_compress_epi32() { + fn test_mm512_mask_compress_epi32() { let src = _mm512_set1_epi32(200); let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_mask_compress_epi32(src, 0, a); @@ -56581,7 +58435,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_compress_epi32() { + fn test_mm512_maskz_compress_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_compress_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -56591,7 +58445,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_compress_epi32() { + fn test_mm256_mask_compress_epi32() { let src = _mm256_set1_epi32(200); let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_mask_compress_epi32(src, 0, a); @@ -56602,7 +58456,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_compress_epi32() { + fn test_mm256_maskz_compress_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_compress_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -56612,7 +58466,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_compress_epi32() { + fn test_mm_mask_compress_epi32() { let src = _mm_set1_epi32(200); let a = _mm_set_epi32(0, 1, 2, 3); let r = _mm_mask_compress_epi32(src, 0, a); @@ -56623,7 +58477,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_compress_epi32() { + fn test_mm_maskz_compress_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let r = _mm_maskz_compress_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -56633,7 +58487,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_compress_ps() { + fn test_mm512_mask_compress_ps() { let src = _mm512_set1_ps(200.); let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -56648,7 +58502,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_compress_ps() { + fn test_mm512_maskz_compress_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -56662,7 +58516,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_compress_ps() { + fn test_mm256_mask_compress_ps() { let src = _mm256_set1_ps(200.); let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_mask_compress_ps(src, 0, a); @@ -56673,7 +58527,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_compress_ps() { + fn test_mm256_maskz_compress_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_maskz_compress_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -56683,7 +58537,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_compress_ps() { + fn test_mm_mask_compress_ps() { let src = _mm_set1_ps(200.); let a = _mm_set_ps(0., 1., 2., 3.); let r = _mm_mask_compress_ps(src, 0, a); @@ -56694,7 +58548,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_compress_ps() { + fn test_mm_maskz_compress_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let r = _mm_maskz_compress_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -56849,7 +58703,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_expand_epi32() { + fn test_mm512_maskz_expand_epi32() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_expand_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -56859,7 +58713,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_expand_epi32() { + fn test_mm256_mask_expand_epi32() { let src = _mm256_set1_epi32(200); let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_mask_expand_epi32(src, 0, a); @@ -56870,7 +58724,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_expand_epi32() { + fn test_mm256_maskz_expand_epi32() { let a = _mm256_set_epi32(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm256_maskz_expand_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -56880,7 +58734,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_expand_epi32() { + fn test_mm_mask_expand_epi32() { let src = _mm_set1_epi32(200); let a = _mm_set_epi32(0, 1, 2, 3); let r = _mm_mask_expand_epi32(src, 0, a); @@ -56891,7 +58745,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_expand_epi32() { + fn test_mm_maskz_expand_epi32() { let a = _mm_set_epi32(0, 1, 2, 3); let r = _mm_maskz_expand_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -56901,7 +58755,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_expand_ps() { + fn test_mm512_mask_expand_ps() { let src = _mm512_set1_ps(200.); let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., @@ -56916,7 +58770,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_expand_ps() { + fn test_mm512_maskz_expand_ps() { let a = _mm512_set_ps( 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., ); @@ -56930,7 +58784,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_expand_ps() { + fn test_mm256_mask_expand_ps() { let src = _mm256_set1_ps(200.); let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_mask_expand_ps(src, 0, a); @@ -56941,7 +58795,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_expand_ps() { + fn test_mm256_maskz_expand_ps() { let a = _mm256_set_ps(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm256_maskz_expand_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -56951,7 +58805,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_expand_ps() { + fn test_mm_mask_expand_ps() { let src = _mm_set1_ps(200.); let a = _mm_set_ps(0., 1., 2., 3.); let r = _mm_mask_expand_ps(src, 0, a); @@ -56962,7 +58816,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_expand_ps() { + fn test_mm_maskz_expand_ps() { let a = _mm_set_ps(0., 1., 2., 3.); let r = _mm_maskz_expand_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -56972,7 +58826,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_loadu_epi32() { + const unsafe fn test_mm512_loadu_epi32() { let a = &[4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50]; let p = a.as_ptr(); let r = _mm512_loadu_epi32(black_box(p)); @@ -56981,7 +58835,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_loadu_epi32() { + const unsafe fn test_mm256_loadu_epi32() { let a = &[4, 3, 2, 5, 8, 9, 64, 50]; let p = a.as_ptr(); let r = _mm256_loadu_epi32(black_box(p)); @@ -56990,7 +58844,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_loadu_epi32() { + const unsafe fn test_mm_loadu_epi32() { let a = &[4, 3, 2, 5]; let p = a.as_ptr(); let r = _mm_loadu_epi32(black_box(p)); @@ -57194,7 +59048,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_storeu_epi32() { + const unsafe fn test_mm512_storeu_epi32() { let a = _mm512_set1_epi32(9); let mut r = _mm512_undefined_epi32(); _mm512_storeu_epi32(&mut r as *mut _ as *mut i32, a); @@ -57202,7 +59056,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_storeu_epi32() { + const unsafe fn test_mm256_storeu_epi32() { let a = _mm256_set1_epi32(9); let mut r = _mm256_undefined_si256(); _mm256_storeu_epi32(&mut r as *mut _ as *mut i32, a); @@ -57210,7 +59064,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_storeu_epi32() { + const unsafe fn test_mm_storeu_epi32() { let a = _mm_set1_epi32(9); let mut r = _mm_undefined_si128(); _mm_storeu_epi32(&mut r as *mut _ as *mut i32, a); @@ -57218,7 +59072,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_loadu_si512() { + const unsafe fn test_mm512_loadu_si512() { let a = &[4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50]; let p = a.as_ptr().cast(); let r = _mm512_loadu_si512(black_box(p)); @@ -57227,7 +59081,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_storeu_si512() { + const unsafe fn test_mm512_storeu_si512() { let a = _mm512_set1_epi32(9); let mut r = _mm512_undefined_epi32(); _mm512_storeu_si512(&mut r as *mut _, a); @@ -57235,7 +59089,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_load_si512() { + const unsafe fn test_mm512_load_si512() { #[repr(align(64))] struct Align { data: [i32; 16], // 64 bytes @@ -57250,7 +59104,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_store_si512() { + const unsafe fn test_mm512_store_si512() { let a = _mm512_set1_epi32(9); let mut r = _mm512_undefined_epi32(); _mm512_store_si512(&mut r as *mut _, a); @@ -57258,7 +59112,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_load_epi32() { + const unsafe fn test_mm512_load_epi32() { #[repr(align(64))] struct Align { data: [i32; 16], // 64 bytes @@ -57273,7 +59127,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_load_epi32() { + const unsafe fn test_mm256_load_epi32() { #[repr(align(64))] struct Align { data: [i32; 8], @@ -57288,7 +59142,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_load_epi32() { + const unsafe fn test_mm_load_epi32() { #[repr(align(64))] struct Align { data: [i32; 4], @@ -57301,7 +59155,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_store_epi32() { + const unsafe fn test_mm512_store_epi32() { let a = _mm512_set1_epi32(9); let mut r = _mm512_undefined_epi32(); _mm512_store_epi32(&mut r as *mut _ as *mut i32, a); @@ -57309,7 +59163,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_store_epi32() { + const unsafe fn test_mm256_store_epi32() { let a = _mm256_set1_epi32(9); let mut r = _mm256_undefined_si256(); _mm256_store_epi32(&mut r as *mut _ as *mut i32, a); @@ -57317,7 +59171,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_store_epi32() { + const unsafe fn test_mm_store_epi32() { let a = _mm_set1_epi32(9); let mut r = _mm_undefined_si128(); _mm_store_epi32(&mut r as *mut _ as *mut i32, a); @@ -57325,7 +59179,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_load_ps() { + const unsafe fn test_mm512_load_ps() { #[repr(align(64))] struct Align { data: [f32; 16], // 64 bytes @@ -57344,7 +59198,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_store_ps() { + const unsafe fn test_mm512_store_ps() { let a = _mm512_set1_ps(9.); let mut r = _mm512_undefined_ps(); _mm512_store_ps(&mut r as *mut _ as *mut f32, a); @@ -57352,7 +59206,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_set1_epi32() { + const fn test_mm512_mask_set1_epi32() { let src = _mm512_set1_epi32(2); let a: i32 = 11; let r = _mm512_mask_set1_epi32(src, 0, a); @@ -57363,7 +59217,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_set1_epi32() { + const fn test_mm512_maskz_set1_epi32() { let a: i32 = 11; let r = _mm512_maskz_set1_epi32(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -57373,7 +59227,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_set1_epi32() { + const fn test_mm256_mask_set1_epi32() { let src = _mm256_set1_epi32(2); let a: i32 = 11; let r = _mm256_mask_set1_epi32(src, 0, a); @@ -57384,7 +59238,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_set1_epi32() { + const fn test_mm256_maskz_set1_epi32() { let a: i32 = 11; let r = _mm256_maskz_set1_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -57394,7 +59248,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_set1_epi32() { + const fn test_mm_mask_set1_epi32() { let src = _mm_set1_epi32(2); let a: i32 = 11; let r = _mm_mask_set1_epi32(src, 0, a); @@ -57405,7 +59259,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_set1_epi32() { + const fn test_mm_maskz_set1_epi32() { let a: i32 = 11; let r = _mm_maskz_set1_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -57415,7 +59269,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_move_ss() { + const fn test_mm_mask_move_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -57428,7 +59282,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_move_ss() { + const fn test_mm_maskz_move_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_move_ss(0, a, b); @@ -57440,7 +59294,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_move_sd() { + const fn test_mm_mask_move_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57453,7 +59307,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_move_sd() { + const fn test_mm_maskz_move_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_move_sd(0, a, b); @@ -57465,7 +59319,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_add_ss() { + const fn test_mm_mask_add_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -57478,7 +59332,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_add_ss() { + const fn test_mm_maskz_add_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_add_ss(0, a, b); @@ -57490,7 +59344,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_add_sd() { + const fn test_mm_mask_add_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57503,7 +59357,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_add_sd() { + const fn test_mm_maskz_add_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_add_sd(0, a, b); @@ -57515,7 +59369,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sub_ss() { + const fn test_mm_mask_sub_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -57528,7 +59382,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sub_ss() { + const fn test_mm_maskz_sub_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_sub_ss(0, a, b); @@ -57540,7 +59394,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sub_sd() { + const fn test_mm_mask_sub_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57553,7 +59407,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sub_sd() { + const fn test_mm_maskz_sub_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_sub_sd(0, a, b); @@ -57565,7 +59419,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_mul_ss() { + const fn test_mm_mask_mul_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -57578,7 +59432,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_mul_ss() { + const fn test_mm_maskz_mul_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_mul_ss(0, a, b); @@ -57590,7 +59444,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_mul_sd() { + const fn test_mm_mask_mul_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57603,7 +59457,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_mul_sd() { + const fn test_mm_maskz_mul_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_mul_sd(0, a, b); @@ -57615,7 +59469,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_div_ss() { + const fn test_mm_mask_div_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -57628,7 +59482,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_div_ss() { + const fn test_mm_maskz_div_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_div_ss(0, a, b); @@ -57640,7 +59494,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_div_sd() { + const fn test_mm_mask_div_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57653,7 +59507,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_div_sd() { + const fn test_mm_maskz_div_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_div_sd(0, a, b); @@ -57665,7 +59519,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_max_ss() { + fn test_mm_mask_max_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_mask_max_ss(a, 0, a, b); @@ -57677,7 +59531,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_max_ss() { + fn test_mm_maskz_max_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_maskz_max_ss(0, a, b); @@ -57689,7 +59543,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_max_sd() { + fn test_mm_mask_max_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_mask_max_sd(a, 0, a, b); @@ -57701,7 +59555,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_max_sd() { + fn test_mm_maskz_max_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_maskz_max_sd(0, a, b); @@ -57713,7 +59567,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_min_ss() { + fn test_mm_mask_min_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_mask_min_ss(a, 0, a, b); @@ -57725,7 +59579,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_min_ss() { + fn test_mm_maskz_min_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_maskz_min_ss(0, a, b); @@ -57737,7 +59591,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_min_sd() { + fn test_mm_mask_min_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_mask_min_sd(a, 0, a, b); @@ -57749,7 +59603,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_min_sd() { + fn test_mm_maskz_min_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_maskz_min_sd(0, a, b); @@ -57761,7 +59615,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sqrt_ss() { + fn test_mm_mask_sqrt_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); @@ -57774,7 +59628,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sqrt_ss() { + fn test_mm_maskz_sqrt_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_maskz_sqrt_ss(0, a, b); @@ -57786,7 +59640,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sqrt_sd() { + fn test_mm_mask_sqrt_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57799,7 +59653,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sqrt_sd() { + fn test_mm_maskz_sqrt_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_sqrt_sd(0, a, b); @@ -57811,7 +59665,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_rsqrt14_ss() { + fn test_mm_rsqrt14_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_rsqrt14_ss(a, b); @@ -57820,7 +59674,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_rsqrt14_ss() { + fn test_mm_mask_rsqrt14_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); @@ -57833,7 +59687,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_rsqrt14_ss() { + fn test_mm_maskz_rsqrt14_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_maskz_rsqrt14_ss(0, a, b); @@ -57845,7 +59699,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_rsqrt14_sd() { + fn test_mm_rsqrt14_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_rsqrt14_sd(a, b); @@ -57854,7 +59708,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_rsqrt14_sd() { + fn test_mm_mask_rsqrt14_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57867,7 +59721,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_rsqrt14_sd() { + fn test_mm_maskz_rsqrt14_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_rsqrt14_sd(0, a, b); @@ -57879,7 +59733,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_rcp14_ss() { + fn test_mm_rcp14_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_rcp14_ss(a, b); @@ -57888,7 +59742,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_rcp14_ss() { + fn test_mm_mask_rcp14_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); @@ -57901,7 +59755,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_rcp14_ss() { + fn test_mm_maskz_rcp14_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_maskz_rcp14_ss(0, a, b); @@ -57913,7 +59767,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_rcp14_sd() { + fn test_mm_rcp14_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_rcp14_sd(a, b); @@ -57922,7 +59776,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_rcp14_sd() { + fn test_mm_mask_rcp14_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -57935,7 +59789,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_rcp14_sd() { + fn test_mm_maskz_rcp14_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_rcp14_sd(0, a, b); @@ -57947,7 +59801,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getexp_ss() { + fn test_mm_getexp_ss() { let a = _mm_set1_ps(2.); let b = _mm_set1_ps(3.); let r = _mm_getexp_ss(a, b); @@ -57956,7 +59810,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getexp_ss() { + fn test_mm_mask_getexp_ss() { let a = _mm_set1_ps(2.); let b = _mm_set1_ps(3.); let r = _mm_mask_getexp_ss(a, 0, a, b); @@ -57968,7 +59822,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getexp_ss() { + fn test_mm_maskz_getexp_ss() { let a = _mm_set1_ps(2.); let b = _mm_set1_ps(3.); let r = _mm_maskz_getexp_ss(0, a, b); @@ -57980,7 +59834,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getexp_sd() { + fn test_mm_getexp_sd() { let a = _mm_set1_pd(2.); let b = _mm_set1_pd(3.); let r = _mm_getexp_sd(a, b); @@ -57989,7 +59843,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getexp_sd() { + fn test_mm_mask_getexp_sd() { let a = _mm_set1_pd(2.); let b = _mm_set1_pd(3.); let r = _mm_mask_getexp_sd(a, 0, a, b); @@ -58001,7 +59855,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getexp_sd() { + fn test_mm_maskz_getexp_sd() { let a = _mm_set1_pd(2.); let b = _mm_set1_pd(3.); let r = _mm_maskz_getexp_sd(0, a, b); @@ -58013,7 +59867,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getmant_ss() { + fn test_mm_getmant_ss() { let a = _mm_set1_ps(20.); let b = _mm_set1_ps(10.); let r = _mm_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, b); @@ -58022,7 +59876,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getmant_ss() { + fn test_mm_mask_getmant_ss() { let a = _mm_set1_ps(20.); let b = _mm_set1_ps(10.); let r = _mm_mask_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a, b); @@ -58034,7 +59888,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getmant_ss() { + fn test_mm_maskz_getmant_ss() { let a = _mm_set1_ps(20.); let b = _mm_set1_ps(10.); let r = _mm_maskz_getmant_ss::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a, b); @@ -58046,7 +59900,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getmant_sd() { + fn test_mm_getmant_sd() { let a = _mm_set1_pd(20.); let b = _mm_set1_pd(10.); let r = _mm_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, b); @@ -58055,7 +59909,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getmant_sd() { + fn test_mm_mask_getmant_sd() { let a = _mm_set1_pd(20.); let b = _mm_set1_pd(10.); let r = _mm_mask_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a, b); @@ -58067,7 +59921,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getmant_sd() { + fn test_mm_maskz_getmant_sd() { let a = _mm_set1_pd(20.); let b = _mm_set1_pd(10.); let r = _mm_maskz_getmant_sd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a, b); @@ -58079,7 +59933,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_roundscale_ss() { + fn test_mm_roundscale_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_roundscale_ss::<0>(a, b); @@ -58088,7 +59942,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_roundscale_ss() { + fn test_mm_mask_roundscale_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_mask_roundscale_ss::<0>(a, 0, a, b); @@ -58100,7 +59954,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_roundscale_ss() { + fn test_mm_maskz_roundscale_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_maskz_roundscale_ss::<0>(0, a, b); @@ -58112,7 +59966,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_roundscale_sd() { + fn test_mm_roundscale_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_roundscale_sd::<0>(a, b); @@ -58121,7 +59975,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_roundscale_sd() { + fn test_mm_mask_roundscale_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_mask_roundscale_sd::<0>(a, 0, a, b); @@ -58133,7 +59987,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_roundscale_sd() { + fn test_mm_maskz_roundscale_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_maskz_roundscale_sd::<0>(0, a, b); @@ -58145,7 +59999,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_scalef_ss() { + fn test_mm_scalef_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_scalef_ss(a, b); @@ -58154,7 +60008,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_scalef_ss() { + fn test_mm_mask_scalef_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_mask_scalef_ss(a, 0, a, b); @@ -58166,7 +60020,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_scalef_ss() { + fn test_mm_maskz_scalef_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_maskz_scalef_ss(0, a, b); @@ -58178,7 +60032,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_scalef_sd() { + fn test_mm_scalef_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_scalef_sd(a, b); @@ -58187,7 +60041,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_scalef_sd() { + fn test_mm_mask_scalef_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_mask_scalef_sd(a, 0, a, b); @@ -58199,7 +60053,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_scalef_sd() { + fn test_mm_maskz_scalef_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_maskz_scalef_sd(0, a, b); @@ -58211,7 +60065,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmadd_ss() { + const fn test_mm_mask_fmadd_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58223,7 +60077,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmadd_ss() { + const fn test_mm_maskz_fmadd_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58236,7 +60090,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmadd_ss() { + const fn test_mm_mask3_fmadd_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58248,7 +60102,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmadd_sd() { + const fn test_mm_mask_fmadd_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58260,7 +60114,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmadd_sd() { + const fn test_mm_maskz_fmadd_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58273,7 +60127,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmadd_sd() { + const fn test_mm_mask3_fmadd_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58285,7 +60139,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmsub_ss() { + const fn test_mm_mask_fmsub_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58297,7 +60151,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmsub_ss() { + const fn test_mm_maskz_fmsub_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58310,7 +60164,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmsub_ss() { + const fn test_mm_mask3_fmsub_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58322,7 +60176,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmsub_sd() { + const fn test_mm_mask_fmsub_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58334,7 +60188,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmsub_sd() { + const fn test_mm_maskz_fmsub_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58347,7 +60201,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmsub_sd() { + const fn test_mm_mask3_fmsub_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58359,7 +60213,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmadd_ss() { + const fn test_mm_mask_fnmadd_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58371,7 +60225,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmadd_ss() { + const fn test_mm_maskz_fnmadd_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58384,7 +60238,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmadd_ss() { + const fn test_mm_mask3_fnmadd_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58396,7 +60250,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmadd_sd() { + const fn test_mm_mask_fnmadd_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58408,7 +60262,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmadd_sd() { + const fn test_mm_maskz_fnmadd_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58421,7 +60275,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmadd_sd() { + const fn test_mm_mask3_fnmadd_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58433,7 +60287,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmsub_ss() { + const fn test_mm_mask_fnmsub_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58445,7 +60299,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmsub_ss() { + const fn test_mm_maskz_fnmsub_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58458,7 +60312,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmsub_ss() { + const fn test_mm_mask3_fnmsub_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -58470,7 +60324,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmsub_sd() { + const fn test_mm_mask_fnmsub_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58482,7 +60336,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmsub_sd() { + const fn test_mm_maskz_fnmsub_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58495,7 +60349,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmsub_sd() { + const fn test_mm_mask3_fnmsub_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -58507,7 +60361,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_add_round_ss() { + fn test_mm_add_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58516,7 +60370,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_add_round_ss() { + fn test_mm_mask_add_round_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -58531,7 +60385,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_add_round_ss() { + fn test_mm_maskz_add_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_add_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58544,7 +60398,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_add_round_sd() { + fn test_mm_add_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58553,7 +60407,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_add_round_sd() { + fn test_mm_mask_add_round_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -58568,7 +60422,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_add_round_sd() { + fn test_mm_maskz_add_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_add_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58581,7 +60435,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_sub_round_ss() { + fn test_mm_sub_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58590,7 +60444,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sub_round_ss() { + fn test_mm_mask_sub_round_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -58605,7 +60459,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sub_round_ss() { + fn test_mm_maskz_sub_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_sub_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58618,7 +60472,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_sub_round_sd() { + fn test_mm_sub_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58627,7 +60481,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sub_round_sd() { + fn test_mm_mask_sub_round_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -58642,7 +60496,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sub_round_sd() { + fn test_mm_maskz_sub_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_sub_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58655,7 +60509,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mul_round_ss() { + fn test_mm_mul_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58664,7 +60518,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_mul_round_ss() { + fn test_mm_mask_mul_round_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -58679,7 +60533,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_mul_round_ss() { + fn test_mm_maskz_mul_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_mul_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58692,7 +60546,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mul_round_sd() { + fn test_mm_mul_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58701,7 +60555,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_mul_round_sd() { + fn test_mm_mask_mul_round_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -58716,7 +60570,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_mul_round_sd() { + fn test_mm_maskz_mul_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_mul_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58729,7 +60583,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_div_round_ss() { + fn test_mm_div_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58738,7 +60592,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_div_round_ss() { + fn test_mm_mask_div_round_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); @@ -58753,7 +60607,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_div_round_ss() { + fn test_mm_maskz_div_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 40.); let r = _mm_maskz_div_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58766,7 +60620,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_div_round_sd() { + fn test_mm_div_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58775,7 +60629,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_div_round_sd() { + fn test_mm_mask_div_round_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -58790,7 +60644,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_div_round_sd() { + fn test_mm_maskz_div_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_div_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58803,7 +60657,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_max_round_ss() { + fn test_mm_max_round_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -58812,7 +60666,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_max_round_ss() { + fn test_mm_mask_max_round_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_mask_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -58824,7 +60678,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_max_round_ss() { + fn test_mm_maskz_max_round_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_maskz_max_round_ss::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -58836,7 +60690,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_max_round_sd() { + fn test_mm_max_round_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -58845,7 +60699,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_max_round_sd() { + fn test_mm_mask_max_round_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_mask_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -58857,7 +60711,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_max_round_sd() { + fn test_mm_maskz_max_round_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_maskz_max_round_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -58869,7 +60723,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_min_round_ss() { + fn test_mm_min_round_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -58878,7 +60732,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_min_round_ss() { + fn test_mm_mask_min_round_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_mask_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -58890,7 +60744,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_min_round_ss() { + fn test_mm_maskz_min_round_ss() { let a = _mm_set_ps(0., 1., 2., 3.); let b = _mm_set_ps(4., 5., 6., 7.); let r = _mm_maskz_min_round_ss::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -58902,7 +60756,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_min_round_sd() { + fn test_mm_min_round_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -58911,7 +60765,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_min_round_sd() { + fn test_mm_mask_min_round_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_mask_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -58923,7 +60777,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_min_round_sd() { + fn test_mm_maskz_min_round_sd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(2., 3.); let r = _mm_maskz_min_round_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -58935,7 +60789,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_sqrt_round_ss() { + fn test_mm_sqrt_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58944,7 +60798,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sqrt_round_ss() { + fn test_mm_mask_sqrt_round_ss() { let src = _mm_set_ps(10., 11., 100., 110.); let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); @@ -58959,7 +60813,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sqrt_round_ss() { + fn test_mm_maskz_sqrt_round_ss() { let a = _mm_set_ps(1., 2., 10., 20.); let b = _mm_set_ps(3., 4., 30., 4.); let r = _mm_maskz_sqrt_round_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -58972,7 +60826,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_sqrt_round_sd() { + fn test_mm_sqrt_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -58981,7 +60835,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_sqrt_round_sd() { + fn test_mm_mask_sqrt_round_sd() { let src = _mm_set_pd(10., 11.); let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); @@ -58996,7 +60850,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_sqrt_round_sd() { + fn test_mm_maskz_sqrt_round_sd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(3., 4.); let r = _mm_maskz_sqrt_round_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -59009,7 +60863,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getexp_round_ss() { + fn test_mm_getexp_round_ss() { let a = _mm_set1_ps(2.); let b = _mm_set1_ps(3.); let r = _mm_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -59018,7 +60872,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getexp_round_ss() { + fn test_mm_mask_getexp_round_ss() { let a = _mm_set1_ps(2.); let b = _mm_set1_ps(3.); let r = _mm_mask_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -59030,7 +60884,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getexp_round_ss() { + fn test_mm_maskz_getexp_round_ss() { let a = _mm_set1_ps(2.); let b = _mm_set1_ps(3.); let r = _mm_maskz_getexp_round_ss::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -59042,7 +60896,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getexp_round_sd() { + fn test_mm_getexp_round_sd() { let a = _mm_set1_pd(2.); let b = _mm_set1_pd(3.); let r = _mm_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -59051,7 +60905,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getexp_round_sd() { + fn test_mm_mask_getexp_round_sd() { let a = _mm_set1_pd(2.); let b = _mm_set1_pd(3.); let r = _mm_mask_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -59063,7 +60917,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getexp_round_sd() { + fn test_mm_maskz_getexp_round_sd() { let a = _mm_set1_pd(2.); let b = _mm_set1_pd(3.); let r = _mm_maskz_getexp_round_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -59075,7 +60929,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getmant_round_ss() { + fn test_mm_getmant_round_ss() { let a = _mm_set1_ps(20.); let b = _mm_set1_ps(10.); let r = @@ -59087,7 +60941,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getmant_round_ss() { + fn test_mm_mask_getmant_round_ss() { let a = _mm_set1_ps(20.); let b = _mm_set1_ps(10.); let r = _mm_mask_getmant_round_ss::< @@ -59107,7 +60961,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getmant_round_ss() { + fn test_mm_maskz_getmant_round_ss() { let a = _mm_set1_ps(20.); let b = _mm_set1_ps(10.); let r = _mm_maskz_getmant_round_ss::< @@ -59127,7 +60981,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_getmant_round_sd() { + fn test_mm_getmant_round_sd() { let a = _mm_set1_pd(20.); let b = _mm_set1_pd(10.); let r = @@ -59139,7 +60993,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_getmant_round_sd() { + fn test_mm_mask_getmant_round_sd() { let a = _mm_set1_pd(20.); let b = _mm_set1_pd(10.); let r = _mm_mask_getmant_round_sd::< @@ -59159,7 +61013,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_getmant_round_sd() { + fn test_mm_maskz_getmant_round_sd() { let a = _mm_set1_pd(20.); let b = _mm_set1_pd(10.); let r = _mm_maskz_getmant_round_sd::< @@ -59179,7 +61033,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_roundscale_round_ss() { + fn test_mm_roundscale_round_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, b); @@ -59188,7 +61042,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_roundscale_round_ss() { + fn test_mm_mask_roundscale_round_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_mask_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -59200,7 +61054,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_roundscale_round_ss() { + fn test_mm_maskz_roundscale_round_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_maskz_roundscale_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -59212,7 +61066,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_roundscale_round_sd() { + fn test_mm_roundscale_round_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, b); @@ -59221,7 +61075,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_roundscale_round_sd() { + fn test_mm_mask_roundscale_round_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_mask_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -59233,7 +61087,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_roundscale_round_sd() { + fn test_mm_maskz_roundscale_round_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_maskz_roundscale_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -59245,7 +61099,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_scalef_round_ss() { + fn test_mm_scalef_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -59254,7 +61108,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_scalef_round_ss() { + fn test_mm_mask_scalef_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = _mm_mask_scalef_round_ss::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -59270,7 +61124,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_scalef_round_ss() { + fn test_mm_maskz_scalef_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(3.); let r = @@ -59285,7 +61139,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_scalef_round_sd() { + fn test_mm_scalef_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -59294,7 +61148,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_scalef_round_sd() { + fn test_mm_mask_scalef_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_mask_scalef_round_sd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -59310,7 +61164,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_scalef_round_sd() { + fn test_mm_maskz_scalef_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = @@ -59325,7 +61179,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fmadd_round_ss() { + fn test_mm_fmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59335,7 +61189,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmadd_round_ss() { + fn test_mm_mask_fmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59351,7 +61205,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmadd_round_ss() { + fn test_mm_maskz_fmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59368,7 +61222,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmadd_round_ss() { + fn test_mm_mask3_fmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59384,7 +61238,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fmadd_round_sd() { + fn test_mm_fmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59394,7 +61248,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmadd_round_sd() { + fn test_mm_mask_fmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59410,7 +61264,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmadd_round_sd() { + fn test_mm_maskz_fmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59427,7 +61281,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmadd_round_sd() { + fn test_mm_mask3_fmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59443,7 +61297,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fmsub_round_ss() { + fn test_mm_fmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59453,7 +61307,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmsub_round_ss() { + fn test_mm_mask_fmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59469,7 +61323,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmsub_round_ss() { + fn test_mm_maskz_fmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59486,7 +61340,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmsub_round_ss() { + fn test_mm_mask3_fmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59502,7 +61356,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fmsub_round_sd() { + fn test_mm_fmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59512,7 +61366,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fmsub_round_sd() { + fn test_mm_mask_fmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59528,7 +61382,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fmsub_round_sd() { + fn test_mm_maskz_fmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59545,7 +61399,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fmsub_round_sd() { + fn test_mm_mask3_fmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59561,7 +61415,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fnmadd_round_ss() { + fn test_mm_fnmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59571,7 +61425,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmadd_round_ss() { + fn test_mm_mask_fnmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59587,7 +61441,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmadd_round_ss() { + fn test_mm_maskz_fnmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59604,7 +61458,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmadd_round_ss() { + fn test_mm_mask3_fnmadd_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59620,7 +61474,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fnmadd_round_sd() { + fn test_mm_fnmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59630,7 +61484,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmadd_round_sd() { + fn test_mm_mask_fnmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59646,7 +61500,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmadd_round_sd() { + fn test_mm_maskz_fnmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59663,7 +61517,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmadd_round_sd() { + fn test_mm_mask3_fnmadd_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59679,7 +61533,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fnmsub_round_ss() { + fn test_mm_fnmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59689,7 +61543,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmsub_round_ss() { + fn test_mm_mask_fnmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59705,7 +61559,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmsub_round_ss() { + fn test_mm_maskz_fnmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59722,7 +61576,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmsub_round_ss() { + fn test_mm_mask3_fnmsub_round_ss() { let a = _mm_set1_ps(1.); let b = _mm_set1_ps(2.); let c = _mm_set1_ps(3.); @@ -59738,7 +61592,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fnmsub_round_sd() { + fn test_mm_fnmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59748,7 +61602,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fnmsub_round_sd() { + fn test_mm_mask_fnmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59764,7 +61618,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fnmsub_round_sd() { + fn test_mm_maskz_fnmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59781,7 +61635,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask3_fnmsub_round_sd() { + fn test_mm_mask3_fnmsub_round_sd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let c = _mm_set1_pd(3.); @@ -59797,7 +61651,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fixupimm_ss() { + fn test_mm_fixupimm_ss() { let a = _mm_set_ps(0., 0., 0., f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -59807,7 +61661,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fixupimm_ss() { + fn test_mm_mask_fixupimm_ss() { let a = _mm_set_ps(0., 0., 0., f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -59817,7 +61671,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fixupimm_ss() { + fn test_mm_maskz_fixupimm_ss() { let a = _mm_set_ps(0., 0., 0., f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -59830,7 +61684,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fixupimm_sd() { + fn test_mm_fixupimm_sd() { let a = _mm_set_pd(0., f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -59840,7 +61694,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fixupimm_sd() { + fn test_mm_mask_fixupimm_sd() { let a = _mm_set_pd(0., f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -59850,7 +61704,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fixupimm_sd() { + fn test_mm_maskz_fixupimm_sd() { let a = _mm_set_pd(0., f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -59863,7 +61717,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fixupimm_round_ss() { + fn test_mm_fixupimm_round_ss() { let a = _mm_set_ps(1., 0., 0., f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -59873,7 +61727,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fixupimm_round_ss() { + fn test_mm_mask_fixupimm_round_ss() { let a = _mm_set_ps(0., 0., 0., f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -59883,7 +61737,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fixupimm_round_ss() { + fn test_mm_maskz_fixupimm_round_ss() { let a = _mm_set_ps(0., 0., 0., f32::NAN); let b = _mm_set1_ps(f32::MAX); let c = _mm_set1_epi32(i32::MAX); @@ -59896,7 +61750,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_fixupimm_round_sd() { + fn test_mm_fixupimm_round_sd() { let a = _mm_set_pd(0., f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -59906,7 +61760,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_fixupimm_round_sd() { + fn test_mm_mask_fixupimm_round_sd() { let a = _mm_set_pd(0., f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -59916,7 +61770,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_fixupimm_round_sd() { + fn test_mm_maskz_fixupimm_round_sd() { let a = _mm_set_pd(0., f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -59929,7 +61783,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cvtss_sd() { + fn test_mm_mask_cvtss_sd() { let a = _mm_set_pd(6., -7.5); let b = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_mask_cvtss_sd(a, 0, a, b); @@ -59940,7 +61794,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_cvtss_sd() { + fn test_mm_maskz_cvtss_sd() { let a = _mm_set_pd(6., -7.5); let b = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_maskz_cvtss_sd(0, a, b); @@ -59952,7 +61806,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cvtsd_ss() { + fn test_mm_mask_cvtsd_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b = _mm_set_pd(6., -7.5); let r = _mm_mask_cvtsd_ss(a, 0, a, b); @@ -59963,7 +61817,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_cvtsd_ss() { + fn test_mm_maskz_cvtsd_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b = _mm_set_pd(6., -7.5); let r = _mm_maskz_cvtsd_ss(0, a, b); @@ -59975,7 +61829,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_sd() { + fn test_mm_cvt_roundss_sd() { let a = _mm_set_pd(6., -7.5); let b = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -59984,7 +61838,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cvt_roundss_sd() { + fn test_mm_mask_cvt_roundss_sd() { let a = _mm_set_pd(6., -7.5); let b = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_mask_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -59995,7 +61849,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_cvt_roundss_sd() { + fn test_mm_maskz_cvt_roundss_sd() { let a = _mm_set_pd(6., -7.5); let b = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_maskz_cvt_roundss_sd::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -60007,7 +61861,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_ss() { + fn test_mm_cvt_roundsd_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b = _mm_set_pd(6., -7.5); let r = _mm_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -60016,7 +61870,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_mask_cvt_roundsd_ss() { + fn test_mm_mask_cvt_roundsd_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b = _mm_set_pd(6., -7.5); let r = _mm_mask_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, 0, a, b); @@ -60029,7 +61883,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_maskz_cvt_roundsd_ss() { + fn test_mm_maskz_cvt_roundsd_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b = _mm_set_pd(6., -7.5); let r = _mm_maskz_cvt_roundsd_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(0, a, b); @@ -60043,7 +61897,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_si32() { + fn test_mm_cvt_roundss_si32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_si32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i32 = -1; @@ -60051,7 +61905,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_i32() { + fn test_mm_cvt_roundss_i32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_i32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i32 = -1; @@ -60059,7 +61913,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_u32() { + fn test_mm_cvt_roundss_u32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_u32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: u32 = u32::MAX; @@ -60067,7 +61921,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtss_i32() { + fn test_mm_cvtss_i32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtss_i32(a); let e: i32 = -2; @@ -60075,7 +61929,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtss_u32() { + fn test_mm_cvtss_u32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtss_u32(a); let e: u32 = u32::MAX; @@ -60083,7 +61937,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_si32() { + fn test_mm_cvt_roundsd_si32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvt_roundsd_si32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i32 = -1; @@ -60091,7 +61945,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_i32() { + fn test_mm_cvt_roundsd_i32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvt_roundsd_i32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i32 = -1; @@ -60099,7 +61953,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_u32() { + fn test_mm_cvt_roundsd_u32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvt_roundsd_u32::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: u32 = u32::MAX; @@ -60107,7 +61961,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtsd_i32() { + fn test_mm_cvtsd_i32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtsd_i32(a); let e: i32 = -2; @@ -60115,7 +61969,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtsd_u32() { + fn test_mm_cvtsd_u32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtsd_u32(a); let e: u32 = u32::MAX; @@ -60123,7 +61977,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundi32_ss() { + fn test_mm_cvt_roundi32_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: i32 = 9; let r = _mm_cvt_roundi32_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -60132,7 +61986,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsi32_ss() { + fn test_mm_cvt_roundsi32_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: i32 = 9; let r = _mm_cvt_roundsi32_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -60141,7 +61995,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundu32_ss() { + fn test_mm_cvt_roundu32_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: u32 = 9; let r = _mm_cvt_roundu32_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -60150,7 +62004,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvti32_ss() { + const fn test_mm_cvti32_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: i32 = 9; let r = _mm_cvti32_ss(a, b); @@ -60159,7 +62013,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvti32_sd() { + const fn test_mm_cvti32_sd() { let a = _mm_set_pd(1., -1.5); let b: i32 = 9; let r = _mm_cvti32_sd(a, b); @@ -60168,7 +62022,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundss_si32() { + fn test_mm_cvtt_roundss_si32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtt_roundss_si32::<_MM_FROUND_NO_EXC>(a); let e: i32 = -1; @@ -60176,7 +62030,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundss_i32() { + fn test_mm_cvtt_roundss_i32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtt_roundss_i32::<_MM_FROUND_NO_EXC>(a); let e: i32 = -1; @@ -60184,7 +62038,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundss_u32() { + fn test_mm_cvtt_roundss_u32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtt_roundss_u32::<_MM_FROUND_NO_EXC>(a); let e: u32 = u32::MAX; @@ -60192,7 +62046,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttss_i32() { + fn test_mm_cvttss_i32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvttss_i32(a); let e: i32 = -1; @@ -60200,7 +62054,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttss_u32() { + fn test_mm_cvttss_u32() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvttss_u32(a); let e: u32 = u32::MAX; @@ -60208,7 +62062,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundsd_si32() { + fn test_mm_cvtt_roundsd_si32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtt_roundsd_si32::<_MM_FROUND_NO_EXC>(a); let e: i32 = -1; @@ -60216,7 +62070,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundsd_i32() { + fn test_mm_cvtt_roundsd_i32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtt_roundsd_i32::<_MM_FROUND_NO_EXC>(a); let e: i32 = -1; @@ -60224,7 +62078,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundsd_u32() { + fn test_mm_cvtt_roundsd_u32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtt_roundsd_u32::<_MM_FROUND_NO_EXC>(a); let e: u32 = u32::MAX; @@ -60232,7 +62086,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttsd_i32() { + fn test_mm_cvttsd_i32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvttsd_i32(a); let e: i32 = -1; @@ -60240,7 +62094,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttsd_u32() { + fn test_mm_cvttsd_u32() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvttsd_u32(a); let e: u32 = u32::MAX; @@ -60248,7 +62102,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtu32_ss() { + const fn test_mm_cvtu32_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: u32 = 9; let r = _mm_cvtu32_ss(a, b); @@ -60257,7 +62111,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtu32_sd() { + const fn test_mm_cvtu32_sd() { let a = _mm_set_pd(1., -1.5); let b: u32 = 9; let r = _mm_cvtu32_sd(a, b); @@ -60266,7 +62120,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_comi_round_ss() { + fn test_mm_comi_round_ss() { let a = _mm_set1_ps(2.2); let b = _mm_set1_ps(1.1); let r = _mm_comi_round_ss::<0, _MM_FROUND_CUR_DIRECTION>(a, b); @@ -60275,7 +62129,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_comi_round_sd() { + fn test_mm_comi_round_sd() { let a = _mm_set1_pd(2.2); let b = _mm_set1_pd(1.1); let r = _mm_comi_round_sd::<0, _MM_FROUND_CUR_DIRECTION>(a, b); @@ -60284,7 +62138,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsi512_si32() { + const fn test_mm512_cvtsi512_si32() { let a = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_cvtsi512_si32(a); let e: i32 = 1; @@ -60292,7 +62146,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtss_f32() { + const fn test_mm512_cvtss_f32() { let a = _mm512_setr_ps( 312.0134, 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50., ); @@ -60300,13 +62154,13 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsd_f64() { + const fn test_mm512_cvtsd_f64() { let r = _mm512_cvtsd_f64(_mm512_setr_pd(-1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8)); assert_eq!(r, -1.1); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_pd() { + const fn test_mm512_shuffle_pd() { let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.); let b = _mm512_setr_pd(2., 3., 6., 7., 2., 3., 6., 7.); let r = _mm512_shuffle_pd::<0b11_11_11_11>(a, b); @@ -60315,7 +62169,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_pd() { + const fn test_mm512_mask_shuffle_pd() { let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.); let b = _mm512_setr_pd(2., 3., 6., 7., 2., 3., 6., 7.); let r = _mm512_mask_shuffle_pd::<0b11_11_11_11>(a, 0, a, b); @@ -60326,7 +62180,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_pd() { + const fn test_mm512_maskz_shuffle_pd() { let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.); let b = _mm512_setr_pd(2., 3., 6., 7., 2., 3., 6., 7.); let r = _mm512_maskz_shuffle_pd::<0b11_11_11_11>(0, a, b); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512fp16.rs b/library/stdarch/crates/core_arch/src/x86/avx512fp16.rs index 13cae45d0f81..57d47c0bb010 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512fp16.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512fp16.rs @@ -9,7 +9,8 @@ use crate::ptr; #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_set_ph( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_ph( e7: f16, e6: f16, e5: f16, @@ -28,7 +29,8 @@ pub fn _mm_set_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_set_ph( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set_ph( e15: f16, e14: f16, e13: f16, @@ -57,7 +59,8 @@ pub fn _mm256_set_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_set_ph( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set_ph( e31: f16, e30: f16, e29: f16, @@ -104,7 +107,8 @@ pub fn _mm512_set_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_set_sh(a: f16) -> __m128h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_sh(a: f16) -> __m128h { __m128h([a, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]) } @@ -114,7 +118,8 @@ pub fn _mm_set_sh(a: f16) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_set1_ph(a: f16) -> __m128h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_ph(a: f16) -> __m128h { unsafe { transmute(f16x8::splat(a)) } } @@ -124,7 +129,8 @@ pub fn _mm_set1_ph(a: f16) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_set1_ph(a: f16) -> __m256h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_set1_ph(a: f16) -> __m256h { unsafe { transmute(f16x16::splat(a)) } } @@ -134,7 +140,8 @@ pub fn _mm256_set1_ph(a: f16) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_set1_ph(a: f16) -> __m512h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_set1_ph(a: f16) -> __m512h { unsafe { transmute(f16x32::splat(a)) } } @@ -144,7 +151,8 @@ pub fn _mm512_set1_ph(a: f16) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_setr_ph( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setr_ph( e0: f16, e1: f16, e2: f16, @@ -163,7 +171,8 @@ pub fn _mm_setr_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_setr_ph( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setr_ph( e0: f16, e1: f16, e2: f16, @@ -192,7 +201,8 @@ pub fn _mm256_setr_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_setr_ph( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setr_ph( e0: f16, e1: f16, e2: f16, @@ -237,8 +247,9 @@ pub fn _mm512_setr_ph( /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_setzero_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_setzero_ph() -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setzero_ph() -> __m128h { unsafe { transmute(f16x8::ZERO) } } @@ -247,8 +258,9 @@ pub fn _mm_setzero_ph() -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_setzero_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_setzero_ph() -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_setzero_ph() -> __m256h { f16x16::ZERO.as_m256h() } @@ -257,8 +269,9 @@ pub fn _mm256_setzero_ph() -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_setzero_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_setzero_ph() -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_setzero_ph() -> __m512h { f16x32::ZERO.as_m512h() } @@ -270,8 +283,9 @@ pub fn _mm512_setzero_ph() -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_undefined_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_undefined_ph() -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_undefined_ph() -> __m128h { f16x8::ZERO.as_m128h() } @@ -283,8 +297,9 @@ pub fn _mm_undefined_ph() -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_undefined_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_undefined_ph() -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_undefined_ph() -> __m256h { f16x16::ZERO.as_m256h() } @@ -296,8 +311,9 @@ pub fn _mm256_undefined_ph() -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_undefined_ph() -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_undefined_ph() -> __m512h { f16x32::ZERO.as_m512h() } @@ -307,8 +323,9 @@ pub fn _mm512_undefined_ph() -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castpd_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_castpd_ph(a: __m128d) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castpd_ph(a: __m128d) -> __m128h { unsafe { transmute(a) } } @@ -318,8 +335,9 @@ pub fn _mm_castpd_ph(a: __m128d) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castpd_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castpd_ph(a: __m256d) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castpd_ph(a: __m256d) -> __m256h { unsafe { transmute(a) } } @@ -329,8 +347,9 @@ pub fn _mm256_castpd_ph(a: __m256d) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castpd_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castpd_ph(a: __m512d) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castpd_ph(a: __m512d) -> __m512h { unsafe { transmute(a) } } @@ -340,8 +359,9 @@ pub fn _mm512_castpd_ph(a: __m512d) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castph_pd) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_castph_pd(a: __m128h) -> __m128d { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castph_pd(a: __m128h) -> __m128d { unsafe { transmute(a) } } @@ -351,8 +371,9 @@ pub fn _mm_castph_pd(a: __m128h) -> __m128d { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castph_pd) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castph_pd(a: __m256h) -> __m256d { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castph_pd(a: __m256h) -> __m256d { unsafe { transmute(a) } } @@ -362,8 +383,9 @@ pub fn _mm256_castph_pd(a: __m256h) -> __m256d { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph_pd) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph_pd(a: __m512h) -> __m512d { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph_pd(a: __m512h) -> __m512d { unsafe { transmute(a) } } @@ -373,8 +395,9 @@ pub fn _mm512_castph_pd(a: __m512h) -> __m512d { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castps_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_castps_ph(a: __m128) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castps_ph(a: __m128) -> __m128h { unsafe { transmute(a) } } @@ -384,8 +407,9 @@ pub fn _mm_castps_ph(a: __m128) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castps_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castps_ph(a: __m256) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castps_ph(a: __m256) -> __m256h { unsafe { transmute(a) } } @@ -395,8 +419,9 @@ pub fn _mm256_castps_ph(a: __m256) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castps_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castps_ph(a: __m512) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castps_ph(a: __m512) -> __m512h { unsafe { transmute(a) } } @@ -406,8 +431,9 @@ pub fn _mm512_castps_ph(a: __m512) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castph_ps) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_castph_ps(a: __m128h) -> __m128 { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castph_ps(a: __m128h) -> __m128 { unsafe { transmute(a) } } @@ -417,8 +443,9 @@ pub fn _mm_castph_ps(a: __m128h) -> __m128 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castph_ps) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castph_ps(a: __m256h) -> __m256 { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castph_ps(a: __m256h) -> __m256 { unsafe { transmute(a) } } @@ -428,8 +455,9 @@ pub fn _mm256_castph_ps(a: __m256h) -> __m256 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph_ps) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph_ps(a: __m512h) -> __m512 { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph_ps(a: __m512h) -> __m512 { unsafe { transmute(a) } } @@ -439,8 +467,9 @@ pub fn _mm512_castph_ps(a: __m512h) -> __m512 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castsi128_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_castsi128_ph(a: __m128i) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castsi128_ph(a: __m128i) -> __m128h { unsafe { transmute(a) } } @@ -450,8 +479,9 @@ pub fn _mm_castsi128_ph(a: __m128i) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castsi256_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castsi256_ph(a: __m256i) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castsi256_ph(a: __m256i) -> __m256h { unsafe { transmute(a) } } @@ -461,8 +491,9 @@ pub fn _mm256_castsi256_ph(a: __m256i) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castsi512_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castsi512_ph(a: __m512i) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castsi512_ph(a: __m512i) -> __m512h { unsafe { transmute(a) } } @@ -472,8 +503,9 @@ pub fn _mm512_castsi512_ph(a: __m512i) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_castph_si128) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_castph_si128(a: __m128h) -> __m128i { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castph_si128(a: __m128h) -> __m128i { unsafe { transmute(a) } } @@ -483,8 +515,9 @@ pub fn _mm_castph_si128(a: __m128h) -> __m128i { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castph_si256) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castph_si256(a: __m256h) -> __m256i { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castph_si256(a: __m256h) -> __m256i { unsafe { transmute(a) } } @@ -494,8 +527,9 @@ pub fn _mm256_castph_si256(a: __m256h) -> __m256i { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph_si512) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph_si512(a: __m512h) -> __m512i { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph_si512(a: __m512h) -> __m512i { unsafe { transmute(a) } } @@ -505,8 +539,9 @@ pub fn _mm512_castph_si512(a: __m512h) -> __m512i { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castph256_ph128) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castph256_ph128(a: __m256h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castph256_ph128(a: __m256h) -> __m128h { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]) } } @@ -516,8 +551,9 @@ pub fn _mm256_castph256_ph128(a: __m256h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph512_ph128) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph512_ph128(a: __m512h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph512_ph128(a: __m512h) -> __m128h { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]) } } @@ -527,8 +563,9 @@ pub fn _mm512_castph512_ph128(a: __m512h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph512_ph256) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph512_ph256(a: __m512h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph512_ph256(a: __m512h) -> __m256h { unsafe { simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) } } @@ -539,8 +576,9 @@ pub fn _mm512_castph512_ph256(a: __m512h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_castph128_ph256) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_castph128_ph256(a: __m128h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_castph128_ph256(a: __m128h) -> __m256h { unsafe { simd_shuffle!( a, @@ -557,8 +595,9 @@ pub fn _mm256_castph128_ph256(a: __m128h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph128_ph512) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph128_ph512(a: __m128h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph128_ph512(a: __m128h) -> __m512h { unsafe { simd_shuffle!( a, @@ -578,8 +617,9 @@ pub fn _mm512_castph128_ph512(a: __m128h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_castph256_ph512) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_castph256_ph512(a: __m256h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_castph256_ph512(a: __m256h) -> __m512h { unsafe { simd_shuffle!( a, @@ -599,8 +639,9 @@ pub fn _mm512_castph256_ph512(a: __m256h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_zextph128_ph256) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_zextph128_ph256(a: __m128h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_zextph128_ph256(a: __m128h) -> __m256h { unsafe { simd_shuffle!( a, @@ -617,8 +658,9 @@ pub fn _mm256_zextph128_ph256(a: __m128h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_zextph256_ph512) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_zextph256_ph512(a: __m256h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextph256_ph512(a: __m256h) -> __m512h { unsafe { simd_shuffle!( a, @@ -638,8 +680,9 @@ pub fn _mm512_zextph256_ph512(a: __m256h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_zextph128_ph512) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_zextph128_ph512(a: __m128h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_zextph128_ph512(a: __m128h) -> __m512h { unsafe { simd_shuffle!( a, @@ -687,7 +730,7 @@ macro_rules! cmp_asm { // FIXME: use LLVM intrinsics #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cmp_ph_mask(a: __m128h, b: __m128h) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM5, 5); @@ -703,7 +746,7 @@ pub fn _mm_cmp_ph_mask(a: __m128h, b: __m128h) -> __mmask8 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cmp_ph_mask(k1: __mmask8, a: __m128h, b: __m128h) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM5, 5); @@ -718,7 +761,7 @@ pub fn _mm_mask_cmp_ph_mask(k1: __mmask8, a: __m128h, b: __m128 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cmp_ph_mask(a: __m256h, b: __m256h) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM5, 5); @@ -734,7 +777,7 @@ pub fn _mm256_cmp_ph_mask(a: __m256h, b: __m256h) -> __mmask16 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cmp_ph_mask( k1: __mmask16, a: __m256h, @@ -753,7 +796,7 @@ pub fn _mm256_mask_cmp_ph_mask( #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cmp_ph_mask(a: __m512h, b: __m512h) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM5, 5); @@ -769,7 +812,7 @@ pub fn _mm512_cmp_ph_mask(a: __m512h, b: __m512h) -> __mmask32 #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cmp_ph_mask( k1: __mmask32, a: __m512h, @@ -790,7 +833,7 @@ pub fn _mm512_mask_cmp_ph_mask( #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cmp_round_ph_mask( a: __m512h, b: __m512h, @@ -825,7 +868,7 @@ pub fn _mm512_cmp_round_ph_mask( #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(3, 4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cmp_round_ph_mask( k1: __mmask32, a: __m512h, @@ -860,7 +903,7 @@ pub fn _mm512_mask_cmp_round_ph_mask( #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cmp_round_sh_mask(a: __m128h, b: __m128h) -> __mmask8 { static_assert_uimm_bits!(IMM5, 5); static_assert_sae!(SAE); @@ -875,7 +918,7 @@ pub fn _mm_cmp_round_sh_mask(a: __m128h, b: __m #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(3, 4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cmp_round_sh_mask( k1: __mmask8, a: __m128h, @@ -895,7 +938,7 @@ pub fn _mm_mask_cmp_round_sh_mask( #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cmp_sh_mask(a: __m128h, b: __m128h) -> __mmask8 { static_assert_uimm_bits!(IMM5, 5); _mm_cmp_round_sh_mask::(a, b) @@ -908,7 +951,7 @@ pub fn _mm_cmp_sh_mask(a: __m128h, b: __m128h) -> __mmask8 { #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cmp_sh_mask(k1: __mmask8, a: __m128h, b: __m128h) -> __mmask8 { static_assert_uimm_bits!(IMM5, 5); _mm_mask_cmp_round_sh_mask::(k1, a, b) @@ -922,7 +965,7 @@ pub fn _mm_mask_cmp_sh_mask(k1: __mmask8, a: __m128h, b: __m128 #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comi_round_sh(a: __m128h, b: __m128h) -> i32 { unsafe { static_assert_uimm_bits!(IMM5, 5); @@ -938,7 +981,7 @@ pub fn _mm_comi_round_sh(a: __m128h, b: __m128h #[inline] #[target_feature(enable = "avx512fp16")] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comi_sh(a: __m128h, b: __m128h) -> i32 { static_assert_uimm_bits!(IMM5, 5); _mm_comi_round_sh::(a, b) @@ -950,7 +993,7 @@ pub fn _mm_comi_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comieq_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comieq_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_EQ_OS>(a, b) } @@ -961,7 +1004,7 @@ pub fn _mm_comieq_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comige_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comige_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_GE_OS>(a, b) } @@ -972,7 +1015,7 @@ pub fn _mm_comige_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comigt_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comigt_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_GT_OS>(a, b) } @@ -983,7 +1026,7 @@ pub fn _mm_comigt_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comile_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comile_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_LE_OS>(a, b) } @@ -994,7 +1037,7 @@ pub fn _mm_comile_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comilt_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comilt_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_LT_OS>(a, b) } @@ -1005,9 +1048,9 @@ pub fn _mm_comilt_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_comineq_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_comineq_sh(a: __m128h, b: __m128h) -> i32 { - _mm_comi_sh::<_CMP_NEQ_OS>(a, b) + _mm_comi_sh::<_CMP_NEQ_US>(a, b) } /// Compare the lower half-precision (16-bit) floating-point elements in a and b for equality, and @@ -1016,7 +1059,7 @@ pub fn _mm_comineq_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomieq_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_ucomieq_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_EQ_OQ>(a, b) } @@ -1027,7 +1070,7 @@ pub fn _mm_ucomieq_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomige_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_ucomige_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_GE_OQ>(a, b) } @@ -1038,7 +1081,7 @@ pub fn _mm_ucomige_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomigt_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_ucomigt_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_GT_OQ>(a, b) } @@ -1049,7 +1092,7 @@ pub fn _mm_ucomigt_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomile_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_ucomile_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_LE_OQ>(a, b) } @@ -1060,7 +1103,7 @@ pub fn _mm_ucomile_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomilt_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_ucomilt_sh(a: __m128h, b: __m128h) -> i32 { _mm_comi_sh::<_CMP_LT_OQ>(a, b) } @@ -1071,9 +1114,9 @@ pub fn _mm_ucomilt_sh(a: __m128h, b: __m128h) -> i32 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_ucomineq_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_ucomineq_sh(a: __m128h, b: __m128h) -> i32 { - _mm_comi_sh::<_CMP_NEQ_OQ>(a, b) + _mm_comi_sh::<_CMP_NEQ_UQ>(a, b) } /// Load 128-bits (composed of 8 packed half-precision (16-bit) floating-point elements) from memory into @@ -1083,7 +1126,8 @@ pub fn _mm_ucomineq_sh(a: __m128h, b: __m128h) -> i32 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm_load_ph(mem_addr: *const f16) -> __m128h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_ph(mem_addr: *const f16) -> __m128h { *mem_addr.cast() } @@ -1094,7 +1138,8 @@ pub unsafe fn _mm_load_ph(mem_addr: *const f16) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm256_load_ph(mem_addr: *const f16) -> __m256h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_load_ph(mem_addr: *const f16) -> __m256h { *mem_addr.cast() } @@ -1105,7 +1150,8 @@ pub unsafe fn _mm256_load_ph(mem_addr: *const f16) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm512_load_ph(mem_addr: *const f16) -> __m512h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_load_ph(mem_addr: *const f16) -> __m512h { *mem_addr.cast() } @@ -1116,7 +1162,8 @@ pub unsafe fn _mm512_load_ph(mem_addr: *const f16) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm_load_sh(mem_addr: *const f16) -> __m128h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_sh(mem_addr: *const f16) -> __m128h { _mm_set_sh(*mem_addr) } @@ -1165,7 +1212,8 @@ pub unsafe fn _mm_maskz_load_sh(k: __mmask8, mem_addr: *const f16) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm_loadu_ph(mem_addr: *const f16) -> __m128h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_ph(mem_addr: *const f16) -> __m128h { ptr::read_unaligned(mem_addr.cast()) } @@ -1176,7 +1224,8 @@ pub unsafe fn _mm_loadu_ph(mem_addr: *const f16) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm256_loadu_ph(mem_addr: *const f16) -> __m256h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_loadu_ph(mem_addr: *const f16) -> __m256h { ptr::read_unaligned(mem_addr.cast()) } @@ -1187,7 +1236,8 @@ pub unsafe fn _mm256_loadu_ph(mem_addr: *const f16) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm512_loadu_ph(mem_addr: *const f16) -> __m512h { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_loadu_ph(mem_addr: *const f16) -> __m512h { ptr::read_unaligned(mem_addr.cast()) } @@ -1198,8 +1248,9 @@ pub unsafe fn _mm512_loadu_ph(mem_addr: *const f16) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_move_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_move_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_move_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let mut mov: f16 = simd_extract!(src, 0); if (k & 1) != 0 { @@ -1216,8 +1267,9 @@ pub fn _mm_mask_move_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __ /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_move_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_move_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_move_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let mut mov: f16 = 0.; if (k & 1) != 0 { @@ -1233,8 +1285,9 @@ pub fn _mm_maskz_move_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_move_sh) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_move_sh(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_move_sh(a: __m128h, b: __m128h) -> __m128h { unsafe { let mov: f16 = simd_extract!(b, 0); simd_insert!(a, 0, mov) @@ -1248,7 +1301,8 @@ pub fn _mm_move_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm_store_ph(mem_addr: *mut f16, a: __m128h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_ph(mem_addr: *mut f16, a: __m128h) { *mem_addr.cast() = a; } @@ -1259,7 +1313,8 @@ pub unsafe fn _mm_store_ph(mem_addr: *mut f16, a: __m128h) { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm256_store_ph(mem_addr: *mut f16, a: __m256h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_store_ph(mem_addr: *mut f16, a: __m256h) { *mem_addr.cast() = a; } @@ -1270,7 +1325,8 @@ pub unsafe fn _mm256_store_ph(mem_addr: *mut f16, a: __m256h) { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm512_store_ph(mem_addr: *mut f16, a: __m512h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_store_ph(mem_addr: *mut f16, a: __m512h) { *mem_addr.cast() = a; } @@ -1280,7 +1336,8 @@ pub unsafe fn _mm512_store_ph(mem_addr: *mut f16, a: __m512h) { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm_store_sh(mem_addr: *mut f16, a: __m128h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_sh(mem_addr: *mut f16, a: __m128h) { *mem_addr = simd_extract!(a, 0); } @@ -1307,7 +1364,8 @@ pub unsafe fn _mm_mask_store_sh(mem_addr: *mut f16, k: __mmask8, a: __m128h) { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm_storeu_ph(mem_addr: *mut f16, a: __m128h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_ph(mem_addr: *mut f16, a: __m128h) { ptr::write_unaligned(mem_addr.cast(), a); } @@ -1318,7 +1376,8 @@ pub unsafe fn _mm_storeu_ph(mem_addr: *mut f16, a: __m128h) { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm256_storeu_ph(mem_addr: *mut f16, a: __m256h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm256_storeu_ph(mem_addr: *mut f16, a: __m256h) { ptr::write_unaligned(mem_addr.cast(), a); } @@ -1329,7 +1388,8 @@ pub unsafe fn _mm256_storeu_ph(mem_addr: *mut f16, a: __m256h) { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub unsafe fn _mm512_storeu_ph(mem_addr: *mut f16, a: __m512h) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm512_storeu_ph(mem_addr: *mut f16, a: __m512h) { ptr::write_unaligned(mem_addr.cast(), a); } @@ -1339,8 +1399,9 @@ pub unsafe fn _mm512_storeu_ph(mem_addr: *mut f16, a: __m512h) { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_add_ph(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_ph(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_add(a, b) } } @@ -1351,8 +1412,9 @@ pub fn _mm_add_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_add_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_add_ph(a, b); simd_select_bitmask(k, r, src) @@ -1366,8 +1428,9 @@ pub fn _mm_mask_add_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_add_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_add_ph(a, b); simd_select_bitmask(k, r, _mm_setzero_ph()) @@ -1380,8 +1443,9 @@ pub fn _mm_maskz_add_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_add_ph(a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_add_ph(a: __m256h, b: __m256h) -> __m256h { unsafe { simd_add(a, b) } } @@ -1392,8 +1456,9 @@ pub fn _mm256_add_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_add_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_add_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_add_ph(a, b); simd_select_bitmask(k, r, src) @@ -1407,8 +1472,9 @@ pub fn _mm256_mask_add_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_add_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_add_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_add_ph(a, b); simd_select_bitmask(k, r, _mm256_setzero_ph()) @@ -1421,8 +1487,9 @@ pub fn _mm256_maskz_add_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_add_ph(a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_add_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { simd_add(a, b) } } @@ -1433,8 +1500,9 @@ pub fn _mm512_add_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_add_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_add_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_add_ph(a, b); simd_select_bitmask(k, r, src) @@ -1448,8 +1516,9 @@ pub fn _mm512_mask_add_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_add_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_add_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_add_ph(a, b); simd_select_bitmask(k, r, _mm512_setzero_ph()) @@ -1470,7 +1539,7 @@ pub fn _mm512_maskz_add_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_add_round_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -1493,7 +1562,7 @@ pub fn _mm512_add_round_ph(a: __m512h, b: __m512h) -> __m51 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_add_round_ph( src: __m512h, k: __mmask32, @@ -1521,7 +1590,7 @@ pub fn _mm512_mask_add_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_add_round_ph( k: __mmask32, a: __m512h, @@ -1549,7 +1618,7 @@ pub fn _mm512_maskz_add_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_add_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_add_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -1571,7 +1640,7 @@ pub fn _mm_add_round_sh(a: __m128h, b: __m128h) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_add_round_sh( src: __m128h, k: __mmask8, @@ -1600,7 +1669,7 @@ pub fn _mm_mask_add_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_add_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_add_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -1613,8 +1682,9 @@ pub fn _mm_maskz_add_round_sh(k: __mmask8, a: __m128h, b: _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_add_sh(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_sh(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_insert!(a, 0, _mm_cvtsh_h(a) + _mm_cvtsh_h(b)) } } @@ -1626,8 +1696,9 @@ pub fn _mm_add_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_add_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_add_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let extractsrc: f16 = simd_extract!(src, 0); let mut add: f16 = extractsrc; @@ -1648,8 +1719,9 @@ pub fn _mm_mask_add_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vaddsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_add_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_add_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let mut add: f16 = 0.; if (k & 0b00000001) != 0 { @@ -1667,8 +1739,9 @@ pub fn _mm_maskz_add_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_sub_ph(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_ph(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_sub(a, b) } } @@ -1679,8 +1752,9 @@ pub fn _mm_sub_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_sub_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_sub_ph(a, b); simd_select_bitmask(k, r, src) @@ -1694,8 +1768,9 @@ pub fn _mm_mask_sub_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_sub_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_sub_ph(a, b); simd_select_bitmask(k, r, _mm_setzero_ph()) @@ -1708,8 +1783,9 @@ pub fn _mm_maskz_sub_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_sub_ph(a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_sub_ph(a: __m256h, b: __m256h) -> __m256h { unsafe { simd_sub(a, b) } } @@ -1720,8 +1796,9 @@ pub fn _mm256_sub_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_sub_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_sub_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_sub_ph(a, b); simd_select_bitmask(k, r, src) @@ -1735,8 +1812,9 @@ pub fn _mm256_mask_sub_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_sub_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_sub_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_sub_ph(a, b); simd_select_bitmask(k, r, _mm256_setzero_ph()) @@ -1749,8 +1827,9 @@ pub fn _mm256_maskz_sub_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_sub_ph(a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_sub_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { simd_sub(a, b) } } @@ -1761,8 +1840,9 @@ pub fn _mm512_sub_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_sub_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_sub_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_sub_ph(a, b); simd_select_bitmask(k, r, src) @@ -1776,8 +1856,9 @@ pub fn _mm512_mask_sub_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_sub_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_sub_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_sub_ph(a, b); simd_select_bitmask(k, r, _mm512_setzero_ph()) @@ -1798,7 +1879,7 @@ pub fn _mm512_maskz_sub_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_sub_round_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -1821,7 +1902,7 @@ pub fn _mm512_sub_round_ph(a: __m512h, b: __m512h) -> __m51 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_sub_round_ph( src: __m512h, k: __mmask32, @@ -1850,7 +1931,7 @@ pub fn _mm512_mask_sub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_sub_round_ph( k: __mmask32, a: __m512h, @@ -1878,7 +1959,7 @@ pub fn _mm512_maskz_sub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_sub_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_sub_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -1900,7 +1981,7 @@ pub fn _mm_sub_round_sh(a: __m128h, b: __m128h) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_sub_round_sh( src: __m128h, k: __mmask8, @@ -1929,7 +2010,7 @@ pub fn _mm_mask_sub_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_sub_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_sub_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -1942,8 +2023,9 @@ pub fn _mm_maskz_sub_round_sh(k: __mmask8, a: __m128h, b: _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_sub_sh(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_sh(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_insert!(a, 0, _mm_cvtsh_h(a) - _mm_cvtsh_h(b)) } } @@ -1955,8 +2037,9 @@ pub fn _mm_sub_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_sub_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_sub_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let extractsrc: f16 = simd_extract!(src, 0); let mut add: f16 = extractsrc; @@ -1977,8 +2060,9 @@ pub fn _mm_mask_sub_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsubsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_sub_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_sub_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let mut add: f16 = 0.; if (k & 0b00000001) != 0 { @@ -1996,8 +2080,9 @@ pub fn _mm_maskz_sub_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mul_ph(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_ph(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_mul(a, b) } } @@ -2008,8 +2093,9 @@ pub fn _mm_mul_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_mul_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_mul_ph(a, b); simd_select_bitmask(k, r, src) @@ -2023,8 +2109,9 @@ pub fn _mm_mask_mul_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_mul_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_mul_ph(a, b); simd_select_bitmask(k, r, _mm_setzero_ph()) @@ -2037,8 +2124,9 @@ pub fn _mm_maskz_mul_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mul_ph(a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mul_ph(a: __m256h, b: __m256h) -> __m256h { unsafe { simd_mul(a, b) } } @@ -2049,8 +2137,9 @@ pub fn _mm256_mul_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_mul_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_mul_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_mul_ph(a, b); simd_select_bitmask(k, r, src) @@ -2064,8 +2153,9 @@ pub fn _mm256_mask_mul_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_mul_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_mul_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_mul_ph(a, b); simd_select_bitmask(k, r, _mm256_setzero_ph()) @@ -2078,8 +2168,9 @@ pub fn _mm256_maskz_mul_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mul_ph(a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mul_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { simd_mul(a, b) } } @@ -2090,8 +2181,9 @@ pub fn _mm512_mul_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_mul_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_mul_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_mul_ph(a, b); simd_select_bitmask(k, r, src) @@ -2105,8 +2197,9 @@ pub fn _mm512_mask_mul_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_mul_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_mul_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_mul_ph(a, b); simd_select_bitmask(k, r, _mm512_setzero_ph()) @@ -2127,7 +2220,7 @@ pub fn _mm512_maskz_mul_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mul_round_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -2150,7 +2243,7 @@ pub fn _mm512_mul_round_ph(a: __m512h, b: __m512h) -> __m51 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_mul_round_ph( src: __m512h, k: __mmask32, @@ -2179,7 +2272,7 @@ pub fn _mm512_mask_mul_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_mul_round_ph( k: __mmask32, a: __m512h, @@ -2207,7 +2300,7 @@ pub fn _mm512_maskz_mul_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mul_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_mul_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -2229,7 +2322,7 @@ pub fn _mm_mul_round_sh(a: __m128h, b: __m128h) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_mul_round_sh( src: __m128h, k: __mmask8, @@ -2258,7 +2351,7 @@ pub fn _mm_mask_mul_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_mul_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_mul_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -2271,8 +2364,9 @@ pub fn _mm_maskz_mul_round_sh(k: __mmask8, a: __m128h, b: _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mul_sh(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_sh(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_insert!(a, 0, _mm_cvtsh_h(a) * _mm_cvtsh_h(b)) } } @@ -2284,8 +2378,9 @@ pub fn _mm_mul_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_mul_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_mul_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let extractsrc: f16 = simd_extract!(src, 0); let mut add: f16 = extractsrc; @@ -2306,8 +2401,9 @@ pub fn _mm_mask_mul_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmulsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_mul_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_mul_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let mut add: f16 = 0.; if (k & 0b00000001) != 0 { @@ -2325,8 +2421,9 @@ pub fn _mm_maskz_mul_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_div_ph(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_div_ph(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_div(a, b) } } @@ -2337,8 +2434,9 @@ pub fn _mm_div_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_div_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_div_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_div_ph(a, b); simd_select_bitmask(k, r, src) @@ -2352,8 +2450,9 @@ pub fn _mm_mask_div_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_div_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_div_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let r = _mm_div_ph(a, b); simd_select_bitmask(k, r, _mm_setzero_ph()) @@ -2366,8 +2465,9 @@ pub fn _mm_maskz_div_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_div_ph(a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_div_ph(a: __m256h, b: __m256h) -> __m256h { unsafe { simd_div(a, b) } } @@ -2378,8 +2478,9 @@ pub fn _mm256_div_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_div_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_div_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_div_ph(a, b); simd_select_bitmask(k, r, src) @@ -2393,8 +2494,9 @@ pub fn _mm256_mask_div_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_div_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_div_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { let r = _mm256_div_ph(a, b); simd_select_bitmask(k, r, _mm256_setzero_ph()) @@ -2407,8 +2509,9 @@ pub fn _mm256_maskz_div_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_div_ph(a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_div_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { simd_div(a, b) } } @@ -2419,8 +2522,9 @@ pub fn _mm512_div_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_div_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_div_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_div_ph(a, b); simd_select_bitmask(k, r, src) @@ -2434,8 +2538,9 @@ pub fn _mm512_mask_div_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_div_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_div_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { let r = _mm512_div_ph(a, b); simd_select_bitmask(k, r, _mm512_setzero_ph()) @@ -2456,7 +2561,7 @@ pub fn _mm512_maskz_div_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_div_round_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -2479,7 +2584,7 @@ pub fn _mm512_div_round_ph(a: __m512h, b: __m512h) -> __m51 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_div_round_ph( src: __m512h, k: __mmask32, @@ -2508,7 +2613,7 @@ pub fn _mm512_mask_div_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_div_round_ph( k: __mmask32, a: __m512h, @@ -2536,7 +2641,7 @@ pub fn _mm512_maskz_div_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_div_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_div_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -2558,7 +2663,7 @@ pub fn _mm_div_round_sh(a: __m128h, b: __m128h) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_div_round_sh( src: __m128h, k: __mmask8, @@ -2587,7 +2692,7 @@ pub fn _mm_mask_div_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_div_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_div_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -2600,8 +2705,9 @@ pub fn _mm_maskz_div_round_sh(k: __mmask8, a: __m128h, b: _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_div_sh(a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_div_sh(a: __m128h, b: __m128h) -> __m128h { unsafe { simd_insert!(a, 0, _mm_cvtsh_h(a) / _mm_cvtsh_h(b)) } } @@ -2613,8 +2719,9 @@ pub fn _mm_div_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_div_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_div_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let extractsrc: f16 = simd_extract!(src, 0); let mut add: f16 = extractsrc; @@ -2635,8 +2742,9 @@ pub fn _mm_mask_div_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vdivsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_div_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_div_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { let mut add: f16 = 0.; if (k & 0b00000001) != 0 { @@ -2656,7 +2764,7 @@ pub fn _mm_maskz_div_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mul_pch(a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_pch(_mm_undefined_ph(), 0xff, a, b) } @@ -2669,7 +2777,7 @@ pub fn _mm_mul_pch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_mul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { transmute(vfmulcph_128(transmute(a), transmute(b), transmute(src), k)) } } @@ -2682,7 +2790,7 @@ pub fn _mm_mask_mul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_mul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_pch(_mm_setzero_ph(), k, a, b) } @@ -2695,7 +2803,7 @@ pub fn _mm_maskz_mul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mul_pch(a: __m256h, b: __m256h) -> __m256h { _mm256_mask_mul_pch(_mm256_undefined_ph(), 0xff, a, b) } @@ -2708,7 +2816,7 @@ pub fn _mm256_mul_pch(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_mul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) -> __m256h { unsafe { transmute(vfmulcph_256(transmute(a), transmute(b), transmute(src), k)) } } @@ -2721,7 +2829,7 @@ pub fn _mm256_mask_mul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_mul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { _mm256_mask_mul_pch(_mm256_setzero_ph(), k, a, b) } @@ -2734,7 +2842,7 @@ pub fn _mm256_maskz_mul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mul_pch(a: __m512h, b: __m512h) -> __m512h { _mm512_mask_mul_pch(_mm512_undefined_ph(), 0xffff, a, b) } @@ -2747,7 +2855,7 @@ pub fn _mm512_mul_pch(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_mul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_mul_round_pch::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -2760,7 +2868,7 @@ pub fn _mm512_mask_mul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_mul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_mul_pch(_mm512_setzero_ph(), k, a, b) } @@ -2782,7 +2890,7 @@ pub fn _mm512_maskz_mul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mul_round_pch(a: __m512h, b: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask_mul_round_pch::(_mm512_undefined_ph(), 0xffff, a, b) @@ -2805,7 +2913,7 @@ pub fn _mm512_mul_round_pch(a: __m512h, b: __m512h) -> __m5 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_mul_round_pch( src: __m512h, k: __mmask16, @@ -2841,7 +2949,7 @@ pub fn _mm512_mask_mul_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_mul_round_pch( k: __mmask16, a: __m512h, @@ -2860,7 +2968,7 @@ pub fn _mm512_maskz_mul_round_pch( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mul_sch(a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_sch(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -2874,7 +2982,7 @@ pub fn _mm_mul_sch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_mul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_round_sch::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -2888,7 +2996,7 @@ pub fn _mm_mask_mul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_mul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_sch(f16x8::ZERO.as_m128h(), k, a, b) } @@ -2911,7 +3019,7 @@ pub fn _mm_maskz_mul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mul_round_sch(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_mul_round_sch::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -2935,7 +3043,7 @@ pub fn _mm_mul_round_sch(a: __m128h, b: __m128h) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_mul_round_sch( src: __m128h, k: __mmask8, @@ -2972,7 +3080,7 @@ pub fn _mm_mask_mul_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_mul_round_sch( k: __mmask8, a: __m128h, @@ -2990,7 +3098,7 @@ pub fn _mm_maskz_mul_round_sch( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmul_pch(a: __m128h, b: __m128h) -> __m128h { _mm_mul_pch(a, b) } @@ -3003,7 +3111,7 @@ pub fn _mm_fmul_pch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_pch(src, k, a, b) } @@ -3016,7 +3124,7 @@ pub fn _mm_mask_fmul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_maskz_mul_pch(k, a, b) } @@ -3029,7 +3137,7 @@ pub fn _mm_maskz_fmul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_fmul_pch(a: __m256h, b: __m256h) -> __m256h { _mm256_mul_pch(a, b) } @@ -3042,7 +3150,7 @@ pub fn _mm256_fmul_pch(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_fmul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) -> __m256h { _mm256_mask_mul_pch(src, k, a, b) } @@ -3055,7 +3163,7 @@ pub fn _mm256_mask_fmul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_fmul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { _mm256_maskz_mul_pch(k, a, b) } @@ -3067,7 +3175,7 @@ pub fn _mm256_maskz_fmul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmul_pch(a: __m512h, b: __m512h) -> __m512h { _mm512_mul_pch(a, b) } @@ -3080,7 +3188,7 @@ pub fn _mm512_fmul_pch(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_mul_pch(src, k, a, b) } @@ -3093,7 +3201,7 @@ pub fn _mm512_mask_fmul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_maskz_mul_pch(k, a, b) } @@ -3113,7 +3221,7 @@ pub fn _mm512_maskz_fmul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmul_round_pch(a: __m512h, b: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mul_round_pch::(a, b) @@ -3135,7 +3243,7 @@ pub fn _mm512_fmul_round_pch(a: __m512h, b: __m512h) -> __m #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmul_round_pch( src: __m512h, k: __mmask16, @@ -3162,7 +3270,7 @@ pub fn _mm512_mask_fmul_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmul_round_pch( k: __mmask16, a: __m512h, @@ -3180,7 +3288,7 @@ pub fn _mm512_maskz_fmul_round_pch( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmul_sch(a: __m128h, b: __m128h) -> __m128h { _mm_mul_sch(a, b) } @@ -3193,7 +3301,7 @@ pub fn _mm_fmul_sch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_mul_sch(src, k, a, b) } @@ -3206,7 +3314,7 @@ pub fn _mm_mask_fmul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_maskz_mul_sch(k, a, b) } @@ -3227,7 +3335,7 @@ pub fn _mm_maskz_fmul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmul_round_sch(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mul_round_sch::(a, b) @@ -3250,7 +3358,7 @@ pub fn _mm_fmul_round_sch(a: __m128h, b: __m128h) -> __m128 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmul_round_sch( src: __m128h, k: __mmask8, @@ -3278,7 +3386,7 @@ pub fn _mm_mask_fmul_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmul_round_sch( k: __mmask8, a: __m128h, @@ -3297,7 +3405,7 @@ pub fn _mm_maskz_fmul_round_sch( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cmul_pch(a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_pch(_mm_undefined_ph(), 0xff, a, b) } @@ -3311,7 +3419,7 @@ pub fn _mm_cmul_pch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cmul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { transmute(vfcmulcph_128(transmute(a), transmute(b), transmute(src), k)) } } @@ -3325,7 +3433,7 @@ pub fn _mm_mask_cmul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cmul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_pch(_mm_setzero_ph(), k, a, b) } @@ -3339,7 +3447,7 @@ pub fn _mm_maskz_cmul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cmul_pch(a: __m256h, b: __m256h) -> __m256h { _mm256_mask_cmul_pch(_mm256_undefined_ph(), 0xff, a, b) } @@ -3353,7 +3461,7 @@ pub fn _mm256_cmul_pch(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cmul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) -> __m256h { unsafe { transmute(vfcmulcph_256(transmute(a), transmute(b), transmute(src), k)) } } @@ -3367,7 +3475,7 @@ pub fn _mm256_mask_cmul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cmul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { _mm256_mask_cmul_pch(_mm256_setzero_ph(), k, a, b) } @@ -3381,7 +3489,7 @@ pub fn _mm256_maskz_cmul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cmul_pch(a: __m512h, b: __m512h) -> __m512h { _mm512_mask_cmul_pch(_mm512_undefined_ph(), 0xffff, a, b) } @@ -3395,7 +3503,7 @@ pub fn _mm512_cmul_pch(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cmul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_cmul_round_pch::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -3409,7 +3517,7 @@ pub fn _mm512_mask_cmul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cmul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_cmul_pch(_mm512_setzero_ph(), k, a, b) } @@ -3432,7 +3540,7 @@ pub fn _mm512_maskz_cmul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cmul_round_pch(a: __m512h, b: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask_cmul_round_pch::(_mm512_undefined_ph(), 0xffff, a, b) @@ -3456,7 +3564,7 @@ pub fn _mm512_cmul_round_pch(a: __m512h, b: __m512h) -> __m #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cmul_round_pch( src: __m512h, k: __mmask16, @@ -3493,7 +3601,7 @@ pub fn _mm512_mask_cmul_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cmul_round_pch( k: __mmask16, a: __m512h, @@ -3511,7 +3619,7 @@ pub fn _mm512_maskz_cmul_round_pch( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cmul_sch(a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_sch(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -3525,7 +3633,7 @@ pub fn _mm_cmul_sch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cmul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_round_sch::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -3539,7 +3647,7 @@ pub fn _mm_mask_cmul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cmul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_sch(f16x8::ZERO.as_m128h(), k, a, b) } @@ -3561,7 +3669,7 @@ pub fn _mm_maskz_cmul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cmul_round_sch(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_cmul_round_sch::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -3585,7 +3693,7 @@ pub fn _mm_cmul_round_sch(a: __m128h, b: __m128h) -> __m128 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cmul_round_sch( src: __m128h, k: __mmask8, @@ -3622,7 +3730,7 @@ pub fn _mm_mask_cmul_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cmul_round_sch( k: __mmask8, a: __m128h, @@ -3641,7 +3749,7 @@ pub fn _mm_maskz_cmul_round_sch( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fcmul_pch(a: __m128h, b: __m128h) -> __m128h { _mm_cmul_pch(a, b) } @@ -3655,7 +3763,7 @@ pub fn _mm_fcmul_pch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fcmul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_pch(src, k, a, b) } @@ -3669,7 +3777,7 @@ pub fn _mm_mask_fcmul_pch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fcmul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_maskz_cmul_pch(k, a, b) } @@ -3683,7 +3791,7 @@ pub fn _mm_maskz_fcmul_pch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_fcmul_pch(a: __m256h, b: __m256h) -> __m256h { _mm256_cmul_pch(a, b) } @@ -3697,7 +3805,7 @@ pub fn _mm256_fcmul_pch(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_fcmul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) -> __m256h { _mm256_mask_cmul_pch(src, k, a, b) } @@ -3711,7 +3819,7 @@ pub fn _mm256_mask_fcmul_pch(src: __m256h, k: __mmask8, a: __m256h, b: __m256h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_fcmul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { _mm256_maskz_cmul_pch(k, a, b) } @@ -3725,7 +3833,7 @@ pub fn _mm256_maskz_fcmul_pch(k: __mmask8, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fcmul_pch(a: __m512h, b: __m512h) -> __m512h { _mm512_cmul_pch(a, b) } @@ -3739,7 +3847,7 @@ pub fn _mm512_fcmul_pch(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fcmul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_cmul_pch(src, k, a, b) } @@ -3753,7 +3861,7 @@ pub fn _mm512_mask_fcmul_pch(src: __m512h, k: __mmask16, a: __m512h, b: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fcmul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { _mm512_maskz_cmul_pch(k, a, b) } @@ -3775,7 +3883,7 @@ pub fn _mm512_maskz_fcmul_pch(k: __mmask16, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fcmul_round_pch(a: __m512h, b: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_cmul_round_pch::(a, b) @@ -3799,7 +3907,7 @@ pub fn _mm512_fcmul_round_pch(a: __m512h, b: __m512h) -> __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fcmul_round_pch( src: __m512h, k: __mmask16, @@ -3828,7 +3936,7 @@ pub fn _mm512_mask_fcmul_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fcmul_round_pch( k: __mmask16, a: __m512h, @@ -3847,7 +3955,7 @@ pub fn _mm512_maskz_fcmul_round_pch( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fcmul_sch(a: __m128h, b: __m128h) -> __m128h { _mm_cmul_sch(a, b) } @@ -3861,7 +3969,7 @@ pub fn _mm_fcmul_sch(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fcmul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_cmul_sch(src, k, a, b) } @@ -3875,7 +3983,7 @@ pub fn _mm_mask_fcmul_sch(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fcmul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_maskz_cmul_sch(k, a, b) } @@ -3897,7 +4005,7 @@ pub fn _mm_maskz_fcmul_sch(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fcmul_round_sch(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_cmul_round_sch::(a, b) @@ -3921,7 +4029,7 @@ pub fn _mm_fcmul_round_sch(a: __m128h, b: __m128h) -> __m12 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fcmul_round_sch( src: __m128h, k: __mmask8, @@ -3950,7 +4058,7 @@ pub fn _mm_mask_fcmul_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmulcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fcmul_round_sch( k: __mmask8, a: __m128h, @@ -3966,8 +4074,9 @@ pub fn _mm_maskz_fcmul_round_sch( /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_abs_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_abs_ph(v2: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_abs_ph(v2: __m128h) -> __m128h { unsafe { transmute(_mm_and_si128(transmute(v2), _mm_set1_epi16(i16::MAX))) } } @@ -3977,8 +4086,9 @@ pub fn _mm_abs_ph(v2: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_abs_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_abs_ph(v2: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_abs_ph(v2: __m256h) -> __m256h { unsafe { transmute(_mm256_and_si256(transmute(v2), _mm256_set1_epi16(i16::MAX))) } } @@ -3988,8 +4098,9 @@ pub fn _mm256_abs_ph(v2: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_abs_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_abs_ph(v2: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_abs_ph(v2: __m512h) -> __m512h { unsafe { transmute(_mm512_and_si512(transmute(v2), _mm512_set1_epi16(i16::MAX))) } } @@ -4001,8 +4112,9 @@ pub fn _mm512_abs_ph(v2: __m512h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_conj_pch) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_conj_pch(a: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_conj_pch(a: __m128h) -> __m128h { unsafe { transmute(_mm_xor_si128(transmute(a), _mm_set1_epi32(i32::MIN))) } } @@ -4014,8 +4126,9 @@ pub fn _mm_conj_pch(a: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_conj_pch) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_conj_pch(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_conj_pch(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { let r: __m128 = transmute(_mm_conj_pch(a)); transmute(simd_select_bitmask(k, r, transmute(src))) @@ -4030,8 +4143,9 @@ pub fn _mm_mask_conj_pch(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_maskz_conj_pch) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_conj_pch(k: __mmask8, a: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_conj_pch(k: __mmask8, a: __m128h) -> __m128h { _mm_mask_conj_pch(_mm_setzero_ph(), k, a) } @@ -4042,8 +4156,9 @@ pub fn _mm_maskz_conj_pch(k: __mmask8, a: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_conj_pch) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_conj_pch(a: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_conj_pch(a: __m256h) -> __m256h { unsafe { transmute(_mm256_xor_si256(transmute(a), _mm256_set1_epi32(i32::MIN))) } } @@ -4055,8 +4170,9 @@ pub fn _mm256_conj_pch(a: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_conj_pch) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_conj_pch(src: __m256h, k: __mmask8, a: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_conj_pch(src: __m256h, k: __mmask8, a: __m256h) -> __m256h { unsafe { let r: __m256 = transmute(_mm256_conj_pch(a)); transmute(simd_select_bitmask(k, r, transmute(src))) @@ -4071,8 +4187,9 @@ pub fn _mm256_mask_conj_pch(src: __m256h, k: __mmask8, a: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_maskz_conj_pch) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_conj_pch(k: __mmask8, a: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_conj_pch(k: __mmask8, a: __m256h) -> __m256h { _mm256_mask_conj_pch(_mm256_setzero_ph(), k, a) } @@ -4083,8 +4200,9 @@ pub fn _mm256_maskz_conj_pch(k: __mmask8, a: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_conj_pch) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_conj_pch(a: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_conj_pch(a: __m512h) -> __m512h { unsafe { transmute(_mm512_xor_si512(transmute(a), _mm512_set1_epi32(i32::MIN))) } } @@ -4096,8 +4214,9 @@ pub fn _mm512_conj_pch(a: __m512h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_conj_pch) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_conj_pch(src: __m512h, k: __mmask16, a: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_conj_pch(src: __m512h, k: __mmask16, a: __m512h) -> __m512h { unsafe { let r: __m512 = transmute(_mm512_conj_pch(a)); transmute(simd_select_bitmask(k, r, transmute(src))) @@ -4112,8 +4231,9 @@ pub fn _mm512_mask_conj_pch(src: __m512h, k: __mmask16, a: __m512h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_maskz_conj_pch) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_conj_pch(k: __mmask16, a: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_conj_pch(k: __mmask16, a: __m512h) -> __m512h { _mm512_mask_conj_pch(_mm512_setzero_ph(), k, a) } @@ -4125,7 +4245,7 @@ pub fn _mm512_maskz_conj_pch(k: __mmask16, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmadd_pch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_mask3_fmadd_pch(a, b, c, 0xff) } @@ -4139,7 +4259,7 @@ pub fn _mm_fmadd_pch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmadd_pch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { let r: __m128 = transmute(_mm_mask3_fmadd_pch(a, b, c, k)); // using `0xff` would have been fine here, but this is what CLang does @@ -4156,7 +4276,7 @@ pub fn _mm_mask_fmadd_pch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fmadd_pch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { transmute(vfmaddcph_mask3_128( @@ -4177,7 +4297,7 @@ pub fn _mm_mask3_fmadd_pch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmadd_pch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { transmute(vfmaddcph_maskz_128( @@ -4197,7 +4317,7 @@ pub fn _mm_maskz_fmadd_pch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_fmadd_pch(a: __m256h, b: __m256h, c: __m256h) -> __m256h { _mm256_mask3_fmadd_pch(a, b, c, 0xff) } @@ -4211,7 +4331,7 @@ pub fn _mm256_fmadd_pch(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_fmadd_pch(a: __m256h, k: __mmask8, b: __m256h, c: __m256h) -> __m256h { unsafe { let r: __m256 = transmute(_mm256_mask3_fmadd_pch(a, b, c, k)); // using `0xff` would have been fine here, but this is what CLang does @@ -4228,7 +4348,7 @@ pub fn _mm256_mask_fmadd_pch(a: __m256h, k: __mmask8, b: __m256h, c: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask3_fmadd_pch(a: __m256h, b: __m256h, c: __m256h, k: __mmask8) -> __m256h { unsafe { transmute(vfmaddcph_mask3_256( @@ -4249,7 +4369,7 @@ pub fn _mm256_mask3_fmadd_pch(a: __m256h, b: __m256h, c: __m256h, k: __mmask8) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_fmadd_pch(k: __mmask8, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { transmute(vfmaddcph_maskz_256( @@ -4269,7 +4389,7 @@ pub fn _mm256_maskz_fmadd_pch(k: __mmask8, a: __m256h, b: __m256h, c: __m256h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmadd_pch(a: __m512h, b: __m512h, c: __m512h) -> __m512h { _mm512_fmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(a, b, c) } @@ -4283,7 +4403,7 @@ pub fn _mm512_fmadd_pch(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmadd_pch(a: __m512h, k: __mmask16, b: __m512h, c: __m512h) -> __m512h { _mm512_mask_fmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(a, k, b, c) } @@ -4297,7 +4417,7 @@ pub fn _mm512_mask_fmadd_pch(a: __m512h, k: __mmask16, b: __m512h, c: __m512h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fmadd_pch(a: __m512h, b: __m512h, c: __m512h, k: __mmask16) -> __m512h { _mm512_mask3_fmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(a, b, c, k) } @@ -4311,7 +4431,7 @@ pub fn _mm512_mask3_fmadd_pch(a: __m512h, b: __m512h, c: __m512h, k: __mmask16) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmadd_pch(k: __mmask16, a: __m512h, b: __m512h, c: __m512h) -> __m512h { _mm512_maskz_fmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(k, a, b, c) } @@ -4333,7 +4453,7 @@ pub fn _mm512_maskz_fmadd_pch(k: __mmask16, a: __m512h, b: __m512h, c: __m512h) #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmadd_round_pch(a: __m512h, b: __m512h, c: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask3_fmadd_round_pch::(a, b, c, 0xffff) @@ -4357,7 +4477,7 @@ pub fn _mm512_fmadd_round_pch(a: __m512h, b: __m512h, c: __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmadd_round_pch( a: __m512h, k: __mmask16, @@ -4389,7 +4509,7 @@ pub fn _mm512_mask_fmadd_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fmadd_round_pch( a: __m512h, b: __m512h, @@ -4426,7 +4546,7 @@ pub fn _mm512_mask3_fmadd_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmadd_round_pch( k: __mmask16, a: __m512h, @@ -4454,7 +4574,7 @@ pub fn _mm512_maskz_fmadd_round_pch( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmadd_sch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_fmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(a, b, c) } @@ -4469,7 +4589,7 @@ pub fn _mm_fmadd_sch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmadd_sch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { _mm_mask_fmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(a, k, b, c) } @@ -4484,7 +4604,7 @@ pub fn _mm_mask_fmadd_sch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fmadd_sch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { _mm_mask3_fmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(a, b, c, k) } @@ -4499,7 +4619,7 @@ pub fn _mm_mask3_fmadd_sch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmadd_sch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_maskz_fmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(k, a, b, c) } @@ -4521,7 +4641,7 @@ pub fn _mm_maskz_fmadd_sch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> _ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmadd_round_sch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -4554,7 +4674,7 @@ pub fn _mm_fmadd_round_sch(a: __m128h, b: __m128h, c: __m12 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmadd_round_sch( a: __m128h, k: __mmask8, @@ -4588,7 +4708,7 @@ pub fn _mm_mask_fmadd_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fmadd_round_sch( a: __m128h, b: __m128h, @@ -4622,7 +4742,7 @@ pub fn _mm_mask3_fmadd_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmadd_round_sch( k: __mmask8, a: __m128h, @@ -4650,7 +4770,7 @@ pub fn _mm_maskz_fmadd_round_sch( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fcmadd_pch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_mask3_fcmadd_pch(a, b, c, 0xff) } @@ -4665,7 +4785,7 @@ pub fn _mm_fcmadd_pch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fcmadd_pch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { let r: __m128 = transmute(_mm_mask3_fcmadd_pch(a, b, c, k)); // using `0xff` would have been fine here, but this is what CLang does @@ -4683,7 +4803,7 @@ pub fn _mm_mask_fcmadd_pch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fcmadd_pch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { transmute(vfcmaddcph_mask3_128( @@ -4705,7 +4825,7 @@ pub fn _mm_mask3_fcmadd_pch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fcmadd_pch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { transmute(vfcmaddcph_maskz_128( @@ -4726,7 +4846,7 @@ pub fn _mm_maskz_fcmadd_pch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_fcmadd_pch(a: __m256h, b: __m256h, c: __m256h) -> __m256h { _mm256_mask3_fcmadd_pch(a, b, c, 0xff) } @@ -4741,7 +4861,7 @@ pub fn _mm256_fcmadd_pch(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_fcmadd_pch(a: __m256h, k: __mmask8, b: __m256h, c: __m256h) -> __m256h { unsafe { let r: __m256 = transmute(_mm256_mask3_fcmadd_pch(a, b, c, k)); // using `0xff` would have been fine here, but this is what CLang does @@ -4759,7 +4879,7 @@ pub fn _mm256_mask_fcmadd_pch(a: __m256h, k: __mmask8, b: __m256h, c: __m256h) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask3_fcmadd_pch(a: __m256h, b: __m256h, c: __m256h, k: __mmask8) -> __m256h { unsafe { transmute(vfcmaddcph_mask3_256( @@ -4781,7 +4901,7 @@ pub fn _mm256_mask3_fcmadd_pch(a: __m256h, b: __m256h, c: __m256h, k: __mmask8) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_fcmadd_pch(k: __mmask8, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { transmute(vfcmaddcph_maskz_256( @@ -4802,7 +4922,7 @@ pub fn _mm256_maskz_fcmadd_pch(k: __mmask8, a: __m256h, b: __m256h, c: __m256h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fcmadd_pch(a: __m512h, b: __m512h, c: __m512h) -> __m512h { _mm512_fcmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(a, b, c) } @@ -4817,7 +4937,7 @@ pub fn _mm512_fcmadd_pch(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fcmadd_pch(a: __m512h, k: __mmask16, b: __m512h, c: __m512h) -> __m512h { _mm512_mask_fcmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(a, k, b, c) } @@ -4832,7 +4952,7 @@ pub fn _mm512_mask_fcmadd_pch(a: __m512h, k: __mmask16, b: __m512h, c: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fcmadd_pch(a: __m512h, b: __m512h, c: __m512h, k: __mmask16) -> __m512h { _mm512_mask3_fcmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(a, b, c, k) } @@ -4847,7 +4967,7 @@ pub fn _mm512_mask3_fcmadd_pch(a: __m512h, b: __m512h, c: __m512h, k: __mmask16) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fcmadd_pch(k: __mmask16, a: __m512h, b: __m512h, c: __m512h) -> __m512h { _mm512_maskz_fcmadd_round_pch::<_MM_FROUND_CUR_DIRECTION>(k, a, b, c) } @@ -4870,7 +4990,7 @@ pub fn _mm512_maskz_fcmadd_pch(k: __mmask16, a: __m512h, b: __m512h, c: __m512h) #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fcmadd_round_pch(a: __m512h, b: __m512h, c: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask3_fcmadd_round_pch::(a, b, c, 0xffff) @@ -4895,7 +5015,7 @@ pub fn _mm512_fcmadd_round_pch(a: __m512h, b: __m512h, c: _ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fcmadd_round_pch( a: __m512h, k: __mmask16, @@ -4928,7 +5048,7 @@ pub fn _mm512_mask_fcmadd_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fcmadd_round_pch( a: __m512h, b: __m512h, @@ -4966,7 +5086,7 @@ pub fn _mm512_mask3_fcmadd_round_pch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fcmadd_round_pch( k: __mmask16, a: __m512h, @@ -4995,7 +5115,7 @@ pub fn _mm512_maskz_fcmadd_round_pch( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fcmadd_sch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_fcmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(a, b, c) } @@ -5011,7 +5131,7 @@ pub fn _mm_fcmadd_sch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fcmadd_sch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { _mm_mask_fcmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(a, k, b, c) } @@ -5027,7 +5147,7 @@ pub fn _mm_mask_fcmadd_sch(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fcmadd_sch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { _mm_mask3_fcmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(a, b, c, k) } @@ -5043,7 +5163,7 @@ pub fn _mm_mask3_fcmadd_sch(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fcmadd_sch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_maskz_fcmadd_round_sch::<_MM_FROUND_CUR_DIRECTION>(k, a, b, c) } @@ -5067,7 +5187,7 @@ pub fn _mm_maskz_fcmadd_sch(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fcmadd_round_sch(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -5101,7 +5221,7 @@ pub fn _mm_fcmadd_round_sch(a: __m128h, b: __m128h, c: __m1 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fcmadd_round_sch( a: __m128h, k: __mmask8, @@ -5136,7 +5256,7 @@ pub fn _mm_mask_fcmadd_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fcmadd_round_sch( a: __m128h, b: __m128h, @@ -5171,7 +5291,7 @@ pub fn _mm_mask3_fcmadd_round_sch( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfcmaddcsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fcmadd_round_sch( k: __mmask8, a: __m128h, @@ -5197,8 +5317,9 @@ pub fn _mm_maskz_fcmadd_round_sch( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fmadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_fma(a, b, c) } } @@ -5210,8 +5331,9 @@ pub fn _mm_fmadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fmadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmadd_ph(a, b, c), a) } } @@ -5223,8 +5345,9 @@ pub fn _mm_mask_fmadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fmadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmadd_ph(a, b, c), c) } } @@ -5236,8 +5359,9 @@ pub fn _mm_mask3_fmadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fmadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmadd_ph(a, b, c), _mm_setzero_ph()) } } @@ -5248,8 +5372,9 @@ pub fn _mm_maskz_fmadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_fmadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_fma(a, b, c) } } @@ -5261,8 +5386,9 @@ pub fn _mm256_fmadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_fmadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmadd_ph(a, b, c), a) } } @@ -5274,8 +5400,9 @@ pub fn _mm256_mask_fmadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask3_fmadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmadd_ph(a, b, c), c) } } @@ -5287,8 +5414,9 @@ pub fn _mm256_mask3_fmadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_fmadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmadd_ph(a, b, c), _mm256_setzero_ph()) } } @@ -5299,8 +5427,9 @@ pub fn _mm256_maskz_fmadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_fmadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_fma(a, b, c) } } @@ -5312,8 +5441,9 @@ pub fn _mm512_fmadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_fmadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmadd_ph(a, b, c), a) } } @@ -5325,8 +5455,9 @@ pub fn _mm512_mask_fmadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask3_fmadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmadd_ph(a, b, c), c) } } @@ -5338,8 +5469,9 @@ pub fn _mm512_mask3_fmadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_fmadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmadd_ph(a, b, c), _mm512_setzero_ph()) } } @@ -5359,7 +5491,7 @@ pub fn _mm512_maskz_fmadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) - #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmadd_round_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -5384,7 +5516,7 @@ pub fn _mm512_fmadd_round_ph(a: __m512h, b: __m512h, c: __m #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmadd_round_ph( a: __m512h, k: __mmask32, @@ -5414,7 +5546,7 @@ pub fn _mm512_mask_fmadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fmadd_round_ph( a: __m512h, b: __m512h, @@ -5444,7 +5576,7 @@ pub fn _mm512_mask3_fmadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmadd_round_ph( k: __mmask32, a: __m512h, @@ -5469,8 +5601,9 @@ pub fn _mm512_maskz_fmadd_round_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fmadd_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmadd_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let extracta: f16 = simd_extract!(a, 0); let extractb: f16 = simd_extract!(b, 0); @@ -5489,8 +5622,9 @@ pub fn _mm_fmadd_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fmadd_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmadd_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fmadd: f16 = simd_extract!(a, 0); if k & 1 != 0 { @@ -5511,8 +5645,9 @@ pub fn _mm_mask_fmadd_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fmadd_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmadd_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { let mut fmadd: f16 = simd_extract!(c, 0); if k & 1 != 0 { @@ -5533,8 +5668,9 @@ pub fn _mm_mask3_fmadd_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fmadd_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmadd_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fmadd: f16 = 0.0; if k & 1 != 0 { @@ -5564,7 +5700,7 @@ pub fn _mm_maskz_fmadd_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmadd_round_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -5594,7 +5730,7 @@ pub fn _mm_fmadd_round_sh(a: __m128h, b: __m128h, c: __m128 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmadd_round_sh( a: __m128h, k: __mmask8, @@ -5631,7 +5767,7 @@ pub fn _mm_mask_fmadd_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fmadd_round_sh( a: __m128h, b: __m128h, @@ -5668,7 +5804,7 @@ pub fn _mm_mask3_fmadd_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmadd_round_sh( k: __mmask8, a: __m128h, @@ -5696,8 +5832,9 @@ pub fn _mm_maskz_fmadd_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fmsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -5709,8 +5846,9 @@ pub fn _mm_fmsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fmsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmsub_ph(a, b, c), a) } } @@ -5722,8 +5860,9 @@ pub fn _mm_mask_fmsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fmsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmsub_ph(a, b, c), c) } } @@ -5735,8 +5874,9 @@ pub fn _mm_mask3_fmsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fmsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmsub_ph(a, b, c), _mm_setzero_ph()) } } @@ -5747,8 +5887,9 @@ pub fn _mm_maskz_fmsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_fmsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -5760,8 +5901,9 @@ pub fn _mm256_fmsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_fmsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmsub_ph(a, b, c), a) } } @@ -5773,8 +5915,9 @@ pub fn _mm256_mask_fmsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask3_fmsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmsub_ph(a, b, c), c) } } @@ -5786,8 +5929,9 @@ pub fn _mm256_mask3_fmsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_fmsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmsub_ph(a, b, c), _mm256_setzero_ph()) } } @@ -5798,8 +5942,9 @@ pub fn _mm256_maskz_fmsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_fmsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -5811,8 +5956,9 @@ pub fn _mm512_fmsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_fmsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmsub_ph(a, b, c), a) } } @@ -5824,8 +5970,9 @@ pub fn _mm512_mask_fmsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask3_fmsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmsub_ph(a, b, c), c) } } @@ -5837,8 +5984,9 @@ pub fn _mm512_mask3_fmsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_fmsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmsub_ph(a, b, c), _mm512_setzero_ph()) } } @@ -5858,7 +6006,7 @@ pub fn _mm512_maskz_fmsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) - #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmsub_round_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -5883,7 +6031,7 @@ pub fn _mm512_fmsub_round_ph(a: __m512h, b: __m512h, c: __m #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmsub_round_ph( a: __m512h, k: __mmask32, @@ -5913,7 +6061,7 @@ pub fn _mm512_mask_fmsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fmsub_round_ph( a: __m512h, b: __m512h, @@ -5943,7 +6091,7 @@ pub fn _mm512_mask3_fmsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmsub_round_ph( k: __mmask32, a: __m512h, @@ -5968,8 +6116,9 @@ pub fn _mm512_maskz_fmsub_round_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fmsub_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsub_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let extracta: f16 = simd_extract!(a, 0); let extractb: f16 = simd_extract!(b, 0); @@ -5988,8 +6137,9 @@ pub fn _mm_fmsub_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fmsub_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsub_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fmsub: f16 = simd_extract!(a, 0); if k & 1 != 0 { @@ -6010,8 +6160,9 @@ pub fn _mm_mask_fmsub_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fmsub_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsub_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { let mut fmsub: f16 = simd_extract!(c, 0); if k & 1 != 0 { @@ -6032,8 +6183,9 @@ pub fn _mm_mask3_fmsub_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fmsub_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsub_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fmsub: f16 = 0.0; if k & 1 != 0 { @@ -6063,7 +6215,7 @@ pub fn _mm_maskz_fmsub_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fmsub_round_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -6093,7 +6245,7 @@ pub fn _mm_fmsub_round_sh(a: __m128h, b: __m128h, c: __m128 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fmsub_round_sh( a: __m128h, k: __mmask8, @@ -6130,7 +6282,7 @@ pub fn _mm_mask_fmsub_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fmsub_round_sh( a: __m128h, b: __m128h, @@ -6159,7 +6311,7 @@ pub fn _mm_mask3_fmsub_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fmsub_round_sh( k: __mmask8, a: __m128h, @@ -6186,8 +6338,9 @@ pub fn _mm_maskz_fmsub_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fnmadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -6199,8 +6352,9 @@ pub fn _mm_fnmadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fnmadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fnmadd_ph(a, b, c), a) } } @@ -6212,8 +6366,9 @@ pub fn _mm_mask_fnmadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fnmadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fnmadd_ph(a, b, c), c) } } @@ -6225,8 +6380,9 @@ pub fn _mm_mask3_fnmadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fnmadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fnmadd_ph(a, b, c), _mm_setzero_ph()) } } @@ -6237,8 +6393,9 @@ pub fn _mm_maskz_fnmadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_fnmadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fnmadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -6250,8 +6407,9 @@ pub fn _mm256_fnmadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_fnmadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fnmadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fnmadd_ph(a, b, c), a) } } @@ -6263,8 +6421,9 @@ pub fn _mm256_mask_fnmadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask3_fnmadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fnmadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fnmadd_ph(a, b, c), c) } } @@ -6276,8 +6435,9 @@ pub fn _mm256_mask3_fnmadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_fnmadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fnmadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fnmadd_ph(a, b, c), _mm256_setzero_ph()) } } @@ -6288,8 +6448,9 @@ pub fn _mm256_maskz_fnmadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_fnmadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fnmadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -6301,8 +6462,9 @@ pub fn _mm512_fnmadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_fnmadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fnmadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fnmadd_ph(a, b, c), a) } } @@ -6314,8 +6476,9 @@ pub fn _mm512_mask_fnmadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask3_fnmadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fnmadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fnmadd_ph(a, b, c), c) } } @@ -6327,8 +6490,9 @@ pub fn _mm512_mask3_fnmadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_fnmadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fnmadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fnmadd_ph(a, b, c), _mm512_setzero_ph()) } } @@ -6348,7 +6512,7 @@ pub fn _mm512_maskz_fnmadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fnmadd_round_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -6373,7 +6537,7 @@ pub fn _mm512_fnmadd_round_ph(a: __m512h, b: __m512h, c: __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fnmadd_round_ph( a: __m512h, k: __mmask32, @@ -6403,7 +6567,7 @@ pub fn _mm512_mask_fnmadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fnmadd_round_ph( a: __m512h, b: __m512h, @@ -6433,7 +6597,7 @@ pub fn _mm512_mask3_fnmadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fnmadd_round_ph( k: __mmask32, a: __m512h, @@ -6458,8 +6622,9 @@ pub fn _mm512_maskz_fnmadd_round_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fnmadd_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmadd_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let extracta: f16 = simd_extract!(a, 0); let extractb: f16 = simd_extract!(b, 0); @@ -6478,8 +6643,9 @@ pub fn _mm_fnmadd_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fnmadd_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmadd_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fnmadd: f16 = simd_extract!(a, 0); if k & 1 != 0 { @@ -6500,8 +6666,9 @@ pub fn _mm_mask_fnmadd_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fnmadd_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmadd_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { let mut fnmadd: f16 = simd_extract!(c, 0); if k & 1 != 0 { @@ -6522,8 +6689,9 @@ pub fn _mm_mask3_fnmadd_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fnmadd_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmadd_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fnmadd: f16 = 0.0; if k & 1 != 0 { @@ -6553,7 +6721,7 @@ pub fn _mm_maskz_fnmadd_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> _ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fnmadd_round_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -6583,7 +6751,7 @@ pub fn _mm_fnmadd_round_sh(a: __m128h, b: __m128h, c: __m12 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fnmadd_round_sh( a: __m128h, k: __mmask8, @@ -6620,7 +6788,7 @@ pub fn _mm_mask_fnmadd_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fnmadd_round_sh( a: __m128h, b: __m128h, @@ -6657,7 +6825,7 @@ pub fn _mm_mask3_fnmadd_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fnmadd_round_sh( k: __mmask8, a: __m128h, @@ -6684,8 +6852,9 @@ pub fn _mm_maskz_fnmadd_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fnmsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -6697,8 +6866,9 @@ pub fn _mm_fnmsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fnmsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fnmsub_ph(a, b, c), a) } } @@ -6710,8 +6880,9 @@ pub fn _mm_mask_fnmsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fnmsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fnmsub_ph(a, b, c), c) } } @@ -6723,8 +6894,9 @@ pub fn _mm_mask3_fnmsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fnmsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fnmsub_ph(a, b, c), _mm_setzero_ph()) } } @@ -6735,8 +6907,9 @@ pub fn _mm_maskz_fnmsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_fnmsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fnmsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -6748,8 +6921,9 @@ pub fn _mm256_fnmsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_fnmsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fnmsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fnmsub_ph(a, b, c), a) } } @@ -6761,8 +6935,9 @@ pub fn _mm256_mask_fnmsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) - #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask3_fnmsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fnmsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fnmsub_ph(a, b, c), c) } } @@ -6774,8 +6949,9 @@ pub fn _mm256_mask3_fnmsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_fnmsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fnmsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fnmsub_ph(a, b, c), _mm256_setzero_ph()) } } @@ -6786,8 +6962,9 @@ pub fn _mm256_maskz_fnmsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_fnmsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fnmsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -6799,8 +6976,9 @@ pub fn _mm512_fnmsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_fnmsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fnmsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fnmsub_ph(a, b, c), a) } } @@ -6812,8 +6990,9 @@ pub fn _mm512_mask_fnmsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) - #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask3_fnmsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fnmsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fnmsub_ph(a, b, c), c) } } @@ -6825,8 +7004,9 @@ pub fn _mm512_mask3_fnmsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_fnmsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fnmsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fnmsub_ph(a, b, c), _mm512_setzero_ph()) } } @@ -6846,7 +7026,7 @@ pub fn _mm512_maskz_fnmsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fnmsub_round_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -6871,7 +7051,7 @@ pub fn _mm512_fnmsub_round_ph(a: __m512h, b: __m512h, c: __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fnmsub_round_ph( a: __m512h, k: __mmask32, @@ -6901,7 +7081,7 @@ pub fn _mm512_mask_fnmsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fnmsub_round_ph( a: __m512h, b: __m512h, @@ -6931,7 +7111,7 @@ pub fn _mm512_mask3_fnmsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fnmsub_round_ph( k: __mmask32, a: __m512h, @@ -6956,8 +7136,9 @@ pub fn _mm512_maskz_fnmsub_round_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fnmsub_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmsub_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let extracta: f16 = simd_extract!(a, 0); let extractb: f16 = simd_extract!(b, 0); @@ -6976,8 +7157,9 @@ pub fn _mm_fnmsub_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fnmsub_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fnmsub_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fnmsub: f16 = simd_extract!(a, 0); if k & 1 != 0 { @@ -6998,8 +7180,9 @@ pub fn _mm_mask_fnmsub_sh(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fnmsub_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fnmsub_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { let mut fnmsub: f16 = simd_extract!(c, 0); if k & 1 != 0 { @@ -7020,8 +7203,9 @@ pub fn _mm_mask3_fnmsub_sh(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fnmsub_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fnmsub_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let mut fnmsub: f16 = 0.0; if k & 1 != 0 { @@ -7051,7 +7235,7 @@ pub fn _mm_maskz_fnmsub_sh(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> _ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fnmsub_round_sh(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -7081,7 +7265,7 @@ pub fn _mm_fnmsub_round_sh(a: __m128h, b: __m128h, c: __m12 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fnmsub_round_sh( a: __m128h, k: __mmask8, @@ -7118,7 +7302,7 @@ pub fn _mm_mask_fnmsub_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask3_fnmsub_round_sh( a: __m128h, b: __m128h, @@ -7155,7 +7339,7 @@ pub fn _mm_mask3_fnmsub_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfnmsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_fnmsub_round_sh( k: __mmask8, a: __m128h, @@ -7182,8 +7366,9 @@ pub fn _mm_maskz_fnmsub_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fmaddsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmaddsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -7199,8 +7384,9 @@ pub fn _mm_fmaddsub_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fmaddsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmaddsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmaddsub_ph(a, b, c), a) } } @@ -7212,8 +7398,9 @@ pub fn _mm_mask_fmaddsub_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fmaddsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmaddsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmaddsub_ph(a, b, c), c) } } @@ -7225,8 +7412,9 @@ pub fn _mm_mask3_fmaddsub_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fmaddsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmaddsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmaddsub_ph(a, b, c), _mm_setzero_ph()) } } @@ -7237,8 +7425,9 @@ pub fn _mm_maskz_fmaddsub_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_fmaddsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmaddsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -7258,8 +7447,9 @@ pub fn _mm256_fmaddsub_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_fmaddsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmaddsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_ph(a, b, c), a) } } @@ -7271,8 +7461,9 @@ pub fn _mm256_mask_fmaddsub_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask3_fmaddsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmaddsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_ph(a, b, c), c) } } @@ -7284,8 +7475,9 @@ pub fn _mm256_mask3_fmaddsub_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_fmaddsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmaddsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmaddsub_ph(a, b, c), _mm256_setzero_ph()) } } @@ -7296,8 +7488,9 @@ pub fn _mm256_maskz_fmaddsub_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_fmaddsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmaddsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -7320,8 +7513,9 @@ pub fn _mm512_fmaddsub_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_fmaddsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmaddsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_ph(a, b, c), a) } } @@ -7333,8 +7527,9 @@ pub fn _mm512_mask_fmaddsub_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask3_fmaddsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmaddsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_ph(a, b, c), c) } } @@ -7346,8 +7541,9 @@ pub fn _mm512_mask3_fmaddsub_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_fmaddsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmaddsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmaddsub_ph(a, b, c), _mm512_setzero_ph()) } } @@ -7367,7 +7563,7 @@ pub fn _mm512_maskz_fmaddsub_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmaddsub_round_ph( a: __m512h, b: __m512h, @@ -7396,7 +7592,7 @@ pub fn _mm512_fmaddsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmaddsub_round_ph( a: __m512h, k: __mmask32, @@ -7426,7 +7622,7 @@ pub fn _mm512_mask_fmaddsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fmaddsub_round_ph( a: __m512h, b: __m512h, @@ -7456,7 +7652,7 @@ pub fn _mm512_mask3_fmaddsub_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmaddsub, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmaddsub_round_ph( k: __mmask32, a: __m512h, @@ -7480,8 +7676,9 @@ pub fn _mm512_maskz_fmaddsub_round_ph( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_fmsubadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsubadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { _mm_fmaddsub_ph(a, b, unsafe { simd_neg(c) }) } @@ -7493,8 +7690,9 @@ pub fn _mm_fmsubadd_ph(a: __m128h, b: __m128h, c: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_fmsubadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_fmsubadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmsubadd_ph(a, b, c), a) } } @@ -7506,8 +7704,9 @@ pub fn _mm_mask_fmsubadd_ph(a: __m128h, k: __mmask8, b: __m128h, c: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask3_fmsubadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask3_fmsubadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmsubadd_ph(a, b, c), c) } } @@ -7519,8 +7718,9 @@ pub fn _mm_mask3_fmsubadd_ph(a: __m128h, b: __m128h, c: __m128h, k: __mmask8) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_maskz_fmsubadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_fmsubadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_fmsubadd_ph(a, b, c), _mm_setzero_ph()) } } @@ -7531,8 +7731,9 @@ pub fn _mm_maskz_fmsubadd_ph(k: __mmask8, a: __m128h, b: __m128h, c: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_fmsubadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmsubadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { _mm256_fmaddsub_ph(a, b, unsafe { simd_neg(c) }) } @@ -7544,8 +7745,9 @@ pub fn _mm256_fmsubadd_ph(a: __m256h, b: __m256h, c: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_fmsubadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_fmsubadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_ph(a, b, c), a) } } @@ -7557,8 +7759,9 @@ pub fn _mm256_mask_fmsubadd_ph(a: __m256h, k: __mmask16, b: __m256h, c: __m256h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask3_fmsubadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask3_fmsubadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_ph(a, b, c), c) } } @@ -7570,8 +7773,9 @@ pub fn _mm256_mask3_fmsubadd_ph(a: __m256h, b: __m256h, c: __m256h, k: __mmask16 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_maskz_fmsubadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_fmsubadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_fmsubadd_ph(a, b, c), _mm256_setzero_ph()) } } @@ -7582,8 +7786,9 @@ pub fn _mm256_maskz_fmsubadd_ph(k: __mmask16, a: __m256h, b: __m256h, c: __m256h #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_fmsubadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_fmsubadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { _mm512_fmaddsub_ph(a, b, unsafe { simd_neg(c) }) } @@ -7595,8 +7800,9 @@ pub fn _mm512_fmsubadd_ph(a: __m512h, b: __m512h, c: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_fmsubadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_fmsubadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_ph(a, b, c), a) } } @@ -7608,8 +7814,9 @@ pub fn _mm512_mask_fmsubadd_ph(a: __m512h, k: __mmask32, b: __m512h, c: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask3_fmsubadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask3_fmsubadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_ph(a, b, c), c) } } @@ -7621,8 +7828,9 @@ pub fn _mm512_mask3_fmsubadd_ph(a: __m512h, b: __m512h, c: __m512h, k: __mmask32 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_maskz_fmsubadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_fmsubadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_fmsubadd_ph(a, b, c), _mm512_setzero_ph()) } } @@ -7642,7 +7850,7 @@ pub fn _mm512_maskz_fmsubadd_ph(k: __mmask32, a: __m512h, b: __m512h, c: __m512h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fmsubadd_round_ph( a: __m512h, b: __m512h, @@ -7671,7 +7879,7 @@ pub fn _mm512_fmsubadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fmsubadd_round_ph( a: __m512h, k: __mmask32, @@ -7701,7 +7909,7 @@ pub fn _mm512_mask_fmsubadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask3_fmsubadd_round_ph( a: __m512h, b: __m512h, @@ -7731,7 +7939,7 @@ pub fn _mm512_mask3_fmsubadd_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfmsubadd, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_fmsubadd_round_ph( k: __mmask32, a: __m512h, @@ -7755,7 +7963,7 @@ pub fn _mm512_maskz_fmsubadd_round_ph( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_rcp_ph(a: __m128h) -> __m128h { _mm_mask_rcp_ph(_mm_undefined_ph(), 0xff, a) } @@ -7768,7 +7976,7 @@ pub fn _mm_rcp_ph(a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_rcp_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { vrcpph_128(a, src, k) } } @@ -7781,7 +7989,7 @@ pub fn _mm_mask_rcp_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_rcp_ph(k: __mmask8, a: __m128h) -> __m128h { _mm_mask_rcp_ph(_mm_setzero_ph(), k, a) } @@ -7793,7 +8001,7 @@ pub fn _mm_maskz_rcp_ph(k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_rcp_ph(a: __m256h) -> __m256h { _mm256_mask_rcp_ph(_mm256_undefined_ph(), 0xffff, a) } @@ -7806,7 +8014,7 @@ pub fn _mm256_rcp_ph(a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_rcp_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { unsafe { vrcpph_256(a, src, k) } } @@ -7819,7 +8027,7 @@ pub fn _mm256_mask_rcp_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_rcp_ph(k: __mmask16, a: __m256h) -> __m256h { _mm256_mask_rcp_ph(_mm256_setzero_ph(), k, a) } @@ -7831,7 +8039,7 @@ pub fn _mm256_maskz_rcp_ph(k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_rcp_ph(a: __m512h) -> __m512h { _mm512_mask_rcp_ph(_mm512_undefined_ph(), 0xffffffff, a) } @@ -7844,7 +8052,7 @@ pub fn _mm512_rcp_ph(a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_rcp_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { unsafe { vrcpph_512(a, src, k) } } @@ -7857,7 +8065,7 @@ pub fn _mm512_mask_rcp_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrcpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_rcp_ph(k: __mmask32, a: __m512h) -> __m512h { _mm512_mask_rcp_ph(_mm512_setzero_ph(), k, a) } @@ -7871,7 +8079,7 @@ pub fn _mm512_maskz_rcp_ph(k: __mmask32, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrcpsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_rcp_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_rcp_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -7885,7 +8093,7 @@ pub fn _mm_rcp_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrcpsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_rcp_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { vrcpsh(a, b, src, k) } } @@ -7899,7 +8107,7 @@ pub fn _mm_mask_rcp_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrcpsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_rcp_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_rcp_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -7912,7 +8120,7 @@ pub fn _mm_maskz_rcp_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_rsqrt_ph(a: __m128h) -> __m128h { _mm_mask_rsqrt_ph(_mm_undefined_ph(), 0xff, a) } @@ -7926,7 +8134,7 @@ pub fn _mm_rsqrt_ph(a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_rsqrt_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { vrsqrtph_128(a, src, k) } } @@ -7940,7 +8148,7 @@ pub fn _mm_mask_rsqrt_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_rsqrt_ph(k: __mmask8, a: __m128h) -> __m128h { _mm_mask_rsqrt_ph(_mm_setzero_ph(), k, a) } @@ -7953,7 +8161,7 @@ pub fn _mm_maskz_rsqrt_ph(k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_rsqrt_ph(a: __m256h) -> __m256h { _mm256_mask_rsqrt_ph(_mm256_undefined_ph(), 0xffff, a) } @@ -7967,7 +8175,7 @@ pub fn _mm256_rsqrt_ph(a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_rsqrt_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { unsafe { vrsqrtph_256(a, src, k) } } @@ -7981,7 +8189,7 @@ pub fn _mm256_mask_rsqrt_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_rsqrt_ph(k: __mmask16, a: __m256h) -> __m256h { _mm256_mask_rsqrt_ph(_mm256_setzero_ph(), k, a) } @@ -7994,7 +8202,7 @@ pub fn _mm256_maskz_rsqrt_ph(k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_rsqrt_ph(a: __m512h) -> __m512h { _mm512_mask_rsqrt_ph(_mm512_undefined_ph(), 0xffffffff, a) } @@ -8008,7 +8216,7 @@ pub fn _mm512_rsqrt_ph(a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_rsqrt_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { unsafe { vrsqrtph_512(a, src, k) } } @@ -8022,7 +8230,7 @@ pub fn _mm512_mask_rsqrt_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_rsqrt_ph(k: __mmask32, a: __m512h) -> __m512h { _mm512_mask_rsqrt_ph(_mm512_setzero_ph(), k, a) } @@ -8036,7 +8244,7 @@ pub fn _mm512_maskz_rsqrt_ph(k: __mmask32, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrsqrtsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_rsqrt_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_rsqrt_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -8050,7 +8258,7 @@ pub fn _mm_rsqrt_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrsqrtsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_rsqrt_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { vrsqrtsh(a, b, src, k) } } @@ -8064,7 +8272,7 @@ pub fn _mm_mask_rsqrt_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrsqrtsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_rsqrt_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_rsqrt_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -8076,7 +8284,7 @@ pub fn _mm_maskz_rsqrt_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_sqrt_ph(a: __m128h) -> __m128h { unsafe { simd_fsqrt(a) } } @@ -8088,7 +8296,7 @@ pub fn _mm_sqrt_ph(a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_sqrt_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_sqrt_ph(a), src) } } @@ -8100,7 +8308,7 @@ pub fn _mm_mask_sqrt_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_sqrt_ph(k: __mmask8, a: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_sqrt_ph(a), _mm_setzero_ph()) } } @@ -8112,7 +8320,7 @@ pub fn _mm_maskz_sqrt_ph(k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_sqrt_ph(a: __m256h) -> __m256h { unsafe { simd_fsqrt(a) } } @@ -8124,7 +8332,7 @@ pub fn _mm256_sqrt_ph(a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_sqrt_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_sqrt_ph(a), src) } } @@ -8136,7 +8344,7 @@ pub fn _mm256_mask_sqrt_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_sqrt_ph(k: __mmask16, a: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_sqrt_ph(a), _mm256_setzero_ph()) } } @@ -8148,7 +8356,7 @@ pub fn _mm256_maskz_sqrt_ph(k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_sqrt_ph(a: __m512h) -> __m512h { unsafe { simd_fsqrt(a) } } @@ -8160,7 +8368,7 @@ pub fn _mm512_sqrt_ph(a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_sqrt_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_sqrt_ph(a), src) } } @@ -8172,7 +8380,7 @@ pub fn _mm512_mask_sqrt_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_sqrt_ph(k: __mmask32, a: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_sqrt_ph(a), _mm512_setzero_ph()) } } @@ -8192,7 +8400,7 @@ pub fn _mm512_maskz_sqrt_ph(k: __mmask32, a: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_sqrt_round_ph(a: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -8215,7 +8423,7 @@ pub fn _mm512_sqrt_round_ph(a: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_sqrt_round_ph( src: __m512h, k: __mmask32, @@ -8242,7 +8450,7 @@ pub fn _mm512_mask_sqrt_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_sqrt_round_ph(k: __mmask32, a: __m512h) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -8258,7 +8466,7 @@ pub fn _mm512_maskz_sqrt_round_ph(k: __mmask32, a: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_sqrt_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_sqrt_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -8271,7 +8479,7 @@ pub fn _mm_sqrt_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_sqrt_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_sqrt_round_sh::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -8284,7 +8492,7 @@ pub fn _mm_mask_sqrt_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_sqrt_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_sqrt_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -8305,7 +8513,7 @@ pub fn _mm_maskz_sqrt_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_sqrt_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_sqrt_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -8327,7 +8535,7 @@ pub fn _mm_sqrt_round_sh(a: __m128h, b: __m128h) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_sqrt_round_sh( src: __m128h, k: __mmask8, @@ -8356,7 +8564,7 @@ pub fn _mm_mask_sqrt_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vsqrtsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_sqrt_round_sh( k: __mmask8, a: __m128h, @@ -8374,7 +8582,7 @@ pub fn _mm_maskz_sqrt_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_max_ph(a: __m128h, b: __m128h) -> __m128h { unsafe { vmaxph_128(a, b) } } @@ -8388,7 +8596,7 @@ pub fn _mm_max_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_max_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_max_ph(a, b), src) } } @@ -8402,7 +8610,7 @@ pub fn _mm_mask_max_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_max_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_max_ph(a, b), _mm_setzero_ph()) } } @@ -8415,7 +8623,7 @@ pub fn _mm_maskz_max_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_max_ph(a: __m256h, b: __m256h) -> __m256h { unsafe { vmaxph_256(a, b) } } @@ -8429,7 +8637,7 @@ pub fn _mm256_max_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_max_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_max_ph(a, b), src) } } @@ -8443,7 +8651,7 @@ pub fn _mm256_mask_max_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_max_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_max_ph(a, b), _mm256_setzero_ph()) } } @@ -8456,7 +8664,7 @@ pub fn _mm256_maskz_max_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_max_ph(a: __m512h, b: __m512h) -> __m512h { _mm512_max_round_ph::<_MM_FROUND_CUR_DIRECTION>(a, b) } @@ -8470,7 +8678,7 @@ pub fn _mm512_max_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_max_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_max_ph(a, b), src) } } @@ -8484,7 +8692,7 @@ pub fn _mm512_mask_max_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmaxph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_max_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_max_ph(a, b), _mm512_setzero_ph()) } } @@ -8499,7 +8707,7 @@ pub fn _mm512_maskz_max_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmaxph, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_max_round_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_sae!(SAE); @@ -8517,7 +8725,7 @@ pub fn _mm512_max_round_ph(a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmaxph, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_max_round_ph( src: __m512h, k: __mmask32, @@ -8540,7 +8748,7 @@ pub fn _mm512_mask_max_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vmaxph, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_max_round_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_sae!(SAE); @@ -8557,7 +8765,7 @@ pub fn _mm512_maskz_max_round_ph(k: __mmask32, a: __m512h, b: __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_max_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_max_sh(_mm_undefined_ph(), 0xff, a, b) } @@ -8571,7 +8779,7 @@ pub fn _mm_max_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_max_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_max_round_sh::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -8585,7 +8793,7 @@ pub fn _mm_mask_max_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_max_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_max_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -8600,7 +8808,7 @@ pub fn _mm_maskz_max_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxsh, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_max_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_sae!(SAE); _mm_mask_max_round_sh::(_mm_undefined_ph(), 0xff, a, b) @@ -8617,7 +8825,7 @@ pub fn _mm_max_round_sh(a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxsh, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_max_round_sh( src: __m128h, k: __mmask8, @@ -8641,7 +8849,7 @@ pub fn _mm_mask_max_round_sh( #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vmaxsh, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_max_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_sae!(SAE); _mm_mask_max_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -8655,7 +8863,7 @@ pub fn _mm_maskz_max_round_sh(k: __mmask8, a: __m128h, b: __m128 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_min_ph(a: __m128h, b: __m128h) -> __m128h { unsafe { vminph_128(a, b) } } @@ -8669,7 +8877,7 @@ pub fn _mm_min_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_min_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_min_ph(a, b), src) } } @@ -8683,7 +8891,7 @@ pub fn _mm_mask_min_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_min_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, _mm_min_ph(a, b), _mm_setzero_ph()) } } @@ -8696,7 +8904,7 @@ pub fn _mm_maskz_min_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_min_ph(a: __m256h, b: __m256h) -> __m256h { unsafe { vminph_256(a, b) } } @@ -8710,7 +8918,7 @@ pub fn _mm256_min_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_min_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_min_ph(a, b), src) } } @@ -8724,7 +8932,7 @@ pub fn _mm256_mask_min_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_min_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_min_ph(a, b), _mm256_setzero_ph()) } } @@ -8737,7 +8945,7 @@ pub fn _mm256_maskz_min_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_min_ph(a: __m512h, b: __m512h) -> __m512h { _mm512_min_round_ph::<_MM_FROUND_CUR_DIRECTION>(a, b) } @@ -8751,7 +8959,7 @@ pub fn _mm512_min_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_min_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_min_ph(a, b), src) } } @@ -8765,7 +8973,7 @@ pub fn _mm512_mask_min_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vminph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_min_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_min_ph(a, b), _mm512_setzero_ph()) } } @@ -8779,7 +8987,7 @@ pub fn _mm512_maskz_min_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vminph, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_min_round_ph(a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_sae!(SAE); @@ -8797,7 +9005,7 @@ pub fn _mm512_min_round_ph(a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vminph, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_min_round_ph( src: __m512h, k: __mmask32, @@ -8820,7 +9028,7 @@ pub fn _mm512_mask_min_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vminph, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_min_round_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { static_assert_sae!(SAE); @@ -8837,7 +9045,7 @@ pub fn _mm512_maskz_min_round_ph(k: __mmask32, a: __m512h, b: __ #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_min_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_min_sh(_mm_undefined_ph(), 0xff, a, b) } @@ -8851,7 +9059,7 @@ pub fn _mm_min_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_min_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_min_round_sh::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -8865,7 +9073,7 @@ pub fn _mm_mask_min_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_min_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_min_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -8880,7 +9088,7 @@ pub fn _mm_maskz_min_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminsh, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_min_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_sae!(SAE); _mm_mask_min_round_sh::(_mm_undefined_ph(), 0xff, a, b) @@ -8897,7 +9105,7 @@ pub fn _mm_min_round_sh(a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminsh, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_min_round_sh( src: __m128h, k: __mmask8, @@ -8921,7 +9129,7 @@ pub fn _mm_mask_min_round_sh( #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vminsh, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_min_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_sae!(SAE); _mm_mask_min_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -8935,7 +9143,7 @@ pub fn _mm_maskz_min_round_sh(k: __mmask8, a: __m128h, b: __m128 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_getexp_ph(a: __m128h) -> __m128h { _mm_mask_getexp_ph(_mm_undefined_ph(), 0xff, a) } @@ -8949,7 +9157,7 @@ pub fn _mm_getexp_ph(a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_getexp_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { vgetexpph_128(a, src, k) } } @@ -8963,7 +9171,7 @@ pub fn _mm_mask_getexp_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_getexp_ph(k: __mmask8, a: __m128h) -> __m128h { _mm_mask_getexp_ph(_mm_setzero_ph(), k, a) } @@ -8976,7 +9184,7 @@ pub fn _mm_maskz_getexp_ph(k: __mmask8, a: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_getexp_ph(a: __m256h) -> __m256h { _mm256_mask_getexp_ph(_mm256_undefined_ph(), 0xffff, a) } @@ -8990,7 +9198,7 @@ pub fn _mm256_getexp_ph(a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_getexp_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { unsafe { vgetexpph_256(a, src, k) } } @@ -9004,7 +9212,7 @@ pub fn _mm256_mask_getexp_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_getexp_ph(k: __mmask16, a: __m256h) -> __m256h { _mm256_mask_getexp_ph(_mm256_setzero_ph(), k, a) } @@ -9017,7 +9225,7 @@ pub fn _mm256_maskz_getexp_ph(k: __mmask16, a: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_getexp_ph(a: __m512h) -> __m512h { _mm512_mask_getexp_ph(_mm512_undefined_ph(), 0xffffffff, a) } @@ -9031,7 +9239,7 @@ pub fn _mm512_getexp_ph(a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_getexp_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { _mm512_mask_getexp_round_ph::<_MM_FROUND_CUR_DIRECTION>(src, k, a) } @@ -9045,7 +9253,7 @@ pub fn _mm512_mask_getexp_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_getexp_ph(k: __mmask32, a: __m512h) -> __m512h { _mm512_mask_getexp_ph(_mm512_setzero_ph(), k, a) } @@ -9060,7 +9268,7 @@ pub fn _mm512_maskz_getexp_ph(k: __mmask32, a: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpph, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_getexp_round_ph(a: __m512h) -> __m512h { static_assert_sae!(SAE); _mm512_mask_getexp_round_ph::(_mm512_undefined_ph(), 0xffffffff, a) @@ -9076,7 +9284,7 @@ pub fn _mm512_getexp_round_ph(a: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpph, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_getexp_round_ph( src: __m512h, k: __mmask32, @@ -9098,7 +9306,7 @@ pub fn _mm512_mask_getexp_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpph, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_getexp_round_ph(k: __mmask32, a: __m512h) -> __m512h { static_assert_sae!(SAE); _mm512_mask_getexp_round_ph::(_mm512_setzero_ph(), k, a) @@ -9113,7 +9321,7 @@ pub fn _mm512_maskz_getexp_round_ph(k: __mmask32, a: __m512h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_getexp_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_getexp_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -9128,7 +9336,7 @@ pub fn _mm_getexp_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_getexp_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_getexp_round_sh::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -9143,7 +9351,7 @@ pub fn _mm_mask_getexp_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_getexp_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_getexp_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -9159,7 +9367,7 @@ pub fn _mm_maskz_getexp_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpsh, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_getexp_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_sae!(SAE); _mm_mask_getexp_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -9176,7 +9384,7 @@ pub fn _mm_getexp_round_sh(a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpsh, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_getexp_round_sh( src: __m128h, k: __mmask8, @@ -9200,7 +9408,7 @@ pub fn _mm_mask_getexp_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vgetexpsh, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_getexp_round_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_sae!(SAE); _mm_mask_getexp_round_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -9228,7 +9436,7 @@ pub fn _mm_maskz_getexp_round_sh(k: __mmask8, a: __m128h, b: __m #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vgetmantph, NORM = 0, SIGN = 0))] #[rustc_legacy_const_generics(1, 2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_getmant_ph( a: __m128h, ) -> __m128h { @@ -9260,7 +9468,7 @@ pub fn _mm_getmant_ph( a: __m256h, ) -> __m256h { @@ -9366,7 +9574,7 @@ pub fn _mm256_getmant_ph( a: __m512h, ) -> __m512h { @@ -9472,7 +9680,7 @@ pub fn _mm512_getmant_ph( a: __m128h, b: __m128h, @@ -9703,7 +9911,7 @@ pub fn _mm_getmant_sh(a: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_roundscale_ph::(_mm_undefined_ph(), 0xff, a) @@ -9923,7 +10131,7 @@ pub fn _mm_roundscale_ph(a: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_roundscale_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -9948,7 +10156,7 @@ pub fn _mm_mask_roundscale_ph(src: __m128h, k: __mmask8, a: __m #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_roundscale_ph(k: __mmask8, a: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_roundscale_ph::(_mm_setzero_ph(), k, a) @@ -9970,7 +10178,7 @@ pub fn _mm_maskz_roundscale_ph(k: __mmask8, a: __m128h) -> __m1 #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_roundscale_ph(a: __m256h) -> __m256h { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_roundscale_ph::(_mm256_undefined_ph(), 0xffff, a) @@ -9993,7 +10201,7 @@ pub fn _mm256_roundscale_ph(a: __m256h) -> __m256h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_roundscale_ph( src: __m256h, k: __mmask16, @@ -10022,7 +10230,7 @@ pub fn _mm256_mask_roundscale_ph( #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_roundscale_ph(k: __mmask16, a: __m256h) -> __m256h { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_roundscale_ph::(_mm256_setzero_ph(), k, a) @@ -10044,7 +10252,7 @@ pub fn _mm256_maskz_roundscale_ph(k: __mmask16, a: __m256h) -> #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_roundscale_ph(a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_roundscale_ph::(_mm512_undefined_ph(), 0xffffffff, a) @@ -10067,7 +10275,7 @@ pub fn _mm512_roundscale_ph(a: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_roundscale_ph( src: __m512h, k: __mmask32, @@ -10094,7 +10302,7 @@ pub fn _mm512_mask_roundscale_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_roundscale_ph(k: __mmask32, a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_roundscale_ph::(_mm512_setzero_ph(), k, a) @@ -10117,7 +10325,7 @@ pub fn _mm512_maskz_roundscale_ph(k: __mmask32, a: __m512h) -> #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(1, 2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_roundscale_round_ph(a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); static_assert_sae!(SAE); @@ -10142,7 +10350,7 @@ pub fn _mm512_roundscale_round_ph(a: __m512h) - #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(3, 4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_roundscale_round_ph( src: __m512h, k: __mmask32, @@ -10172,7 +10380,7 @@ pub fn _mm512_mask_roundscale_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscaleph, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_roundscale_round_ph( k: __mmask32, a: __m512h, @@ -10199,7 +10407,7 @@ pub fn _mm512_maskz_roundscale_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscalesh, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_roundscale_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_roundscale_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -10222,7 +10430,7 @@ pub fn _mm_roundscale_sh(a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscalesh, IMM8 = 0))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_roundscale_sh( src: __m128h, k: __mmask8, @@ -10250,7 +10458,7 @@ pub fn _mm_mask_roundscale_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscalesh, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_roundscale_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_roundscale_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -10275,7 +10483,7 @@ pub fn _mm_maskz_roundscale_sh(k: __mmask8, a: __m128h, b: __m1 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscalesh, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_roundscale_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); static_assert_sae!(SAE); @@ -10301,7 +10509,7 @@ pub fn _mm_roundscale_round_sh(a: __m128h, b: _ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscalesh, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(4, 5)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_roundscale_round_sh( src: __m128h, k: __mmask8, @@ -10334,7 +10542,7 @@ pub fn _mm_mask_roundscale_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vrndscalesh, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(3, 4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_roundscale_round_sh( k: __mmask8, a: __m128h, @@ -10352,7 +10560,7 @@ pub fn _mm_maskz_roundscale_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_scalef_ph(a: __m128h, b: __m128h) -> __m128h { _mm_mask_scalef_ph(_mm_undefined_ph(), 0xff, a, b) } @@ -10364,7 +10572,7 @@ pub fn _mm_scalef_ph(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_scalef_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { vscalefph_128(a, b, src, k) } } @@ -10376,7 +10584,7 @@ pub fn _mm_mask_scalef_ph(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_scalef_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_scalef_ph(_mm_setzero_ph(), k, a, b) } @@ -10388,7 +10596,7 @@ pub fn _mm_maskz_scalef_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_scalef_ph(a: __m256h, b: __m256h) -> __m256h { _mm256_mask_scalef_ph(_mm256_undefined_ph(), 0xffff, a, b) } @@ -10400,7 +10608,7 @@ pub fn _mm256_scalef_ph(a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_scalef_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { vscalefph_256(a, b, src, k) } } @@ -10412,7 +10620,7 @@ pub fn _mm256_mask_scalef_ph(src: __m256h, k: __mmask16, a: __m256h, b: __m256h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_scalef_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { _mm256_mask_scalef_ph(_mm256_setzero_ph(), k, a, b) } @@ -10424,7 +10632,7 @@ pub fn _mm256_maskz_scalef_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_scalef_ph(a: __m512h, b: __m512h) -> __m512h { _mm512_mask_scalef_ph(_mm512_undefined_ph(), 0xffffffff, a, b) } @@ -10436,7 +10644,7 @@ pub fn _mm512_scalef_ph(a: __m512h, b: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_scalef_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_scalef_round_ph::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -10448,7 +10656,7 @@ pub fn _mm512_mask_scalef_ph(src: __m512h, k: __mmask32, a: __m512h, b: __m512h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_scalef_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { _mm512_mask_scalef_ph(_mm512_setzero_ph(), k, a, b) } @@ -10469,7 +10677,7 @@ pub fn _mm512_maskz_scalef_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_scalef_round_ph(a: __m512h, b: __m512h) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask_scalef_round_ph::(_mm512_undefined_ph(), 0xffffffff, a, b) @@ -10491,7 +10699,7 @@ pub fn _mm512_scalef_round_ph(a: __m512h, b: __m512h) -> __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefph, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_scalef_round_ph( src: __m512h, k: __mmask32, @@ -10520,7 +10728,7 @@ pub fn _mm512_mask_scalef_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_scalef_round_ph( k: __mmask32, a: __m512h, @@ -10538,7 +10746,7 @@ pub fn _mm512_maskz_scalef_round_ph( #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_scalef_sh(a: __m128h, b: __m128h) -> __m128h { _mm_mask_scalef_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -10551,7 +10759,7 @@ pub fn _mm_scalef_sh(a: __m128h, b: __m128h) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_scalef_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_scalef_round_sh::<_MM_FROUND_CUR_DIRECTION>(src, k, a, b) } @@ -10564,7 +10772,7 @@ pub fn _mm_mask_scalef_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefsh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_scalef_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { _mm_mask_scalef_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -10586,7 +10794,7 @@ pub fn _mm_maskz_scalef_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefsh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_scalef_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_scalef_round_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -10609,7 +10817,7 @@ pub fn _mm_scalef_round_sh(a: __m128h, b: __m128h) -> __m12 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefsh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_scalef_round_sh( src: __m128h, k: __mmask8, @@ -10639,7 +10847,7 @@ pub fn _mm_mask_scalef_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vscalefsh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_scalef_round_sh( k: __mmask8, a: __m128h, @@ -10665,7 +10873,7 @@ pub fn _mm_maskz_scalef_round_sh( #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_reduce_ph(a: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_reduce_ph::(_mm_undefined_ph(), 0xff, a) @@ -10688,7 +10896,7 @@ pub fn _mm_reduce_ph(a: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_reduce_ph(src: __m128h, k: __mmask8, a: __m128h) -> __m128h { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -10713,7 +10921,7 @@ pub fn _mm_mask_reduce_ph(src: __m128h, k: __mmask8, a: __m128h #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_reduce_ph(k: __mmask8, a: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_reduce_ph::(_mm_setzero_ph(), k, a) @@ -10735,7 +10943,7 @@ pub fn _mm_maskz_reduce_ph(k: __mmask8, a: __m128h) -> __m128h #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_reduce_ph(a: __m256h) -> __m256h { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_reduce_ph::(_mm256_undefined_ph(), 0xffff, a) @@ -10758,7 +10966,7 @@ pub fn _mm256_reduce_ph(a: __m256h) -> __m256h { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_reduce_ph(src: __m256h, k: __mmask16, a: __m256h) -> __m256h { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -10783,7 +10991,7 @@ pub fn _mm256_mask_reduce_ph(src: __m256h, k: __mmask16, a: __m #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_reduce_ph(k: __mmask16, a: __m256h) -> __m256h { static_assert_uimm_bits!(IMM8, 8); _mm256_mask_reduce_ph::(_mm256_setzero_ph(), k, a) @@ -10805,7 +11013,7 @@ pub fn _mm256_maskz_reduce_ph(k: __mmask16, a: __m256h) -> __m2 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_reduce_ph(a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_reduce_ph::(_mm512_undefined_ph(), 0xffffffff, a) @@ -10828,7 +11036,7 @@ pub fn _mm512_reduce_ph(a: __m512h) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_reduce_ph(src: __m512h, k: __mmask32, a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_reduce_round_ph::(src, k, a) @@ -10851,7 +11059,7 @@ pub fn _mm512_mask_reduce_ph(src: __m512h, k: __mmask32, a: __m #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_reduce_ph(k: __mmask32, a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); _mm512_mask_reduce_ph::(_mm512_setzero_ph(), k, a) @@ -10875,7 +11083,7 @@ pub fn _mm512_maskz_reduce_ph(k: __mmask32, a: __m512h) -> __m5 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(1, 2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_reduce_round_ph(a: __m512h) -> __m512h { static_assert_uimm_bits!(IMM8, 8); static_assert_sae!(SAE); @@ -10901,7 +11109,7 @@ pub fn _mm512_reduce_round_ph(a: __m512h) -> __ #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(3, 4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_reduce_round_ph( src: __m512h, k: __mmask32, @@ -10933,7 +11141,7 @@ pub fn _mm512_mask_reduce_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreduceph, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_reduce_round_ph( k: __mmask32, a: __m512h, @@ -10960,7 +11168,7 @@ pub fn _mm512_maskz_reduce_round_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreducesh, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_reduce_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_reduce_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -10984,7 +11192,7 @@ pub fn _mm_reduce_sh(a: __m128h, b: __m128h) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreducesh, IMM8 = 0))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_reduce_sh( src: __m128h, k: __mmask8, @@ -11013,7 +11221,7 @@ pub fn _mm_mask_reduce_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreducesh, IMM8 = 0))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_reduce_sh(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); _mm_mask_reduce_sh::(f16x8::ZERO.as_m128h(), k, a, b) @@ -11038,7 +11246,7 @@ pub fn _mm_maskz_reduce_sh(k: __mmask8, a: __m128h, b: __m128h) #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreducesh, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(2, 3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_reduce_round_sh(a: __m128h, b: __m128h) -> __m128h { static_assert_uimm_bits!(IMM8, 8); static_assert_sae!(SAE); @@ -11065,7 +11273,7 @@ pub fn _mm_reduce_round_sh(a: __m128h, b: __m12 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreducesh, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(4, 5)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_reduce_round_sh( src: __m128h, k: __mmask8, @@ -11099,7 +11307,7 @@ pub fn _mm_mask_reduce_round_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vreducesh, IMM8 = 0, SAE = 8))] #[rustc_legacy_const_generics(3, 4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_reduce_round_sh( k: __mmask8, a: __m128h, @@ -11117,7 +11325,8 @@ pub fn _mm_maskz_reduce_round_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_reduce_add_ph(a: __m128h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_add_ph(a: __m128h) -> f16 { unsafe { let b = simd_shuffle!(a, a, [4, 5, 6, 7, 0, 1, 2, 3]); let a = _mm_add_ph(a, b); @@ -11134,7 +11343,8 @@ pub fn _mm_reduce_add_ph(a: __m128h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_reduce_add_ph(a: __m256h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_add_ph(a: __m256h) -> f16 { unsafe { let p = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); let q = simd_shuffle!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -11149,7 +11359,8 @@ pub fn _mm256_reduce_add_ph(a: __m256h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_reduce_add_ph(a: __m512h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_add_ph(a: __m512h) -> f16 { unsafe { let p = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); let q = simd_shuffle!( @@ -11170,7 +11381,8 @@ pub fn _mm512_reduce_add_ph(a: __m512h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_reduce_mul_ph(a: __m128h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_reduce_mul_ph(a: __m128h) -> f16 { unsafe { let b = simd_shuffle!(a, a, [4, 5, 6, 7, 0, 1, 2, 3]); let a = _mm_mul_ph(a, b); @@ -11187,7 +11399,8 @@ pub fn _mm_reduce_mul_ph(a: __m128h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_reduce_mul_ph(a: __m256h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_reduce_mul_ph(a: __m256h) -> f16 { unsafe { let p = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); let q = simd_shuffle!(a, a, [8, 9, 10, 11, 12, 13, 14, 15]); @@ -11202,7 +11415,8 @@ pub fn _mm256_reduce_mul_ph(a: __m256h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_reduce_mul_ph(a: __m512h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_reduce_mul_ph(a: __m512h) -> f16 { unsafe { let p = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); let q = simd_shuffle!( @@ -11368,7 +11582,7 @@ macro_rules! fpclass_asm { // FIXME: use LLVM intrinsics #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfpclassph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fpclass_ph_mask(a: __m128h) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11395,7 +11609,7 @@ pub fn _mm_fpclass_ph_mask(a: __m128h) -> __mmask8 { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfpclassph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fpclass_ph_mask(k1: __mmask8, a: __m128h) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11421,7 +11635,7 @@ pub fn _mm_mask_fpclass_ph_mask(k1: __mmask8, a: __m128h) -> __ #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfpclassph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_fpclass_ph_mask(a: __m256h) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11448,7 +11662,7 @@ pub fn _mm256_fpclass_ph_mask(a: __m256h) -> __mmask16 { #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vfpclassph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_fpclass_ph_mask(k1: __mmask16, a: __m256h) -> __mmask16 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11474,7 +11688,7 @@ pub fn _mm256_mask_fpclass_ph_mask(k1: __mmask16, a: __m256h) - #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfpclassph, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_fpclass_ph_mask(a: __m512h) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11501,7 +11715,7 @@ pub fn _mm512_fpclass_ph_mask(a: __m512h) -> __mmask32 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfpclassph, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_fpclass_ph_mask(k1: __mmask32, a: __m512h) -> __mmask32 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11527,7 +11741,7 @@ pub fn _mm512_mask_fpclass_ph_mask(k1: __mmask32, a: __m512h) - #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfpclasssh, IMM8 = 0))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_fpclass_sh_mask(a: __m128h) -> __mmask8 { _mm_mask_fpclass_sh_mask::(0xff, a) } @@ -11551,7 +11765,7 @@ pub fn _mm_fpclass_sh_mask(a: __m128h) -> __mmask8 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vfpclasssh, IMM8 = 0))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_fpclass_sh_mask(k1: __mmask8, a: __m128h) -> __mmask8 { unsafe { static_assert_uimm_bits!(IMM8, 8); @@ -11565,8 +11779,9 @@ pub fn _mm_mask_fpclass_sh_mask(k1: __mmask8, a: __m128h) -> __ /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_blend_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_mask_blend_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_blend_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { unsafe { simd_select_bitmask(k, b, a) } } @@ -11576,8 +11791,9 @@ pub fn _mm_mask_blend_ph(k: __mmask8, a: __m128h, b: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_blend_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_mask_blend_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_blend_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { unsafe { simd_select_bitmask(k, b, a) } } @@ -11587,8 +11803,9 @@ pub fn _mm256_mask_blend_ph(k: __mmask16, a: __m256h, b: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_mask_blend_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_mask_blend_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_blend_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { unsafe { simd_select_bitmask(k, b, a) } } @@ -11598,7 +11815,7 @@ pub fn _mm512_mask_blend_ph(k: __mmask32, a: __m512h, b: __m512h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutex2var_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_permutex2var_ph(a: __m128h, idx: __m128i, b: __m128h) -> __m128h { _mm_castsi128_ph(_mm_permutex2var_epi16( _mm_castph_si128(a), @@ -11613,7 +11830,7 @@ pub fn _mm_permutex2var_ph(a: __m128h, idx: __m128i, b: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutex2var_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_permutex2var_ph(a: __m256h, idx: __m256i, b: __m256h) -> __m256h { _mm256_castsi256_ph(_mm256_permutex2var_epi16( _mm256_castph_si256(a), @@ -11628,7 +11845,7 @@ pub fn _mm256_permutex2var_ph(a: __m256h, idx: __m256i, b: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutex2var_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_permutex2var_ph(a: __m512h, idx: __m512i, b: __m512h) -> __m512h { _mm512_castsi512_ph(_mm512_permutex2var_epi16( _mm512_castph_si512(a), @@ -11643,7 +11860,7 @@ pub fn _mm512_permutex2var_ph(a: __m512h, idx: __m512i, b: __m512h) -> __m512h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_permutexvar_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_permutexvar_ph(idx: __m128i, a: __m128h) -> __m128h { _mm_castsi128_ph(_mm_permutexvar_epi16(idx, _mm_castph_si128(a))) } @@ -11654,7 +11871,7 @@ pub fn _mm_permutexvar_ph(idx: __m128i, a: __m128h) -> __m128h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_permutexvar_ph) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_permutexvar_ph(idx: __m256i, a: __m256h) -> __m256h { _mm256_castsi256_ph(_mm256_permutexvar_epi16(idx, _mm256_castph_si256(a))) } @@ -11665,7 +11882,7 @@ pub fn _mm256_permutexvar_ph(idx: __m256i, a: __m256h) -> __m256h { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_permutexvar_ph) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_permutexvar_ph(idx: __m512i, a: __m512h) -> __m512h { _mm512_castsi512_ph(_mm512_permutexvar_epi16(idx, _mm512_castph_si512(a))) } @@ -11677,7 +11894,7 @@ pub fn _mm512_permutexvar_ph(idx: __m512i, a: __m512h) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtepi16_ph(a: __m128i) -> __m128h { unsafe { vcvtw2ph_128(a.as_i16x8(), _MM_FROUND_CUR_DIRECTION) } } @@ -11690,7 +11907,7 @@ pub fn _mm_cvtepi16_ph(a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtepi16_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { unsafe { simd_select_bitmask(k, _mm_cvtepi16_ph(a), src) } } @@ -11702,7 +11919,7 @@ pub fn _mm_mask_cvtepi16_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtepi16_ph(k: __mmask8, a: __m128i) -> __m128h { _mm_mask_cvtepi16_ph(_mm_setzero_ph(), k, a) } @@ -11714,7 +11931,7 @@ pub fn _mm_maskz_cvtepi16_ph(k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtepi16_ph(a: __m256i) -> __m256h { unsafe { vcvtw2ph_256(a.as_i16x16(), _MM_FROUND_CUR_DIRECTION) } } @@ -11727,7 +11944,7 @@ pub fn _mm256_cvtepi16_ph(a: __m256i) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtepi16_ph(src: __m256h, k: __mmask16, a: __m256i) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_cvtepi16_ph(a), src) } } @@ -11739,7 +11956,7 @@ pub fn _mm256_mask_cvtepi16_ph(src: __m256h, k: __mmask16, a: __m256i) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtepi16_ph(k: __mmask16, a: __m256i) -> __m256h { _mm256_mask_cvtepi16_ph(_mm256_setzero_ph(), k, a) } @@ -11751,7 +11968,7 @@ pub fn _mm256_maskz_cvtepi16_ph(k: __mmask16, a: __m256i) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtepi16_ph(a: __m512i) -> __m512h { unsafe { vcvtw2ph_512(a.as_i16x32(), _MM_FROUND_CUR_DIRECTION) } } @@ -11764,7 +11981,7 @@ pub fn _mm512_cvtepi16_ph(a: __m512i) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtepi16_ph(src: __m512h, k: __mmask32, a: __m512i) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_cvtepi16_ph(a), src) } } @@ -11776,7 +11993,7 @@ pub fn _mm512_mask_cvtepi16_ph(src: __m512h, k: __mmask32, a: __m512i) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtepi16_ph(k: __mmask32, a: __m512i) -> __m512h { _mm512_mask_cvtepi16_ph(_mm512_setzero_ph(), k, a) } @@ -11797,7 +12014,7 @@ pub fn _mm512_maskz_cvtepi16_ph(k: __mmask32, a: __m512i) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtw2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundepi16_ph(a: __m512i) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -11822,7 +12039,7 @@ pub fn _mm512_cvt_roundepi16_ph(a: __m512i) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtw2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundepi16_ph( src: __m512h, k: __mmask32, @@ -11850,7 +12067,7 @@ pub fn _mm512_mask_cvt_roundepi16_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtw2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundepi16_ph(k: __mmask32, a: __m512i) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundepi16_ph::(_mm512_setzero_ph(), k, a) @@ -11863,7 +12080,7 @@ pub fn _mm512_maskz_cvt_roundepi16_ph(k: __mmask32, a: __m5 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtepu16_ph(a: __m128i) -> __m128h { unsafe { vcvtuw2ph_128(a.as_u16x8(), _MM_FROUND_CUR_DIRECTION) } } @@ -11876,7 +12093,7 @@ pub fn _mm_cvtepu16_ph(a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtepu16_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { unsafe { simd_select_bitmask(k, _mm_cvtepu16_ph(a), src) } } @@ -11888,7 +12105,7 @@ pub fn _mm_mask_cvtepu16_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtepu16_ph(k: __mmask8, a: __m128i) -> __m128h { _mm_mask_cvtepu16_ph(_mm_setzero_ph(), k, a) } @@ -11900,7 +12117,7 @@ pub fn _mm_maskz_cvtepu16_ph(k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtepu16_ph(a: __m256i) -> __m256h { unsafe { vcvtuw2ph_256(a.as_u16x16(), _MM_FROUND_CUR_DIRECTION) } } @@ -11913,7 +12130,7 @@ pub fn _mm256_cvtepu16_ph(a: __m256i) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtepu16_ph(src: __m256h, k: __mmask16, a: __m256i) -> __m256h { unsafe { simd_select_bitmask(k, _mm256_cvtepu16_ph(a), src) } } @@ -11925,7 +12142,7 @@ pub fn _mm256_mask_cvtepu16_ph(src: __m256h, k: __mmask16, a: __m256i) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtepu16_ph(k: __mmask16, a: __m256i) -> __m256h { _mm256_mask_cvtepu16_ph(_mm256_setzero_ph(), k, a) } @@ -11937,7 +12154,7 @@ pub fn _mm256_maskz_cvtepu16_ph(k: __mmask16, a: __m256i) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtepu16_ph(a: __m512i) -> __m512h { unsafe { vcvtuw2ph_512(a.as_u16x32(), _MM_FROUND_CUR_DIRECTION) } } @@ -11950,7 +12167,7 @@ pub fn _mm512_cvtepu16_ph(a: __m512i) -> __m512h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtepu16_ph(src: __m512h, k: __mmask32, a: __m512i) -> __m512h { unsafe { simd_select_bitmask(k, _mm512_cvtepu16_ph(a), src) } } @@ -11962,7 +12179,7 @@ pub fn _mm512_mask_cvtepu16_ph(src: __m512h, k: __mmask32, a: __m512i) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuw2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtepu16_ph(k: __mmask32, a: __m512i) -> __m512h { _mm512_mask_cvtepu16_ph(_mm512_setzero_ph(), k, a) } @@ -11983,7 +12200,7 @@ pub fn _mm512_maskz_cvtepu16_ph(k: __mmask32, a: __m512i) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuw2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundepu16_ph(a: __m512i) -> __m512h { unsafe { static_assert_rounding!(ROUNDING); @@ -12008,7 +12225,7 @@ pub fn _mm512_cvt_roundepu16_ph(a: __m512i) -> __m512h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuw2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundepu16_ph( src: __m512h, k: __mmask32, @@ -12036,7 +12253,7 @@ pub fn _mm512_mask_cvt_roundepu16_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuw2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundepu16_ph(k: __mmask32, a: __m512i) -> __m512h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundepu16_ph::(_mm512_setzero_ph(), k, a) @@ -12049,7 +12266,7 @@ pub fn _mm512_maskz_cvt_roundepu16_ph(k: __mmask32, a: __m5 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtepi32_ph(a: __m128i) -> __m128h { _mm_mask_cvtepi32_ph(_mm_setzero_ph(), 0xff, a) } @@ -12062,7 +12279,7 @@ pub fn _mm_cvtepi32_ph(a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtepi32_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { unsafe { vcvtdq2ph_128(a.as_i32x4(), src, k) } } @@ -12075,7 +12292,7 @@ pub fn _mm_mask_cvtepi32_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtepi32_ph(k: __mmask8, a: __m128i) -> __m128h { _mm_mask_cvtepi32_ph(_mm_setzero_ph(), k, a) } @@ -12087,7 +12304,7 @@ pub fn _mm_maskz_cvtepi32_ph(k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtepi32_ph(a: __m256i) -> __m128h { unsafe { vcvtdq2ph_256(a.as_i32x8(), _MM_FROUND_CUR_DIRECTION) } } @@ -12100,7 +12317,7 @@ pub fn _mm256_cvtepi32_ph(a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtepi32_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h { unsafe { simd_select_bitmask(k, _mm256_cvtepi32_ph(a), src) } } @@ -12112,7 +12329,7 @@ pub fn _mm256_mask_cvtepi32_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtepi32_ph(k: __mmask8, a: __m256i) -> __m128h { _mm256_mask_cvtepi32_ph(_mm_setzero_ph(), k, a) } @@ -12124,7 +12341,7 @@ pub fn _mm256_maskz_cvtepi32_ph(k: __mmask8, a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtepi32_ph(a: __m512i) -> __m256h { unsafe { vcvtdq2ph_512(a.as_i32x16(), _MM_FROUND_CUR_DIRECTION) } } @@ -12137,7 +12354,7 @@ pub fn _mm512_cvtepi32_ph(a: __m512i) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtepi32_ph(src: __m256h, k: __mmask16, a: __m512i) -> __m256h { unsafe { simd_select_bitmask(k, _mm512_cvtepi32_ph(a), src) } } @@ -12149,7 +12366,7 @@ pub fn _mm512_mask_cvtepi32_ph(src: __m256h, k: __mmask16, a: __m512i) -> __m256 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtdq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtepi32_ph(k: __mmask16, a: __m512i) -> __m256h { _mm512_mask_cvtepi32_ph(f16x16::ZERO.as_m256h(), k, a) } @@ -12170,7 +12387,7 @@ pub fn _mm512_maskz_cvtepi32_ph(k: __mmask16, a: __m512i) -> __m256h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtdq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundepi32_ph(a: __m512i) -> __m256h { unsafe { static_assert_rounding!(ROUNDING); @@ -12195,7 +12412,7 @@ pub fn _mm512_cvt_roundepi32_ph(a: __m512i) -> __m256h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtdq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundepi32_ph( src: __m256h, k: __mmask16, @@ -12223,7 +12440,7 @@ pub fn _mm512_mask_cvt_roundepi32_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtdq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundepi32_ph(k: __mmask16, a: __m512i) -> __m256h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundepi32_ph::(f16x16::ZERO.as_m256h(), k, a) @@ -12237,7 +12454,7 @@ pub fn _mm512_maskz_cvt_roundepi32_ph(k: __mmask16, a: __m5 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsi2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvti32_sh(a: __m128h, b: i32) -> __m128h { unsafe { vcvtsi2sh(a, b, _MM_FROUND_CUR_DIRECTION) } } @@ -12259,7 +12476,7 @@ pub fn _mm_cvti32_sh(a: __m128h, b: i32) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsi2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundi32_sh(a: __m128h, b: i32) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -12274,7 +12491,7 @@ pub fn _mm_cvt_roundi32_sh(a: __m128h, b: i32) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtepu32_ph(a: __m128i) -> __m128h { _mm_mask_cvtepu32_ph(_mm_setzero_ph(), 0xff, a) } @@ -12287,7 +12504,7 @@ pub fn _mm_cvtepu32_ph(a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtepu32_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { unsafe { vcvtudq2ph_128(a.as_u32x4(), src, k) } } @@ -12300,7 +12517,7 @@ pub fn _mm_mask_cvtepu32_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtepu32_ph(k: __mmask8, a: __m128i) -> __m128h { _mm_mask_cvtepu32_ph(_mm_setzero_ph(), k, a) } @@ -12312,7 +12529,7 @@ pub fn _mm_maskz_cvtepu32_ph(k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtepu32_ph(a: __m256i) -> __m128h { unsafe { vcvtudq2ph_256(a.as_u32x8(), _MM_FROUND_CUR_DIRECTION) } } @@ -12325,7 +12542,7 @@ pub fn _mm256_cvtepu32_ph(a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtepu32_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h { unsafe { simd_select_bitmask(k, _mm256_cvtepu32_ph(a), src) } } @@ -12337,7 +12554,7 @@ pub fn _mm256_mask_cvtepu32_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtepu32_ph(k: __mmask8, a: __m256i) -> __m128h { _mm256_mask_cvtepu32_ph(_mm_setzero_ph(), k, a) } @@ -12349,7 +12566,7 @@ pub fn _mm256_maskz_cvtepu32_ph(k: __mmask8, a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtepu32_ph(a: __m512i) -> __m256h { unsafe { vcvtudq2ph_512(a.as_u32x16(), _MM_FROUND_CUR_DIRECTION) } } @@ -12362,7 +12579,7 @@ pub fn _mm512_cvtepu32_ph(a: __m512i) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtepu32_ph(src: __m256h, k: __mmask16, a: __m512i) -> __m256h { unsafe { simd_select_bitmask(k, _mm512_cvtepu32_ph(a), src) } } @@ -12374,7 +12591,7 @@ pub fn _mm512_mask_cvtepu32_ph(src: __m256h, k: __mmask16, a: __m512i) -> __m256 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtudq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtepu32_ph(k: __mmask16, a: __m512i) -> __m256h { _mm512_mask_cvtepu32_ph(f16x16::ZERO.as_m256h(), k, a) } @@ -12395,7 +12612,7 @@ pub fn _mm512_maskz_cvtepu32_ph(k: __mmask16, a: __m512i) -> __m256h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtudq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundepu32_ph(a: __m512i) -> __m256h { unsafe { static_assert_rounding!(ROUNDING); @@ -12420,7 +12637,7 @@ pub fn _mm512_cvt_roundepu32_ph(a: __m512i) -> __m256h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtudq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundepu32_ph( src: __m256h, k: __mmask16, @@ -12448,7 +12665,7 @@ pub fn _mm512_mask_cvt_roundepu32_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtudq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundepu32_ph(k: __mmask16, a: __m512i) -> __m256h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundepu32_ph::(f16x16::ZERO.as_m256h(), k, a) @@ -12462,7 +12679,7 @@ pub fn _mm512_maskz_cvt_roundepu32_ph(k: __mmask16, a: __m5 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtusi2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtu32_sh(a: __m128h, b: u32) -> __m128h { unsafe { vcvtusi2sh(a, b, _MM_FROUND_CUR_DIRECTION) } } @@ -12484,7 +12701,7 @@ pub fn _mm_cvtu32_sh(a: __m128h, b: u32) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtusi2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundu32_sh(a: __m128h, b: u32) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -12499,7 +12716,7 @@ pub fn _mm_cvt_roundu32_sh(a: __m128h, b: u32) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtepi64_ph(a: __m128i) -> __m128h { _mm_mask_cvtepi64_ph(_mm_setzero_ph(), 0xff, a) } @@ -12512,7 +12729,7 @@ pub fn _mm_cvtepi64_ph(a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtepi64_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { unsafe { vcvtqq2ph_128(a.as_i64x2(), src, k) } } @@ -12525,7 +12742,7 @@ pub fn _mm_mask_cvtepi64_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtepi64_ph(k: __mmask8, a: __m128i) -> __m128h { _mm_mask_cvtepi64_ph(_mm_setzero_ph(), k, a) } @@ -12537,7 +12754,7 @@ pub fn _mm_maskz_cvtepi64_ph(k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtepi64_ph(a: __m256i) -> __m128h { _mm256_mask_cvtepi64_ph(_mm_setzero_ph(), 0xff, a) } @@ -12550,7 +12767,7 @@ pub fn _mm256_cvtepi64_ph(a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtepi64_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h { unsafe { vcvtqq2ph_256(a.as_i64x4(), src, k) } } @@ -12563,7 +12780,7 @@ pub fn _mm256_mask_cvtepi64_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtepi64_ph(k: __mmask8, a: __m256i) -> __m128h { _mm256_mask_cvtepi64_ph(_mm_setzero_ph(), k, a) } @@ -12575,7 +12792,7 @@ pub fn _mm256_maskz_cvtepi64_ph(k: __mmask8, a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtepi64_ph(a: __m512i) -> __m128h { unsafe { vcvtqq2ph_512(a.as_i64x8(), _MM_FROUND_CUR_DIRECTION) } } @@ -12588,7 +12805,7 @@ pub fn _mm512_cvtepi64_ph(a: __m512i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtepi64_ph(src: __m128h, k: __mmask8, a: __m512i) -> __m128h { unsafe { simd_select_bitmask(k, _mm512_cvtepi64_ph(a), src) } } @@ -12600,7 +12817,7 @@ pub fn _mm512_mask_cvtepi64_ph(src: __m128h, k: __mmask8, a: __m512i) -> __m128h #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtepi64_ph(k: __mmask8, a: __m512i) -> __m128h { _mm512_mask_cvtepi64_ph(f16x8::ZERO.as_m128h(), k, a) } @@ -12621,7 +12838,7 @@ pub fn _mm512_maskz_cvtepi64_ph(k: __mmask8, a: __m512i) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtqq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundepi64_ph(a: __m512i) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -12646,7 +12863,7 @@ pub fn _mm512_cvt_roundepi64_ph(a: __m512i) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtqq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundepi64_ph( src: __m128h, k: __mmask8, @@ -12674,7 +12891,7 @@ pub fn _mm512_mask_cvt_roundepi64_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtqq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundepi64_ph(k: __mmask8, a: __m512i) -> __m128h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundepi64_ph::(f16x8::ZERO.as_m128h(), k, a) @@ -12687,7 +12904,7 @@ pub fn _mm512_maskz_cvt_roundepi64_ph(k: __mmask8, a: __m51 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtepu64_ph(a: __m128i) -> __m128h { _mm_mask_cvtepu64_ph(_mm_setzero_ph(), 0xff, a) } @@ -12700,7 +12917,7 @@ pub fn _mm_cvtepu64_ph(a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtepu64_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { unsafe { vcvtuqq2ph_128(a.as_u64x2(), src, k) } } @@ -12713,7 +12930,7 @@ pub fn _mm_mask_cvtepu64_ph(src: __m128h, k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtepu64_ph(k: __mmask8, a: __m128i) -> __m128h { _mm_mask_cvtepu64_ph(_mm_setzero_ph(), k, a) } @@ -12725,7 +12942,7 @@ pub fn _mm_maskz_cvtepu64_ph(k: __mmask8, a: __m128i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtepu64_ph(a: __m256i) -> __m128h { _mm256_mask_cvtepu64_ph(_mm_setzero_ph(), 0xff, a) } @@ -12738,7 +12955,7 @@ pub fn _mm256_cvtepu64_ph(a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtepu64_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h { unsafe { vcvtuqq2ph_256(a.as_u64x4(), src, k) } } @@ -12751,7 +12968,7 @@ pub fn _mm256_mask_cvtepu64_ph(src: __m128h, k: __mmask8, a: __m256i) -> __m128h #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtepu64_ph(k: __mmask8, a: __m256i) -> __m128h { _mm256_mask_cvtepu64_ph(_mm_setzero_ph(), k, a) } @@ -12763,7 +12980,7 @@ pub fn _mm256_maskz_cvtepu64_ph(k: __mmask8, a: __m256i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtepu64_ph(a: __m512i) -> __m128h { unsafe { vcvtuqq2ph_512(a.as_u64x8(), _MM_FROUND_CUR_DIRECTION) } } @@ -12776,7 +12993,7 @@ pub fn _mm512_cvtepu64_ph(a: __m512i) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtepu64_ph(src: __m128h, k: __mmask8, a: __m512i) -> __m128h { unsafe { simd_select_bitmask(k, _mm512_cvtepu64_ph(a), src) } } @@ -12788,7 +13005,7 @@ pub fn _mm512_mask_cvtepu64_ph(src: __m128h, k: __mmask8, a: __m512i) -> __m128h #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuqq2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtepu64_ph(k: __mmask8, a: __m512i) -> __m128h { _mm512_mask_cvtepu64_ph(f16x8::ZERO.as_m128h(), k, a) } @@ -12809,7 +13026,7 @@ pub fn _mm512_maskz_cvtepu64_ph(k: __mmask8, a: __m512i) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuqq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundepu64_ph(a: __m512i) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -12834,7 +13051,7 @@ pub fn _mm512_cvt_roundepu64_ph(a: __m512i) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuqq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundepu64_ph( src: __m128h, k: __mmask8, @@ -12862,7 +13079,7 @@ pub fn _mm512_mask_cvt_roundepu64_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtuqq2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundepu64_ph(k: __mmask8, a: __m512i) -> __m128h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundepu64_ph::(f16x8::ZERO.as_m128h(), k, a) @@ -12875,7 +13092,7 @@ pub fn _mm512_maskz_cvt_roundepu64_ph(k: __mmask8, a: __m51 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtxps_ph(a: __m128) -> __m128h { _mm_mask_cvtxps_ph(_mm_setzero_ph(), 0xff, a) } @@ -12888,7 +13105,7 @@ pub fn _mm_cvtxps_ph(a: __m128) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtxps_ph(src: __m128h, k: __mmask8, a: __m128) -> __m128h { unsafe { vcvtps2phx_128(a, src, k) } } @@ -12901,7 +13118,7 @@ pub fn _mm_mask_cvtxps_ph(src: __m128h, k: __mmask8, a: __m128) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtxps_ph(k: __mmask8, a: __m128) -> __m128h { _mm_mask_cvtxps_ph(_mm_setzero_ph(), k, a) } @@ -12913,7 +13130,7 @@ pub fn _mm_maskz_cvtxps_ph(k: __mmask8, a: __m128) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtxps_ph(a: __m256) -> __m128h { _mm256_mask_cvtxps_ph(_mm_setzero_ph(), 0xff, a) } @@ -12926,7 +13143,7 @@ pub fn _mm256_cvtxps_ph(a: __m256) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtxps_ph(src: __m128h, k: __mmask8, a: __m256) -> __m128h { unsafe { vcvtps2phx_256(a, src, k) } } @@ -12939,7 +13156,7 @@ pub fn _mm256_mask_cvtxps_ph(src: __m128h, k: __mmask8, a: __m256) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtxps_ph(k: __mmask8, a: __m256) -> __m128h { _mm256_mask_cvtxps_ph(_mm_setzero_ph(), k, a) } @@ -12951,7 +13168,7 @@ pub fn _mm256_maskz_cvtxps_ph(k: __mmask8, a: __m256) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtxps_ph(a: __m512) -> __m256h { _mm512_mask_cvtxps_ph(f16x16::ZERO.as_m256h(), 0xffff, a) } @@ -12964,7 +13181,7 @@ pub fn _mm512_cvtxps_ph(a: __m512) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtxps_ph(src: __m256h, k: __mmask16, a: __m512) -> __m256h { unsafe { vcvtps2phx_512(a, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -12977,7 +13194,7 @@ pub fn _mm512_mask_cvtxps_ph(src: __m256h, k: __mmask16, a: __m512) -> __m256h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtps2phx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtxps_ph(k: __mmask16, a: __m512) -> __m256h { _mm512_mask_cvtxps_ph(f16x16::ZERO.as_m256h(), k, a) } @@ -12998,7 +13215,7 @@ pub fn _mm512_maskz_cvtxps_ph(k: __mmask16, a: __m512) -> __m256h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtps2phx, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtx_roundps_ph(a: __m512) -> __m256h { static_assert_rounding!(ROUNDING); _mm512_mask_cvtx_roundps_ph::(f16x16::ZERO.as_m256h(), 0xffff, a) @@ -13021,7 +13238,7 @@ pub fn _mm512_cvtx_roundps_ph(a: __m512) -> __m256h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtps2phx, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtx_roundps_ph( src: __m256h, k: __mmask16, @@ -13050,7 +13267,7 @@ pub fn _mm512_mask_cvtx_roundps_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtps2phx, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtx_roundps_ph(k: __mmask16, a: __m512) -> __m256h { static_assert_rounding!(ROUNDING); _mm512_mask_cvtx_roundps_ph::(f16x16::ZERO.as_m256h(), k, a) @@ -13064,7 +13281,7 @@ pub fn _mm512_maskz_cvtx_roundps_ph(k: __mmask16, a: __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtss2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtss_sh(a: __m128h, b: __m128) -> __m128h { _mm_mask_cvtss_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -13078,7 +13295,7 @@ pub fn _mm_cvtss_sh(a: __m128h, b: __m128) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtss2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtss_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128) -> __m128h { unsafe { vcvtss2sh(a, b, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -13092,7 +13309,7 @@ pub fn _mm_mask_cvtss_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128) -> __ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtss2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtss_sh(k: __mmask8, a: __m128h, b: __m128) -> __m128h { _mm_mask_cvtss_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -13114,7 +13331,7 @@ pub fn _mm_maskz_cvtss_sh(k: __mmask8, a: __m128h, b: __m128) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtss2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundss_sh(a: __m128h, b: __m128) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_cvt_roundss_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -13138,7 +13355,7 @@ pub fn _mm_cvt_roundss_sh(a: __m128h, b: __m128) -> __m128h #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtss2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvt_roundss_sh( src: __m128h, k: __mmask8, @@ -13169,7 +13386,7 @@ pub fn _mm_mask_cvt_roundss_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtss2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvt_roundss_sh( k: __mmask8, a: __m128h, @@ -13186,7 +13403,7 @@ pub fn _mm_maskz_cvt_roundss_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtpd_ph(a: __m128d) -> __m128h { _mm_mask_cvtpd_ph(_mm_setzero_ph(), 0xff, a) } @@ -13199,7 +13416,7 @@ pub fn _mm_cvtpd_ph(a: __m128d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtpd_ph(src: __m128h, k: __mmask8, a: __m128d) -> __m128h { unsafe { vcvtpd2ph_128(a, src, k) } } @@ -13212,7 +13429,7 @@ pub fn _mm_mask_cvtpd_ph(src: __m128h, k: __mmask8, a: __m128d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtpd_ph(k: __mmask8, a: __m128d) -> __m128h { _mm_mask_cvtpd_ph(_mm_setzero_ph(), k, a) } @@ -13224,7 +13441,7 @@ pub fn _mm_maskz_cvtpd_ph(k: __mmask8, a: __m128d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtpd_ph(a: __m256d) -> __m128h { _mm256_mask_cvtpd_ph(_mm_setzero_ph(), 0xff, a) } @@ -13237,7 +13454,7 @@ pub fn _mm256_cvtpd_ph(a: __m256d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtpd_ph(src: __m128h, k: __mmask8, a: __m256d) -> __m128h { unsafe { vcvtpd2ph_256(a, src, k) } } @@ -13250,7 +13467,7 @@ pub fn _mm256_mask_cvtpd_ph(src: __m128h, k: __mmask8, a: __m256d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtpd_ph(k: __mmask8, a: __m256d) -> __m128h { _mm256_mask_cvtpd_ph(_mm_setzero_ph(), k, a) } @@ -13262,7 +13479,7 @@ pub fn _mm256_maskz_cvtpd_ph(k: __mmask8, a: __m256d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtpd_ph(a: __m512d) -> __m128h { _mm512_mask_cvtpd_ph(f16x8::ZERO.as_m128h(), 0xff, a) } @@ -13275,7 +13492,7 @@ pub fn _mm512_cvtpd_ph(a: __m512d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtpd_ph(src: __m128h, k: __mmask8, a: __m512d) -> __m128h { unsafe { vcvtpd2ph_512(a, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -13288,7 +13505,7 @@ pub fn _mm512_mask_cvtpd_ph(src: __m128h, k: __mmask8, a: __m512d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtpd2ph))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtpd_ph(k: __mmask8, a: __m512d) -> __m128h { _mm512_mask_cvtpd_ph(f16x8::ZERO.as_m128h(), k, a) } @@ -13309,7 +13526,7 @@ pub fn _mm512_maskz_cvtpd_ph(k: __mmask8, a: __m512d) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtpd2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundpd_ph(a: __m512d) -> __m128h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundpd_ph::(f16x8::ZERO.as_m128h(), 0xff, a) @@ -13332,7 +13549,7 @@ pub fn _mm512_cvt_roundpd_ph(a: __m512d) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtpd2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundpd_ph( src: __m128h, k: __mmask8, @@ -13361,7 +13578,7 @@ pub fn _mm512_mask_cvt_roundpd_ph( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtpd2ph, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundpd_ph(k: __mmask8, a: __m512d) -> __m128h { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundpd_ph::(f16x8::ZERO.as_m128h(), k, a) @@ -13375,7 +13592,7 @@ pub fn _mm512_maskz_cvt_roundpd_ph(k: __mmask8, a: __m512d) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsd2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsd_sh(a: __m128h, b: __m128d) -> __m128h { _mm_mask_cvtsd_sh(f16x8::ZERO.as_m128h(), 0xff, a, b) } @@ -13389,7 +13606,7 @@ pub fn _mm_cvtsd_sh(a: __m128h, b: __m128d) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsd2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtsd_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128d) -> __m128h { unsafe { vcvtsd2sh(a, b, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -13403,7 +13620,7 @@ pub fn _mm_mask_cvtsd_sh(src: __m128h, k: __mmask8, a: __m128h, b: __m128d) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsd2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtsd_sh(k: __mmask8, a: __m128h, b: __m128d) -> __m128h { _mm_mask_cvtsd_sh(f16x8::ZERO.as_m128h(), k, a, b) } @@ -13425,7 +13642,7 @@ pub fn _mm_maskz_cvtsd_sh(k: __mmask8, a: __m128h, b: __m128d) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsd2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsd_sh(a: __m128h, b: __m128d) -> __m128h { static_assert_rounding!(ROUNDING); _mm_mask_cvt_roundsd_sh::(f16x8::ZERO.as_m128h(), 0xff, a, b) @@ -13449,7 +13666,7 @@ pub fn _mm_cvt_roundsd_sh(a: __m128h, b: __m128d) -> __m128 #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsd2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvt_roundsd_sh( src: __m128h, k: __mmask8, @@ -13480,7 +13697,7 @@ pub fn _mm_mask_cvt_roundsd_sh( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsd2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvt_roundsd_sh( k: __mmask8, a: __m128h, @@ -13497,7 +13714,7 @@ pub fn _mm_maskz_cvt_roundsd_sh( #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_epi16(a: __m128h) -> __m128i { _mm_mask_cvtph_epi16(_mm_undefined_si128(), 0xff, a) } @@ -13510,7 +13727,7 @@ pub fn _mm_cvtph_epi16(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_epi16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvtph2w_128(a, src.as_i16x8(), k)) } } @@ -13522,7 +13739,7 @@ pub fn _mm_mask_cvtph_epi16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_epi16(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvtph_epi16(_mm_setzero_si128(), k, a) } @@ -13534,7 +13751,7 @@ pub fn _mm_maskz_cvtph_epi16(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_epi16(a: __m256h) -> __m256i { _mm256_mask_cvtph_epi16(_mm256_undefined_si256(), 0xffff, a) } @@ -13547,7 +13764,7 @@ pub fn _mm256_cvtph_epi16(a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_epi16(src: __m256i, k: __mmask16, a: __m256h) -> __m256i { unsafe { transmute(vcvtph2w_256(a, src.as_i16x16(), k)) } } @@ -13559,7 +13776,7 @@ pub fn _mm256_mask_cvtph_epi16(src: __m256i, k: __mmask16, a: __m256h) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_epi16(k: __mmask16, a: __m256h) -> __m256i { _mm256_mask_cvtph_epi16(_mm256_setzero_si256(), k, a) } @@ -13571,7 +13788,7 @@ pub fn _mm256_maskz_cvtph_epi16(k: __mmask16, a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_epi16(a: __m512h) -> __m512i { _mm512_mask_cvtph_epi16(_mm512_undefined_epi32(), 0xffffffff, a) } @@ -13584,7 +13801,7 @@ pub fn _mm512_cvtph_epi16(a: __m512h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_epi16(src: __m512i, k: __mmask32, a: __m512h) -> __m512i { unsafe { transmute(vcvtph2w_512( @@ -13603,7 +13820,7 @@ pub fn _mm512_mask_cvtph_epi16(src: __m512i, k: __mmask32, a: __m512h) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_epi16(k: __mmask32, a: __m512h) -> __m512i { _mm512_mask_cvtph_epi16(_mm512_setzero_si512(), k, a) } @@ -13624,7 +13841,7 @@ pub fn _mm512_maskz_cvtph_epi16(k: __mmask32, a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2w, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_epi16(a: __m512h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epi16::(_mm512_undefined_epi32(), 0xffffffff, a) @@ -13647,7 +13864,7 @@ pub fn _mm512_cvt_roundph_epi16(a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2w, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_epi16( src: __m512i, k: __mmask32, @@ -13675,7 +13892,7 @@ pub fn _mm512_mask_cvt_roundph_epi16( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2w, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_epi16(k: __mmask32, a: __m512h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epi16::(_mm512_setzero_si512(), k, a) @@ -13688,7 +13905,7 @@ pub fn _mm512_maskz_cvt_roundph_epi16(k: __mmask32, a: __m5 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_epu16(a: __m128h) -> __m128i { _mm_mask_cvtph_epu16(_mm_undefined_si128(), 0xff, a) } @@ -13701,7 +13918,7 @@ pub fn _mm_cvtph_epu16(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_epu16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvtph2uw_128(a, src.as_u16x8(), k)) } } @@ -13713,7 +13930,7 @@ pub fn _mm_mask_cvtph_epu16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_epu16(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvtph_epu16(_mm_setzero_si128(), k, a) } @@ -13725,7 +13942,7 @@ pub fn _mm_maskz_cvtph_epu16(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_epu16(a: __m256h) -> __m256i { _mm256_mask_cvtph_epu16(_mm256_undefined_si256(), 0xffff, a) } @@ -13738,7 +13955,7 @@ pub fn _mm256_cvtph_epu16(a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_epu16(src: __m256i, k: __mmask16, a: __m256h) -> __m256i { unsafe { transmute(vcvtph2uw_256(a, src.as_u16x16(), k)) } } @@ -13750,7 +13967,7 @@ pub fn _mm256_mask_cvtph_epu16(src: __m256i, k: __mmask16, a: __m256h) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_epu16(k: __mmask16, a: __m256h) -> __m256i { _mm256_mask_cvtph_epu16(_mm256_setzero_si256(), k, a) } @@ -13762,7 +13979,7 @@ pub fn _mm256_maskz_cvtph_epu16(k: __mmask16, a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_epu16(a: __m512h) -> __m512i { _mm512_mask_cvtph_epu16(_mm512_undefined_epi32(), 0xffffffff, a) } @@ -13775,7 +13992,7 @@ pub fn _mm512_cvtph_epu16(a: __m512h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_epu16(src: __m512i, k: __mmask32, a: __m512h) -> __m512i { unsafe { transmute(vcvtph2uw_512( @@ -13794,7 +14011,7 @@ pub fn _mm512_mask_cvtph_epu16(src: __m512i, k: __mmask32, a: __m512h) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_epu16(k: __mmask32, a: __m512h) -> __m512i { _mm512_mask_cvtph_epu16(_mm512_setzero_si512(), k, a) } @@ -13809,7 +14026,7 @@ pub fn _mm512_maskz_cvtph_epu16(k: __mmask32, a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uw, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_epu16(a: __m512h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvt_roundph_epu16::(_mm512_undefined_epi32(), 0xffffffff, a) @@ -13826,7 +14043,7 @@ pub fn _mm512_cvt_roundph_epu16(a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uw, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_epu16( src: __m512i, k: __mmask32, @@ -13848,7 +14065,7 @@ pub fn _mm512_mask_cvt_roundph_epu16( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uw, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_epu16(k: __mmask32, a: __m512h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvt_roundph_epu16::(_mm512_setzero_si512(), k, a) @@ -13861,7 +14078,7 @@ pub fn _mm512_maskz_cvt_roundph_epu16(k: __mmask32, a: __m512h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttph_epi16(a: __m128h) -> __m128i { _mm_mask_cvttph_epi16(_mm_undefined_si128(), 0xff, a) } @@ -13874,7 +14091,7 @@ pub fn _mm_cvttph_epi16(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvttph_epi16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvttph2w_128(a, src.as_i16x8(), k)) } } @@ -13887,7 +14104,7 @@ pub fn _mm_mask_cvttph_epi16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvttph_epi16(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvttph_epi16(_mm_setzero_si128(), k, a) } @@ -13899,7 +14116,7 @@ pub fn _mm_maskz_cvttph_epi16(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvttph_epi16(a: __m256h) -> __m256i { _mm256_mask_cvttph_epi16(_mm256_undefined_si256(), 0xffff, a) } @@ -13912,7 +14129,7 @@ pub fn _mm256_cvttph_epi16(a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvttph_epi16(src: __m256i, k: __mmask16, a: __m256h) -> __m256i { unsafe { transmute(vcvttph2w_256(a, src.as_i16x16(), k)) } } @@ -13925,7 +14142,7 @@ pub fn _mm256_mask_cvttph_epi16(src: __m256i, k: __mmask16, a: __m256h) -> __m25 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvttph_epi16(k: __mmask16, a: __m256h) -> __m256i { _mm256_mask_cvttph_epi16(_mm256_setzero_si256(), k, a) } @@ -13937,7 +14154,7 @@ pub fn _mm256_maskz_cvttph_epi16(k: __mmask16, a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvttph_epi16(a: __m512h) -> __m512i { _mm512_mask_cvttph_epi16(_mm512_undefined_epi32(), 0xffffffff, a) } @@ -13950,7 +14167,7 @@ pub fn _mm512_cvttph_epi16(a: __m512h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvttph_epi16(src: __m512i, k: __mmask32, a: __m512h) -> __m512i { unsafe { transmute(vcvttph2w_512( @@ -13970,7 +14187,7 @@ pub fn _mm512_mask_cvttph_epi16(src: __m512i, k: __mmask32, a: __m512h) -> __m51 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2w))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvttph_epi16(k: __mmask32, a: __m512h) -> __m512i { _mm512_mask_cvttph_epi16(_mm512_setzero_si512(), k, a) } @@ -13985,7 +14202,7 @@ pub fn _mm512_maskz_cvttph_epi16(k: __mmask32, a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2w, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtt_roundph_epi16(a: __m512h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epi16::(_mm512_undefined_epi32(), 0xffffffff, a) @@ -14002,7 +14219,7 @@ pub fn _mm512_cvtt_roundph_epi16(a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2w, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtt_roundph_epi16( src: __m512i, k: __mmask32, @@ -14025,7 +14242,7 @@ pub fn _mm512_mask_cvtt_roundph_epi16( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2w, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtt_roundph_epi16(k: __mmask32, a: __m512h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epi16::(_mm512_setzero_si512(), k, a) @@ -14038,7 +14255,7 @@ pub fn _mm512_maskz_cvtt_roundph_epi16(k: __mmask32, a: __m512h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttph_epu16(a: __m128h) -> __m128i { _mm_mask_cvttph_epu16(_mm_undefined_si128(), 0xff, a) } @@ -14051,7 +14268,7 @@ pub fn _mm_cvttph_epu16(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvttph_epu16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvttph2uw_128(a, src.as_u16x8(), k)) } } @@ -14064,7 +14281,7 @@ pub fn _mm_mask_cvttph_epu16(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvttph_epu16(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvttph_epu16(_mm_setzero_si128(), k, a) } @@ -14076,7 +14293,7 @@ pub fn _mm_maskz_cvttph_epu16(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvttph_epu16(a: __m256h) -> __m256i { _mm256_mask_cvttph_epu16(_mm256_undefined_si256(), 0xffff, a) } @@ -14089,7 +14306,7 @@ pub fn _mm256_cvttph_epu16(a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvttph_epu16(src: __m256i, k: __mmask16, a: __m256h) -> __m256i { unsafe { transmute(vcvttph2uw_256(a, src.as_u16x16(), k)) } } @@ -14102,7 +14319,7 @@ pub fn _mm256_mask_cvttph_epu16(src: __m256i, k: __mmask16, a: __m256h) -> __m25 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvttph_epu16(k: __mmask16, a: __m256h) -> __m256i { _mm256_mask_cvttph_epu16(_mm256_setzero_si256(), k, a) } @@ -14114,7 +14331,7 @@ pub fn _mm256_maskz_cvttph_epu16(k: __mmask16, a: __m256h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvttph_epu16(a: __m512h) -> __m512i { _mm512_mask_cvttph_epu16(_mm512_undefined_epi32(), 0xffffffff, a) } @@ -14127,7 +14344,7 @@ pub fn _mm512_cvttph_epu16(a: __m512h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvttph_epu16(src: __m512i, k: __mmask32, a: __m512h) -> __m512i { unsafe { transmute(vcvttph2uw_512( @@ -14147,7 +14364,7 @@ pub fn _mm512_mask_cvttph_epu16(src: __m512i, k: __mmask32, a: __m512h) -> __m51 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uw))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvttph_epu16(k: __mmask32, a: __m512h) -> __m512i { _mm512_mask_cvttph_epu16(_mm512_setzero_si512(), k, a) } @@ -14162,7 +14379,7 @@ pub fn _mm512_maskz_cvttph_epu16(k: __mmask32, a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uw, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtt_roundph_epu16(a: __m512h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epu16::(_mm512_undefined_epi32(), 0xffffffff, a) @@ -14179,7 +14396,7 @@ pub fn _mm512_cvtt_roundph_epu16(a: __m512h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uw, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtt_roundph_epu16( src: __m512i, k: __mmask32, @@ -14202,7 +14419,7 @@ pub fn _mm512_mask_cvtt_roundph_epu16( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uw, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtt_roundph_epu16(k: __mmask32, a: __m512h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epu16::(_mm512_setzero_si512(), k, a) @@ -14215,7 +14432,7 @@ pub fn _mm512_maskz_cvtt_roundph_epu16(k: __mmask32, a: __m512h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_epi32(a: __m128h) -> __m128i { _mm_mask_cvtph_epi32(_mm_undefined_si128(), 0xff, a) } @@ -14227,7 +14444,7 @@ pub fn _mm_cvtph_epi32(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_epi32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvtph2dq_128(a, src.as_i32x4(), k)) } } @@ -14239,7 +14456,7 @@ pub fn _mm_mask_cvtph_epi32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_epi32(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvtph_epi32(_mm_setzero_si128(), k, a) } @@ -14251,7 +14468,7 @@ pub fn _mm_maskz_cvtph_epi32(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_epi32(a: __m128h) -> __m256i { _mm256_mask_cvtph_epi32(_mm256_undefined_si256(), 0xff, a) } @@ -14263,7 +14480,7 @@ pub fn _mm256_cvtph_epi32(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_epi32(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvtph2dq_256(a, src.as_i32x8(), k)) } } @@ -14275,7 +14492,7 @@ pub fn _mm256_mask_cvtph_epi32(src: __m256i, k: __mmask8, a: __m128h) -> __m256i #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_epi32(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvtph_epi32(_mm256_setzero_si256(), k, a) } @@ -14287,7 +14504,7 @@ pub fn _mm256_maskz_cvtph_epi32(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_epi32(a: __m256h) -> __m512i { _mm512_mask_cvtph_epi32(_mm512_undefined_epi32(), 0xffff, a) } @@ -14299,7 +14516,7 @@ pub fn _mm512_cvtph_epi32(a: __m256h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_epi32(src: __m512i, k: __mmask16, a: __m256h) -> __m512i { unsafe { transmute(vcvtph2dq_512( @@ -14318,7 +14535,7 @@ pub fn _mm512_mask_cvtph_epi32(src: __m512i, k: __mmask16, a: __m256h) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_epi32(k: __mmask16, a: __m256h) -> __m512i { _mm512_mask_cvtph_epi32(_mm512_setzero_si512(), k, a) } @@ -14339,7 +14556,7 @@ pub fn _mm512_maskz_cvtph_epi32(k: __mmask16, a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2dq, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_epi32(a: __m256h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epi32::(_mm512_undefined_epi32(), 0xffff, a) @@ -14361,7 +14578,7 @@ pub fn _mm512_cvt_roundph_epi32(a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2dq, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_epi32( src: __m512i, k: __mmask16, @@ -14389,7 +14606,7 @@ pub fn _mm512_mask_cvt_roundph_epi32( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2dq, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_epi32(k: __mmask16, a: __m256h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epi32::(_mm512_setzero_si512(), k, a) @@ -14402,7 +14619,7 @@ pub fn _mm512_maskz_cvt_roundph_epi32(k: __mmask16, a: __m2 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2si))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsh_i32(a: __m128h) -> i32 { unsafe { vcvtsh2si32(a, _MM_FROUND_CUR_DIRECTION) } } @@ -14423,7 +14640,7 @@ pub fn _mm_cvtsh_i32(a: __m128h) -> i32 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2si, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsh_i32(a: __m128h) -> i32 { unsafe { static_assert_rounding!(ROUNDING); @@ -14438,7 +14655,7 @@ pub fn _mm_cvt_roundsh_i32(a: __m128h) -> i32 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_epu32(a: __m128h) -> __m128i { _mm_mask_cvtph_epu32(_mm_undefined_si128(), 0xff, a) } @@ -14450,7 +14667,7 @@ pub fn _mm_cvtph_epu32(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_epu32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvtph2udq_128(a, src.as_u32x4(), k)) } } @@ -14462,7 +14679,7 @@ pub fn _mm_mask_cvtph_epu32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_epu32(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvtph_epu32(_mm_setzero_si128(), k, a) } @@ -14474,7 +14691,7 @@ pub fn _mm_maskz_cvtph_epu32(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_epu32(a: __m128h) -> __m256i { _mm256_mask_cvtph_epu32(_mm256_undefined_si256(), 0xff, a) } @@ -14486,7 +14703,7 @@ pub fn _mm256_cvtph_epu32(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_epu32(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvtph2udq_256(a, src.as_u32x8(), k)) } } @@ -14498,7 +14715,7 @@ pub fn _mm256_mask_cvtph_epu32(src: __m256i, k: __mmask8, a: __m128h) -> __m256i #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_epu32(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvtph_epu32(_mm256_setzero_si256(), k, a) } @@ -14510,7 +14727,7 @@ pub fn _mm256_maskz_cvtph_epu32(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_epu32(a: __m256h) -> __m512i { _mm512_mask_cvtph_epu32(_mm512_undefined_epi32(), 0xffff, a) } @@ -14522,7 +14739,7 @@ pub fn _mm512_cvtph_epu32(a: __m256h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_epu32(src: __m512i, k: __mmask16, a: __m256h) -> __m512i { unsafe { transmute(vcvtph2udq_512( @@ -14541,7 +14758,7 @@ pub fn _mm512_mask_cvtph_epu32(src: __m512i, k: __mmask16, a: __m256h) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_epu32(k: __mmask16, a: __m256h) -> __m512i { _mm512_mask_cvtph_epu32(_mm512_setzero_si512(), k, a) } @@ -14562,7 +14779,7 @@ pub fn _mm512_maskz_cvtph_epu32(k: __mmask16, a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2udq, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_epu32(a: __m256h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epu32::(_mm512_undefined_epi32(), 0xffff, a) @@ -14584,7 +14801,7 @@ pub fn _mm512_cvt_roundph_epu32(a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2udq, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_epu32( src: __m512i, k: __mmask16, @@ -14612,7 +14829,7 @@ pub fn _mm512_mask_cvt_roundph_epu32( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2udq, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_epu32(k: __mmask16, a: __m256h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epu32::(_mm512_setzero_si512(), k, a) @@ -14625,7 +14842,7 @@ pub fn _mm512_maskz_cvt_roundph_epu32(k: __mmask16, a: __m2 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2usi))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsh_u32(a: __m128h) -> u32 { unsafe { vcvtsh2usi32(a, _MM_FROUND_CUR_DIRECTION) } } @@ -14640,7 +14857,7 @@ pub fn _mm_cvtsh_u32(a: __m128h) -> u32 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2usi, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsh_u32(a: __m128h) -> u32 { unsafe { static_assert_rounding!(SAE); @@ -14655,7 +14872,7 @@ pub fn _mm_cvt_roundsh_u32(a: __m128h) -> u32 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttph_epi32(a: __m128h) -> __m128i { _mm_mask_cvttph_epi32(_mm_undefined_si128(), 0xff, a) } @@ -14667,7 +14884,7 @@ pub fn _mm_cvttph_epi32(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvttph_epi32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvttph2dq_128(a, src.as_i32x4(), k)) } } @@ -14679,7 +14896,7 @@ pub fn _mm_mask_cvttph_epi32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvttph_epi32(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvttph_epi32(_mm_setzero_si128(), k, a) } @@ -14691,7 +14908,7 @@ pub fn _mm_maskz_cvttph_epi32(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvttph_epi32(a: __m128h) -> __m256i { _mm256_mask_cvttph_epi32(_mm256_undefined_si256(), 0xff, a) } @@ -14703,7 +14920,7 @@ pub fn _mm256_cvttph_epi32(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvttph_epi32(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvttph2dq_256(a, src.as_i32x8(), k)) } } @@ -14715,7 +14932,7 @@ pub fn _mm256_mask_cvttph_epi32(src: __m256i, k: __mmask8, a: __m128h) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvttph_epi32(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvttph_epi32(_mm256_setzero_si256(), k, a) } @@ -14727,7 +14944,7 @@ pub fn _mm256_maskz_cvttph_epi32(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvttph_epi32(a: __m256h) -> __m512i { _mm512_mask_cvttph_epi32(_mm512_undefined_epi32(), 0xffff, a) } @@ -14739,7 +14956,7 @@ pub fn _mm512_cvttph_epi32(a: __m256h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvttph_epi32(src: __m512i, k: __mmask16, a: __m256h) -> __m512i { unsafe { transmute(vcvttph2dq_512( @@ -14758,7 +14975,7 @@ pub fn _mm512_mask_cvttph_epi32(src: __m512i, k: __mmask16, a: __m256h) -> __m51 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2dq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvttph_epi32(k: __mmask16, a: __m256h) -> __m512i { _mm512_mask_cvttph_epi32(_mm512_setzero_si512(), k, a) } @@ -14773,7 +14990,7 @@ pub fn _mm512_maskz_cvttph_epi32(k: __mmask16, a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2dq, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtt_roundph_epi32(a: __m256h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epi32::(_mm512_undefined_epi32(), 0xffff, a) @@ -14789,7 +15006,7 @@ pub fn _mm512_cvtt_roundph_epi32(a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2dq, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtt_roundph_epi32( src: __m512i, k: __mmask16, @@ -14811,7 +15028,7 @@ pub fn _mm512_mask_cvtt_roundph_epi32( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2dq, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtt_roundph_epi32(k: __mmask16, a: __m256h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epi32::(_mm512_setzero_si512(), k, a) @@ -14824,7 +15041,7 @@ pub fn _mm512_maskz_cvtt_roundph_epi32(k: __mmask16, a: __m256h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2si))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttsh_i32(a: __m128h) -> i32 { unsafe { vcvttsh2si32(a, _MM_FROUND_CUR_DIRECTION) } } @@ -14839,7 +15056,7 @@ pub fn _mm_cvttsh_i32(a: __m128h) -> i32 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2si, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtt_roundsh_i32(a: __m128h) -> i32 { unsafe { static_assert_sae!(SAE); @@ -14854,7 +15071,7 @@ pub fn _mm_cvtt_roundsh_i32(a: __m128h) -> i32 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttph_epu32(a: __m128h) -> __m128i { _mm_mask_cvttph_epu32(_mm_undefined_si128(), 0xff, a) } @@ -14866,7 +15083,7 @@ pub fn _mm_cvttph_epu32(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvttph_epu32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvttph2udq_128(a, src.as_u32x4(), k)) } } @@ -14878,7 +15095,7 @@ pub fn _mm_mask_cvttph_epu32(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvttph_epu32(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvttph_epu32(_mm_setzero_si128(), k, a) } @@ -14890,7 +15107,7 @@ pub fn _mm_maskz_cvttph_epu32(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvttph_epu32(a: __m128h) -> __m256i { _mm256_mask_cvttph_epu32(_mm256_undefined_si256(), 0xff, a) } @@ -14902,7 +15119,7 @@ pub fn _mm256_cvttph_epu32(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvttph_epu32(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvttph2udq_256(a, src.as_u32x8(), k)) } } @@ -14914,7 +15131,7 @@ pub fn _mm256_mask_cvttph_epu32(src: __m256i, k: __mmask8, a: __m128h) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvttph_epu32(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvttph_epu32(_mm256_setzero_si256(), k, a) } @@ -14926,7 +15143,7 @@ pub fn _mm256_maskz_cvttph_epu32(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvttph_epu32(a: __m256h) -> __m512i { _mm512_mask_cvttph_epu32(_mm512_undefined_epi32(), 0xffff, a) } @@ -14938,7 +15155,7 @@ pub fn _mm512_cvttph_epu32(a: __m256h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvttph_epu32(src: __m512i, k: __mmask16, a: __m256h) -> __m512i { unsafe { transmute(vcvttph2udq_512( @@ -14957,7 +15174,7 @@ pub fn _mm512_mask_cvttph_epu32(src: __m512i, k: __mmask16, a: __m256h) -> __m51 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2udq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvttph_epu32(k: __mmask16, a: __m256h) -> __m512i { _mm512_mask_cvttph_epu32(_mm512_setzero_si512(), k, a) } @@ -14972,7 +15189,7 @@ pub fn _mm512_maskz_cvttph_epu32(k: __mmask16, a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2udq, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtt_roundph_epu32(a: __m256h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epu32::(_mm512_undefined_epi32(), 0xffff, a) @@ -14988,7 +15205,7 @@ pub fn _mm512_cvtt_roundph_epu32(a: __m256h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2udq, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtt_roundph_epu32( src: __m512i, k: __mmask16, @@ -15010,7 +15227,7 @@ pub fn _mm512_mask_cvtt_roundph_epu32( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2udq, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtt_roundph_epu32(k: __mmask16, a: __m256h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epu32::(_mm512_setzero_si512(), k, a) @@ -15023,7 +15240,7 @@ pub fn _mm512_maskz_cvtt_roundph_epu32(k: __mmask16, a: __m256h) #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2usi))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttsh_u32(a: __m128h) -> u32 { unsafe { vcvttsh2usi32(a, _MM_FROUND_CUR_DIRECTION) } } @@ -15038,7 +15255,7 @@ pub fn _mm_cvttsh_u32(a: __m128h) -> u32 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2usi, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtt_roundsh_u32(a: __m128h) -> u32 { unsafe { static_assert_sae!(SAE); @@ -15053,7 +15270,7 @@ pub fn _mm_cvtt_roundsh_u32(a: __m128h) -> u32 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_epi64(a: __m128h) -> __m128i { _mm_mask_cvtph_epi64(_mm_undefined_si128(), 0xff, a) } @@ -15065,7 +15282,7 @@ pub fn _mm_cvtph_epi64(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_epi64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvtph2qq_128(a, src.as_i64x2(), k)) } } @@ -15077,7 +15294,7 @@ pub fn _mm_mask_cvtph_epi64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_epi64(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvtph_epi64(_mm_setzero_si128(), k, a) } @@ -15089,7 +15306,7 @@ pub fn _mm_maskz_cvtph_epi64(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_epi64(a: __m128h) -> __m256i { _mm256_mask_cvtph_epi64(_mm256_undefined_si256(), 0xff, a) } @@ -15101,7 +15318,7 @@ pub fn _mm256_cvtph_epi64(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_epi64(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvtph2qq_256(a, src.as_i64x4(), k)) } } @@ -15113,7 +15330,7 @@ pub fn _mm256_mask_cvtph_epi64(src: __m256i, k: __mmask8, a: __m128h) -> __m256i #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_epi64(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvtph_epi64(_mm256_setzero_si256(), k, a) } @@ -15125,7 +15342,7 @@ pub fn _mm256_maskz_cvtph_epi64(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_epi64(a: __m128h) -> __m512i { _mm512_mask_cvtph_epi64(_mm512_undefined_epi32(), 0xff, a) } @@ -15137,7 +15354,7 @@ pub fn _mm512_cvtph_epi64(a: __m128h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_epi64(src: __m512i, k: __mmask8, a: __m128h) -> __m512i { unsafe { transmute(vcvtph2qq_512( @@ -15156,7 +15373,7 @@ pub fn _mm512_mask_cvtph_epi64(src: __m512i, k: __mmask8, a: __m128h) -> __m512i #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_epi64(k: __mmask8, a: __m128h) -> __m512i { _mm512_mask_cvtph_epi64(_mm512_setzero_si512(), k, a) } @@ -15177,7 +15394,7 @@ pub fn _mm512_maskz_cvtph_epi64(k: __mmask8, a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2qq, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_epi64(a: __m128h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epi64::(_mm512_undefined_epi32(), 0xff, a) @@ -15199,7 +15416,7 @@ pub fn _mm512_cvt_roundph_epi64(a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2qq, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_epi64( src: __m512i, k: __mmask8, @@ -15227,7 +15444,7 @@ pub fn _mm512_mask_cvt_roundph_epi64( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2qq, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_epi64(k: __mmask8, a: __m128h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epi64::(_mm512_setzero_si512(), k, a) @@ -15240,7 +15457,7 @@ pub fn _mm512_maskz_cvt_roundph_epi64(k: __mmask8, a: __m12 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_epu64(a: __m128h) -> __m128i { _mm_mask_cvtph_epu64(_mm_undefined_si128(), 0xff, a) } @@ -15252,7 +15469,7 @@ pub fn _mm_cvtph_epu64(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_epu64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvtph2uqq_128(a, src.as_u64x2(), k)) } } @@ -15264,7 +15481,7 @@ pub fn _mm_mask_cvtph_epu64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_epu64(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvtph_epu64(_mm_setzero_si128(), k, a) } @@ -15276,7 +15493,7 @@ pub fn _mm_maskz_cvtph_epu64(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_epu64(a: __m128h) -> __m256i { _mm256_mask_cvtph_epu64(_mm256_undefined_si256(), 0xff, a) } @@ -15288,7 +15505,7 @@ pub fn _mm256_cvtph_epu64(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_epu64(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvtph2uqq_256(a, src.as_u64x4(), k)) } } @@ -15300,7 +15517,7 @@ pub fn _mm256_mask_cvtph_epu64(src: __m256i, k: __mmask8, a: __m128h) -> __m256i #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_epu64(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvtph_epu64(_mm256_setzero_si256(), k, a) } @@ -15312,7 +15529,7 @@ pub fn _mm256_maskz_cvtph_epu64(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_epu64(a: __m128h) -> __m512i { _mm512_mask_cvtph_epu64(_mm512_undefined_epi32(), 0xff, a) } @@ -15324,7 +15541,7 @@ pub fn _mm512_cvtph_epu64(a: __m128h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_epu64(src: __m512i, k: __mmask8, a: __m128h) -> __m512i { unsafe { transmute(vcvtph2uqq_512( @@ -15343,7 +15560,7 @@ pub fn _mm512_mask_cvtph_epu64(src: __m512i, k: __mmask8, a: __m128h) -> __m512i #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_epu64(k: __mmask8, a: __m128h) -> __m512i { _mm512_mask_cvtph_epu64(_mm512_setzero_si512(), k, a) } @@ -15364,7 +15581,7 @@ pub fn _mm512_maskz_cvtph_epu64(k: __mmask8, a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uqq, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_epu64(a: __m128h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epu64::(_mm512_undefined_epi32(), 0xff, a) @@ -15386,7 +15603,7 @@ pub fn _mm512_cvt_roundph_epu64(a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uqq, ROUNDING = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_epu64( src: __m512i, k: __mmask8, @@ -15414,7 +15631,7 @@ pub fn _mm512_mask_cvt_roundph_epu64( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2uqq, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_epu64(k: __mmask8, a: __m128h) -> __m512i { static_assert_rounding!(ROUNDING); _mm512_mask_cvt_roundph_epu64::(_mm512_setzero_si512(), k, a) @@ -15427,7 +15644,7 @@ pub fn _mm512_maskz_cvt_roundph_epu64(k: __mmask8, a: __m12 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttph_epi64(a: __m128h) -> __m128i { _mm_mask_cvttph_epi64(_mm_undefined_si128(), 0xff, a) } @@ -15439,7 +15656,7 @@ pub fn _mm_cvttph_epi64(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvttph_epi64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvttph2qq_128(a, src.as_i64x2(), k)) } } @@ -15451,7 +15668,7 @@ pub fn _mm_mask_cvttph_epi64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvttph_epi64(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvttph_epi64(_mm_setzero_si128(), k, a) } @@ -15463,7 +15680,7 @@ pub fn _mm_maskz_cvttph_epi64(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvttph_epi64(a: __m128h) -> __m256i { _mm256_mask_cvttph_epi64(_mm256_undefined_si256(), 0xff, a) } @@ -15475,7 +15692,7 @@ pub fn _mm256_cvttph_epi64(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvttph_epi64(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvttph2qq_256(a, src.as_i64x4(), k)) } } @@ -15487,7 +15704,7 @@ pub fn _mm256_mask_cvttph_epi64(src: __m256i, k: __mmask8, a: __m128h) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvttph_epi64(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvttph_epi64(_mm256_setzero_si256(), k, a) } @@ -15499,7 +15716,7 @@ pub fn _mm256_maskz_cvttph_epi64(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvttph_epi64(a: __m128h) -> __m512i { _mm512_mask_cvttph_epi64(_mm512_undefined_epi32(), 0xff, a) } @@ -15511,7 +15728,7 @@ pub fn _mm512_cvttph_epi64(a: __m128h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvttph_epi64(src: __m512i, k: __mmask8, a: __m128h) -> __m512i { unsafe { transmute(vcvttph2qq_512( @@ -15530,7 +15747,7 @@ pub fn _mm512_mask_cvttph_epi64(src: __m512i, k: __mmask8, a: __m128h) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2qq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvttph_epi64(k: __mmask8, a: __m128h) -> __m512i { _mm512_mask_cvttph_epi64(_mm512_setzero_si512(), k, a) } @@ -15545,7 +15762,7 @@ pub fn _mm512_maskz_cvttph_epi64(k: __mmask8, a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2qq, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtt_roundph_epi64(a: __m128h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epi64::(_mm512_undefined_epi32(), 0xff, a) @@ -15561,7 +15778,7 @@ pub fn _mm512_cvtt_roundph_epi64(a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2qq, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtt_roundph_epi64( src: __m512i, k: __mmask8, @@ -15583,7 +15800,7 @@ pub fn _mm512_mask_cvtt_roundph_epi64( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2qq, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtt_roundph_epi64(k: __mmask8, a: __m128h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epi64::(_mm512_setzero_si512(), k, a) @@ -15596,7 +15813,7 @@ pub fn _mm512_maskz_cvtt_roundph_epi64(k: __mmask8, a: __m128h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttph_epu64(a: __m128h) -> __m128i { _mm_mask_cvttph_epu64(_mm_undefined_si128(), 0xff, a) } @@ -15608,7 +15825,7 @@ pub fn _mm_cvttph_epu64(a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvttph_epu64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { unsafe { transmute(vcvttph2uqq_128(a, src.as_u64x2(), k)) } } @@ -15620,7 +15837,7 @@ pub fn _mm_mask_cvttph_epu64(src: __m128i, k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvttph_epu64(k: __mmask8, a: __m128h) -> __m128i { _mm_mask_cvttph_epu64(_mm_setzero_si128(), k, a) } @@ -15632,7 +15849,7 @@ pub fn _mm_maskz_cvttph_epu64(k: __mmask8, a: __m128h) -> __m128i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvttph_epu64(a: __m128h) -> __m256i { _mm256_mask_cvttph_epu64(_mm256_undefined_si256(), 0xff, a) } @@ -15644,7 +15861,7 @@ pub fn _mm256_cvttph_epu64(a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvttph_epu64(src: __m256i, k: __mmask8, a: __m128h) -> __m256i { unsafe { transmute(vcvttph2uqq_256(a, src.as_u64x4(), k)) } } @@ -15656,7 +15873,7 @@ pub fn _mm256_mask_cvttph_epu64(src: __m256i, k: __mmask8, a: __m128h) -> __m256 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvttph_epu64(k: __mmask8, a: __m128h) -> __m256i { _mm256_mask_cvttph_epu64(_mm256_setzero_si256(), k, a) } @@ -15668,7 +15885,7 @@ pub fn _mm256_maskz_cvttph_epu64(k: __mmask8, a: __m128h) -> __m256i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvttph_epu64(a: __m128h) -> __m512i { _mm512_mask_cvttph_epu64(_mm512_undefined_epi32(), 0xff, a) } @@ -15680,7 +15897,7 @@ pub fn _mm512_cvttph_epu64(a: __m128h) -> __m512i { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvttph_epu64(src: __m512i, k: __mmask8, a: __m128h) -> __m512i { unsafe { transmute(vcvttph2uqq_512( @@ -15699,7 +15916,7 @@ pub fn _mm512_mask_cvttph_epu64(src: __m512i, k: __mmask8, a: __m128h) -> __m512 #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uqq))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvttph_epu64(k: __mmask8, a: __m128h) -> __m512i { _mm512_mask_cvttph_epu64(_mm512_setzero_si512(), k, a) } @@ -15714,7 +15931,7 @@ pub fn _mm512_maskz_cvttph_epu64(k: __mmask8, a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uqq, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtt_roundph_epu64(a: __m128h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epu64::(_mm512_undefined_epi32(), 0xff, a) @@ -15730,7 +15947,7 @@ pub fn _mm512_cvtt_roundph_epu64(a: __m128h) -> __m512i { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uqq, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtt_roundph_epu64( src: __m512i, k: __mmask8, @@ -15752,7 +15969,7 @@ pub fn _mm512_mask_cvtt_roundph_epu64( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttph2uqq, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtt_roundph_epu64(k: __mmask8, a: __m128h) -> __m512i { static_assert_sae!(SAE); _mm512_mask_cvtt_roundph_epu64::(_mm512_setzero_si512(), k, a) @@ -15765,7 +15982,7 @@ pub fn _mm512_maskz_cvtt_roundph_epu64(k: __mmask8, a: __m128h) #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtxph_ps(a: __m128h) -> __m128 { _mm_mask_cvtxph_ps(_mm_setzero_ps(), 0xff, a) } @@ -15778,7 +15995,7 @@ pub fn _mm_cvtxph_ps(a: __m128h) -> __m128 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtxph_ps(src: __m128, k: __mmask8, a: __m128h) -> __m128 { unsafe { vcvtph2psx_128(a, src, k) } } @@ -15791,7 +16008,7 @@ pub fn _mm_mask_cvtxph_ps(src: __m128, k: __mmask8, a: __m128h) -> __m128 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtxph_ps(k: __mmask8, a: __m128h) -> __m128 { _mm_mask_cvtxph_ps(_mm_setzero_ps(), k, a) } @@ -15803,7 +16020,7 @@ pub fn _mm_maskz_cvtxph_ps(k: __mmask8, a: __m128h) -> __m128 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtxph_ps(a: __m128h) -> __m256 { _mm256_mask_cvtxph_ps(_mm256_setzero_ps(), 0xff, a) } @@ -15816,7 +16033,7 @@ pub fn _mm256_cvtxph_ps(a: __m128h) -> __m256 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtxph_ps(src: __m256, k: __mmask8, a: __m128h) -> __m256 { unsafe { vcvtph2psx_256(a, src, k) } } @@ -15829,7 +16046,7 @@ pub fn _mm256_mask_cvtxph_ps(src: __m256, k: __mmask8, a: __m128h) -> __m256 { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtxph_ps(k: __mmask8, a: __m128h) -> __m256 { _mm256_mask_cvtxph_ps(_mm256_setzero_ps(), k, a) } @@ -15841,7 +16058,7 @@ pub fn _mm256_maskz_cvtxph_ps(k: __mmask8, a: __m128h) -> __m256 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtxph_ps(a: __m256h) -> __m512 { _mm512_mask_cvtxph_ps(_mm512_setzero_ps(), 0xffff, a) } @@ -15854,7 +16071,7 @@ pub fn _mm512_cvtxph_ps(a: __m256h) -> __m512 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtxph_ps(src: __m512, k: __mmask16, a: __m256h) -> __m512 { unsafe { vcvtph2psx_512(a, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -15867,7 +16084,7 @@ pub fn _mm512_mask_cvtxph_ps(src: __m512, k: __mmask16, a: __m256h) -> __m512 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2psx))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtxph_ps(k: __mmask16, a: __m256h) -> __m512 { _mm512_mask_cvtxph_ps(_mm512_setzero_ps(), k, a) } @@ -15882,7 +16099,7 @@ pub fn _mm512_maskz_cvtxph_ps(k: __mmask16, a: __m256h) -> __m512 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2psx, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtx_roundph_ps(a: __m256h) -> __m512 { static_assert_sae!(SAE); _mm512_mask_cvtx_roundph_ps::(_mm512_setzero_ps(), 0xffff, a) @@ -15899,7 +16116,7 @@ pub fn _mm512_cvtx_roundph_ps(a: __m256h) -> __m512 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2psx, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtx_roundph_ps( src: __m512, k: __mmask16, @@ -15922,7 +16139,7 @@ pub fn _mm512_mask_cvtx_roundph_ps( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2psx, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtx_roundph_ps(k: __mmask16, a: __m256h) -> __m512 { static_assert_sae!(SAE); _mm512_mask_cvtx_roundph_ps::(_mm512_setzero_ps(), k, a) @@ -15936,7 +16153,7 @@ pub fn _mm512_maskz_cvtx_roundph_ps(k: __mmask16, a: __m256h) -> #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2ss))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsh_ss(a: __m128, b: __m128h) -> __m128 { _mm_mask_cvtsh_ss(a, 0xff, a, b) } @@ -15950,7 +16167,7 @@ pub fn _mm_cvtsh_ss(a: __m128, b: __m128h) -> __m128 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2ss))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtsh_ss(src: __m128, k: __mmask8, a: __m128, b: __m128h) -> __m128 { unsafe { vcvtsh2ss(a, b, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -15964,7 +16181,7 @@ pub fn _mm_mask_cvtsh_ss(src: __m128, k: __mmask8, a: __m128, b: __m128h) -> __m #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2ss))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtsh_ss(k: __mmask8, a: __m128, b: __m128h) -> __m128 { _mm_mask_cvtsh_ss(_mm_set_ss(0.0), k, a, b) } @@ -15980,7 +16197,7 @@ pub fn _mm_maskz_cvtsh_ss(k: __mmask8, a: __m128, b: __m128h) -> __m128 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2ss, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsh_ss(a: __m128, b: __m128h) -> __m128 { static_assert_sae!(SAE); _mm_mask_cvt_roundsh_ss::(_mm_undefined_ps(), 0xff, a, b) @@ -15998,7 +16215,7 @@ pub fn _mm_cvt_roundsh_ss(a: __m128, b: __m128h) -> __m128 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2ss, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvt_roundsh_ss( src: __m128, k: __mmask8, @@ -16023,7 +16240,7 @@ pub fn _mm_mask_cvt_roundsh_ss( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2ss, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvt_roundsh_ss(k: __mmask8, a: __m128, b: __m128h) -> __m128 { static_assert_sae!(SAE); _mm_mask_cvt_roundsh_ss::(_mm_set_ss(0.0), k, a, b) @@ -16036,7 +16253,7 @@ pub fn _mm_maskz_cvt_roundsh_ss(k: __mmask8, a: __m128, b: __m12 #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtph_pd(a: __m128h) -> __m128d { _mm_mask_cvtph_pd(_mm_setzero_pd(), 0xff, a) } @@ -16049,7 +16266,7 @@ pub fn _mm_cvtph_pd(a: __m128h) -> __m128d { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtph_pd(src: __m128d, k: __mmask8, a: __m128h) -> __m128d { unsafe { vcvtph2pd_128(a, src, k) } } @@ -16062,7 +16279,7 @@ pub fn _mm_mask_cvtph_pd(src: __m128d, k: __mmask8, a: __m128h) -> __m128d { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtph_pd(k: __mmask8, a: __m128h) -> __m128d { _mm_mask_cvtph_pd(_mm_setzero_pd(), k, a) } @@ -16074,7 +16291,7 @@ pub fn _mm_maskz_cvtph_pd(k: __mmask8, a: __m128h) -> __m128d { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_cvtph_pd(a: __m128h) -> __m256d { _mm256_mask_cvtph_pd(_mm256_setzero_pd(), 0xff, a) } @@ -16087,7 +16304,7 @@ pub fn _mm256_cvtph_pd(a: __m128h) -> __m256d { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_mask_cvtph_pd(src: __m256d, k: __mmask8, a: __m128h) -> __m256d { unsafe { vcvtph2pd_256(a, src, k) } } @@ -16100,7 +16317,7 @@ pub fn _mm256_mask_cvtph_pd(src: __m256d, k: __mmask8, a: __m128h) -> __m256d { #[inline] #[target_feature(enable = "avx512fp16,avx512vl")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm256_maskz_cvtph_pd(k: __mmask8, a: __m128h) -> __m256d { _mm256_mask_cvtph_pd(_mm256_setzero_pd(), k, a) } @@ -16112,7 +16329,7 @@ pub fn _mm256_maskz_cvtph_pd(k: __mmask8, a: __m128h) -> __m256d { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvtph_pd(a: __m128h) -> __m512d { _mm512_mask_cvtph_pd(_mm512_setzero_pd(), 0xff, a) } @@ -16125,7 +16342,7 @@ pub fn _mm512_cvtph_pd(a: __m128h) -> __m512d { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvtph_pd(src: __m512d, k: __mmask8, a: __m128h) -> __m512d { unsafe { vcvtph2pd_512(a, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -16138,7 +16355,7 @@ pub fn _mm512_mask_cvtph_pd(src: __m512d, k: __mmask8, a: __m128h) -> __m512d { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2pd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvtph_pd(k: __mmask8, a: __m128h) -> __m512d { _mm512_mask_cvtph_pd(_mm512_setzero_pd(), k, a) } @@ -16153,7 +16370,7 @@ pub fn _mm512_maskz_cvtph_pd(k: __mmask8, a: __m128h) -> __m512d { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2pd, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_cvt_roundph_pd(a: __m128h) -> __m512d { static_assert_sae!(SAE); _mm512_mask_cvt_roundph_pd::(_mm512_setzero_pd(), 0xff, a) @@ -16170,7 +16387,7 @@ pub fn _mm512_cvt_roundph_pd(a: __m128h) -> __m512d { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2pd, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_mask_cvt_roundph_pd( src: __m512d, k: __mmask8, @@ -16193,7 +16410,7 @@ pub fn _mm512_mask_cvt_roundph_pd( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtph2pd, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm512_maskz_cvt_roundph_pd(k: __mmask8, a: __m128h) -> __m512d { static_assert_sae!(SAE); _mm512_mask_cvt_roundph_pd::(_mm512_setzero_pd(), k, a) @@ -16207,7 +16424,7 @@ pub fn _mm512_maskz_cvt_roundph_pd(k: __mmask8, a: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2sd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsh_sd(a: __m128d, b: __m128h) -> __m128d { _mm_mask_cvtsh_sd(a, 0xff, a, b) } @@ -16221,7 +16438,7 @@ pub fn _mm_cvtsh_sd(a: __m128d, b: __m128h) -> __m128d { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2sd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvtsh_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128h) -> __m128d { unsafe { vcvtsh2sd(a, b, src, k, _MM_FROUND_CUR_DIRECTION) } } @@ -16234,7 +16451,7 @@ pub fn _mm_mask_cvtsh_sd(src: __m128d, k: __mmask8, a: __m128d, b: __m128h) -> _ #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2sd))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvtsh_sd(k: __mmask8, a: __m128d, b: __m128h) -> __m128d { _mm_mask_cvtsh_sd(_mm_set_sd(0.0), k, a, b) } @@ -16250,7 +16467,7 @@ pub fn _mm_maskz_cvtsh_sd(k: __mmask8, a: __m128d, b: __m128h) -> __m128d { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2sd, SAE = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsh_sd(a: __m128d, b: __m128h) -> __m128d { static_assert_sae!(SAE); _mm_mask_cvt_roundsh_sd::(a, 0xff, a, b) @@ -16268,7 +16485,7 @@ pub fn _mm_cvt_roundsh_sd(a: __m128d, b: __m128h) -> __m128d { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2sd, SAE = 8))] #[rustc_legacy_const_generics(4)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_mask_cvt_roundsh_sd( src: __m128d, k: __mmask8, @@ -16292,7 +16509,7 @@ pub fn _mm_mask_cvt_roundsh_sd( #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2sd, SAE = 8))] #[rustc_legacy_const_generics(3)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_maskz_cvt_roundsh_sd(k: __mmask8, a: __m128d, b: __m128h) -> __m128d { static_assert_sae!(SAE); _mm_mask_cvt_roundsh_sd::(_mm_set_sd(0.0), k, a, b) @@ -16304,7 +16521,8 @@ pub fn _mm_maskz_cvt_roundsh_sd(k: __mmask8, a: __m128d, b: __m1 #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_cvtsh_h(a: __m128h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsh_h(a: __m128h) -> f16 { unsafe { simd_extract!(a, 0) } } @@ -16314,7 +16532,8 @@ pub fn _mm_cvtsh_h(a: __m128h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm256_cvtsh_h(a: __m256h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtsh_h(a: __m256h) -> f16 { unsafe { simd_extract!(a, 0) } } @@ -16324,7 +16543,8 @@ pub fn _mm256_cvtsh_h(a: __m256h) -> f16 { #[inline] #[target_feature(enable = "avx512fp16")] #[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm512_cvtsh_h(a: __m512h) -> f16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_cvtsh_h(a: __m512h) -> f16 { unsafe { simd_extract!(a, 0) } } @@ -16333,8 +16553,9 @@ pub fn _mm512_cvtsh_h(a: __m512h) -> f16 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi128_si16) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_cvtsi128_si16(a: __m128i) -> i16 { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi128_si16(a: __m128i) -> i16 { unsafe { simd_extract!(a.as_i16x8(), 0) } } @@ -16343,8 +16564,9 @@ pub fn _mm_cvtsi128_si16(a: __m128i) -> i16 { /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi16_si128) #[inline] #[target_feature(enable = "avx512fp16")] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] -pub fn _mm_cvtsi16_si128(a: i16) -> __m128i { +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi16_si128(a: i16) -> __m128i { unsafe { transmute(simd_insert!(i16x8::ZERO, 0, a)) } } @@ -16708,25 +16930,29 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::core_arch::x86::*; use crate::mem::transmute; use crate::ptr::{addr_of, addr_of_mut}; use stdarch_test::simd_test; #[target_feature(enable = "avx512fp16")] - unsafe fn _mm_set1_pch(re: f16, im: f16) -> __m128h { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + const fn _mm_set1_pch(re: f16, im: f16) -> __m128h { _mm_setr_ph(re, im, re, im, re, im, re, im) } #[target_feature(enable = "avx512fp16")] - unsafe fn _mm256_set1_pch(re: f16, im: f16) -> __m256h { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + const fn _mm256_set1_pch(re: f16, im: f16) -> __m256h { _mm256_setr_ph( re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, ) } #[target_feature(enable = "avx512fp16")] - unsafe fn _mm512_set1_pch(re: f16, im: f16) -> __m512h { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + const fn _mm512_set1_pch(re: f16, im: f16) -> __m512h { _mm512_setr_ph( re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, @@ -16734,14 +16960,14 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_set_ph() { + const fn test_mm_set_ph() { let r = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let e = _mm_setr_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); assert_eq_m128h(r, e); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_set_ph() { + const fn test_mm256_set_ph() { let r = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -16752,7 +16978,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_set_ph() { + const fn test_mm512_set_ph() { let r = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -16767,21 +16993,21 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_set_sh() { + const fn test_mm_set_sh() { let r = _mm_set_sh(1.0); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); assert_eq_m128h(r, e); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_set1_ph() { + const fn test_mm_set1_ph() { let r = _mm_set1_ph(1.0); let e = _mm_set_ph(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0); assert_eq_m128h(r, e); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_set1_ph() { + const fn test_mm256_set1_ph() { let r = _mm256_set1_ph(1.0); let e = _mm256_set_ph( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, @@ -16790,7 +17016,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_set1_ph() { + const fn test_mm512_set1_ph() { let r = _mm512_set1_ph(1.0); let e = _mm512_set_ph( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, @@ -16800,14 +17026,14 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_setr_ph() { + const fn test_mm_setr_ph() { let r = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let e = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); assert_eq_m128h(r, e); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_setr_ph() { + const fn test_mm256_setr_ph() { let r = _mm256_setr_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -16818,7 +17044,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_setr_ph() { + const fn test_mm512_setr_ph() { let r = _mm512_setr_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -16833,28 +17059,28 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_setzero_ph() { + const fn test_mm_setzero_ph() { let r = _mm_setzero_ph(); let e = _mm_set1_ph(0.0); assert_eq_m128h(r, e); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_setzero_ph() { + const fn test_mm256_setzero_ph() { let r = _mm256_setzero_ph(); let e = _mm256_set1_ph(0.0); assert_eq_m256h(r, e); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_setzero_ph() { + const fn test_mm512_setzero_ph() { let r = _mm512_setzero_ph(); let e = _mm512_set1_ph(0.0); assert_eq_m512h(r, e); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_castsi128_ph() { + const fn test_mm_castsi128_ph() { let a = _mm_set1_epi16(0x3c00); let r = _mm_castsi128_ph(a); let e = _mm_set1_ph(1.0); @@ -16862,7 +17088,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_castsi256_ph() { + const fn test_mm256_castsi256_ph() { let a = _mm256_set1_epi16(0x3c00); let r = _mm256_castsi256_ph(a); let e = _mm256_set1_ph(1.0); @@ -16870,7 +17096,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_castsi512_ph() { + const fn test_mm512_castsi512_ph() { let a = _mm512_set1_epi16(0x3c00); let r = _mm512_castsi512_ph(a); let e = _mm512_set1_ph(1.0); @@ -16878,7 +17104,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_castph_si128() { + const fn test_mm_castph_si128() { let a = _mm_set1_ph(1.0); let r = _mm_castph_si128(a); let e = _mm_set1_epi16(0x3c00); @@ -16886,7 +17112,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm256_castph_si256() { + const fn test_mm256_castph_si256() { let a = _mm256_set1_ph(1.0); let r = _mm256_castph_si256(a); let e = _mm256_set1_epi16(0x3c00); @@ -16894,7 +17120,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_castph_si512() { + const fn test_mm512_castph_si512() { let a = _mm512_set1_ph(1.0); let r = _mm512_castph_si512(a); let e = _mm512_set1_epi16(0x3c00); @@ -16902,7 +17128,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_castps_ph() { + const fn test_mm_castps_ph() { let a = _mm_castsi128_ps(_mm_set1_epi16(0x3c00)); let r = _mm_castps_ph(a); let e = _mm_set1_ph(1.0); @@ -16910,7 +17136,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_castps_ph() { + const fn test_mm256_castps_ph() { let a = _mm256_castsi256_ps(_mm256_set1_epi16(0x3c00)); let r = _mm256_castps_ph(a); let e = _mm256_set1_ph(1.0); @@ -16918,7 +17144,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_castps_ph() { + const fn test_mm512_castps_ph() { let a = _mm512_castsi512_ps(_mm512_set1_epi16(0x3c00)); let r = _mm512_castps_ph(a); let e = _mm512_set1_ph(1.0); @@ -16926,7 +17152,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_castph_ps() { + const fn test_mm_castph_ps() { let a = _mm_castsi128_ph(_mm_set1_epi32(0x3f800000)); let r = _mm_castph_ps(a); let e = _mm_set1_ps(1.0); @@ -16934,7 +17160,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm256_castph_ps() { + const fn test_mm256_castph_ps() { let a = _mm256_castsi256_ph(_mm256_set1_epi32(0x3f800000)); let r = _mm256_castph_ps(a); let e = _mm256_set1_ps(1.0); @@ -16942,7 +17168,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_castph_ps() { + const fn test_mm512_castph_ps() { let a = _mm512_castsi512_ph(_mm512_set1_epi32(0x3f800000)); let r = _mm512_castph_ps(a); let e = _mm512_set1_ps(1.0); @@ -16950,7 +17176,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_castpd_ph() { + const fn test_mm_castpd_ph() { let a = _mm_castsi128_pd(_mm_set1_epi16(0x3c00)); let r = _mm_castpd_ph(a); let e = _mm_set1_ph(1.0); @@ -16958,7 +17184,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_castpd_ph() { + const fn test_mm256_castpd_ph() { let a = _mm256_castsi256_pd(_mm256_set1_epi16(0x3c00)); let r = _mm256_castpd_ph(a); let e = _mm256_set1_ph(1.0); @@ -16966,7 +17192,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_castpd_ph() { + const fn test_mm512_castpd_ph() { let a = _mm512_castsi512_pd(_mm512_set1_epi16(0x3c00)); let r = _mm512_castpd_ph(a); let e = _mm512_set1_ph(1.0); @@ -16974,7 +17200,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_castph_pd() { + const fn test_mm_castph_pd() { let a = _mm_castsi128_ph(_mm_set1_epi64x(0x3ff0000000000000)); let r = _mm_castph_pd(a); let e = _mm_set1_pd(1.0); @@ -16982,7 +17208,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm256_castph_pd() { + const fn test_mm256_castph_pd() { let a = _mm256_castsi256_ph(_mm256_set1_epi64x(0x3ff0000000000000)); let r = _mm256_castph_pd(a); let e = _mm256_set1_pd(1.0); @@ -16990,7 +17216,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_castph_pd() { + const fn test_mm512_castph_pd() { let a = _mm512_castsi512_ph(_mm512_set1_epi64(0x3ff0000000000000)); let r = _mm512_castph_pd(a); let e = _mm512_set1_pd(1.0); @@ -16998,7 +17224,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_castph256_ph128() { + const fn test_mm256_castph256_ph128() { let a = _mm256_setr_ph( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -17008,7 +17234,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_castph512_ph128() { + const fn test_mm512_castph512_ph128() { let a = _mm512_setr_ph( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., @@ -17019,7 +17245,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_castph512_ph256() { + const fn test_mm512_castph512_ph256() { let a = _mm512_setr_ph( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., @@ -17032,21 +17258,21 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_castph128_ph256() { + const fn test_mm256_castph128_ph256() { let a = _mm_setr_ph(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_castph128_ph256(a); assert_eq_m128h(_mm256_castph256_ph128(r), a); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_castph128_ph512() { + const fn test_mm512_castph128_ph512() { let a = _mm_setr_ph(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_castph128_ph512(a); assert_eq_m128h(_mm512_castph512_ph128(r), a); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_castph256_ph512() { + const fn test_mm512_castph256_ph512() { let a = _mm256_setr_ph( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -17055,7 +17281,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_zextph128_ph256() { + const fn test_mm256_zextph128_ph256() { let a = _mm_setr_ph(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm256_zextph128_ph256(a); let e = _mm256_setr_ph( @@ -17065,7 +17291,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_zextph128_ph512() { + const fn test_mm512_zextph128_ph512() { let a = _mm_setr_ph(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_zextph128_ph512(a); let e = _mm512_setr_ph( @@ -17076,7 +17302,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_zextph256_ph512() { + const fn test_mm512_zextph256_ph512() { let a = _mm256_setr_ph( 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., ); @@ -17089,7 +17315,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cmp_ph_mask() { + fn test_mm_cmp_ph_mask() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(1.0, 2.0, 3.0, 4.0, -5.0, -6.0, -7.0, -8.0); let r = _mm_cmp_ph_mask::<_CMP_EQ_OQ>(a, b); @@ -17097,7 +17323,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cmp_ph_mask() { + fn test_mm_mask_cmp_ph_mask() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(1.0, 2.0, 3.0, 4.0, -5.0, -6.0, -7.0, -8.0); let r = _mm_mask_cmp_ph_mask::<_CMP_EQ_OQ>(0b01010101, a, b); @@ -17105,7 +17331,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cmp_ph_mask() { + fn test_mm256_cmp_ph_mask() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17118,7 +17344,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cmp_ph_mask() { + fn test_mm256_mask_cmp_ph_mask() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17131,7 +17357,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cmp_ph_mask() { + fn test_mm512_cmp_ph_mask() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17147,7 +17373,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cmp_ph_mask() { + fn test_mm512_mask_cmp_ph_mask() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17163,7 +17389,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cmp_round_ph_mask() { + fn test_mm512_cmp_round_ph_mask() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17179,7 +17405,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cmp_round_ph_mask() { + fn test_mm512_mask_cmp_round_ph_mask() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17199,7 +17425,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cmp_round_sh_mask() { + fn test_mm_cmp_round_sh_mask() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_cmp_round_sh_mask::<_CMP_EQ_OQ, _MM_FROUND_NO_EXC>(a, b); @@ -17207,7 +17433,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_cmp_round_sh_mask() { + fn test_mm_mask_cmp_round_sh_mask() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_mask_cmp_round_sh_mask::<_CMP_EQ_OQ, _MM_FROUND_NO_EXC>(0, a, b); @@ -17215,7 +17441,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cmp_sh_mask() { + fn test_mm_cmp_sh_mask() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_cmp_sh_mask::<_CMP_EQ_OQ>(a, b); @@ -17223,7 +17449,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_cmp_sh_mask() { + fn test_mm_mask_cmp_sh_mask() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_mask_cmp_sh_mask::<_CMP_EQ_OQ>(0, a, b); @@ -17231,7 +17457,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comi_round_sh() { + fn test_mm_comi_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_comi_round_sh::<_CMP_EQ_OQ, _MM_FROUND_NO_EXC>(a, b); @@ -17239,7 +17465,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comi_sh() { + fn test_mm_comi_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_comi_sh::<_CMP_EQ_OQ>(a, b); @@ -17247,7 +17473,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comieq_sh() { + fn test_mm_comieq_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_comieq_sh(a, b); @@ -17255,7 +17481,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comige_sh() { + fn test_mm_comige_sh() { let a = _mm_set_sh(2.0); let b = _mm_set_sh(1.0); let r = _mm_comige_sh(a, b); @@ -17263,7 +17489,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comigt_sh() { + fn test_mm_comigt_sh() { let a = _mm_set_sh(2.0); let b = _mm_set_sh(1.0); let r = _mm_comigt_sh(a, b); @@ -17271,7 +17497,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comile_sh() { + fn test_mm_comile_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_comile_sh(a, b); @@ -17279,7 +17505,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comilt_sh() { + fn test_mm_comilt_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_comilt_sh(a, b); @@ -17287,7 +17513,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_comineq_sh() { + fn test_mm_comineq_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_comineq_sh(a, b); @@ -17295,7 +17521,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_ucomieq_sh() { + fn test_mm_ucomieq_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(1.0); let r = _mm_ucomieq_sh(a, b); @@ -17303,7 +17529,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_ucomige_sh() { + fn test_mm_ucomige_sh() { let a = _mm_set_sh(2.0); let b = _mm_set_sh(1.0); let r = _mm_ucomige_sh(a, b); @@ -17311,7 +17537,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_ucomigt_sh() { + fn test_mm_ucomigt_sh() { let a = _mm_set_sh(2.0); let b = _mm_set_sh(1.0); let r = _mm_ucomigt_sh(a, b); @@ -17319,7 +17545,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_ucomile_sh() { + fn test_mm_ucomile_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_ucomile_sh(a, b); @@ -17327,7 +17553,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_ucomilt_sh() { + fn test_mm_ucomilt_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_ucomilt_sh(a, b); @@ -17335,7 +17561,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_ucomineq_sh() { + fn test_mm_ucomineq_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_ucomineq_sh(a, b); @@ -17343,14 +17569,14 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_load_ph() { + const unsafe fn test_mm_load_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_load_ph(addr_of!(a).cast()); assert_eq_m128h(a, b); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_load_ph() { + const unsafe fn test_mm256_load_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17359,7 +17585,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_load_ph() { + const unsafe fn test_mm512_load_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17370,7 +17596,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_load_sh() { + const unsafe fn test_mm_load_sh() { let a = _mm_set_sh(1.0); let b = _mm_load_sh(addr_of!(a).cast()); assert_eq_m128h(a, b); @@ -17396,7 +17622,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_loadu_ph() { + const unsafe fn test_mm_loadu_ph() { let array = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let r = _mm_loadu_ph(array.as_ptr()); let e = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -17404,7 +17630,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_loadu_ph() { + const unsafe fn test_mm256_loadu_ph() { let array = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ]; @@ -17416,7 +17642,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_loadu_ph() { + const unsafe fn test_mm512_loadu_ph() { let array = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17432,7 +17658,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_move_sh() { + const fn test_mm_move_sh() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_sh(9.0); let r = _mm_move_sh(a, b); @@ -17441,7 +17667,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_move_sh() { + const fn test_mm_mask_move_sh() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_sh(9.0); let src = _mm_set_sh(10.0); @@ -17451,7 +17677,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_move_sh() { + const fn test_mm_maskz_move_sh() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_sh(9.0); let r = _mm_maskz_move_sh(0, a, b); @@ -17460,7 +17686,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_store_ph() { + const unsafe fn test_mm_store_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let mut b = _mm_setzero_ph(); _mm_store_ph(addr_of_mut!(b).cast(), a); @@ -17468,7 +17694,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_store_ph() { + const unsafe fn test_mm256_store_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17478,7 +17704,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_store_ph() { + const unsafe fn test_mm512_store_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17490,7 +17716,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_store_sh() { + const unsafe fn test_mm_store_sh() { let a = _mm_set_sh(1.0); let mut b = _mm_setzero_ph(); _mm_store_sh(addr_of_mut!(b).cast(), a); @@ -17508,7 +17734,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_storeu_ph() { + const unsafe fn test_mm_storeu_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let mut array = [0.0; 8]; _mm_storeu_ph(array.as_mut_ptr(), a); @@ -17516,7 +17742,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_storeu_ph() { + const unsafe fn test_mm256_storeu_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17526,7 +17752,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_storeu_ph() { + const unsafe fn test_mm512_storeu_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17538,7 +17764,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_add_ph() { + const fn test_mm_add_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let r = _mm_add_ph(a, b); @@ -17547,7 +17773,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_add_ph() { + const fn test_mm_mask_add_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); @@ -17557,7 +17783,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_add_ph() { + const fn test_mm_maskz_add_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let r = _mm_maskz_add_ph(0b01010101, a, b); @@ -17566,7 +17792,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_add_ph() { + const fn test_mm256_add_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17579,7 +17805,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_add_ph() { + const fn test_mm256_mask_add_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17597,7 +17823,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_add_ph() { + const fn test_mm256_maskz_add_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17612,7 +17838,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_add_ph() { + const fn test_mm512_add_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17629,7 +17855,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_add_ph() { + const fn test_mm512_mask_add_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17653,7 +17879,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_add_ph() { + const fn test_mm512_maskz_add_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17673,7 +17899,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_add_round_ph() { + fn test_mm512_add_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17690,7 +17916,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_add_round_ph() { + fn test_mm512_mask_add_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17719,7 +17945,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_add_round_ph() { + fn test_mm512_maskz_add_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17743,7 +17969,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_add_round_sh() { + fn test_mm_add_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_add_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -17752,7 +17978,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_add_round_sh() { + fn test_mm_mask_add_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -17769,7 +17995,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_add_round_sh() { + fn test_mm_maskz_add_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = @@ -17783,7 +18009,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_add_sh() { + const fn test_mm_add_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_add_sh(a, b); @@ -17792,7 +18018,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_add_sh() { + const fn test_mm_mask_add_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -17805,7 +18031,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_add_sh() { + const fn test_mm_maskz_add_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_maskz_add_sh(0, a, b); @@ -17817,7 +18043,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_sub_ph() { + const fn test_mm_sub_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let r = _mm_sub_ph(a, b); @@ -17826,7 +18052,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_sub_ph() { + const fn test_mm_mask_sub_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); @@ -17836,7 +18062,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_sub_ph() { + const fn test_mm_maskz_sub_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let r = _mm_maskz_sub_ph(0b01010101, a, b); @@ -17845,7 +18071,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_sub_ph() { + const fn test_mm256_sub_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17861,7 +18087,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_sub_ph() { + const fn test_mm256_mask_sub_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17879,7 +18105,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_sub_ph() { + const fn test_mm256_maskz_sub_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -17894,7 +18120,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_sub_ph() { + const fn test_mm512_sub_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17915,7 +18141,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_sub_ph() { + const fn test_mm512_mask_sub_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17939,7 +18165,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_sub_ph() { + const fn test_mm512_maskz_sub_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17959,7 +18185,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_sub_round_ph() { + fn test_mm512_sub_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -17980,7 +18206,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_sub_round_ph() { + fn test_mm512_mask_sub_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18009,7 +18235,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_sub_round_ph() { + fn test_mm512_maskz_sub_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18033,7 +18259,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_sub_round_sh() { + fn test_mm_sub_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_sub_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18042,7 +18268,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_sub_round_sh() { + fn test_mm_mask_sub_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -18059,7 +18285,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_sub_round_sh() { + fn test_mm_maskz_sub_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = @@ -18073,7 +18299,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_sub_sh() { + const fn test_mm_sub_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_sub_sh(a, b); @@ -18082,7 +18308,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_sub_sh() { + const fn test_mm_mask_sub_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -18095,7 +18321,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_sub_sh() { + const fn test_mm_maskz_sub_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_maskz_sub_sh(0, a, b); @@ -18107,7 +18333,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mul_ph() { + const fn test_mm_mul_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let r = _mm_mul_ph(a, b); @@ -18116,7 +18342,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_mul_ph() { + const fn test_mm_mask_mul_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); @@ -18126,7 +18352,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_mul_ph() { + const fn test_mm_maskz_mul_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0); let r = _mm_maskz_mul_ph(0b01010101, a, b); @@ -18135,7 +18361,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mul_ph() { + const fn test_mm256_mul_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -18151,7 +18377,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_mul_ph() { + const fn test_mm256_mask_mul_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -18169,7 +18395,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_mul_ph() { + const fn test_mm256_maskz_mul_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -18184,7 +18410,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mul_ph() { + const fn test_mm512_mul_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18205,7 +18431,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_mul_ph() { + const fn test_mm512_mask_mul_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18229,7 +18455,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_mul_ph() { + const fn test_mm512_maskz_mul_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18249,7 +18475,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mul_round_ph() { + fn test_mm512_mul_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18270,7 +18496,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_mul_round_ph() { + fn test_mm512_mask_mul_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18299,7 +18525,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_mul_round_ph() { + fn test_mm512_maskz_mul_round_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -18323,7 +18549,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mul_round_sh() { + fn test_mm_mul_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_mul_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18332,7 +18558,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_mul_round_sh() { + fn test_mm_mask_mul_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -18349,7 +18575,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_mul_round_sh() { + fn test_mm_maskz_mul_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = @@ -18363,7 +18589,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mul_sh() { + const fn test_mm_mul_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_mul_sh(a, b); @@ -18372,7 +18598,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_mul_sh() { + const fn test_mm_mask_mul_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -18385,7 +18611,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_mul_sh() { + const fn test_mm_maskz_mul_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_maskz_mul_sh(0, a, b); @@ -18397,7 +18623,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_div_ph() { + const fn test_mm_div_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let r = _mm_div_ph(a, b); @@ -18406,7 +18632,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_div_ph() { + const fn test_mm_mask_div_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let src = _mm_set_ph(4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); @@ -18416,7 +18642,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_div_ph() { + const fn test_mm_maskz_div_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let r = _mm_maskz_div_ph(0b01010101, a, b); @@ -18425,7 +18651,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_div_ph() { + const fn test_mm256_div_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let r = _mm256_div_ph(a, b); @@ -18434,7 +18660,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_div_ph() { + const fn test_mm256_mask_div_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let src = _mm256_set_ph( @@ -18449,7 +18675,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_div_ph() { + const fn test_mm256_maskz_div_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let r = _mm256_maskz_div_ph(0b0101010101010101, a, b); @@ -18460,7 +18686,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_div_ph() { + const fn test_mm512_div_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let r = _mm512_div_ph(a, b); @@ -18469,7 +18695,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_div_ph() { + const fn test_mm512_mask_div_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let src = _mm512_set_ph( @@ -18486,7 +18712,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_div_ph() { + const fn test_mm512_maskz_div_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let r = _mm512_maskz_div_ph(0b01010101010101010101010101010101, a, b); @@ -18498,7 +18724,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_div_round_ph() { + fn test_mm512_div_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let r = _mm512_div_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18507,7 +18733,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_div_round_ph() { + fn test_mm512_mask_div_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let src = _mm512_set_ph( @@ -18529,7 +18755,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_div_round_ph() { + fn test_mm512_maskz_div_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let r = _mm512_maskz_div_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -18545,7 +18771,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_div_round_sh() { + fn test_mm_div_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_div_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18554,7 +18780,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_div_round_sh() { + fn test_mm_mask_div_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -18571,7 +18797,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_div_round_sh() { + fn test_mm_maskz_div_round_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = @@ -18585,7 +18811,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_div_sh() { + const fn test_mm_div_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_div_sh(a, b); @@ -18594,7 +18820,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_div_sh() { + const fn test_mm_mask_div_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let src = _mm_set_sh(4.0); @@ -18607,7 +18833,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_div_sh() { + const fn test_mm_maskz_div_sh() { let a = _mm_set_sh(1.0); let b = _mm_set_sh(2.0); let r = _mm_maskz_div_sh(0, a, b); @@ -18619,7 +18845,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mul_pch() { + fn test_mm_mul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 1.0); let r = _mm_mul_pch(a, b); @@ -18628,7 +18854,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_mul_pch() { + fn test_mm_mask_mul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 1.0); let src = _mm_setr_ph(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); @@ -18638,7 +18864,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_mul_pch() { + fn test_mm_maskz_mul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 1.0); let r = _mm_maskz_mul_pch(0b0101, a, b); @@ -18647,7 +18873,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mul_pch() { + fn test_mm256_mul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 1.0); let r = _mm256_mul_pch(a, b); @@ -18656,7 +18882,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_mul_pch() { + fn test_mm256_mask_mul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 1.0); let src = _mm256_setr_ph( @@ -18670,7 +18896,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_mul_pch() { + fn test_mm256_maskz_mul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 1.0); let r = _mm256_maskz_mul_pch(0b01010101, a, b); @@ -18681,7 +18907,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mul_pch() { + fn test_mm512_mul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_mul_pch(a, b); @@ -18690,7 +18916,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_mul_pch() { + fn test_mm512_mask_mul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let src = _mm512_setr_ph( @@ -18708,7 +18934,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_mul_pch() { + fn test_mm512_maskz_mul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_maskz_mul_pch(0b0101010101010101, a, b); @@ -18720,7 +18946,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mul_round_pch() { + fn test_mm512_mul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_mul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18729,7 +18955,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_mul_round_pch() { + fn test_mm512_mask_mul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let src = _mm512_setr_ph( @@ -18752,7 +18978,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_mul_round_pch() { + fn test_mm512_maskz_mul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_maskz_mul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -18768,7 +18994,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mul_round_sch() { + fn test_mm_mul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = _mm_mul_round_sch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18777,7 +19003,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_mul_round_sch() { + fn test_mm_mask_mul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -18789,7 +19015,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_mul_round_sch() { + fn test_mm_maskz_mul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = @@ -18799,7 +19025,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mul_sch() { + fn test_mm_mul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = _mm_mul_sch(a, b); @@ -18808,7 +19034,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_mul_sch() { + fn test_mm_mask_mul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -18818,7 +19044,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_mul_sch() { + fn test_mm_maskz_mul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = _mm_maskz_mul_sch(0, a, b); @@ -18827,7 +19053,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmul_pch() { + fn test_mm_fmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 1.0); let r = _mm_fmul_pch(a, b); @@ -18836,7 +19062,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmul_pch() { + fn test_mm_mask_fmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 1.0); let src = _mm_setr_ph(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); @@ -18846,7 +19072,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmul_pch() { + fn test_mm_maskz_fmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 1.0); let r = _mm_maskz_fmul_pch(0b0101, a, b); @@ -18855,7 +19081,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fmul_pch() { + fn test_mm256_fmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 1.0); let r = _mm256_fmul_pch(a, b); @@ -18864,7 +19090,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fmul_pch() { + fn test_mm256_mask_fmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 1.0); let src = _mm256_setr_ph( @@ -18878,7 +19104,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fmul_pch() { + fn test_mm256_maskz_fmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 1.0); let r = _mm256_maskz_fmul_pch(0b01010101, a, b); @@ -18889,7 +19115,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmul_pch() { + fn test_mm512_fmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_fmul_pch(a, b); @@ -18898,7 +19124,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmul_pch() { + fn test_mm512_mask_fmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let src = _mm512_setr_ph( @@ -18916,7 +19142,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmul_pch() { + fn test_mm512_maskz_fmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_maskz_fmul_pch(0b0101010101010101, a, b); @@ -18928,7 +19154,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmul_round_pch() { + fn test_mm512_fmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_fmul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18937,7 +19163,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmul_round_pch() { + fn test_mm512_mask_fmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let src = _mm512_setr_ph( @@ -18960,7 +19186,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmul_round_pch() { + fn test_mm512_maskz_fmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 1.0); let r = _mm512_maskz_fmul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -18976,7 +19202,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmul_round_sch() { + fn test_mm_fmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = _mm_fmul_round_sch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -18985,7 +19211,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmul_round_sch() { + fn test_mm_mask_fmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -18997,7 +19223,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmul_round_sch() { + fn test_mm_maskz_fmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = @@ -19007,7 +19233,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmul_sch() { + fn test_mm_fmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = _mm_fmul_sch(a, b); @@ -19016,7 +19242,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmul_sch() { + fn test_mm_mask_fmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -19026,7 +19252,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmul_sch() { + fn test_mm_maskz_fmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 1.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let r = _mm_maskz_fmul_sch(0, a, b); @@ -19035,7 +19261,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cmul_pch() { + fn test_mm_cmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, -1.0); let r = _mm_cmul_pch(a, b); @@ -19044,7 +19270,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cmul_pch() { + fn test_mm_mask_cmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, -1.0); let src = _mm_setr_ph(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); @@ -19054,7 +19280,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cmul_pch() { + fn test_mm_maskz_cmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, -1.0); let r = _mm_maskz_cmul_pch(0b0101, a, b); @@ -19063,7 +19289,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cmul_pch() { + fn test_mm256_cmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, -1.0); let r = _mm256_cmul_pch(a, b); @@ -19072,7 +19298,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cmul_pch() { + fn test_mm256_mask_cmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, -1.0); let src = _mm256_setr_ph( @@ -19086,7 +19312,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cmul_pch() { + fn test_mm256_maskz_cmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, -1.0); let r = _mm256_maskz_cmul_pch(0b01010101, a, b); @@ -19097,7 +19323,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cmul_pch() { + fn test_mm512_cmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_cmul_pch(a, b); @@ -19106,7 +19332,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cmul_pch() { + fn test_mm512_mask_cmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let src = _mm512_setr_ph( @@ -19124,7 +19350,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cmul_pch() { + fn test_mm512_maskz_cmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_maskz_cmul_pch(0b0101010101010101, a, b); @@ -19136,7 +19362,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cmul_round_pch() { + fn test_mm512_cmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_cmul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -19145,7 +19371,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cmul_round_pch() { + fn test_mm512_mask_cmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let src = _mm512_setr_ph( @@ -19168,7 +19394,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cmul_round_pch() { + fn test_mm512_maskz_cmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_maskz_cmul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -19184,7 +19410,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cmul_sch() { + fn test_mm_cmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = _mm_cmul_sch(a, b); @@ -19193,7 +19419,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cmul_sch() { + fn test_mm_mask_cmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -19203,7 +19429,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cmul_sch() { + fn test_mm_maskz_cmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = _mm_maskz_cmul_sch(0, a, b); @@ -19212,7 +19438,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cmul_round_sch() { + fn test_mm_cmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = _mm_cmul_round_sch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -19221,7 +19447,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cmul_round_sch() { + fn test_mm_mask_cmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -19233,7 +19459,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cmul_round_sch() { + fn test_mm_maskz_cmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = @@ -19243,7 +19469,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fcmul_pch() { + fn test_mm_fcmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, -1.0); let r = _mm_fcmul_pch(a, b); @@ -19252,7 +19478,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fcmul_pch() { + fn test_mm_mask_fcmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, -1.0); let src = _mm_setr_ph(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); @@ -19262,7 +19488,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fcmul_pch() { + fn test_mm_maskz_fcmul_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, -1.0); let r = _mm_maskz_fcmul_pch(0b0101, a, b); @@ -19271,7 +19497,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fcmul_pch() { + fn test_mm256_fcmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, -1.0); let r = _mm256_fcmul_pch(a, b); @@ -19280,7 +19506,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fcmul_pch() { + fn test_mm256_mask_fcmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, -1.0); let src = _mm256_setr_ph( @@ -19294,7 +19520,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fcmul_pch() { + fn test_mm256_maskz_fcmul_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, -1.0); let r = _mm256_maskz_fcmul_pch(0b01010101, a, b); @@ -19305,7 +19531,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fcmul_pch() { + fn test_mm512_fcmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_fcmul_pch(a, b); @@ -19314,7 +19540,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fcmul_pch() { + fn test_mm512_mask_fcmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let src = _mm512_setr_ph( @@ -19332,7 +19558,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fcmul_pch() { + fn test_mm512_maskz_fcmul_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_maskz_fcmul_pch(0b0101010101010101, a, b); @@ -19344,7 +19570,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fcmul_round_pch() { + fn test_mm512_fcmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_fcmul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -19353,7 +19579,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fcmul_round_pch() { + fn test_mm512_mask_fcmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let src = _mm512_setr_ph( @@ -19376,7 +19602,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fcmul_round_pch() { + fn test_mm512_maskz_fcmul_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, -1.0); let r = _mm512_maskz_fcmul_round_pch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -19392,7 +19618,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fcmul_sch() { + fn test_mm_fcmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = _mm_fcmul_sch(a, b); @@ -19401,7 +19627,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fcmul_sch() { + fn test_mm_mask_fcmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -19411,7 +19637,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fcmul_sch() { + fn test_mm_maskz_fcmul_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = _mm_maskz_fcmul_sch(0, a, b); @@ -19420,7 +19646,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fcmul_round_sch() { + fn test_mm_fcmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = _mm_fcmul_round_sch::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -19429,7 +19655,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fcmul_round_sch() { + fn test_mm_mask_fcmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let src = _mm_setr_ph(14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0); @@ -19441,7 +19667,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fcmul_round_sch() { + fn test_mm_maskz_fcmul_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, -1.0, 8.0, -9.0, 10.0, -11.0, 12.0, -13.0); let r = @@ -19451,7 +19677,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_abs_ph() { + const fn test_mm_abs_ph() { let a = _mm_set_ph(-1.0, 0.0, 1.0, -2.0, 3.0, -4.0, 5.0, -6.0); let r = _mm_abs_ph(a); let e = _mm_set_ph(1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0); @@ -19459,7 +19685,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_abs_ph() { + const fn test_mm256_abs_ph() { let a = _mm256_set_ph( -1.0, 0.0, 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0, 9.0, -10.0, 11.0, -12.0, 13.0, -14.0, @@ -19472,7 +19698,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_abs_ph() { + const fn test_mm512_abs_ph() { let a = _mm512_set_ph( -1.0, 0.0, 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0, 9.0, -10.0, 11.0, -12.0, 13.0, -14.0, 15.0, -16.0, 17.0, -18.0, 19.0, -20.0, 21.0, -22.0, 23.0, -24.0, 25.0, -26.0, @@ -19488,7 +19714,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_conj_pch() { + const fn test_mm_conj_pch() { let a = _mm_set1_pch(0.0, 1.0); let r = _mm_conj_pch(a); let e = _mm_set1_pch(0.0, -1.0); @@ -19496,7 +19722,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_conj_pch() { + const fn test_mm_mask_conj_pch() { let a = _mm_set1_pch(0.0, 1.0); let src = _mm_setr_ph(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); let r = _mm_mask_conj_pch(src, 0b0101, a); @@ -19505,7 +19731,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_conj_pch() { + const fn test_mm_maskz_conj_pch() { let a = _mm_set1_pch(0.0, 1.0); let r = _mm_maskz_conj_pch(0b0101, a); let e = _mm_setr_ph(0.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0); @@ -19513,7 +19739,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_conj_pch() { + const fn test_mm256_conj_pch() { let a = _mm256_set1_pch(0.0, 1.0); let r = _mm256_conj_pch(a); let e = _mm256_set1_pch(0.0, -1.0); @@ -19521,7 +19747,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_conj_pch() { + const fn test_mm256_mask_conj_pch() { let a = _mm256_set1_pch(0.0, 1.0); let src = _mm256_setr_ph( 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, @@ -19534,7 +19760,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_conj_pch() { + const fn test_mm256_maskz_conj_pch() { let a = _mm256_set1_pch(0.0, 1.0); let r = _mm256_maskz_conj_pch(0b01010101, a); let e = _mm256_setr_ph( @@ -19544,7 +19770,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_conj_pch() { + const fn test_mm512_conj_pch() { let a = _mm512_set1_pch(0.0, 1.0); let r = _mm512_conj_pch(a); let e = _mm512_set1_pch(0.0, -1.0); @@ -19552,7 +19778,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_conj_pch() { + const fn test_mm512_mask_conj_pch() { let a = _mm512_set1_pch(0.0, 1.0); let src = _mm512_setr_ph( 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, @@ -19569,7 +19795,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_conj_pch() { + const fn test_mm512_maskz_conj_pch() { let a = _mm512_set1_pch(0.0, 1.0); let r = _mm512_maskz_conj_pch(0b0101010101010101, a); let e = _mm512_setr_ph( @@ -19580,7 +19806,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmadd_pch() { + fn test_mm_fmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19590,7 +19816,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmadd_pch() { + fn test_mm_mask_fmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19600,7 +19826,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmadd_pch() { + fn test_mm_mask3_fmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19610,7 +19836,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmadd_pch() { + fn test_mm_maskz_fmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19620,7 +19846,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fmadd_pch() { + fn test_mm256_fmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19630,7 +19856,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fmadd_pch() { + fn test_mm256_mask_fmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19642,7 +19868,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fmadd_pch() { + fn test_mm256_mask3_fmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19654,7 +19880,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fmadd_pch() { + fn test_mm256_maskz_fmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19666,7 +19892,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmadd_pch() { + fn test_mm512_fmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19676,7 +19902,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmadd_pch() { + fn test_mm512_mask_fmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19689,7 +19915,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmadd_pch() { + fn test_mm512_mask3_fmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19702,7 +19928,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmadd_pch() { + fn test_mm512_maskz_fmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19715,7 +19941,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmadd_round_pch() { + fn test_mm512_fmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19726,7 +19952,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmadd_round_pch() { + fn test_mm512_mask_fmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19744,7 +19970,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmadd_round_pch() { + fn test_mm512_mask3_fmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19762,7 +19988,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmadd_round_pch() { + fn test_mm512_maskz_fmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19780,7 +20006,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmadd_sch() { + fn test_mm_fmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19790,7 +20016,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmadd_sch() { + fn test_mm_mask_fmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19803,7 +20029,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmadd_sch() { + fn test_mm_mask3_fmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19816,7 +20042,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmadd_sch() { + fn test_mm_maskz_fmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19829,7 +20055,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmadd_round_sch() { + fn test_mm_fmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19839,7 +20065,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmadd_round_sch() { + fn test_mm_mask_fmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19856,7 +20082,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmadd_round_sch() { + fn test_mm_mask3_fmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19873,7 +20099,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmadd_round_sch() { + fn test_mm_maskz_fmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -19890,7 +20116,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fcmadd_pch() { + fn test_mm_fcmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19900,7 +20126,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fcmadd_pch() { + fn test_mm_mask_fcmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19910,7 +20136,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fcmadd_pch() { + fn test_mm_mask3_fcmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19920,7 +20146,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fcmadd_pch() { + fn test_mm_maskz_fcmadd_pch() { let a = _mm_set1_pch(0.0, 1.0); let b = _mm_set1_pch(0.0, 2.0); let c = _mm_set1_pch(0.0, 3.0); @@ -19930,7 +20156,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fcmadd_pch() { + fn test_mm256_fcmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19940,7 +20166,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fcmadd_pch() { + fn test_mm256_mask_fcmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19952,7 +20178,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fcmadd_pch() { + fn test_mm256_mask3_fcmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19964,7 +20190,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fcmadd_pch() { + fn test_mm256_maskz_fcmadd_pch() { let a = _mm256_set1_pch(0.0, 1.0); let b = _mm256_set1_pch(0.0, 2.0); let c = _mm256_set1_pch(0.0, 3.0); @@ -19976,7 +20202,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fcmadd_pch() { + fn test_mm512_fcmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19986,7 +20212,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fcmadd_pch() { + fn test_mm512_mask_fcmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -19999,7 +20225,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fcmadd_pch() { + fn test_mm512_mask3_fcmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -20012,7 +20238,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fcmadd_pch() { + fn test_mm512_maskz_fcmadd_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -20025,7 +20251,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fcmadd_round_pch() { + fn test_mm512_fcmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -20036,7 +20262,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fcmadd_round_pch() { + fn test_mm512_mask_fcmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -20054,7 +20280,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fcmadd_round_pch() { + fn test_mm512_mask3_fcmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -20072,7 +20298,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fcmadd_round_pch() { + fn test_mm512_maskz_fcmadd_round_pch() { let a = _mm512_set1_pch(0.0, 1.0); let b = _mm512_set1_pch(0.0, 2.0); let c = _mm512_set1_pch(0.0, 3.0); @@ -20090,7 +20316,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fcmadd_sch() { + fn test_mm_fcmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20100,7 +20326,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fcmadd_sch() { + fn test_mm_mask_fcmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20113,7 +20339,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fcmadd_sch() { + fn test_mm_mask3_fcmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20126,7 +20352,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fcmadd_sch() { + fn test_mm_maskz_fcmadd_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20139,7 +20365,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fcmadd_round_sch() { + fn test_mm_fcmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20149,7 +20375,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fcmadd_round_sch() { + fn test_mm_mask_fcmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20166,7 +20392,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fcmadd_round_sch() { + fn test_mm_mask3_fcmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20183,7 +20409,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fcmadd_round_sch() { + fn test_mm_maskz_fcmadd_round_sch() { let a = _mm_setr_ph(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); let b = _mm_setr_ph(0.0, 2.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0); let c = _mm_setr_ph(0.0, 3.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0); @@ -20200,7 +20426,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmadd_ph() { + const fn test_mm_fmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20210,7 +20436,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmadd_ph() { + const fn test_mm_mask_fmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20220,7 +20446,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmadd_ph() { + const fn test_mm_mask3_fmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20230,7 +20456,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmadd_ph() { + const fn test_mm_maskz_fmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20240,7 +20466,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fmadd_ph() { + const fn test_mm256_fmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20250,7 +20476,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fmadd_ph() { + const fn test_mm256_mask_fmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20262,7 +20488,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fmadd_ph() { + const fn test_mm256_mask3_fmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20274,7 +20500,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fmadd_ph() { + const fn test_mm256_maskz_fmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20286,7 +20512,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmadd_ph() { + const fn test_mm512_fmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20296,7 +20522,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmadd_ph() { + const fn test_mm512_mask_fmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20309,7 +20535,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmadd_ph() { + const fn test_mm512_mask3_fmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20322,7 +20548,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmadd_ph() { + const fn test_mm512_maskz_fmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20335,7 +20561,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmadd_round_ph() { + fn test_mm512_fmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20345,7 +20571,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmadd_round_ph() { + fn test_mm512_mask_fmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20363,7 +20589,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmadd_round_ph() { + fn test_mm512_mask3_fmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20381,7 +20607,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmadd_round_ph() { + fn test_mm512_maskz_fmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20399,7 +20625,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmadd_sh() { + const fn test_mm_fmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20409,7 +20635,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmadd_sh() { + const fn test_mm_mask_fmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20422,7 +20648,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmadd_sh() { + const fn test_mm_mask3_fmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20435,7 +20661,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmadd_sh() { + const fn test_mm_maskz_fmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20448,7 +20674,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmadd_round_sh() { + fn test_mm_fmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20458,7 +20684,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmadd_round_sh() { + fn test_mm_mask_fmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20475,7 +20701,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmadd_round_sh() { + fn test_mm_mask3_fmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20492,7 +20718,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmadd_round_sh() { + fn test_mm_maskz_fmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20509,7 +20735,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmsub_ph() { + const fn test_mm_fmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20519,7 +20745,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmsub_ph() { + const fn test_mm_mask_fmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20529,7 +20755,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmsub_ph() { + const fn test_mm_mask3_fmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20539,7 +20765,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmsub_ph() { + const fn test_mm_maskz_fmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20549,7 +20775,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fmsub_ph() { + const fn test_mm256_fmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20559,7 +20785,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fmsub_ph() { + const fn test_mm256_mask_fmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20571,7 +20797,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fmsub_ph() { + const fn test_mm256_mask3_fmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20583,7 +20809,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fmsub_ph() { + const fn test_mm256_maskz_fmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20595,7 +20821,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmsub_ph() { + const fn test_mm512_fmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20605,7 +20831,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmsub_ph() { + const fn test_mm512_mask_fmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20618,7 +20844,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmsub_ph() { + const fn test_mm512_mask3_fmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20631,7 +20857,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmsub_ph() { + const fn test_mm512_maskz_fmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20644,7 +20870,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmsub_round_ph() { + fn test_mm512_fmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20654,7 +20880,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmsub_round_ph() { + fn test_mm512_mask_fmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20672,7 +20898,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmsub_round_ph() { + fn test_mm512_mask3_fmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20690,7 +20916,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmsub_round_ph() { + fn test_mm512_maskz_fmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20708,7 +20934,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmsub_sh() { + const fn test_mm_fmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20718,7 +20944,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmsub_sh() { + const fn test_mm_mask_fmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20731,7 +20957,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmsub_sh() { + const fn test_mm_mask3_fmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20744,7 +20970,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmsub_sh() { + const fn test_mm_maskz_fmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20757,7 +20983,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmsub_round_sh() { + fn test_mm_fmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20767,7 +20993,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmsub_round_sh() { + fn test_mm_mask_fmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20784,7 +21010,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmsub_round_sh() { + fn test_mm_mask3_fmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20801,7 +21027,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmsub_round_sh() { + fn test_mm_maskz_fmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -20818,7 +21044,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fnmadd_ph() { + const fn test_mm_fnmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20828,7 +21054,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fnmadd_ph() { + const fn test_mm_mask_fnmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20838,7 +21064,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fnmadd_ph() { + const fn test_mm_mask3_fnmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20848,7 +21074,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fnmadd_ph() { + const fn test_mm_maskz_fnmadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -20858,7 +21084,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fnmadd_ph() { + const fn test_mm256_fnmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20868,7 +21094,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fnmadd_ph() { + const fn test_mm256_mask_fnmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20880,7 +21106,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fnmadd_ph() { + const fn test_mm256_mask3_fnmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20892,7 +21118,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fnmadd_ph() { + const fn test_mm256_maskz_fnmadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -20904,7 +21130,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fnmadd_ph() { + const fn test_mm512_fnmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20914,7 +21140,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fnmadd_ph() { + const fn test_mm512_mask_fnmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20927,7 +21153,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fnmadd_ph() { + const fn test_mm512_mask3_fnmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20940,7 +21166,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fnmadd_ph() { + const fn test_mm512_maskz_fnmadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20953,7 +21179,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fnmadd_round_ph() { + fn test_mm512_fnmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20964,7 +21190,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fnmadd_round_ph() { + fn test_mm512_mask_fnmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -20982,7 +21208,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fnmadd_round_ph() { + fn test_mm512_mask3_fnmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21000,7 +21226,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fnmadd_round_ph() { + fn test_mm512_maskz_fnmadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21018,7 +21244,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fnmadd_sh() { + const fn test_mm_fnmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21028,7 +21254,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fnmadd_sh() { + const fn test_mm_mask_fnmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21041,7 +21267,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fnmadd_sh() { + const fn test_mm_mask3_fnmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21054,7 +21280,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fnmadd_sh() { + const fn test_mm_maskz_fnmadd_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21067,7 +21293,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fnmadd_round_sh() { + fn test_mm_fnmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21077,7 +21303,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fnmadd_round_sh() { + fn test_mm_mask_fnmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21094,7 +21320,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fnmadd_round_sh() { + fn test_mm_mask3_fnmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21111,7 +21337,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fnmadd_round_sh() { + fn test_mm_maskz_fnmadd_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21128,7 +21354,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fnmsub_ph() { + const fn test_mm_fnmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21138,7 +21364,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fnmsub_ph() { + const fn test_mm_mask_fnmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21148,7 +21374,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fnmsub_ph() { + const fn test_mm_mask3_fnmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21158,7 +21384,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fnmsub_ph() { + const fn test_mm_maskz_fnmsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21168,7 +21394,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fnmsub_ph() { + const fn test_mm256_fnmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21178,7 +21404,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fnmsub_ph() { + const fn test_mm256_mask_fnmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21190,7 +21416,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fnmsub_ph() { + const fn test_mm256_mask3_fnmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21202,7 +21428,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fnmsub_ph() { + const fn test_mm256_maskz_fnmsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21214,7 +21440,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fnmsub_ph() { + const fn test_mm512_fnmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21224,7 +21450,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fnmsub_ph() { + const fn test_mm512_mask_fnmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21237,7 +21463,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fnmsub_ph() { + const fn test_mm512_mask3_fnmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21250,7 +21476,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fnmsub_ph() { + const fn test_mm512_maskz_fnmsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21263,7 +21489,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fnmsub_round_ph() { + fn test_mm512_fnmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21274,7 +21500,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fnmsub_round_ph() { + fn test_mm512_mask_fnmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21292,7 +21518,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fnmsub_round_ph() { + fn test_mm512_mask3_fnmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21310,7 +21536,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fnmsub_round_ph() { + fn test_mm512_maskz_fnmsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21328,7 +21554,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fnmsub_sh() { + const fn test_mm_fnmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21338,7 +21564,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fnmsub_sh() { + const fn test_mm_mask_fnmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21351,7 +21577,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fnmsub_sh() { + const fn test_mm_mask3_fnmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21364,7 +21590,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fnmsub_sh() { + const fn test_mm_maskz_fnmsub_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21377,7 +21603,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fnmsub_round_sh() { + fn test_mm_fnmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21387,7 +21613,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fnmsub_round_sh() { + fn test_mm_mask_fnmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21404,7 +21630,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fnmsub_round_sh() { + fn test_mm_mask3_fnmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21421,7 +21647,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fnmsub_round_sh() { + fn test_mm_maskz_fnmsub_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(2.0, 20., 21., 22., 23., 24., 25., 26.); let c = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -21438,7 +21664,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmaddsub_ph() { + const fn test_mm_fmaddsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21448,7 +21674,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmaddsub_ph() { + const fn test_mm_mask_fmaddsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21458,7 +21684,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmaddsub_ph() { + const fn test_mm_mask3_fmaddsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21468,7 +21694,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmaddsub_ph() { + const fn test_mm_maskz_fmaddsub_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21478,7 +21704,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fmaddsub_ph() { + const fn test_mm256_fmaddsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21490,7 +21716,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fmaddsub_ph() { + const fn test_mm256_mask_fmaddsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21502,7 +21728,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fmaddsub_ph() { + const fn test_mm256_mask3_fmaddsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21514,7 +21740,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fmaddsub_ph() { + const fn test_mm256_maskz_fmaddsub_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21526,7 +21752,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmaddsub_ph() { + const fn test_mm512_fmaddsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21539,7 +21765,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmaddsub_ph() { + const fn test_mm512_mask_fmaddsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21552,7 +21778,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmaddsub_ph() { + const fn test_mm512_mask3_fmaddsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21565,7 +21791,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmaddsub_ph() { + const fn test_mm512_maskz_fmaddsub_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21578,7 +21804,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmaddsub_round_ph() { + fn test_mm512_fmaddsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21592,7 +21818,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmaddsub_round_ph() { + fn test_mm512_mask_fmaddsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21610,7 +21836,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmaddsub_round_ph() { + fn test_mm512_mask3_fmaddsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21628,7 +21854,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmaddsub_round_ph() { + fn test_mm512_maskz_fmaddsub_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21646,7 +21872,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fmsubadd_ph() { + const fn test_mm_fmsubadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21656,7 +21882,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fmsubadd_ph() { + const fn test_mm_mask_fmsubadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21666,7 +21892,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask3_fmsubadd_ph() { + const fn test_mm_mask3_fmsubadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21676,7 +21902,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_fmsubadd_ph() { + const fn test_mm_maskz_fmsubadd_ph() { let a = _mm_set1_ph(1.0); let b = _mm_set1_ph(2.0); let c = _mm_set1_ph(3.0); @@ -21686,7 +21912,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fmsubadd_ph() { + const fn test_mm256_fmsubadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21698,7 +21924,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fmsubadd_ph() { + const fn test_mm256_mask_fmsubadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21710,7 +21936,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask3_fmsubadd_ph() { + const fn test_mm256_mask3_fmsubadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21722,7 +21948,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_fmsubadd_ph() { + const fn test_mm256_maskz_fmsubadd_ph() { let a = _mm256_set1_ph(1.0); let b = _mm256_set1_ph(2.0); let c = _mm256_set1_ph(3.0); @@ -21734,7 +21960,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmsubadd_ph() { + const fn test_mm512_fmsubadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21747,7 +21973,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmsubadd_ph() { + const fn test_mm512_mask_fmsubadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21760,7 +21986,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmsubadd_ph() { + const fn test_mm512_mask3_fmsubadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21773,7 +21999,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmsubadd_ph() { + const fn test_mm512_maskz_fmsubadd_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21786,7 +22012,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fmsubadd_round_ph() { + fn test_mm512_fmsubadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21800,7 +22026,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fmsubadd_round_ph() { + fn test_mm512_mask_fmsubadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21818,7 +22044,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask3_fmsubadd_round_ph() { + fn test_mm512_mask3_fmsubadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21836,7 +22062,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_fmsubadd_round_ph() { + fn test_mm512_maskz_fmsubadd_round_ph() { let a = _mm512_set1_ph(1.0); let b = _mm512_set1_ph(2.0); let c = _mm512_set1_ph(3.0); @@ -21854,7 +22080,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_rcp_ph() { + fn test_mm_rcp_ph() { let a = _mm_set1_ph(2.0); let r = _mm_rcp_ph(a); let e = _mm_set1_ph(0.5); @@ -21862,7 +22088,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_rcp_ph() { + fn test_mm_mask_rcp_ph() { let a = _mm_set1_ph(2.0); let src = _mm_set1_ph(1.0); let r = _mm_mask_rcp_ph(src, 0b01010101, a); @@ -21871,7 +22097,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_rcp_ph() { + fn test_mm_maskz_rcp_ph() { let a = _mm_set1_ph(2.0); let r = _mm_maskz_rcp_ph(0b01010101, a); let e = _mm_set_ph(0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5); @@ -21879,7 +22105,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_rcp_ph() { + fn test_mm256_rcp_ph() { let a = _mm256_set1_ph(2.0); let r = _mm256_rcp_ph(a); let e = _mm256_set1_ph(0.5); @@ -21887,7 +22113,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_rcp_ph() { + fn test_mm256_mask_rcp_ph() { let a = _mm256_set1_ph(2.0); let src = _mm256_set1_ph(1.0); let r = _mm256_mask_rcp_ph(src, 0b0101010101010101, a); @@ -21898,7 +22124,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_rcp_ph() { + fn test_mm256_maskz_rcp_ph() { let a = _mm256_set1_ph(2.0); let r = _mm256_maskz_rcp_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -21908,7 +22134,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_rcp_ph() { + fn test_mm512_rcp_ph() { let a = _mm512_set1_ph(2.0); let r = _mm512_rcp_ph(a); let e = _mm512_set1_ph(0.5); @@ -21916,7 +22142,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_rcp_ph() { + fn test_mm512_mask_rcp_ph() { let a = _mm512_set1_ph(2.0); let src = _mm512_set1_ph(1.0); let r = _mm512_mask_rcp_ph(src, 0b01010101010101010101010101010101, a); @@ -21928,7 +22154,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_rcp_ph() { + fn test_mm512_maskz_rcp_ph() { let a = _mm512_set1_ph(2.0); let r = _mm512_maskz_rcp_ph(0b01010101010101010101010101010101, a); let e = _mm512_set_ph( @@ -21939,7 +22165,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_rcp_sh() { + fn test_mm_rcp_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_rcp_sh(a, b); @@ -21948,7 +22174,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_rcp_sh() { + fn test_mm_mask_rcp_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -21961,7 +22187,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_rcp_sh() { + fn test_mm_maskz_rcp_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_maskz_rcp_sh(0, a, b); @@ -21973,7 +22199,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_rsqrt_ph() { + fn test_mm_rsqrt_ph() { let a = _mm_set1_ph(4.0); let r = _mm_rsqrt_ph(a); let e = _mm_set1_ph(0.5); @@ -21981,7 +22207,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_rsqrt_ph() { + fn test_mm_mask_rsqrt_ph() { let a = _mm_set1_ph(4.0); let src = _mm_set1_ph(1.0); let r = _mm_mask_rsqrt_ph(src, 0b01010101, a); @@ -21990,7 +22216,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_rsqrt_ph() { + fn test_mm_maskz_rsqrt_ph() { let a = _mm_set1_ph(4.0); let r = _mm_maskz_rsqrt_ph(0b01010101, a); let e = _mm_set_ph(0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5); @@ -21998,7 +22224,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_rsqrt_ph() { + fn test_mm256_rsqrt_ph() { let a = _mm256_set1_ph(4.0); let r = _mm256_rsqrt_ph(a); let e = _mm256_set1_ph(0.5); @@ -22006,7 +22232,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_rsqrt_ph() { + fn test_mm256_mask_rsqrt_ph() { let a = _mm256_set1_ph(4.0); let src = _mm256_set1_ph(1.0); let r = _mm256_mask_rsqrt_ph(src, 0b0101010101010101, a); @@ -22017,7 +22243,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_rsqrt_ph() { + fn test_mm256_maskz_rsqrt_ph() { let a = _mm256_set1_ph(4.0); let r = _mm256_maskz_rsqrt_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -22027,7 +22253,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_rsqrt_ph() { + fn test_mm512_rsqrt_ph() { let a = _mm512_set1_ph(4.0); let r = _mm512_rsqrt_ph(a); let e = _mm512_set1_ph(0.5); @@ -22035,7 +22261,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_rsqrt_ph() { + fn test_mm512_mask_rsqrt_ph() { let a = _mm512_set1_ph(4.0); let src = _mm512_set1_ph(1.0); let r = _mm512_mask_rsqrt_ph(src, 0b01010101010101010101010101010101, a); @@ -22047,7 +22273,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_rsqrt_ph() { + fn test_mm512_maskz_rsqrt_ph() { let a = _mm512_set1_ph(4.0); let r = _mm512_maskz_rsqrt_ph(0b01010101010101010101010101010101, a); let e = _mm512_set_ph( @@ -22058,7 +22284,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_rsqrt_sh() { + fn test_mm_rsqrt_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let r = _mm_rsqrt_sh(a, b); @@ -22067,7 +22293,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_rsqrt_sh() { + fn test_mm_mask_rsqrt_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22080,7 +22306,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_rsqrt_sh() { + fn test_mm_maskz_rsqrt_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let r = _mm_maskz_rsqrt_sh(0, a, b); @@ -22092,7 +22318,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_sqrt_ph() { + fn test_mm_sqrt_ph() { let a = _mm_set1_ph(4.0); let r = _mm_sqrt_ph(a); let e = _mm_set1_ph(2.0); @@ -22100,7 +22326,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_sqrt_ph() { + fn test_mm_mask_sqrt_ph() { let a = _mm_set1_ph(4.0); let src = _mm_set1_ph(1.0); let r = _mm_mask_sqrt_ph(src, 0b01010101, a); @@ -22109,7 +22335,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_sqrt_ph() { + fn test_mm_maskz_sqrt_ph() { let a = _mm_set1_ph(4.0); let r = _mm_maskz_sqrt_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2.0, 0.0, 2.0, 0.0, 2.0, 0.0, 2.0); @@ -22117,7 +22343,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_sqrt_ph() { + fn test_mm256_sqrt_ph() { let a = _mm256_set1_ph(4.0); let r = _mm256_sqrt_ph(a); let e = _mm256_set1_ph(2.0); @@ -22125,7 +22351,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_sqrt_ph() { + fn test_mm256_mask_sqrt_ph() { let a = _mm256_set1_ph(4.0); let src = _mm256_set1_ph(1.0); let r = _mm256_mask_sqrt_ph(src, 0b0101010101010101, a); @@ -22136,7 +22362,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_sqrt_ph() { + fn test_mm256_maskz_sqrt_ph() { let a = _mm256_set1_ph(4.0); let r = _mm256_maskz_sqrt_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -22146,7 +22372,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_sqrt_ph() { + fn test_mm512_sqrt_ph() { let a = _mm512_set1_ph(4.0); let r = _mm512_sqrt_ph(a); let e = _mm512_set1_ph(2.0); @@ -22154,7 +22380,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_sqrt_ph() { + fn test_mm512_mask_sqrt_ph() { let a = _mm512_set1_ph(4.0); let src = _mm512_set1_ph(1.0); let r = _mm512_mask_sqrt_ph(src, 0b01010101010101010101010101010101, a); @@ -22166,7 +22392,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_sqrt_ph() { + fn test_mm512_maskz_sqrt_ph() { let a = _mm512_set1_ph(4.0); let r = _mm512_maskz_sqrt_ph(0b01010101010101010101010101010101, a); let e = _mm512_set_ph( @@ -22177,7 +22403,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_sqrt_round_ph() { + fn test_mm512_sqrt_round_ph() { let a = _mm512_set1_ph(4.0); let r = _mm512_sqrt_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set1_ph(2.0); @@ -22185,7 +22411,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_sqrt_round_ph() { + fn test_mm512_mask_sqrt_round_ph() { let a = _mm512_set1_ph(4.0); let src = _mm512_set1_ph(1.0); let r = _mm512_mask_sqrt_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -22201,7 +22427,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_sqrt_round_ph() { + fn test_mm512_maskz_sqrt_round_ph() { let a = _mm512_set1_ph(4.0); let r = _mm512_maskz_sqrt_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01010101010101010101010101010101, @@ -22215,7 +22441,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_sqrt_sh() { + fn test_mm_sqrt_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let r = _mm_sqrt_sh(a, b); @@ -22224,7 +22450,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_sqrt_sh() { + fn test_mm_mask_sqrt_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22237,7 +22463,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_sqrt_sh() { + fn test_mm_maskz_sqrt_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let r = _mm_maskz_sqrt_sh(0, a, b); @@ -22249,7 +22475,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_sqrt_round_sh() { + fn test_mm_sqrt_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let r = _mm_sqrt_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -22258,7 +22484,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_sqrt_round_sh() { + fn test_mm_mask_sqrt_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22275,7 +22501,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_sqrt_round_sh() { + fn test_mm_maskz_sqrt_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(4.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0); let r = @@ -22289,7 +22515,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_max_ph() { + fn test_mm_max_ph() { let a = _mm_set1_ph(2.0); let b = _mm_set1_ph(1.0); let r = _mm_max_ph(a, b); @@ -22298,7 +22524,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_max_ph() { + fn test_mm_mask_max_ph() { let a = _mm_set1_ph(2.0); let b = _mm_set1_ph(1.0); let src = _mm_set1_ph(3.0); @@ -22308,7 +22534,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_max_ph() { + fn test_mm_maskz_max_ph() { let a = _mm_set1_ph(2.0); let b = _mm_set1_ph(1.0); let r = _mm_maskz_max_ph(0b01010101, a, b); @@ -22317,7 +22543,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_max_ph() { + fn test_mm256_max_ph() { let a = _mm256_set1_ph(2.0); let b = _mm256_set1_ph(1.0); let r = _mm256_max_ph(a, b); @@ -22326,7 +22552,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_max_ph() { + fn test_mm256_mask_max_ph() { let a = _mm256_set1_ph(2.0); let b = _mm256_set1_ph(1.0); let src = _mm256_set1_ph(3.0); @@ -22338,7 +22564,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_max_ph() { + fn test_mm256_maskz_max_ph() { let a = _mm256_set1_ph(2.0); let b = _mm256_set1_ph(1.0); let r = _mm256_maskz_max_ph(0b0101010101010101, a, b); @@ -22349,7 +22575,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_max_ph() { + fn test_mm512_max_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_max_ph(a, b); @@ -22358,7 +22584,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_max_ph() { + fn test_mm512_mask_max_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let src = _mm512_set1_ph(3.0); @@ -22371,7 +22597,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_max_ph() { + fn test_mm512_maskz_max_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_maskz_max_ph(0b01010101010101010101010101010101, a, b); @@ -22383,7 +22609,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_max_round_ph() { + fn test_mm512_max_round_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_max_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -22392,7 +22618,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_max_round_ph() { + fn test_mm512_mask_max_round_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let src = _mm512_set1_ph(3.0); @@ -22410,7 +22636,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_max_round_ph() { + fn test_mm512_maskz_max_round_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_maskz_max_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -22426,7 +22652,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_max_sh() { + fn test_mm_max_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_max_sh(a, b); @@ -22435,7 +22661,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_max_sh() { + fn test_mm_mask_max_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22448,7 +22674,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_max_sh() { + fn test_mm_maskz_max_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_maskz_max_sh(0, a, b); @@ -22460,7 +22686,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_max_round_sh() { + fn test_mm_max_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_max_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -22469,7 +22695,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_max_round_sh() { + fn test_mm_mask_max_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22486,7 +22712,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_max_round_sh() { + fn test_mm_maskz_max_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = @@ -22500,7 +22726,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_min_ph() { + fn test_mm_min_ph() { let a = _mm_set1_ph(2.0); let b = _mm_set1_ph(1.0); let r = _mm_min_ph(a, b); @@ -22509,7 +22735,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_min_ph() { + fn test_mm_mask_min_ph() { let a = _mm_set1_ph(2.0); let b = _mm_set1_ph(1.0); let src = _mm_set1_ph(3.0); @@ -22519,7 +22745,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_min_ph() { + fn test_mm_maskz_min_ph() { let a = _mm_set1_ph(2.0); let b = _mm_set1_ph(1.0); let r = _mm_maskz_min_ph(0b01010101, a, b); @@ -22528,7 +22754,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_min_ph() { + fn test_mm256_min_ph() { let a = _mm256_set1_ph(2.0); let b = _mm256_set1_ph(1.0); let r = _mm256_min_ph(a, b); @@ -22537,7 +22763,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_min_ph() { + fn test_mm256_mask_min_ph() { let a = _mm256_set1_ph(2.0); let b = _mm256_set1_ph(1.0); let src = _mm256_set1_ph(3.0); @@ -22549,7 +22775,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_min_ph() { + fn test_mm256_maskz_min_ph() { let a = _mm256_set1_ph(2.0); let b = _mm256_set1_ph(1.0); let r = _mm256_maskz_min_ph(0b0101010101010101, a, b); @@ -22560,7 +22786,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_min_ph() { + fn test_mm512_min_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_min_ph(a, b); @@ -22569,7 +22795,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_min_ph() { + fn test_mm512_mask_min_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let src = _mm512_set1_ph(3.0); @@ -22582,7 +22808,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_min_ph() { + fn test_mm512_maskz_min_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_maskz_min_ph(0b01010101010101010101010101010101, a, b); @@ -22594,7 +22820,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_min_round_ph() { + fn test_mm512_min_round_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_min_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -22603,7 +22829,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_min_round_ph() { + fn test_mm512_mask_min_round_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let src = _mm512_set1_ph(3.0); @@ -22621,7 +22847,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_min_round_ph() { + fn test_mm512_maskz_min_round_ph() { let a = _mm512_set1_ph(2.0); let b = _mm512_set1_ph(1.0); let r = _mm512_maskz_min_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -22637,7 +22863,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_min_sh() { + fn test_mm_min_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_min_sh(a, b); @@ -22646,7 +22872,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_min_sh() { + fn test_mm_mask_min_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22659,7 +22885,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_min_sh() { + fn test_mm_maskz_min_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_maskz_min_sh(0, a, b); @@ -22671,7 +22897,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_min_round_sh() { + fn test_mm_min_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = _mm_min_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -22680,7 +22906,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_min_round_sh() { + fn test_mm_mask_min_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let src = _mm_setr_ph(3.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0); @@ -22697,7 +22923,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_min_round_sh() { + fn test_mm_maskz_min_round_sh() { let a = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let b = _mm_setr_ph(2.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0); let r = @@ -22711,7 +22937,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_getexp_ph() { + fn test_mm_getexp_ph() { let a = _mm_set1_ph(3.0); let r = _mm_getexp_ph(a); let e = _mm_set1_ph(1.0); @@ -22719,7 +22945,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_getexp_ph() { + fn test_mm_mask_getexp_ph() { let a = _mm_set1_ph(3.0); let src = _mm_set1_ph(4.0); let r = _mm_mask_getexp_ph(src, 0b01010101, a); @@ -22728,7 +22954,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_getexp_ph() { + fn test_mm_maskz_getexp_ph() { let a = _mm_set1_ph(3.0); let r = _mm_maskz_getexp_ph(0b01010101, a); let e = _mm_set_ph(0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0); @@ -22736,7 +22962,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_getexp_ph() { + fn test_mm256_getexp_ph() { let a = _mm256_set1_ph(3.0); let r = _mm256_getexp_ph(a); let e = _mm256_set1_ph(1.0); @@ -22744,7 +22970,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_getexp_ph() { + fn test_mm256_mask_getexp_ph() { let a = _mm256_set1_ph(3.0); let src = _mm256_set1_ph(4.0); let r = _mm256_mask_getexp_ph(src, 0b0101010101010101, a); @@ -22755,7 +22981,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_getexp_ph() { + fn test_mm256_maskz_getexp_ph() { let a = _mm256_set1_ph(3.0); let r = _mm256_maskz_getexp_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -22765,7 +22991,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_getexp_ph() { + fn test_mm512_getexp_ph() { let a = _mm512_set1_ph(3.0); let r = _mm512_getexp_ph(a); let e = _mm512_set1_ph(1.0); @@ -22773,7 +22999,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_getexp_ph() { + fn test_mm512_mask_getexp_ph() { let a = _mm512_set1_ph(3.0); let src = _mm512_set1_ph(4.0); let r = _mm512_mask_getexp_ph(src, 0b01010101010101010101010101010101, a); @@ -22785,7 +23011,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_getexp_ph() { + fn test_mm512_maskz_getexp_ph() { let a = _mm512_set1_ph(3.0); let r = _mm512_maskz_getexp_ph(0b01010101010101010101010101010101, a); let e = _mm512_set_ph( @@ -22796,7 +23022,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_getexp_round_ph() { + fn test_mm512_getexp_round_ph() { let a = _mm512_set1_ph(3.0); let r = _mm512_getexp_round_ph::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set1_ph(1.0); @@ -22804,7 +23030,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_getexp_round_ph() { + fn test_mm512_mask_getexp_round_ph() { let a = _mm512_set1_ph(3.0); let src = _mm512_set1_ph(4.0); let r = _mm512_mask_getexp_round_ph::<_MM_FROUND_NO_EXC>( @@ -22820,7 +23046,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_getexp_round_ph() { + fn test_mm512_maskz_getexp_round_ph() { let a = _mm512_set1_ph(3.0); let r = _mm512_maskz_getexp_round_ph::<_MM_FROUND_NO_EXC>( 0b01010101010101010101010101010101, @@ -22834,7 +23060,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_getexp_sh() { + fn test_mm_getexp_sh() { let a = _mm_setr_ph(4.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_getexp_sh(a, b); @@ -22843,7 +23069,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_getexp_sh() { + fn test_mm_mask_getexp_sh() { let a = _mm_setr_ph(4.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(4.0, 30., 31., 32., 33., 34., 35., 36.); @@ -22856,7 +23082,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_getexp_sh() { + fn test_mm_maskz_getexp_sh() { let a = _mm_setr_ph(4.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_getexp_sh(0, a, b); @@ -22868,7 +23094,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_getexp_round_sh() { + fn test_mm_getexp_round_sh() { let a = _mm_setr_ph(4.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_getexp_round_sh::<_MM_FROUND_NO_EXC>(a, b); @@ -22877,7 +23103,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_getexp_round_sh() { + fn test_mm_mask_getexp_round_sh() { let a = _mm_setr_ph(4.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(4.0, 30., 31., 32., 33., 34., 35., 36.); @@ -22890,7 +23116,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_getexp_round_sh() { + fn test_mm_maskz_getexp_round_sh() { let a = _mm_setr_ph(4.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_getexp_round_sh::<_MM_FROUND_NO_EXC>(0, a, b); @@ -22902,7 +23128,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_getmant_ph() { + fn test_mm_getmant_ph() { let a = _mm_set1_ph(10.0); let r = _mm_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a); let e = _mm_set1_ph(1.25); @@ -22910,7 +23136,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_getmant_ph() { + fn test_mm_mask_getmant_ph() { let a = _mm_set1_ph(10.0); let src = _mm_set1_ph(20.0); let r = _mm_mask_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(src, 0b01010101, a); @@ -22919,7 +23145,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_getmant_ph() { + fn test_mm_maskz_getmant_ph() { let a = _mm_set1_ph(10.0); let r = _mm_maskz_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(0b01010101, a); let e = _mm_set_ph(0.0, 1.25, 0.0, 1.25, 0.0, 1.25, 0.0, 1.25); @@ -22927,7 +23153,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_getmant_ph() { + fn test_mm256_getmant_ph() { let a = _mm256_set1_ph(10.0); let r = _mm256_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a); let e = _mm256_set1_ph(1.25); @@ -22935,7 +23161,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_getmant_ph() { + fn test_mm256_mask_getmant_ph() { let a = _mm256_set1_ph(10.0); let src = _mm256_set1_ph(20.0); let r = _mm256_mask_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>( @@ -22951,7 +23177,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_getmant_ph() { + fn test_mm256_maskz_getmant_ph() { let a = _mm256_set1_ph(10.0); let r = _mm256_maskz_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>( 0b0101010101010101, @@ -22964,7 +23190,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_getmant_ph() { + fn test_mm512_getmant_ph() { let a = _mm512_set1_ph(10.0); let r = _mm512_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a); let e = _mm512_set1_ph(1.25); @@ -22972,7 +23198,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_getmant_ph() { + fn test_mm512_mask_getmant_ph() { let a = _mm512_set1_ph(10.0); let src = _mm512_set1_ph(20.0); let r = _mm512_mask_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>( @@ -22989,7 +23215,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_getmant_ph() { + fn test_mm512_maskz_getmant_ph() { let a = _mm512_set1_ph(10.0); let r = _mm512_maskz_getmant_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>( 0b01010101010101010101010101010101, @@ -23003,7 +23229,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_getmant_round_ph() { + fn test_mm512_getmant_round_ph() { let a = _mm512_set1_ph(10.0); let r = _mm512_getmant_round_ph::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN, _MM_FROUND_NO_EXC>( @@ -23014,7 +23240,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_getmant_round_ph() { + fn test_mm512_mask_getmant_round_ph() { let a = _mm512_set1_ph(10.0); let src = _mm512_set1_ph(20.0); let r = _mm512_mask_getmant_round_ph::< @@ -23031,7 +23257,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_getmant_round_ph() { + fn test_mm512_maskz_getmant_round_ph() { let a = _mm512_set1_ph(10.0); let r = _mm512_maskz_getmant_round_ph::< _MM_MANT_NORM_P75_1P5, @@ -23046,7 +23272,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_getmant_sh() { + fn test_mm_getmant_sh() { let a = _mm_setr_ph(15.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(10.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_getmant_sh::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(a, b); @@ -23055,7 +23281,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_getmant_sh() { + fn test_mm_mask_getmant_sh() { let a = _mm_setr_ph(15.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(10.0, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(20.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23068,7 +23294,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_getmant_sh() { + fn test_mm_maskz_getmant_sh() { let a = _mm_setr_ph(15.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(10.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_getmant_sh::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN>(0, a, b); @@ -23080,7 +23306,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_getmant_round_sh() { + fn test_mm_getmant_round_sh() { let a = _mm_setr_ph(15.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(10.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_getmant_round_sh::<_MM_MANT_NORM_P75_1P5, _MM_MANT_SIGN_NAN, _MM_FROUND_NO_EXC>( @@ -23091,7 +23317,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_getmant_round_sh() { + fn test_mm_mask_getmant_round_sh() { let a = _mm_setr_ph(15.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(10.0, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(20.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23112,7 +23338,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_getmant_round_sh() { + fn test_mm_maskz_getmant_round_sh() { let a = _mm_setr_ph(15.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(10.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_getmant_round_sh::< @@ -23132,7 +23358,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_roundscale_ph() { + fn test_mm_roundscale_ph() { let a = _mm_set1_ph(1.1); let r = _mm_roundscale_ph::<0>(a); let e = _mm_set1_ph(1.0); @@ -23140,7 +23366,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_roundscale_ph() { + fn test_mm_mask_roundscale_ph() { let a = _mm_set1_ph(1.1); let src = _mm_set1_ph(2.0); let r = _mm_mask_roundscale_ph::<0>(src, 0b01010101, a); @@ -23149,7 +23375,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_roundscale_ph() { + fn test_mm_maskz_roundscale_ph() { let a = _mm_set1_ph(1.1); let r = _mm_maskz_roundscale_ph::<0>(0b01010101, a); let e = _mm_set_ph(0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0); @@ -23157,7 +23383,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_roundscale_ph() { + fn test_mm256_roundscale_ph() { let a = _mm256_set1_ph(1.1); let r = _mm256_roundscale_ph::<0>(a); let e = _mm256_set1_ph(1.0); @@ -23165,7 +23391,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_roundscale_ph() { + fn test_mm256_mask_roundscale_ph() { let a = _mm256_set1_ph(1.1); let src = _mm256_set1_ph(2.0); let r = _mm256_mask_roundscale_ph::<0>(src, 0b0101010101010101, a); @@ -23176,7 +23402,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_roundscale_ph() { + fn test_mm256_maskz_roundscale_ph() { let a = _mm256_set1_ph(1.1); let r = _mm256_maskz_roundscale_ph::<0>(0b0101010101010101, a); let e = _mm256_set_ph( @@ -23186,7 +23412,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_roundscale_ph() { + fn test_mm512_roundscale_ph() { let a = _mm512_set1_ph(1.1); let r = _mm512_roundscale_ph::<0>(a); let e = _mm512_set1_ph(1.0); @@ -23194,7 +23420,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_roundscale_ph() { + fn test_mm512_mask_roundscale_ph() { let a = _mm512_set1_ph(1.1); let src = _mm512_set1_ph(2.0); let r = _mm512_mask_roundscale_ph::<0>(src, 0b01010101010101010101010101010101, a); @@ -23206,7 +23432,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_roundscale_ph() { + fn test_mm512_maskz_roundscale_ph() { let a = _mm512_set1_ph(1.1); let r = _mm512_maskz_roundscale_ph::<0>(0b01010101010101010101010101010101, a); let e = _mm512_set_ph( @@ -23217,7 +23443,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_roundscale_round_ph() { + fn test_mm512_roundscale_round_ph() { let a = _mm512_set1_ph(1.1); let r = _mm512_roundscale_round_ph::<0, _MM_FROUND_NO_EXC>(a); let e = _mm512_set1_ph(1.0); @@ -23225,7 +23451,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_roundscale_round_ph() { + fn test_mm512_mask_roundscale_round_ph() { let a = _mm512_set1_ph(1.1); let src = _mm512_set1_ph(2.0); let r = _mm512_mask_roundscale_round_ph::<0, _MM_FROUND_NO_EXC>( @@ -23241,7 +23467,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_roundscale_round_ph() { + fn test_mm512_maskz_roundscale_round_ph() { let a = _mm512_set1_ph(1.1); let r = _mm512_maskz_roundscale_round_ph::<0, _MM_FROUND_NO_EXC>( 0b01010101010101010101010101010101, @@ -23255,7 +23481,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_roundscale_sh() { + fn test_mm_roundscale_sh() { let a = _mm_setr_ph(2.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.1, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_roundscale_sh::<0>(a, b); @@ -23264,7 +23490,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_roundscale_sh() { + fn test_mm_mask_roundscale_sh() { let a = _mm_setr_ph(2.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.1, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23277,7 +23503,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_roundscale_sh() { + fn test_mm_maskz_roundscale_sh() { let a = _mm_setr_ph(2.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.1, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_roundscale_sh::<0>(0, a, b); @@ -23289,7 +23515,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_roundscale_round_sh() { + fn test_mm_roundscale_round_sh() { let a = _mm_setr_ph(2.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.1, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_roundscale_round_sh::<0, _MM_FROUND_NO_EXC>(a, b); @@ -23298,7 +23524,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_roundscale_round_sh() { + fn test_mm_mask_roundscale_round_sh() { let a = _mm_setr_ph(2.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.1, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(3.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23311,7 +23537,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_roundscale_round_sh() { + fn test_mm_maskz_roundscale_round_sh() { let a = _mm_setr_ph(2.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.1, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_roundscale_round_sh::<0, _MM_FROUND_NO_EXC>(0, a, b); @@ -23323,7 +23549,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_scalef_ph() { + fn test_mm_scalef_ph() { let a = _mm_set1_ph(1.); let b = _mm_set1_ph(3.); let r = _mm_scalef_ph(a, b); @@ -23332,7 +23558,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_scalef_ph() { + fn test_mm_mask_scalef_ph() { let a = _mm_set1_ph(1.); let b = _mm_set1_ph(3.); let src = _mm_set1_ph(2.); @@ -23342,7 +23568,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_scalef_ph() { + fn test_mm_maskz_scalef_ph() { let a = _mm_set1_ph(1.); let b = _mm_set1_ph(3.); let r = _mm_maskz_scalef_ph(0b01010101, a, b); @@ -23351,7 +23577,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_scalef_ph() { + fn test_mm256_scalef_ph() { let a = _mm256_set1_ph(1.); let b = _mm256_set1_ph(3.); let r = _mm256_scalef_ph(a, b); @@ -23360,7 +23586,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_scalef_ph() { + fn test_mm256_mask_scalef_ph() { let a = _mm256_set1_ph(1.); let b = _mm256_set1_ph(3.); let src = _mm256_set1_ph(2.); @@ -23372,7 +23598,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_scalef_ph() { + fn test_mm256_maskz_scalef_ph() { let a = _mm256_set1_ph(1.); let b = _mm256_set1_ph(3.); let r = _mm256_maskz_scalef_ph(0b0101010101010101, a, b); @@ -23383,7 +23609,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_scalef_ph() { + fn test_mm512_scalef_ph() { let a = _mm512_set1_ph(1.); let b = _mm512_set1_ph(3.); let r = _mm512_scalef_ph(a, b); @@ -23392,7 +23618,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_scalef_ph() { + fn test_mm512_mask_scalef_ph() { let a = _mm512_set1_ph(1.); let b = _mm512_set1_ph(3.); let src = _mm512_set1_ph(2.); @@ -23405,7 +23631,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_scalef_ph() { + fn test_mm512_maskz_scalef_ph() { let a = _mm512_set1_ph(1.); let b = _mm512_set1_ph(3.); let r = _mm512_maskz_scalef_ph(0b01010101010101010101010101010101, a, b); @@ -23417,7 +23643,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_scalef_round_ph() { + fn test_mm512_scalef_round_ph() { let a = _mm512_set1_ph(1.); let b = _mm512_set1_ph(3.); let r = _mm512_scalef_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -23426,7 +23652,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_scalef_round_ph() { + fn test_mm512_mask_scalef_round_ph() { let a = _mm512_set1_ph(1.); let b = _mm512_set1_ph(3.); let src = _mm512_set1_ph(2.); @@ -23444,7 +23670,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_scalef_round_ph() { + fn test_mm512_maskz_scalef_round_ph() { let a = _mm512_set1_ph(1.); let b = _mm512_set1_ph(3.); let r = _mm512_maskz_scalef_round_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -23460,7 +23686,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_scalef_sh() { + fn test_mm_scalef_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_scalef_sh(a, b); @@ -23469,7 +23695,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_scalef_sh() { + fn test_mm_mask_scalef_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(2.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23482,7 +23708,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_scalef_sh() { + fn test_mm_maskz_scalef_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_scalef_sh(0, a, b); @@ -23494,7 +23720,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_scalef_round_sh() { + fn test_mm_scalef_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_scalef_round_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -23503,7 +23729,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_scalef_round_sh() { + fn test_mm_mask_scalef_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(2.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23520,7 +23746,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_scalef_round_sh() { + fn test_mm_maskz_scalef_round_sh() { let a = _mm_setr_ph(1.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(3.0, 20., 21., 22., 23., 24., 25., 26.); let r = @@ -23534,7 +23760,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_ph() { + fn test_mm_reduce_ph() { let a = _mm_set1_ph(1.25); let r = _mm_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm_set1_ph(0.25); @@ -23542,7 +23768,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_reduce_ph() { + fn test_mm_mask_reduce_ph() { let a = _mm_set1_ph(1.25); let src = _mm_set1_ph(2.0); let r = _mm_mask_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b01010101, a); @@ -23551,7 +23777,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_reduce_ph() { + fn test_mm_maskz_reduce_ph() { let a = _mm_set1_ph(1.25); let r = _mm_maskz_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(0b01010101, a); let e = _mm_set_ph(0.0, 0.25, 0.0, 0.25, 0.0, 0.25, 0.0, 0.25); @@ -23559,7 +23785,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_reduce_ph() { + fn test_mm256_reduce_ph() { let a = _mm256_set1_ph(1.25); let r = _mm256_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm256_set1_ph(0.25); @@ -23567,7 +23793,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_reduce_ph() { + fn test_mm256_mask_reduce_ph() { let a = _mm256_set1_ph(1.25); let src = _mm256_set1_ph(2.0); let r = _mm256_mask_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(src, 0b0101010101010101, a); @@ -23578,7 +23804,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_reduce_ph() { + fn test_mm256_maskz_reduce_ph() { let a = _mm256_set1_ph(1.25); let r = _mm256_maskz_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(0b0101010101010101, a); let e = _mm256_set_ph( @@ -23588,7 +23814,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_reduce_ph() { + fn test_mm512_reduce_ph() { let a = _mm512_set1_ph(1.25); let r = _mm512_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>(a); let e = _mm512_set1_ph(0.25); @@ -23596,7 +23822,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_reduce_ph() { + fn test_mm512_mask_reduce_ph() { let a = _mm512_set1_ph(1.25); let src = _mm512_set1_ph(2.0); let r = _mm512_mask_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>( @@ -23612,7 +23838,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_reduce_ph() { + fn test_mm512_maskz_reduce_ph() { let a = _mm512_set1_ph(1.25); let r = _mm512_maskz_reduce_ph::<{ 16 | _MM_FROUND_TO_ZERO }>( 0b01010101010101010101010101010101, @@ -23626,7 +23852,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_reduce_round_ph() { + fn test_mm512_reduce_round_ph() { let a = _mm512_set1_ph(1.25); let r = _mm512_reduce_round_ph::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>(a); let e = _mm512_set1_ph(0.25); @@ -23634,7 +23860,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_reduce_round_ph() { + fn test_mm512_mask_reduce_round_ph() { let a = _mm512_set1_ph(1.25); let src = _mm512_set1_ph(2.0); let r = _mm512_mask_reduce_round_ph::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>( @@ -23650,7 +23876,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_reduce_round_ph() { + fn test_mm512_maskz_reduce_round_ph() { let a = _mm512_set1_ph(1.25); let r = _mm512_maskz_reduce_round_ph::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>( 0b01010101010101010101010101010101, @@ -23664,7 +23890,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_sh() { + fn test_mm_reduce_sh() { let a = _mm_setr_ph(3.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.25, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_reduce_sh::<{ 16 | _MM_FROUND_TO_ZERO }>(a, b); @@ -23673,7 +23899,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_reduce_sh() { + fn test_mm_mask_reduce_sh() { let a = _mm_setr_ph(3.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.25, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(2.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23686,7 +23912,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_reduce_sh() { + fn test_mm_maskz_reduce_sh() { let a = _mm_setr_ph(3.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.25, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_maskz_reduce_sh::<{ 16 | _MM_FROUND_TO_ZERO }>(0, a, b); @@ -23698,7 +23924,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_round_sh() { + fn test_mm_reduce_round_sh() { let a = _mm_setr_ph(3.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.25, 20., 21., 22., 23., 24., 25., 26.); let r = _mm_reduce_round_sh::<{ 16 | _MM_FROUND_TO_ZERO }, _MM_FROUND_NO_EXC>(a, b); @@ -23707,7 +23933,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_reduce_round_sh() { + fn test_mm_mask_reduce_round_sh() { let a = _mm_setr_ph(3.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.25, 20., 21., 22., 23., 24., 25., 26.); let src = _mm_setr_ph(2.0, 30., 31., 32., 33., 34., 35., 36.); @@ -23724,7 +23950,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_reduce_round_sh() { + fn test_mm_maskz_reduce_round_sh() { let a = _mm_setr_ph(3.0, 10., 11., 12., 13., 14., 15., 16.); let b = _mm_setr_ph(1.25, 20., 21., 22., 23., 24., 25., 26.); let r = @@ -23738,56 +23964,56 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_add_ph() { + const fn test_mm_reduce_add_ph() { let a = _mm_set1_ph(2.0); let r = _mm_reduce_add_ph(a); assert_eq!(r, 16.0); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_reduce_add_ph() { + const fn test_mm256_reduce_add_ph() { let a = _mm256_set1_ph(2.0); let r = _mm256_reduce_add_ph(a); assert_eq!(r, 32.0); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_reduce_add_ph() { + const fn test_mm512_reduce_add_ph() { let a = _mm512_set1_ph(2.0); let r = _mm512_reduce_add_ph(a); assert_eq!(r, 64.0); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_mul_ph() { + const fn test_mm_reduce_mul_ph() { let a = _mm_set1_ph(2.0); let r = _mm_reduce_mul_ph(a); assert_eq!(r, 256.0); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_reduce_mul_ph() { + const fn test_mm256_reduce_mul_ph() { let a = _mm256_set1_ph(2.0); let r = _mm256_reduce_mul_ph(a); assert_eq!(r, 65536.0); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_reduce_mul_ph() { + const fn test_mm512_reduce_mul_ph() { let a = _mm512_set1_ph(2.0); let r = _mm512_reduce_mul_ph(a); assert_eq!(r, 16777216.0); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_max_ph() { + fn test_mm_reduce_max_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_reduce_max_ph(a); assert_eq!(r, 8.0); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_reduce_max_ph() { + fn test_mm256_reduce_max_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -23796,7 +24022,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_reduce_max_ph() { + fn test_mm512_reduce_max_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -23807,14 +24033,14 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_reduce_min_ph() { + fn test_mm_reduce_min_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_reduce_min_ph(a); assert_eq!(r, 1.0); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_reduce_min_ph() { + fn test_mm256_reduce_min_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -23823,7 +24049,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_reduce_min_ph() { + fn test_mm512_reduce_min_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -23834,7 +24060,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_fpclass_ph_mask() { + fn test_mm_fpclass_ph_mask() { let a = _mm_set_ph( 1., f16::INFINITY, @@ -23850,7 +24076,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_fpclass_ph_mask() { + fn test_mm_mask_fpclass_ph_mask() { let a = _mm_set_ph( 1., f16::INFINITY, @@ -23866,7 +24092,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_fpclass_ph_mask() { + fn test_mm256_fpclass_ph_mask() { let a = _mm256_set_ph( 1., f16::INFINITY, @@ -23890,7 +24116,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_fpclass_ph_mask() { + fn test_mm256_mask_fpclass_ph_mask() { let a = _mm256_set_ph( 1., f16::INFINITY, @@ -23914,7 +24140,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_fpclass_ph_mask() { + fn test_mm512_fpclass_ph_mask() { let a = _mm512_set_ph( 1., f16::INFINITY, @@ -23954,7 +24180,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_fpclass_ph_mask() { + fn test_mm512_mask_fpclass_ph_mask() { let a = _mm512_set_ph( 1., f16::INFINITY, @@ -23994,14 +24220,14 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_fpclass_sh_mask() { + fn test_mm_fpclass_sh_mask() { let a = _mm_set_sh(f16::INFINITY); let r = _mm_fpclass_sh_mask::<0x18>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_fpclass_sh_mask() { + fn test_mm_mask_fpclass_sh_mask() { let a = _mm_set_sh(f16::INFINITY); let r = _mm_mask_fpclass_sh_mask::<0x18>(0, a); assert_eq!(r, 0); @@ -24010,7 +24236,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_blend_ph() { + const fn test_mm_mask_blend_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_set_ph(-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0); let r = _mm_mask_blend_ph(0b01010101, a, b); @@ -24019,7 +24245,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_blend_ph() { + const fn test_mm256_mask_blend_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -24036,7 +24262,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_blend_ph() { + const fn test_mm512_mask_blend_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -24057,7 +24283,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_permutex2var_ph() { + fn test_mm_permutex2var_ph() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let b = _mm_setr_ph(9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let idx = _mm_setr_epi16(0, 2, 4, 6, 8, 10, 12, 14); @@ -24067,7 +24293,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_permutex2var_ph() { + fn test_mm256_permutex2var_ph() { let a = _mm256_setr_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -24085,7 +24311,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_permutex2var_ph() { + fn test_mm512_permutex2var_ph() { let a = _mm512_setr_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -24110,7 +24336,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_permutexvar_ph() { + fn test_mm_permutexvar_ph() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let idx = _mm_set_epi16(0, 2, 4, 6, 1, 3, 5, 7); let r = _mm_permutexvar_ph(idx, a); @@ -24119,7 +24345,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_permutexvar_ph() { + fn test_mm256_permutexvar_ph() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -24132,7 +24358,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_permutexvar_ph() { + fn test_mm512_permutexvar_ph() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -24152,7 +24378,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtepi16_ph() { + fn test_mm_cvtepi16_ph() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm_cvtepi16_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24160,7 +24386,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtepi16_ph() { + fn test_mm_mask_cvtepi16_ph() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtepi16_ph(src, 0b01010101, a); @@ -24169,7 +24395,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtepi16_ph() { + fn test_mm_maskz_cvtepi16_ph() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm_maskz_cvtepi16_ph(0b01010101, a); let e = _mm_set_ph(0., 2., 0., 4., 0., 6., 0., 8.); @@ -24177,7 +24403,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtepi16_ph() { + fn test_mm256_cvtepi16_ph() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm256_cvtepi16_ph(a); let e = _mm256_set_ph( @@ -24187,7 +24413,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtepi16_ph() { + fn test_mm256_mask_cvtepi16_ph() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm256_set_ph( 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., @@ -24200,7 +24426,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi16_ph() { + fn test_mm256_maskz_cvtepi16_ph() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm256_maskz_cvtepi16_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -24210,7 +24436,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtepi16_ph() { + fn test_mm512_cvtepi16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24225,7 +24451,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtepi16_ph() { + fn test_mm512_mask_cvtepi16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24243,7 +24469,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtepi16_ph() { + fn test_mm512_maskz_cvtepi16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24257,7 +24483,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundepi16_ph() { + fn test_mm512_cvt_roundepi16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24272,7 +24498,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundepi16_ph() { + fn test_mm512_mask_cvt_roundepi16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24294,7 +24520,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundepi16_ph() { + fn test_mm512_maskz_cvt_roundepi16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24311,7 +24537,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtepu16_ph() { + fn test_mm_cvtepu16_ph() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm_cvtepu16_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24319,7 +24545,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtepu16_ph() { + fn test_mm_mask_cvtepu16_ph() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtepu16_ph(src, 0b01010101, a); @@ -24328,7 +24554,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtepu16_ph() { + fn test_mm_maskz_cvtepu16_ph() { let a = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm_maskz_cvtepu16_ph(0b01010101, a); let e = _mm_set_ph(0., 2., 0., 4., 0., 6., 0., 8.); @@ -24336,7 +24562,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtepu16_ph() { + fn test_mm256_cvtepu16_ph() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm256_cvtepu16_ph(a); let e = _mm256_set_ph( @@ -24346,7 +24572,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtepu16_ph() { + fn test_mm256_mask_cvtepu16_ph() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm256_set_ph( 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., @@ -24359,7 +24585,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu16_ph() { + fn test_mm256_maskz_cvtepu16_ph() { let a = _mm256_set_epi16(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm256_maskz_cvtepu16_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -24369,7 +24595,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtepu16_ph() { + fn test_mm512_cvtepu16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24384,7 +24610,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtepu16_ph() { + fn test_mm512_mask_cvtepu16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24402,7 +24628,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtepu16_ph() { + fn test_mm512_maskz_cvtepu16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24416,7 +24642,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundepu16_ph() { + fn test_mm512_cvt_roundepu16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24431,7 +24657,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundepu16_ph() { + fn test_mm512_mask_cvt_roundepu16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24453,7 +24679,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundepu16_ph() { + fn test_mm512_maskz_cvt_roundepu16_ph() { let a = _mm512_set_epi16( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, @@ -24470,7 +24696,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtepi32_ph() { + fn test_mm_cvtepi32_ph() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_cvtepi32_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); @@ -24478,7 +24704,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtepi32_ph() { + fn test_mm_mask_cvtepi32_ph() { let a = _mm_set_epi32(1, 2, 3, 4); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtepi32_ph(src, 0b0101, a); @@ -24487,7 +24713,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtepi32_ph() { + fn test_mm_maskz_cvtepi32_ph() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_maskz_cvtepi32_ph(0b0101, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 2., 0.0, 4.); @@ -24495,7 +24721,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtepi32_ph() { + fn test_mm256_cvtepi32_ph() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_cvtepi32_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24503,7 +24729,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtepi32_ph() { + fn test_mm256_mask_cvtepi32_ph() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm256_mask_cvtepi32_ph(src, 0b01010101, a); @@ -24512,7 +24738,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi32_ph() { + fn test_mm256_maskz_cvtepi32_ph() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_cvtepi32_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2.0, 0.0, 4.0, 0.0, 6.0, 0.0, 8.0); @@ -24520,7 +24746,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtepi32_ph() { + fn test_mm512_cvtepi32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_cvtepi32_ph(a); let e = _mm256_set_ph( @@ -24530,7 +24756,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtepi32_ph() { + fn test_mm512_mask_cvtepi32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm256_set_ph( 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., @@ -24543,7 +24769,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtepi32_ph() { + fn test_mm512_maskz_cvtepi32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_cvtepi32_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -24553,7 +24779,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvt_roundepi32_ph() { + fn test_mm512_cvt_roundepi32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_cvt_roundepi32_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm256_set_ph( @@ -24563,7 +24789,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvt_roundepi32_ph() { + fn test_mm512_mask_cvt_roundepi32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm256_set_ph( 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., @@ -24580,7 +24806,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvt_roundepi32_ph() { + fn test_mm512_maskz_cvt_roundepi32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_cvt_roundepi32_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b0101010101010101, @@ -24593,7 +24819,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvti32_sh() { + fn test_mm_cvti32_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvti32_sh(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24601,7 +24827,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvt_roundi32_sh() { + fn test_mm_cvt_roundi32_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundi32_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24609,7 +24835,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtepu32_ph() { + fn test_mm_cvtepu32_ph() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_cvtepu32_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); @@ -24617,7 +24843,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtepu32_ph() { + fn test_mm_mask_cvtepu32_ph() { let a = _mm_set_epi32(1, 2, 3, 4); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtepu32_ph(src, 0b0101, a); @@ -24626,7 +24852,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtepu32_ph() { + fn test_mm_maskz_cvtepu32_ph() { let a = _mm_set_epi32(1, 2, 3, 4); let r = _mm_maskz_cvtepu32_ph(0b0101, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 2., 0.0, 4.); @@ -24634,7 +24860,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtepu32_ph() { + fn test_mm256_cvtepu32_ph() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_cvtepu32_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24642,7 +24868,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtepu32_ph() { + fn test_mm256_mask_cvtepu32_ph() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm256_mask_cvtepu32_ph(src, 0b01010101, a); @@ -24651,7 +24877,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu32_ph() { + fn test_mm256_maskz_cvtepu32_ph() { let a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_cvtepu32_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2.0, 0.0, 4.0, 0.0, 6.0, 0.0, 8.0); @@ -24659,7 +24885,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvtepu32_ph() { + fn test_mm512_cvtepu32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_cvtepu32_ph(a); let e = _mm256_set_ph( @@ -24669,7 +24895,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtepu32_ph() { + fn test_mm512_mask_cvtepu32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm256_set_ph( 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., @@ -24682,7 +24908,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtepu32_ph() { + fn test_mm512_maskz_cvtepu32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_cvtepu32_ph(0b0101010101010101, a); let e = _mm256_set_ph( @@ -24692,7 +24918,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvt_roundepu32_ph() { + fn test_mm512_cvt_roundepu32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_cvt_roundepu32_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm256_set_ph( @@ -24702,7 +24928,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvt_roundepu32_ph() { + fn test_mm512_mask_cvt_roundepu32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let src = _mm256_set_ph( 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., @@ -24720,7 +24946,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvt_roundepu32_ph() { + fn test_mm512_maskz_cvt_roundepu32_ph() { let a = _mm512_set_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_cvt_roundepu32_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b0101010101010101, @@ -24733,7 +24959,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtu32_sh() { + fn test_mm_cvtu32_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtu32_sh(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24741,7 +24967,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvt_roundu32_sh() { + fn test_mm_cvt_roundu32_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundu32_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24749,7 +24975,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtepi64_ph() { + fn test_mm_cvtepi64_ph() { let a = _mm_set_epi64x(1, 2); let r = _mm_cvtepi64_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); @@ -24757,7 +24983,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtepi64_ph() { + fn test_mm_mask_cvtepi64_ph() { let a = _mm_set_epi64x(1, 2); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtepi64_ph(src, 0b01, a); @@ -24766,7 +24992,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtepi64_ph() { + fn test_mm_maskz_cvtepi64_ph() { let a = _mm_set_epi64x(1, 2); let r = _mm_maskz_cvtepi64_ph(0b01, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.); @@ -24774,7 +25000,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtepi64_ph() { + fn test_mm256_cvtepi64_ph() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepi64_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); @@ -24782,7 +25008,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtepi64_ph() { + fn test_mm256_mask_cvtepi64_ph() { let a = _mm256_set_epi64x(1, 2, 3, 4); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm256_mask_cvtepi64_ph(src, 0b0101, a); @@ -24791,7 +25017,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi64_ph() { + fn test_mm256_maskz_cvtepi64_ph() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepi64_ph(0b0101, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 4.0); @@ -24799,7 +25025,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvtepi64_ph() { + fn test_mm512_cvtepi64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvtepi64_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24807,7 +25033,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtepi64_ph() { + fn test_mm512_mask_cvtepi64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm512_mask_cvtepi64_ph(src, 0b01010101, a); @@ -24816,7 +25042,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtepi64_ph() { + fn test_mm512_maskz_cvtepi64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvtepi64_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2., 0.0, 4., 0.0, 6., 0.0, 8.); @@ -24824,7 +25050,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvt_roundepi64_ph() { + fn test_mm512_cvt_roundepi64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvt_roundepi64_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24832,7 +25058,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundepi64_ph() { + fn test_mm512_mask_cvt_roundepi64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm512_mask_cvt_roundepi64_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -24843,7 +25069,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvt_roundepi64_ph() { + fn test_mm512_maskz_cvt_roundepi64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvt_roundepi64_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01010101, a, @@ -24853,7 +25079,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtepu64_ph() { + fn test_mm_cvtepu64_ph() { let a = _mm_set_epi64x(1, 2); let r = _mm_cvtepu64_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); @@ -24861,7 +25087,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtepu64_ph() { + fn test_mm_mask_cvtepu64_ph() { let a = _mm_set_epi64x(1, 2); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtepu64_ph(src, 0b01, a); @@ -24870,7 +25096,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtepu64_ph() { + fn test_mm_maskz_cvtepu64_ph() { let a = _mm_set_epi64x(1, 2); let r = _mm_maskz_cvtepu64_ph(0b01, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0); @@ -24878,7 +25104,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtepu64_ph() { + fn test_mm256_cvtepu64_ph() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepu64_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); @@ -24886,7 +25112,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtepu64_ph() { + fn test_mm256_mask_cvtepu64_ph() { let a = _mm256_set_epi64x(1, 2, 3, 4); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm256_mask_cvtepu64_ph(src, 0b0101, a); @@ -24895,7 +25121,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu64_ph() { + fn test_mm256_maskz_cvtepu64_ph() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepu64_ph(0b0101, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 4.0); @@ -24903,7 +25129,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvtepu64_ph() { + fn test_mm512_cvtepu64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvtepu64_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24911,7 +25137,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtepu64_ph() { + fn test_mm512_mask_cvtepu64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm512_mask_cvtepu64_ph(src, 0b01010101, a); @@ -24920,7 +25146,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtepu64_ph() { + fn test_mm512_maskz_cvtepu64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvtepu64_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2., 0.0, 4., 0.0, 6., 0.0, 8.); @@ -24928,7 +25154,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvt_roundepu64_ph() { + fn test_mm512_cvt_roundepu64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_cvt_roundepu64_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24936,7 +25162,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvt_roundepu64_ph() { + fn test_mm512_mask_cvt_roundepu64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm512_mask_cvt_roundepu64_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -24947,7 +25173,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvt_roundepu64_ph() { + fn test_mm512_maskz_cvt_roundepu64_ph() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_cvt_roundepu64_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01010101, a, @@ -24957,7 +25183,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtxps_ph() { + fn test_mm_cvtxps_ph() { let a = _mm_set_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_cvtxps_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); @@ -24965,7 +25191,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtxps_ph() { + fn test_mm_mask_cvtxps_ph() { let a = _mm_set_ps(1.0, 2.0, 3.0, 4.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtxps_ph(src, 0b0101, a); @@ -24974,7 +25200,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtxps_ph() { + fn test_mm_maskz_cvtxps_ph() { let a = _mm_set_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvtxps_ph(0b0101, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 4.0); @@ -24982,7 +25208,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtxps_ph() { + fn test_mm256_cvtxps_ph() { let a = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvtxps_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -24990,7 +25216,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtxps_ph() { + fn test_mm256_mask_cvtxps_ph() { let a = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm256_mask_cvtxps_ph(src, 0b01010101, a); @@ -24999,7 +25225,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtxps_ph() { + fn test_mm256_maskz_cvtxps_ph() { let a = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_maskz_cvtxps_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2.0, 0.0, 4.0, 0.0, 6.0, 0.0, 8.0); @@ -25007,7 +25233,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvtxps_ph() { + fn test_mm512_cvtxps_ph() { let a = _mm512_set_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25019,7 +25245,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtxps_ph() { + fn test_mm512_mask_cvtxps_ph() { let a = _mm512_set_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25034,7 +25260,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtxps_ph() { + fn test_mm512_maskz_cvtxps_ph() { let a = _mm512_set_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25046,7 +25272,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvtx_roundps_ph() { + fn test_mm512_cvtx_roundps_ph() { let a = _mm512_set_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25058,7 +25284,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtx_roundps_ph() { + fn test_mm512_mask_cvtx_roundps_ph() { let a = _mm512_set_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25078,7 +25304,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtx_roundps_ph() { + fn test_mm512_maskz_cvtx_roundps_ph() { let a = _mm512_set_ps( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25093,7 +25319,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtss_sh() { + fn test_mm_cvtss_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_cvtss_sh(a, b); @@ -25102,7 +25328,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtss_sh() { + fn test_mm_mask_cvtss_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let src = _mm_setr_ph(20., 21., 22., 23., 24., 25., 26., 27.); @@ -25115,7 +25341,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtss_sh() { + fn test_mm_maskz_cvtss_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvtss_sh(0, a, b); @@ -25127,7 +25353,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvt_roundss_sh() { + fn test_mm_cvt_roundss_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_cvt_roundss_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -25136,7 +25362,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvt_roundss_sh() { + fn test_mm_mask_cvt_roundss_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let src = _mm_setr_ph(20., 21., 22., 23., 24., 25., 26., 27.); @@ -25153,7 +25379,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvt_roundss_sh() { + fn test_mm_maskz_cvt_roundss_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let r = @@ -25167,7 +25393,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtpd_ph() { + fn test_mm_cvtpd_ph() { let a = _mm_set_pd(1.0, 2.0); let r = _mm_cvtpd_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); @@ -25175,7 +25401,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtpd_ph() { + fn test_mm_mask_cvtpd_ph() { let a = _mm_set_pd(1.0, 2.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm_mask_cvtpd_ph(src, 0b01, a); @@ -25184,7 +25410,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtpd_ph() { + fn test_mm_maskz_cvtpd_ph() { let a = _mm_set_pd(1.0, 2.0); let r = _mm_maskz_cvtpd_ph(0b01, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0); @@ -25192,7 +25418,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtpd_ph() { + fn test_mm256_cvtpd_ph() { let a = _mm256_set_pd(1.0, 2.0, 3.0, 4.0); let r = _mm256_cvtpd_ph(a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); @@ -25200,7 +25426,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtpd_ph() { + fn test_mm256_mask_cvtpd_ph() { let a = _mm256_set_pd(1.0, 2.0, 3.0, 4.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm256_mask_cvtpd_ph(src, 0b0101, a); @@ -25209,7 +25435,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtpd_ph() { + fn test_mm256_maskz_cvtpd_ph() { let a = _mm256_set_pd(1.0, 2.0, 3.0, 4.0); let r = _mm256_maskz_cvtpd_ph(0b0101, a); let e = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 4.0); @@ -25217,7 +25443,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvtpd_ph() { + fn test_mm512_cvtpd_ph() { let a = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvtpd_ph(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -25225,7 +25451,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvtpd_ph() { + fn test_mm512_mask_cvtpd_ph() { let a = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm512_mask_cvtpd_ph(src, 0b01010101, a); @@ -25234,7 +25460,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvtpd_ph() { + fn test_mm512_maskz_cvtpd_ph() { let a = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvtpd_ph(0b01010101, a); let e = _mm_set_ph(0.0, 2., 0.0, 4., 0.0, 6., 0.0, 8.); @@ -25242,7 +25468,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_cvt_roundpd_ph() { + fn test_mm512_cvt_roundpd_ph() { let a = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvt_roundpd_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -25250,7 +25476,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_mask_cvt_roundpd_ph() { + fn test_mm512_mask_cvt_roundpd_ph() { let a = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_ph(10., 11., 12., 13., 14., 15., 16., 17.); let r = _mm512_mask_cvt_roundpd_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -25261,7 +25487,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm512_maskz_cvt_roundpd_ph() { + fn test_mm512_maskz_cvt_roundpd_ph() { let a = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvt_roundpd_ph::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01010101, a, @@ -25271,7 +25497,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtsd_sh() { + fn test_mm_cvtsd_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_pd(1.0, 2.0); let r = _mm_cvtsd_sh(a, b); @@ -25280,7 +25506,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtsd_sh() { + fn test_mm_mask_cvtsd_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_pd(1.0, 2.0); let src = _mm_setr_ph(20., 21., 22., 23., 24., 25., 26., 27.); @@ -25293,7 +25519,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtsd_sh() { + fn test_mm_maskz_cvtsd_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_pd(1.0, 2.0); let r = _mm_maskz_cvtsd_sh(0, a, b); @@ -25305,7 +25531,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvt_roundsd_sh() { + fn test_mm_cvt_roundsd_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_pd(1.0, 2.0); let r = _mm_cvt_roundsd_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -25314,7 +25540,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvt_roundsd_sh() { + fn test_mm_mask_cvt_roundsd_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_pd(1.0, 2.0); let src = _mm_setr_ph(20., 21., 22., 23., 24., 25., 26., 27.); @@ -25331,7 +25557,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvt_roundsd_sh() { + fn test_mm_maskz_cvt_roundsd_sh() { let a = _mm_setr_ph(10., 11., 12., 13., 14., 15., 16., 17.); let b = _mm_setr_pd(1.0, 2.0); let r = @@ -25345,7 +25571,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_epi16() { + fn test_mm_cvtph_epi16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttph_epi16(a); let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); @@ -25353,7 +25579,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_epi16() { + fn test_mm_mask_cvtph_epi16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_epi16(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm_mask_cvttph_epi16(src, 0b01010101, a); @@ -25362,7 +25588,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_epi16() { + fn test_mm_maskz_cvtph_epi16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_maskz_cvttph_epi16(0b01010101, a); let e = _mm_set_epi16(0, 2, 0, 4, 0, 6, 0, 8); @@ -25370,7 +25596,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_epi16() { + fn test_mm256_cvtph_epi16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25380,7 +25606,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_epi16() { + fn test_mm256_mask_cvtph_epi16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25393,7 +25619,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_epi16() { + fn test_mm256_maskz_cvtph_epi16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25403,7 +25629,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_epi16() { + fn test_mm512_cvtph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25418,7 +25644,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_epi16() { + fn test_mm512_mask_cvtph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25437,7 +25663,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_epi16() { + fn test_mm512_maskz_cvtph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25452,7 +25678,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_epi16() { + fn test_mm512_cvt_roundph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25467,7 +25693,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_epi16() { + fn test_mm512_mask_cvt_roundph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25490,7 +25716,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_epi16() { + fn test_mm512_maskz_cvt_roundph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25508,7 +25734,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_epu16() { + fn test_mm_cvtph_epu16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttph_epu16(a); let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); @@ -25516,7 +25742,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_epu16() { + fn test_mm_mask_cvtph_epu16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_epi16(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm_mask_cvttph_epu16(src, 0b01010101, a); @@ -25525,7 +25751,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_epu16() { + fn test_mm_maskz_cvtph_epu16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_maskz_cvttph_epu16(0b01010101, a); let e = _mm_set_epi16(0, 2, 0, 4, 0, 6, 0, 8); @@ -25533,7 +25759,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_epu16() { + fn test_mm256_cvtph_epu16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25543,7 +25769,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_epu16() { + fn test_mm256_mask_cvtph_epu16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25556,7 +25782,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_epu16() { + fn test_mm256_maskz_cvtph_epu16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25566,7 +25792,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_epu16() { + fn test_mm512_cvtph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25581,7 +25807,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_epu16() { + fn test_mm512_mask_cvtph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25600,7 +25826,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_epu16() { + fn test_mm512_maskz_cvtph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25615,7 +25841,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_epu16() { + fn test_mm512_cvt_roundph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25630,7 +25856,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_epu16() { + fn test_mm512_mask_cvt_roundph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25653,7 +25879,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_epu16() { + fn test_mm512_maskz_cvt_roundph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25671,7 +25897,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvttph_epi16() { + fn test_mm_cvttph_epi16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttph_epi16(a); let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); @@ -25679,7 +25905,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvttph_epi16() { + fn test_mm_mask_cvttph_epi16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_epi16(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm_mask_cvttph_epi16(src, 0b01010101, a); @@ -25688,7 +25914,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvttph_epi16() { + fn test_mm_maskz_cvttph_epi16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_maskz_cvttph_epi16(0b01010101, a); let e = _mm_set_epi16(0, 2, 0, 4, 0, 6, 0, 8); @@ -25696,7 +25922,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvttph_epi16() { + fn test_mm256_cvttph_epi16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25706,7 +25932,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvttph_epi16() { + fn test_mm256_mask_cvttph_epi16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25719,7 +25945,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvttph_epi16() { + fn test_mm256_maskz_cvttph_epi16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25729,7 +25955,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvttph_epi16() { + fn test_mm512_cvttph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25744,7 +25970,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvttph_epi16() { + fn test_mm512_mask_cvttph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25763,7 +25989,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvttph_epi16() { + fn test_mm512_maskz_cvttph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25778,7 +26004,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtt_roundph_epi16() { + fn test_mm512_cvtt_roundph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25793,7 +26019,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtt_roundph_epi16() { + fn test_mm512_mask_cvtt_roundph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25816,7 +26042,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtt_roundph_epi16() { + fn test_mm512_maskz_cvtt_roundph_epi16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25834,7 +26060,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvttph_epu16() { + fn test_mm_cvttph_epu16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttph_epu16(a); let e = _mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8); @@ -25842,7 +26068,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvttph_epu16() { + fn test_mm_mask_cvttph_epu16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm_set_epi16(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm_mask_cvttph_epu16(src, 0b01010101, a); @@ -25851,7 +26077,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvttph_epu16() { + fn test_mm_maskz_cvttph_epu16() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_maskz_cvttph_epu16(0b01010101, a); let e = _mm_set_epi16(0, 2, 0, 4, 0, 6, 0, 8); @@ -25859,7 +26085,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvttph_epu16() { + fn test_mm256_cvttph_epu16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25869,7 +26095,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvttph_epu16() { + fn test_mm256_mask_cvttph_epu16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25882,7 +26108,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvttph_epu16() { + fn test_mm256_maskz_cvttph_epu16() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -25892,7 +26118,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvttph_epu16() { + fn test_mm512_cvttph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25907,7 +26133,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvttph_epu16() { + fn test_mm512_mask_cvttph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25926,7 +26152,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvttph_epu16() { + fn test_mm512_maskz_cvttph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25941,7 +26167,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtt_roundph_epu16() { + fn test_mm512_cvtt_roundph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25956,7 +26182,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtt_roundph_epu16() { + fn test_mm512_mask_cvtt_roundph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25979,7 +26205,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtt_roundph_epu16() { + fn test_mm512_maskz_cvtt_roundph_epu16() { let a = _mm512_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -25997,7 +26223,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_epi32() { + fn test_mm_cvtph_epi32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_cvtph_epi32(a); let e = _mm_set_epi32(1, 2, 3, 4); @@ -26005,7 +26231,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_epi32() { + fn test_mm_mask_cvtph_epi32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let src = _mm_set_epi32(10, 11, 12, 13); let r = _mm_mask_cvtph_epi32(src, 0b0101, a); @@ -26014,7 +26240,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_epi32() { + fn test_mm_maskz_cvtph_epi32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvtph_epi32(0b0101, a); let e = _mm_set_epi32(0, 2, 0, 4); @@ -26022,7 +26248,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_epi32() { + fn test_mm256_cvtph_epi32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvtph_epi32(a); let e = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); @@ -26030,7 +26256,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_epi32() { + fn test_mm256_mask_cvtph_epi32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm256_set_epi32(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm256_mask_cvtph_epi32(src, 0b01010101, a); @@ -26039,7 +26265,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_epi32() { + fn test_mm256_maskz_cvtph_epi32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_maskz_cvtph_epi32(0b01010101, a); let e = _mm256_set_epi32(0, 2, 0, 4, 0, 6, 0, 8); @@ -26047,7 +26273,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_epi32() { + fn test_mm512_cvtph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26057,7 +26283,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_epi32() { + fn test_mm512_mask_cvtph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26070,7 +26296,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_epi32() { + fn test_mm512_maskz_cvtph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26080,7 +26306,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_epi32() { + fn test_mm512_cvt_roundph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26090,7 +26316,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_epi32() { + fn test_mm512_mask_cvt_roundph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26107,7 +26333,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_epi32() { + fn test_mm512_maskz_cvt_roundph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26120,21 +26346,21 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_i32() { + fn test_mm_cvtsh_i32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtsh_i32(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvt_roundsh_i32() { + fn test_mm_cvt_roundsh_i32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundsh_i32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_epu32() { + fn test_mm_cvtph_epu32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_cvtph_epu32(a); let e = _mm_set_epi32(1, 2, 3, 4); @@ -26142,7 +26368,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_epu32() { + fn test_mm_mask_cvtph_epu32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let src = _mm_set_epi32(10, 11, 12, 13); let r = _mm_mask_cvtph_epu32(src, 0b0101, a); @@ -26151,7 +26377,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_epu32() { + fn test_mm_maskz_cvtph_epu32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvtph_epu32(0b0101, a); let e = _mm_set_epi32(0, 2, 0, 4); @@ -26159,7 +26385,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_epu32() { + fn test_mm256_cvtph_epu32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvtph_epu32(a); let e = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); @@ -26167,7 +26393,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_epu32() { + fn test_mm256_mask_cvtph_epu32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm256_set_epi32(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm256_mask_cvtph_epu32(src, 0b01010101, a); @@ -26176,7 +26402,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_epu32() { + fn test_mm256_maskz_cvtph_epu32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_maskz_cvtph_epu32(0b01010101, a); let e = _mm256_set_epi32(0, 2, 0, 4, 0, 6, 0, 8); @@ -26184,7 +26410,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_epu32() { + fn test_mm512_cvtph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26194,7 +26420,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_epu32() { + fn test_mm512_mask_cvtph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26207,7 +26433,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_epu32() { + fn test_mm512_maskz_cvtph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26217,7 +26443,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_epu32() { + fn test_mm512_cvt_roundph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26227,7 +26453,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_epu32() { + fn test_mm512_mask_cvt_roundph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26244,7 +26470,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_epu32() { + fn test_mm512_maskz_cvt_roundph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26257,21 +26483,21 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_u32() { + fn test_mm_cvtsh_u32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtsh_u32(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvt_roundsh_u32() { + fn test_mm_cvt_roundsh_u32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundsh_u32::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvttph_epi32() { + fn test_mm_cvttph_epi32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_cvttph_epi32(a); let e = _mm_set_epi32(1, 2, 3, 4); @@ -26279,7 +26505,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvttph_epi32() { + fn test_mm_mask_cvttph_epi32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let src = _mm_set_epi32(10, 11, 12, 13); let r = _mm_mask_cvttph_epi32(src, 0b0101, a); @@ -26288,7 +26514,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvttph_epi32() { + fn test_mm_maskz_cvttph_epi32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvttph_epi32(0b0101, a); let e = _mm_set_epi32(0, 2, 0, 4); @@ -26296,7 +26522,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvttph_epi32() { + fn test_mm256_cvttph_epi32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvttph_epi32(a); let e = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); @@ -26304,7 +26530,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvttph_epi32() { + fn test_mm256_mask_cvttph_epi32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm256_set_epi32(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm256_mask_cvttph_epi32(src, 0b01010101, a); @@ -26313,7 +26539,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvttph_epi32() { + fn test_mm256_maskz_cvttph_epi32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_maskz_cvttph_epi32(0b01010101, a); let e = _mm256_set_epi32(0, 2, 0, 4, 0, 6, 0, 8); @@ -26321,7 +26547,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvttph_epi32() { + fn test_mm512_cvttph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26331,7 +26557,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvttph_epi32() { + fn test_mm512_mask_cvttph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26344,7 +26570,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvttph_epi32() { + fn test_mm512_maskz_cvttph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26354,7 +26580,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtt_roundph_epi32() { + fn test_mm512_cvtt_roundph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26364,7 +26590,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtt_roundph_epi32() { + fn test_mm512_mask_cvtt_roundph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26377,7 +26603,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtt_roundph_epi32() { + fn test_mm512_maskz_cvtt_roundph_epi32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26387,21 +26613,21 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvttsh_i32() { + fn test_mm_cvttsh_i32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttsh_i32(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtt_roundsh_i32() { + fn test_mm_cvtt_roundsh_i32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtt_roundsh_i32::<_MM_FROUND_NO_EXC>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvttph_epu32() { + fn test_mm_cvttph_epu32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_cvttph_epu32(a); let e = _mm_set_epi32(1, 2, 3, 4); @@ -26409,7 +26635,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvttph_epu32() { + fn test_mm_mask_cvttph_epu32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let src = _mm_set_epi32(10, 11, 12, 13); let r = _mm_mask_cvttph_epu32(src, 0b0101, a); @@ -26418,7 +26644,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvttph_epu32() { + fn test_mm_maskz_cvttph_epu32() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvttph_epu32(0b0101, a); let e = _mm_set_epi32(0, 2, 0, 4); @@ -26426,7 +26652,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvttph_epu32() { + fn test_mm256_cvttph_epu32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvttph_epu32(a); let e = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); @@ -26434,7 +26660,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvttph_epu32() { + fn test_mm256_mask_cvttph_epu32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let src = _mm256_set_epi32(10, 11, 12, 13, 14, 15, 16, 17); let r = _mm256_mask_cvttph_epu32(src, 0b01010101, a); @@ -26443,7 +26669,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvttph_epu32() { + fn test_mm256_maskz_cvttph_epu32() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_maskz_cvttph_epu32(0b01010101, a); let e = _mm256_set_epi32(0, 2, 0, 4, 0, 6, 0, 8); @@ -26451,7 +26677,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvttph_epu32() { + fn test_mm512_cvttph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26461,7 +26687,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvttph_epu32() { + fn test_mm512_mask_cvttph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26474,7 +26700,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvttph_epu32() { + fn test_mm512_maskz_cvttph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26484,7 +26710,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtt_roundph_epu32() { + fn test_mm512_cvtt_roundph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26494,7 +26720,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtt_roundph_epu32() { + fn test_mm512_mask_cvtt_roundph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26507,7 +26733,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtt_roundph_epu32() { + fn test_mm512_maskz_cvtt_roundph_epu32() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -26517,21 +26743,21 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvttsh_u32() { + fn test_mm_cvttsh_u32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttsh_u32(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtt_roundsh_u32() { + fn test_mm_cvtt_roundsh_u32() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtt_roundsh_u32::<_MM_FROUND_NO_EXC>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_epi64() { + fn test_mm_cvtph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_cvtph_epi64(a); let e = _mm_set_epi64x(1, 2); @@ -26539,7 +26765,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_epi64() { + fn test_mm_mask_cvtph_epi64() { let src = _mm_set_epi64x(3, 4); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_mask_cvtph_epi64(src, 0b01, a); @@ -26548,7 +26774,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_epi64() { + fn test_mm_maskz_cvtph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_maskz_cvtph_epi64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -26556,7 +26782,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_epi64() { + fn test_mm256_cvtph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_cvtph_epi64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -26564,7 +26790,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_epi64() { + fn test_mm256_mask_cvtph_epi64() { let src = _mm256_set_epi64x(5, 6, 7, 8); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_mask_cvtph_epi64(src, 0b0101, a); @@ -26573,7 +26799,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_epi64() { + fn test_mm256_maskz_cvtph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_maskz_cvtph_epi64(0b0101, a); let e = _mm256_set_epi64x(0, 2, 0, 4); @@ -26581,7 +26807,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_epi64() { + fn test_mm512_cvtph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvtph_epi64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26589,7 +26815,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_epi64() { + fn test_mm512_mask_cvtph_epi64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvtph_epi64(src, 0b01010101, a); @@ -26598,7 +26824,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_epi64() { + fn test_mm512_maskz_cvtph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvtph_epi64(0b01010101, a); let e = _mm512_set_epi64(0, 2, 0, 4, 0, 6, 0, 8); @@ -26606,7 +26832,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_epi64() { + fn test_mm512_cvt_roundph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvt_roundph_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26614,7 +26840,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_epi64() { + fn test_mm512_mask_cvt_roundph_epi64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvt_roundph_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -26625,7 +26851,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_epi64() { + fn test_mm512_maskz_cvt_roundph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvt_roundph_epi64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01010101, a, @@ -26635,7 +26861,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_epu64() { + fn test_mm_cvtph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_cvtph_epu64(a); let e = _mm_set_epi64x(1, 2); @@ -26643,7 +26869,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_epu64() { + fn test_mm_mask_cvtph_epu64() { let src = _mm_set_epi64x(3, 4); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_mask_cvtph_epu64(src, 0b01, a); @@ -26652,7 +26878,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_epu64() { + fn test_mm_maskz_cvtph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_maskz_cvtph_epu64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -26660,7 +26886,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_epu64() { + fn test_mm256_cvtph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_cvtph_epu64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -26668,7 +26894,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_epu64() { + fn test_mm256_mask_cvtph_epu64() { let src = _mm256_set_epi64x(5, 6, 7, 8); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_mask_cvtph_epu64(src, 0b0101, a); @@ -26677,7 +26903,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_epu64() { + fn test_mm256_maskz_cvtph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_maskz_cvtph_epu64(0b0101, a); let e = _mm256_set_epi64x(0, 2, 0, 4); @@ -26685,7 +26911,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_epu64() { + fn test_mm512_cvtph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvtph_epu64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26693,7 +26919,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_epu64() { + fn test_mm512_mask_cvtph_epu64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvtph_epu64(src, 0b01010101, a); @@ -26702,7 +26928,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_epu64() { + fn test_mm512_maskz_cvtph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvtph_epu64(0b01010101, a); let e = _mm512_set_epi64(0, 2, 0, 4, 0, 6, 0, 8); @@ -26710,7 +26936,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_epu64() { + fn test_mm512_cvt_roundph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvt_roundph_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26718,7 +26944,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_epu64() { + fn test_mm512_mask_cvt_roundph_epu64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvt_roundph_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -26729,7 +26955,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_epu64() { + fn test_mm512_maskz_cvt_roundph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvt_roundph_epu64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( 0b01010101, a, @@ -26739,7 +26965,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvttph_epi64() { + fn test_mm_cvttph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_cvttph_epi64(a); let e = _mm_set_epi64x(1, 2); @@ -26747,7 +26973,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvttph_epi64() { + fn test_mm_mask_cvttph_epi64() { let src = _mm_set_epi64x(3, 4); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_mask_cvttph_epi64(src, 0b01, a); @@ -26756,7 +26982,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvttph_epi64() { + fn test_mm_maskz_cvttph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_maskz_cvttph_epi64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -26764,7 +26990,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvttph_epi64() { + fn test_mm256_cvttph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_cvttph_epi64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -26772,7 +26998,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvttph_epi64() { + fn test_mm256_mask_cvttph_epi64() { let src = _mm256_set_epi64x(5, 6, 7, 8); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_mask_cvttph_epi64(src, 0b0101, a); @@ -26781,7 +27007,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvttph_epi64() { + fn test_mm256_maskz_cvttph_epi64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_maskz_cvttph_epi64(0b0101, a); let e = _mm256_set_epi64x(0, 2, 0, 4); @@ -26789,7 +27015,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvttph_epi64() { + fn test_mm512_cvttph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvttph_epi64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26797,7 +27023,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvttph_epi64() { + fn test_mm512_mask_cvttph_epi64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvttph_epi64(src, 0b01010101, a); @@ -26806,7 +27032,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvttph_epi64() { + fn test_mm512_maskz_cvttph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvttph_epi64(0b01010101, a); let e = _mm512_set_epi64(0, 2, 0, 4, 0, 6, 0, 8); @@ -26814,7 +27040,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtt_roundph_epi64() { + fn test_mm512_cvtt_roundph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvtt_roundph_epi64::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26822,7 +27048,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtt_roundph_epi64() { + fn test_mm512_mask_cvtt_roundph_epi64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvtt_roundph_epi64::<_MM_FROUND_NO_EXC>(src, 0b01010101, a); @@ -26831,7 +27057,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtt_roundph_epi64() { + fn test_mm512_maskz_cvtt_roundph_epi64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvtt_roundph_epi64::<_MM_FROUND_NO_EXC>(0b01010101, a); let e = _mm512_set_epi64(0, 2, 0, 4, 0, 6, 0, 8); @@ -26839,7 +27065,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvttph_epu64() { + fn test_mm_cvttph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_cvttph_epu64(a); let e = _mm_set_epi64x(1, 2); @@ -26847,7 +27073,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvttph_epu64() { + fn test_mm_mask_cvttph_epu64() { let src = _mm_set_epi64x(3, 4); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_mask_cvttph_epu64(src, 0b01, a); @@ -26856,7 +27082,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvttph_epu64() { + fn test_mm_maskz_cvttph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_maskz_cvttph_epu64(0b01, a); let e = _mm_set_epi64x(0, 2); @@ -26864,7 +27090,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvttph_epu64() { + fn test_mm256_cvttph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_cvttph_epu64(a); let e = _mm256_set_epi64x(1, 2, 3, 4); @@ -26872,7 +27098,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvttph_epu64() { + fn test_mm256_mask_cvttph_epu64() { let src = _mm256_set_epi64x(5, 6, 7, 8); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_mask_cvttph_epu64(src, 0b0101, a); @@ -26881,7 +27107,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvttph_epu64() { + fn test_mm256_maskz_cvttph_epu64() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_maskz_cvttph_epu64(0b0101, a); let e = _mm256_set_epi64x(0, 2, 0, 4); @@ -26889,7 +27115,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvttph_epu64() { + fn test_mm512_cvttph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvttph_epu64(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26897,7 +27123,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvttph_epu64() { + fn test_mm512_mask_cvttph_epu64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvttph_epu64(src, 0b01010101, a); @@ -26906,7 +27132,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvttph_epu64() { + fn test_mm512_maskz_cvttph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvttph_epu64(0b01010101, a); let e = _mm512_set_epi64(0, 2, 0, 4, 0, 6, 0, 8); @@ -26914,7 +27140,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtt_roundph_epu64() { + fn test_mm512_cvtt_roundph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvtt_roundph_epu64::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); @@ -26922,7 +27148,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtt_roundph_epu64() { + fn test_mm512_mask_cvtt_roundph_epu64() { let src = _mm512_set_epi64(9, 10, 11, 12, 13, 14, 15, 16); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvtt_roundph_epu64::<_MM_FROUND_NO_EXC>(src, 0b01010101, a); @@ -26931,7 +27157,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtt_roundph_epu64() { + fn test_mm512_maskz_cvtt_roundph_epu64() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvtt_roundph_epu64::<_MM_FROUND_NO_EXC>(0b01010101, a); let e = _mm512_set_epi64(0, 2, 0, 4, 0, 6, 0, 8); @@ -26939,7 +27165,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtxph_ps() { + fn test_mm_cvtxph_ps() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_cvtxph_ps(a); let e = _mm_set_ps(1.0, 2.0, 3.0, 4.0); @@ -26947,7 +27173,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtxph_ps() { + fn test_mm_mask_cvtxph_ps() { let src = _mm_set_ps(10.0, 11.0, 12.0, 13.0); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_mask_cvtxph_ps(src, 0b0101, a); @@ -26956,7 +27182,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtxph_ps() { + fn test_mm_maskz_cvtxph_ps() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm_maskz_cvtxph_ps(0b0101, a); let e = _mm_set_ps(0.0, 2.0, 0.0, 4.0); @@ -26964,7 +27190,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtxph_ps() { + fn test_mm256_cvtxph_ps() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvtxph_ps(a); let e = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -26972,7 +27198,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtxph_ps() { + fn test_mm256_mask_cvtxph_ps() { let src = _mm256_set_ps(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_mask_cvtxph_ps(src, 0b01010101, a); @@ -26981,7 +27207,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtxph_ps() { + fn test_mm256_maskz_cvtxph_ps() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_maskz_cvtxph_ps(0b01010101, a); let e = _mm256_set_ps(0.0, 2.0, 0.0, 4.0, 0.0, 6.0, 0.0, 8.0); @@ -26989,7 +27215,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtxph_ps() { + fn test_mm512_cvtxph_ps() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -27001,7 +27227,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtxph_ps() { + fn test_mm512_mask_cvtxph_ps() { let src = _mm512_set_ps( 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, @@ -27018,7 +27244,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtxph_ps() { + fn test_mm512_maskz_cvtxph_ps() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -27030,7 +27256,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtx_roundph_ps() { + fn test_mm512_cvtx_roundph_ps() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -27042,7 +27268,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtx_roundph_ps() { + fn test_mm512_mask_cvtx_roundph_ps() { let src = _mm512_set_ps( 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, @@ -27059,7 +27285,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtx_roundph_ps() { + fn test_mm512_maskz_cvtx_roundph_ps() { let a = _mm256_set_ph( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -27071,7 +27297,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_ss() { + fn test_mm_cvtsh_ss() { let a = _mm_setr_ps(2.0, 20.0, 21.0, 22.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_cvtsh_ss(a, b); @@ -27080,7 +27306,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_cvtsh_ss() { + fn test_mm_mask_cvtsh_ss() { let src = _mm_setr_ps(3.0, 11.0, 12.0, 13.0); let a = _mm_setr_ps(2.0, 20.0, 21.0, 22.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); @@ -27093,7 +27319,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_maskz_cvtsh_ss() { + fn test_mm_maskz_cvtsh_ss() { let a = _mm_setr_ps(2.0, 20.0, 21.0, 22.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_maskz_cvtsh_ss(0, a, b); @@ -27105,7 +27331,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvt_roundsh_ss() { + fn test_mm_cvt_roundsh_ss() { let a = _mm_setr_ps(2.0, 20.0, 21.0, 22.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_cvt_roundsh_ss::<_MM_FROUND_NO_EXC>(a, b); @@ -27114,7 +27340,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_cvt_roundsh_ss() { + fn test_mm_mask_cvt_roundsh_ss() { let src = _mm_setr_ps(3.0, 11.0, 12.0, 13.0); let a = _mm_setr_ps(2.0, 20.0, 21.0, 22.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); @@ -27127,7 +27353,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_maskz_cvt_roundsh_ss() { + fn test_mm_maskz_cvt_roundsh_ss() { let a = _mm_setr_ps(2.0, 20.0, 21.0, 22.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_maskz_cvt_roundsh_ss::<_MM_FROUND_NO_EXC>(0, a, b); @@ -27139,7 +27365,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtph_pd() { + fn test_mm_cvtph_pd() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_cvtph_pd(a); let e = _mm_set_pd(1.0, 2.0); @@ -27147,7 +27373,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_mask_cvtph_pd() { + fn test_mm_mask_cvtph_pd() { let src = _mm_set_pd(10.0, 11.0); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_mask_cvtph_pd(src, 0b01, a); @@ -27156,7 +27382,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_maskz_cvtph_pd() { + fn test_mm_maskz_cvtph_pd() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0); let r = _mm_maskz_cvtph_pd(0b01, a); let e = _mm_set_pd(0.0, 2.0); @@ -27164,7 +27390,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_cvtph_pd() { + fn test_mm256_cvtph_pd() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_cvtph_pd(a); let e = _mm256_set_pd(1.0, 2.0, 3.0, 4.0); @@ -27172,7 +27398,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_mask_cvtph_pd() { + fn test_mm256_mask_cvtph_pd() { let src = _mm256_set_pd(10.0, 11.0, 12.0, 13.0); let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_mask_cvtph_pd(src, 0b0101, a); @@ -27181,7 +27407,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm256_maskz_cvtph_pd() { + fn test_mm256_maskz_cvtph_pd() { let a = _mm_set_ph(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0); let r = _mm256_maskz_cvtph_pd(0b0101, a); let e = _mm256_set_pd(0.0, 2.0, 0.0, 4.0); @@ -27189,7 +27415,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtph_pd() { + fn test_mm512_cvtph_pd() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvtph_pd(a); let e = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -27197,7 +27423,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvtph_pd() { + fn test_mm512_mask_cvtph_pd() { let src = _mm512_set_pd(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvtph_pd(src, 0b01010101, a); @@ -27206,7 +27432,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvtph_pd() { + fn test_mm512_maskz_cvtph_pd() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvtph_pd(0b01010101, a); let e = _mm512_set_pd(0.0, 2.0, 0.0, 4.0, 0.0, 6.0, 0.0, 8.0); @@ -27214,7 +27440,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvt_roundph_pd() { + fn test_mm512_cvt_roundph_pd() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_cvt_roundph_pd::<_MM_FROUND_NO_EXC>(a); let e = _mm512_set_pd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -27222,7 +27448,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_mask_cvt_roundph_pd() { + fn test_mm512_mask_cvt_roundph_pd() { let src = _mm512_set_pd(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0); let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_mask_cvt_roundph_pd::<_MM_FROUND_NO_EXC>(src, 0b01010101, a); @@ -27231,7 +27457,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_maskz_cvt_roundph_pd() { + fn test_mm512_maskz_cvt_roundph_pd() { let a = _mm_set_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm512_maskz_cvt_roundph_pd::<_MM_FROUND_NO_EXC>(0b01010101, a); let e = _mm512_set_pd(0.0, 2.0, 0.0, 4.0, 0.0, 6.0, 0.0, 8.0); @@ -27239,7 +27465,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_sd() { + fn test_mm_cvtsh_sd() { let a = _mm_setr_pd(2.0, 20.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_cvtsh_sd(a, b); @@ -27248,7 +27474,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_cvtsh_sd() { + fn test_mm_mask_cvtsh_sd() { let src = _mm_setr_pd(3.0, 11.0); let a = _mm_setr_pd(2.0, 20.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); @@ -27261,7 +27487,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_maskz_cvtsh_sd() { + fn test_mm_maskz_cvtsh_sd() { let a = _mm_setr_pd(2.0, 20.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_maskz_cvtsh_sd(0, a, b); @@ -27273,7 +27499,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvt_roundsh_sd() { + fn test_mm_cvt_roundsh_sd() { let a = _mm_setr_pd(2.0, 20.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_cvt_roundsh_sd::<_MM_FROUND_NO_EXC>(a, b); @@ -27282,7 +27508,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_mask_cvt_roundsh_sd() { + fn test_mm_mask_cvt_roundsh_sd() { let src = _mm_setr_pd(3.0, 11.0); let a = _mm_setr_pd(2.0, 20.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); @@ -27295,7 +27521,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_maskz_cvt_roundsh_sd() { + fn test_mm_maskz_cvt_roundsh_sd() { let a = _mm_setr_pd(2.0, 20.0); let b = _mm_setr_ph(1.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0); let r = _mm_maskz_cvt_roundsh_sd::<_MM_FROUND_NO_EXC>(0, a, b); @@ -27307,14 +27533,14 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_h() { + const fn test_mm_cvtsh_h() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 42.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtsh_h(a); assert_eq!(r, 1.0); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm256_cvtsh_h() { + const fn test_mm256_cvtsh_h() { let a = _mm256_setr_ph( 1.0, 2.0, 3.0, 42.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, ); @@ -27323,7 +27549,7 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm512_cvtsh_h() { + const fn test_mm512_cvtsh_h() { let a = _mm512_setr_ph( 1.0, 2.0, 3.0, 42.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, @@ -27334,14 +27560,14 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsi128_si16() { + const fn test_mm_cvtsi128_si16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm_cvtsi128_si16(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsi16_si128() { + const fn test_mm_cvtsi16_si128() { let a = 1; let r = _mm_cvtsi16_si128(a); let e = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs b/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs index 7c9d07f69095..5ce28565d108 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512ifma.rs @@ -372,7 +372,7 @@ mod tests { const K: __mmask8 = 0b01101101; #[simd_test(enable = "avx512ifma")] - unsafe fn test_mm512_madd52hi_epu64() { + fn test_mm512_madd52hi_epu64() { let a = _mm512_set1_epi64(10 << 40); let b = _mm512_set1_epi64((11 << 40) + 4); let c = _mm512_set1_epi64((12 << 40) + 3); @@ -386,7 +386,7 @@ mod tests { } #[simd_test(enable = "avx512ifma")] - unsafe fn test_mm512_mask_madd52hi_epu64() { + fn test_mm512_mask_madd52hi_epu64() { let a = _mm512_set1_epi64(10 << 40); let b = _mm512_set1_epi64((11 << 40) + 4); let c = _mm512_set1_epi64((12 << 40) + 3); @@ -401,7 +401,7 @@ mod tests { } #[simd_test(enable = "avx512ifma")] - unsafe fn test_mm512_maskz_madd52hi_epu64() { + fn test_mm512_maskz_madd52hi_epu64() { let a = _mm512_set1_epi64(10 << 40); let b = _mm512_set1_epi64((11 << 40) + 4); let c = _mm512_set1_epi64((12 << 40) + 3); @@ -416,7 +416,7 @@ mod tests { } #[simd_test(enable = "avx512ifma")] - unsafe fn test_mm512_madd52lo_epu64() { + fn test_mm512_madd52lo_epu64() { let a = _mm512_set1_epi64(10 << 40); let b = _mm512_set1_epi64((11 << 40) + 4); let c = _mm512_set1_epi64((12 << 40) + 3); @@ -430,7 +430,7 @@ mod tests { } #[simd_test(enable = "avx512ifma")] - unsafe fn test_mm512_mask_madd52lo_epu64() { + fn test_mm512_mask_madd52lo_epu64() { let a = _mm512_set1_epi64(10 << 40); let b = _mm512_set1_epi64((11 << 40) + 4); let c = _mm512_set1_epi64((12 << 40) + 3); @@ -445,7 +445,7 @@ mod tests { } #[simd_test(enable = "avx512ifma")] - unsafe fn test_mm512_maskz_madd52lo_epu64() { + fn test_mm512_maskz_madd52lo_epu64() { let a = _mm512_set1_epi64(10 << 40); let b = _mm512_set1_epi64((11 << 40) + 4); let c = _mm512_set1_epi64((12 << 40) + 3); @@ -460,7 +460,7 @@ mod tests { } #[simd_test(enable = "avxifma")] - unsafe fn test_mm256_madd52hi_avx_epu64() { + fn test_mm256_madd52hi_avx_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -474,7 +474,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm256_madd52hi_epu64() { + fn test_mm256_madd52hi_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -488,7 +488,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm256_mask_madd52hi_epu64() { + fn test_mm256_mask_madd52hi_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -503,7 +503,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm256_maskz_madd52hi_epu64() { + fn test_mm256_maskz_madd52hi_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -518,7 +518,7 @@ mod tests { } #[simd_test(enable = "avxifma")] - unsafe fn test_mm256_madd52lo_avx_epu64() { + fn test_mm256_madd52lo_avx_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -532,7 +532,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm256_madd52lo_epu64() { + fn test_mm256_madd52lo_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -546,7 +546,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm256_mask_madd52lo_epu64() { + fn test_mm256_mask_madd52lo_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -561,7 +561,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm256_maskz_madd52lo_epu64() { + fn test_mm256_maskz_madd52lo_epu64() { let a = _mm256_set1_epi64x(10 << 40); let b = _mm256_set1_epi64x((11 << 40) + 4); let c = _mm256_set1_epi64x((12 << 40) + 3); @@ -576,7 +576,7 @@ mod tests { } #[simd_test(enable = "avxifma")] - unsafe fn test_mm_madd52hi_avx_epu64() { + fn test_mm_madd52hi_avx_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -590,7 +590,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm_madd52hi_epu64() { + fn test_mm_madd52hi_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -604,7 +604,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm_mask_madd52hi_epu64() { + fn test_mm_mask_madd52hi_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -619,7 +619,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm_maskz_madd52hi_epu64() { + fn test_mm_maskz_madd52hi_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -634,7 +634,7 @@ mod tests { } #[simd_test(enable = "avxifma")] - unsafe fn test_mm_madd52lo_avx_epu64() { + fn test_mm_madd52lo_avx_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -648,7 +648,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm_madd52lo_epu64() { + fn test_mm_madd52lo_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -662,7 +662,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm_mask_madd52lo_epu64() { + fn test_mm_mask_madd52lo_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); @@ -677,7 +677,7 @@ mod tests { } #[simd_test(enable = "avx512ifma,avx512vl")] - unsafe fn test_mm_maskz_madd52lo_epu64() { + fn test_mm_maskz_madd52lo_epu64() { let a = _mm_set1_epi64x(10 << 40); let b = _mm_set1_epi64x((11 << 40) + 4); let c = _mm_set1_epi64x((12 << 40) + 3); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs b/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs index 3527ccc9e44a..d9ad14ef00dd 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512vbmi.rs @@ -484,7 +484,7 @@ mod tests { use crate::core_arch::x86::*; #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_permutex2var_epi8() { + fn test_mm512_permutex2var_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -508,7 +508,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_mask_permutex2var_epi8() { + fn test_mm512_mask_permutex2var_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -539,7 +539,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_maskz_permutex2var_epi8() { + fn test_mm512_maskz_permutex2var_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -570,7 +570,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_mask2_permutex2var_epi8() { + fn test_mm512_mask2_permutex2var_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -601,7 +601,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_permutex2var_epi8() { + fn test_mm256_permutex2var_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -619,7 +619,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_mask_permutex2var_epi8() { + fn test_mm256_mask_permutex2var_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -639,7 +639,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_maskz_permutex2var_epi8() { + fn test_mm256_maskz_permutex2var_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -659,7 +659,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_mask2_permutex2var_epi8() { + fn test_mm256_mask2_permutex2var_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -679,7 +679,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_permutex2var_epi8() { + fn test_mm_permutex2var_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm_set_epi8(1, 1 << 4, 2, 1 << 4, 3, 1 << 4, 4, 1 << 4, 5, 1 << 4, 6, 1 << 4, 7, 1 << 4, 8, 1 << 4); @@ -692,7 +692,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_mask_permutex2var_epi8() { + fn test_mm_mask_permutex2var_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm_set_epi8(1, 1 << 4, 2, 1 << 4, 3, 1 << 4, 4, 1 << 4, 5, 1 << 4, 6, 1 << 4, 7, 1 << 4, 8, 1 << 4); @@ -707,7 +707,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_maskz_permutex2var_epi8() { + fn test_mm_maskz_permutex2var_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm_set_epi8(1, 1 << 4, 2, 1 << 4, 3, 1 << 4, 4, 1 << 4, 5, 1 << 4, 6, 1 << 4, 7, 1 << 4, 8, 1 << 4); @@ -722,7 +722,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_mask2_permutex2var_epi8() { + fn test_mm_mask2_permutex2var_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let idx = _mm_set_epi8(1, 1 << 4, 2, 1 << 4, 3, 1 << 4, 4, 1 << 4, 5, 1 << 4, 6, 1 << 4, 7, 1 << 4, 8, 1 << 4); @@ -737,7 +737,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_permutexvar_epi8() { + fn test_mm512_permutexvar_epi8() { let idx = _mm512_set1_epi8(1); #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -750,7 +750,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_mask_permutexvar_epi8() { + fn test_mm512_mask_permutexvar_epi8() { let idx = _mm512_set1_epi8(1); #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -770,7 +770,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_maskz_permutexvar_epi8() { + fn test_mm512_maskz_permutexvar_epi8() { let idx = _mm512_set1_epi8(1); #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -789,7 +789,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_permutexvar_epi8() { + fn test_mm256_permutexvar_epi8() { let idx = _mm256_set1_epi8(1); #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -800,7 +800,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_mask_permutexvar_epi8() { + fn test_mm256_mask_permutexvar_epi8() { let idx = _mm256_set1_epi8(1); #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -813,7 +813,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_maskz_permutexvar_epi8() { + fn test_mm256_maskz_permutexvar_epi8() { let idx = _mm256_set1_epi8(1); #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -826,7 +826,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_permutexvar_epi8() { + fn test_mm_permutexvar_epi8() { let idx = _mm_set1_epi8(1); let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_permutexvar_epi8(idx, a); @@ -835,7 +835,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_mask_permutexvar_epi8() { + fn test_mm_mask_permutexvar_epi8() { let idx = _mm_set1_epi8(1); let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_mask_permutexvar_epi8(a, 0, idx, a); @@ -846,7 +846,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_maskz_permutexvar_epi8() { + fn test_mm_maskz_permutexvar_epi8() { let idx = _mm_set1_epi8(1); let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_permutexvar_epi8(0, idx, a); @@ -857,7 +857,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_multishift_epi64_epi8() { + fn test_mm512_multishift_epi64_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_multishift_epi64_epi8(a, b); @@ -866,7 +866,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_mask_multishift_epi64_epi8() { + fn test_mm512_mask_multishift_epi64_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_mask_multishift_epi64_epi8(a, 0, a, b); @@ -882,7 +882,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi")] - unsafe fn test_mm512_maskz_multishift_epi64_epi8() { + fn test_mm512_maskz_multishift_epi64_epi8() { let a = _mm512_set1_epi8(1); let b = _mm512_set1_epi8(1); let r = _mm512_maskz_multishift_epi64_epi8(0, a, b); @@ -897,7 +897,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_multishift_epi64_epi8() { + fn test_mm256_multishift_epi64_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let r = _mm256_multishift_epi64_epi8(a, b); @@ -906,7 +906,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_mask_multishift_epi64_epi8() { + fn test_mm256_mask_multishift_epi64_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let r = _mm256_mask_multishift_epi64_epi8(a, 0, a, b); @@ -917,7 +917,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm256_maskz_multishift_epi64_epi8() { + fn test_mm256_maskz_multishift_epi64_epi8() { let a = _mm256_set1_epi8(1); let b = _mm256_set1_epi8(1); let r = _mm256_maskz_multishift_epi64_epi8(0, a, b); @@ -928,7 +928,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_multishift_epi64_epi8() { + fn test_mm_multishift_epi64_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let r = _mm_multishift_epi64_epi8(a, b); @@ -937,7 +937,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_mask_multishift_epi64_epi8() { + fn test_mm_mask_multishift_epi64_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let r = _mm_mask_multishift_epi64_epi8(a, 0, a, b); @@ -948,7 +948,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi,avx512vl")] - unsafe fn test_mm_maskz_multishift_epi64_epi8() { + fn test_mm_maskz_multishift_epi64_epi8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(1); let r = _mm_maskz_multishift_epi64_epi8(0, a, b); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs b/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs index e25fd4528dc2..26cef5814e9c 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512vbmi2.rs @@ -499,7 +499,8 @@ pub fn _mm_maskz_expand_epi8(k: __mmask16, a: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm512_shldv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shldv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shl( a.as_i64x8(), @@ -516,7 +517,8 @@ pub fn _mm512_shldv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm512_mask_shldv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shldv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shldv_epi64(a, b, c).as_i64x8(); transmute(simd_select_bitmask(k, shf, a.as_i64x8())) @@ -530,7 +532,8 @@ pub fn _mm512_mask_shldv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm512_maskz_shldv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shldv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shldv_epi64(a, b, c).as_i64x8(); transmute(simd_select_bitmask(k, shf, i64x8::ZERO)) @@ -544,7 +547,8 @@ pub fn _mm512_maskz_shldv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm256_shldv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shldv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shl( a.as_i64x4(), @@ -561,7 +565,8 @@ pub fn _mm256_shldv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm256_mask_shldv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shldv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shldv_epi64(a, b, c).as_i64x4(); transmute(simd_select_bitmask(k, shf, a.as_i64x4())) @@ -575,7 +580,8 @@ pub fn _mm256_mask_shldv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm256_maskz_shldv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shldv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shldv_epi64(a, b, c).as_i64x4(); transmute(simd_select_bitmask(k, shf, i64x4::ZERO)) @@ -589,7 +595,8 @@ pub fn _mm256_maskz_shldv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm_shldv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shldv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shl( a.as_i64x2(), @@ -606,7 +613,8 @@ pub fn _mm_shldv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm_mask_shldv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shldv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shldv_epi64(a, b, c).as_i64x2(); transmute(simd_select_bitmask(k, shf, a.as_i64x2())) @@ -620,7 +628,8 @@ pub fn _mm_mask_shldv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvq))] -pub fn _mm_maskz_shldv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shldv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shldv_epi64(a, b, c).as_i64x2(); transmute(simd_select_bitmask(k, shf, i64x2::ZERO)) @@ -634,7 +643,8 @@ pub fn _mm_maskz_shldv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm512_shldv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shldv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shl( a.as_i32x16(), @@ -651,7 +661,8 @@ pub fn _mm512_shldv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm512_mask_shldv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shldv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shldv_epi32(a, b, c).as_i32x16(); transmute(simd_select_bitmask(k, shf, a.as_i32x16())) @@ -665,7 +676,8 @@ pub fn _mm512_mask_shldv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm512_maskz_shldv_epi32(k: __mmask16, a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shldv_epi32(k: __mmask16, a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shldv_epi32(a, b, c).as_i32x16(); transmute(simd_select_bitmask(k, shf, i32x16::ZERO)) @@ -679,7 +691,8 @@ pub fn _mm512_maskz_shldv_epi32(k: __mmask16, a: __m512i, b: __m512i, c: __m512i #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm256_shldv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shldv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shl( a.as_i32x8(), @@ -696,7 +709,8 @@ pub fn _mm256_shldv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm256_mask_shldv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shldv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shldv_epi32(a, b, c).as_i32x8(); transmute(simd_select_bitmask(k, shf, a.as_i32x8())) @@ -710,7 +724,8 @@ pub fn _mm256_mask_shldv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm256_maskz_shldv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shldv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shldv_epi32(a, b, c).as_i32x8(); transmute(simd_select_bitmask(k, shf, i32x8::ZERO)) @@ -724,7 +739,8 @@ pub fn _mm256_maskz_shldv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm_shldv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shldv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shl( a.as_i32x4(), @@ -741,7 +757,8 @@ pub fn _mm_shldv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm_mask_shldv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shldv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shldv_epi32(a, b, c).as_i32x4(); transmute(simd_select_bitmask(k, shf, a.as_i32x4())) @@ -755,7 +772,8 @@ pub fn _mm_mask_shldv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvd))] -pub fn _mm_maskz_shldv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shldv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shldv_epi32(a, b, c).as_i32x4(); transmute(simd_select_bitmask(k, shf, i32x4::ZERO)) @@ -769,7 +787,8 @@ pub fn _mm_maskz_shldv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm512_shldv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shldv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shl( a.as_i16x32(), @@ -786,7 +805,8 @@ pub fn _mm512_shldv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm512_mask_shldv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shldv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shldv_epi16(a, b, c).as_i16x32(); transmute(simd_select_bitmask(k, shf, a.as_i16x32())) @@ -800,7 +820,8 @@ pub fn _mm512_mask_shldv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm512_maskz_shldv_epi16(k: __mmask32, a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shldv_epi16(k: __mmask32, a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shldv_epi16(a, b, c).as_i16x32(); transmute(simd_select_bitmask(k, shf, i16x32::ZERO)) @@ -814,7 +835,8 @@ pub fn _mm512_maskz_shldv_epi16(k: __mmask32, a: __m512i, b: __m512i, c: __m512i #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm256_shldv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shldv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shl( a.as_i16x16(), @@ -831,7 +853,8 @@ pub fn _mm256_shldv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm256_mask_shldv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shldv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shldv_epi16(a, b, c).as_i16x16(); transmute(simd_select_bitmask(k, shf, a.as_i16x16())) @@ -845,7 +868,8 @@ pub fn _mm256_mask_shldv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm256_maskz_shldv_epi16(k: __mmask16, a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shldv_epi16(k: __mmask16, a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shldv_epi16(a, b, c).as_i16x16(); transmute(simd_select_bitmask(k, shf, i16x16::ZERO)) @@ -859,7 +883,8 @@ pub fn _mm256_maskz_shldv_epi16(k: __mmask16, a: __m256i, b: __m256i, c: __m256i #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm_shldv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shldv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shl( a.as_i16x8(), @@ -876,7 +901,8 @@ pub fn _mm_shldv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm_mask_shldv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shldv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shldv_epi16(a, b, c).as_i16x8(); transmute(simd_select_bitmask(k, shf, a.as_i16x8())) @@ -890,7 +916,8 @@ pub fn _mm_mask_shldv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldvw))] -pub fn _mm_maskz_shldv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shldv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shldv_epi16(a, b, c).as_i16x8(); transmute(simd_select_bitmask(k, shf, i16x8::ZERO)) @@ -904,7 +931,8 @@ pub fn _mm_maskz_shldv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm512_shrdv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shrdv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shr( b.as_i64x8(), @@ -921,7 +949,8 @@ pub fn _mm512_shrdv_epi64(a: __m512i, b: __m512i, c: __m512i) -> __m512i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm512_mask_shrdv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shrdv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shrdv_epi64(a, b, c).as_i64x8(); transmute(simd_select_bitmask(k, shf, a.as_i64x8())) @@ -935,7 +964,8 @@ pub fn _mm512_mask_shrdv_epi64(a: __m512i, k: __mmask8, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm512_maskz_shrdv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shrdv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shrdv_epi64(a, b, c).as_i64x8(); transmute(simd_select_bitmask(k, shf, i64x8::ZERO)) @@ -949,7 +979,8 @@ pub fn _mm512_maskz_shrdv_epi64(k: __mmask8, a: __m512i, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm256_shrdv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shrdv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shr( b.as_i64x4(), @@ -966,7 +997,8 @@ pub fn _mm256_shrdv_epi64(a: __m256i, b: __m256i, c: __m256i) -> __m256i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm256_mask_shrdv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shrdv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shrdv_epi64(a, b, c).as_i64x4(); transmute(simd_select_bitmask(k, shf, a.as_i64x4())) @@ -980,7 +1012,8 @@ pub fn _mm256_mask_shrdv_epi64(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm256_maskz_shrdv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shrdv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shrdv_epi64(a, b, c).as_i64x4(); transmute(simd_select_bitmask(k, shf, i64x4::ZERO)) @@ -994,7 +1027,8 @@ pub fn _mm256_maskz_shrdv_epi64(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm_shrdv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shrdv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shr( b.as_i64x2(), @@ -1011,7 +1045,8 @@ pub fn _mm_shrdv_epi64(a: __m128i, b: __m128i, c: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm_mask_shrdv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shrdv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shrdv_epi64(a, b, c).as_i64x2(); transmute(simd_select_bitmask(k, shf, a.as_i64x2())) @@ -1025,7 +1060,8 @@ pub fn _mm_mask_shrdv_epi64(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvq))] -pub fn _mm_maskz_shrdv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shrdv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shrdv_epi64(a, b, c).as_i64x2(); transmute(simd_select_bitmask(k, shf, i64x2::ZERO)) @@ -1039,7 +1075,8 @@ pub fn _mm_maskz_shrdv_epi64(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm512_shrdv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shrdv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shr( b.as_i32x16(), @@ -1056,7 +1093,8 @@ pub fn _mm512_shrdv_epi32(a: __m512i, b: __m512i, c: __m512i) -> __m512i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm512_mask_shrdv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shrdv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shrdv_epi32(a, b, c).as_i32x16(); transmute(simd_select_bitmask(k, shf, a.as_i32x16())) @@ -1070,7 +1108,8 @@ pub fn _mm512_mask_shrdv_epi32(a: __m512i, k: __mmask16, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm512_maskz_shrdv_epi32(k: __mmask16, a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shrdv_epi32(k: __mmask16, a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shrdv_epi32(a, b, c).as_i32x16(); transmute(simd_select_bitmask(k, shf, i32x16::ZERO)) @@ -1084,7 +1123,8 @@ pub fn _mm512_maskz_shrdv_epi32(k: __mmask16, a: __m512i, b: __m512i, c: __m512i #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm256_shrdv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shrdv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shr( b.as_i32x8(), @@ -1101,7 +1141,8 @@ pub fn _mm256_shrdv_epi32(a: __m256i, b: __m256i, c: __m256i) -> __m256i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm256_mask_shrdv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shrdv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shrdv_epi32(a, b, c).as_i32x8(); transmute(simd_select_bitmask(k, shf, a.as_i32x8())) @@ -1115,7 +1156,8 @@ pub fn _mm256_mask_shrdv_epi32(a: __m256i, k: __mmask8, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm256_maskz_shrdv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shrdv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shrdv_epi32(a, b, c).as_i32x8(); transmute(simd_select_bitmask(k, shf, i32x8::ZERO)) @@ -1129,7 +1171,8 @@ pub fn _mm256_maskz_shrdv_epi32(k: __mmask8, a: __m256i, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm_shrdv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shrdv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shr( b.as_i32x4(), @@ -1146,7 +1189,8 @@ pub fn _mm_shrdv_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm_mask_shrdv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shrdv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shrdv_epi32(a, b, c).as_i32x4(); transmute(simd_select_bitmask(k, shf, a.as_i32x4())) @@ -1160,7 +1204,8 @@ pub fn _mm_mask_shrdv_epi32(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvd))] -pub fn _mm_maskz_shrdv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shrdv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shrdv_epi32(a, b, c).as_i32x4(); transmute(simd_select_bitmask(k, shf, i32x4::ZERO)) @@ -1174,7 +1219,8 @@ pub fn _mm_maskz_shrdv_epi32(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm512_shrdv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shrdv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { transmute(simd_funnel_shr( b.as_i16x32(), @@ -1191,7 +1237,8 @@ pub fn _mm512_shrdv_epi16(a: __m512i, b: __m512i, c: __m512i) -> __m512i { #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm512_mask_shrdv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shrdv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shrdv_epi16(a, b, c).as_i16x32(); transmute(simd_select_bitmask(k, shf, a.as_i16x32())) @@ -1205,7 +1252,8 @@ pub fn _mm512_mask_shrdv_epi16(a: __m512i, k: __mmask32, b: __m512i, c: __m512i) #[target_feature(enable = "avx512vbmi2")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm512_maskz_shrdv_epi16(k: __mmask32, a: __m512i, b: __m512i, c: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shrdv_epi16(k: __mmask32, a: __m512i, b: __m512i, c: __m512i) -> __m512i { unsafe { let shf = _mm512_shrdv_epi16(a, b, c).as_i16x32(); transmute(simd_select_bitmask(k, shf, i16x32::ZERO)) @@ -1219,7 +1267,8 @@ pub fn _mm512_maskz_shrdv_epi16(k: __mmask32, a: __m512i, b: __m512i, c: __m512i #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm256_shrdv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shrdv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { transmute(simd_funnel_shr( b.as_i16x16(), @@ -1236,7 +1285,8 @@ pub fn _mm256_shrdv_epi16(a: __m256i, b: __m256i, c: __m256i) -> __m256i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm256_mask_shrdv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shrdv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shrdv_epi16(a, b, c).as_i16x16(); transmute(simd_select_bitmask(k, shf, a.as_i16x16())) @@ -1250,7 +1300,8 @@ pub fn _mm256_mask_shrdv_epi16(a: __m256i, k: __mmask16, b: __m256i, c: __m256i) #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm256_maskz_shrdv_epi16(k: __mmask16, a: __m256i, b: __m256i, c: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shrdv_epi16(k: __mmask16, a: __m256i, b: __m256i, c: __m256i) -> __m256i { unsafe { let shf = _mm256_shrdv_epi16(a, b, c).as_i16x16(); transmute(simd_select_bitmask(k, shf, i16x16::ZERO)) @@ -1264,7 +1315,8 @@ pub fn _mm256_maskz_shrdv_epi16(k: __mmask16, a: __m256i, b: __m256i, c: __m256i #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm_shrdv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shrdv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { transmute(simd_funnel_shr( b.as_i16x8(), @@ -1281,7 +1333,8 @@ pub fn _mm_shrdv_epi16(a: __m128i, b: __m128i, c: __m128i) -> __m128i { #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm_mask_shrdv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shrdv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shrdv_epi16(a, b, c).as_i16x8(); transmute(simd_select_bitmask(k, shf, a.as_i16x8())) @@ -1295,7 +1348,8 @@ pub fn _mm_mask_shrdv_epi16(a: __m128i, k: __mmask8, b: __m128i, c: __m128i) -> #[target_feature(enable = "avx512vbmi2,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshrdvw))] -pub fn _mm_maskz_shrdv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shrdv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> __m128i { unsafe { let shf = _mm_shrdv_epi16(a, b, c).as_i16x8(); transmute(simd_select_bitmask(k, shf, i16x8::ZERO)) @@ -1310,7 +1364,8 @@ pub fn _mm_maskz_shrdv_epi16(k: __mmask8, a: __m128i, b: __m128i, c: __m128i) -> #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shldi_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shldi_epi64(a: __m512i, b: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_shldv_epi64(a, b, _mm512_set1_epi64(IMM8 as i64)) } @@ -1323,7 +1378,8 @@ pub fn _mm512_shldi_epi64(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shldi_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shldi_epi64( src: __m512i, k: __mmask8, a: __m512i, @@ -1344,7 +1400,12 @@ pub fn _mm512_mask_shldi_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shldi_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shldi_epi64( + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm512_shldi_epi64::(a, b).as_i64x8(); @@ -1360,7 +1421,8 @@ pub fn _mm512_maskz_shldi_epi64(k: __mmask8, a: __m512i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_shldi_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shldi_epi64(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_shldv_epi64(a, b, _mm256_set1_epi64x(IMM8 as i64)) } @@ -1373,7 +1435,8 @@ pub fn _mm256_shldi_epi64(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shldi_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shldi_epi64( src: __m256i, k: __mmask8, a: __m256i, @@ -1394,7 +1457,12 @@ pub fn _mm256_mask_shldi_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shldi_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shldi_epi64( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_shldi_epi64::(a, b).as_i64x4(); @@ -1410,7 +1478,8 @@ pub fn _mm256_maskz_shldi_epi64(k: __mmask8, a: __m256i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_shldi_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shldi_epi64(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_shldv_epi64(a, b, _mm_set1_epi64x(IMM8 as i64)) } @@ -1423,7 +1492,8 @@ pub fn _mm_shldi_epi64(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shldi_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shldi_epi64( src: __m128i, k: __mmask8, a: __m128i, @@ -1444,7 +1514,12 @@ pub fn _mm_mask_shldi_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shldi_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shldi_epi64( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_shldi_epi64::(a, b).as_i64x2(); @@ -1460,7 +1535,8 @@ pub fn _mm_maskz_shldi_epi64(k: __mmask8, a: __m128i, b: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shldi_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shldi_epi32(a: __m512i, b: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_shldv_epi32(a, b, _mm512_set1_epi32(IMM8)) } @@ -1473,7 +1549,8 @@ pub fn _mm512_shldi_epi32(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shldi_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shldi_epi32( src: __m512i, k: __mmask16, a: __m512i, @@ -1494,7 +1571,12 @@ pub fn _mm512_mask_shldi_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shldi_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shldi_epi32( + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm512_shldi_epi32::(a, b).as_i32x16(); @@ -1510,7 +1592,8 @@ pub fn _mm512_maskz_shldi_epi32(k: __mmask16, a: __m512i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_shldi_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shldi_epi32(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_shldv_epi32(a, b, _mm256_set1_epi32(IMM8)) } @@ -1523,7 +1606,8 @@ pub fn _mm256_shldi_epi32(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shldi_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shldi_epi32( src: __m256i, k: __mmask8, a: __m256i, @@ -1544,7 +1628,12 @@ pub fn _mm256_mask_shldi_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shldi_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shldi_epi32( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_shldi_epi32::(a, b).as_i32x8(); @@ -1560,7 +1649,8 @@ pub fn _mm256_maskz_shldi_epi32(k: __mmask8, a: __m256i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_shldi_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shldi_epi32(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_shldv_epi32(a, b, _mm_set1_epi32(IMM8)) } @@ -1573,7 +1663,8 @@ pub fn _mm_shldi_epi32(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shldi_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shldi_epi32( src: __m128i, k: __mmask8, a: __m128i, @@ -1594,7 +1685,12 @@ pub fn _mm_mask_shldi_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shldi_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shldi_epi32( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_shldi_epi32::(a, b).as_i32x4(); @@ -1610,7 +1706,8 @@ pub fn _mm_maskz_shldi_epi32(k: __mmask8, a: __m128i, b: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm512_shldi_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shldi_epi16(a: __m512i, b: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_shldv_epi16(a, b, _mm512_set1_epi16(IMM8 as i16)) } @@ -1623,7 +1720,8 @@ pub fn _mm512_shldi_epi16(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shldi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shldi_epi16( src: __m512i, k: __mmask32, a: __m512i, @@ -1644,7 +1742,12 @@ pub fn _mm512_mask_shldi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shldi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shldi_epi16( + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm512_shldi_epi16::(a, b).as_i16x32(); @@ -1660,7 +1763,8 @@ pub fn _mm512_maskz_shldi_epi16(k: __mmask32, a: __m512i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm256_shldi_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shldi_epi16(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_shldv_epi16(a, b, _mm256_set1_epi16(IMM8 as i16)) } @@ -1673,7 +1777,8 @@ pub fn _mm256_shldi_epi16(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shldi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shldi_epi16( src: __m256i, k: __mmask16, a: __m256i, @@ -1694,7 +1799,12 @@ pub fn _mm256_mask_shldi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shldi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shldi_epi16( + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_shldi_epi16::(a, b).as_i16x16(); @@ -1710,7 +1820,8 @@ pub fn _mm256_maskz_shldi_epi16(k: __mmask16, a: __m256i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(2)] -pub fn _mm_shldi_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shldi_epi16(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_shldv_epi16(a, b, _mm_set1_epi16(IMM8 as i16)) } @@ -1723,7 +1834,8 @@ pub fn _mm_shldi_epi16(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shldi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shldi_epi16( src: __m128i, k: __mmask8, a: __m128i, @@ -1744,7 +1856,12 @@ pub fn _mm_mask_shldi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shldi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shldi_epi16( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_shldi_epi16::(a, b).as_i16x8(); @@ -1760,7 +1877,8 @@ pub fn _mm_maskz_shldi_epi16(k: __mmask8, a: __m128i, b: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(2)] -pub fn _mm512_shrdi_epi64(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shrdi_epi64(a: __m512i, b: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_shrdv_epi64(a, b, _mm512_set1_epi64(IMM8 as i64)) } @@ -1773,7 +1891,8 @@ pub fn _mm512_shrdi_epi64(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shrdi_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shrdi_epi64( src: __m512i, k: __mmask8, a: __m512i, @@ -1794,7 +1913,12 @@ pub fn _mm512_mask_shrdi_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 255))] //should be vpshrdq #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shrdi_epi64(k: __mmask8, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shrdi_epi64( + k: __mmask8, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm512_shrdi_epi64::(a, b).as_i64x8(); @@ -1810,7 +1934,8 @@ pub fn _mm512_maskz_shrdi_epi64(k: __mmask8, a: __m512i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(2)] -pub fn _mm256_shrdi_epi64(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shrdi_epi64(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_shrdv_epi64(a, b, _mm256_set1_epi64x(IMM8 as i64)) } @@ -1823,7 +1948,8 @@ pub fn _mm256_shrdi_epi64(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shrdi_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shrdi_epi64( src: __m256i, k: __mmask8, a: __m256i, @@ -1844,7 +1970,12 @@ pub fn _mm256_mask_shrdi_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shrdi_epi64(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shrdi_epi64( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_shrdi_epi64::(a, b).as_i64x4(); @@ -1860,7 +1991,8 @@ pub fn _mm256_maskz_shrdi_epi64(k: __mmask8, a: __m256i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(2)] -pub fn _mm_shrdi_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shrdi_epi64(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_shrdv_epi64(a, b, _mm_set1_epi64x(IMM8 as i64)) } @@ -1873,7 +2005,8 @@ pub fn _mm_shrdi_epi64(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shrdi_epi64( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shrdi_epi64( src: __m128i, k: __mmask8, a: __m128i, @@ -1894,7 +2027,12 @@ pub fn _mm_mask_shrdi_epi64( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldq, IMM8 = 5))] //should be vpshrdq #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shrdi_epi64(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shrdi_epi64( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_shrdi_epi64::(a, b).as_i64x2(); @@ -1910,7 +2048,8 @@ pub fn _mm_maskz_shrdi_epi64(k: __mmask8, a: __m128i, b: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(2)] -pub fn _mm512_shrdi_epi32(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shrdi_epi32(a: __m512i, b: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_shrdv_epi32(a, b, _mm512_set1_epi32(IMM8)) } @@ -1923,7 +2062,8 @@ pub fn _mm512_shrdi_epi32(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shrdi_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shrdi_epi32( src: __m512i, k: __mmask16, a: __m512i, @@ -1944,7 +2084,12 @@ pub fn _mm512_mask_shrdi_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shrdi_epi32(k: __mmask16, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shrdi_epi32( + k: __mmask16, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm512_shrdi_epi32::(a, b).as_i32x16(); @@ -1960,7 +2105,8 @@ pub fn _mm512_maskz_shrdi_epi32(k: __mmask16, a: __m512i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(2)] -pub fn _mm256_shrdi_epi32(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shrdi_epi32(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_shrdv_epi32(a, b, _mm256_set1_epi32(IMM8)) } @@ -1973,7 +2119,8 @@ pub fn _mm256_shrdi_epi32(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shrdi_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shrdi_epi32( src: __m256i, k: __mmask8, a: __m256i, @@ -1994,7 +2141,12 @@ pub fn _mm256_mask_shrdi_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shrdi_epi32(k: __mmask8, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shrdi_epi32( + k: __mmask8, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_shrdi_epi32::(a, b).as_i32x8(); @@ -2010,7 +2162,8 @@ pub fn _mm256_maskz_shrdi_epi32(k: __mmask8, a: __m256i, b: __m #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(2)] -pub fn _mm_shrdi_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shrdi_epi32(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_shrdv_epi32(a, b, _mm_set1_epi32(IMM8)) } @@ -2023,7 +2176,8 @@ pub fn _mm_shrdi_epi32(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shrdi_epi32( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shrdi_epi32( src: __m128i, k: __mmask8, a: __m128i, @@ -2044,7 +2198,12 @@ pub fn _mm_mask_shrdi_epi32( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldd, IMM8 = 5))] //should be vpshldd #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shrdi_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shrdi_epi32( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_shrdi_epi32::(a, b).as_i32x4(); @@ -2060,7 +2219,8 @@ pub fn _mm_maskz_shrdi_epi32(k: __mmask8, a: __m128i, b: __m128 #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(2)] -pub fn _mm512_shrdi_epi16(a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_shrdi_epi16(a: __m512i, b: __m512i) -> __m512i { static_assert_uimm_bits!(IMM8, 8); _mm512_shrdv_epi16(a, b, _mm512_set1_epi16(IMM8 as i16)) } @@ -2073,7 +2233,8 @@ pub fn _mm512_shrdi_epi16(a: __m512i, b: __m512i) -> __m512i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(4)] -pub fn _mm512_mask_shrdi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_shrdi_epi16( src: __m512i, k: __mmask32, a: __m512i, @@ -2094,7 +2255,12 @@ pub fn _mm512_mask_shrdi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(3)] -pub fn _mm512_maskz_shrdi_epi16(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_shrdi_epi16( + k: __mmask32, + a: __m512i, + b: __m512i, +) -> __m512i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm512_shrdi_epi16::(a, b).as_i16x32(); @@ -2110,7 +2276,8 @@ pub fn _mm512_maskz_shrdi_epi16(k: __mmask32, a: __m512i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(2)] -pub fn _mm256_shrdi_epi16(a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_shrdi_epi16(a: __m256i, b: __m256i) -> __m256i { static_assert_uimm_bits!(IMM8, 8); _mm256_shrdv_epi16(a, b, _mm256_set1_epi16(IMM8 as i16)) } @@ -2123,7 +2290,8 @@ pub fn _mm256_shrdi_epi16(a: __m256i, b: __m256i) -> __m256i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(4)] -pub fn _mm256_mask_shrdi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_shrdi_epi16( src: __m256i, k: __mmask16, a: __m256i, @@ -2144,7 +2312,12 @@ pub fn _mm256_mask_shrdi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(3)] -pub fn _mm256_maskz_shrdi_epi16(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_shrdi_epi16( + k: __mmask16, + a: __m256i, + b: __m256i, +) -> __m256i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm256_shrdi_epi16::(a, b).as_i16x16(); @@ -2160,7 +2333,8 @@ pub fn _mm256_maskz_shrdi_epi16(k: __mmask16, a: __m256i, b: __ #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(2)] -pub fn _mm_shrdi_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shrdi_epi16(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); _mm_shrdv_epi16(a, b, _mm_set1_epi16(IMM8 as i16)) } @@ -2173,7 +2347,8 @@ pub fn _mm_shrdi_epi16(a: __m128i, b: __m128i) -> __m128i { #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(4)] -pub fn _mm_mask_shrdi_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_shrdi_epi16( src: __m128i, k: __mmask8, a: __m128i, @@ -2194,7 +2369,12 @@ pub fn _mm_mask_shrdi_epi16( #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpshldw, IMM8 = 5))] //should be vpshrdw #[rustc_legacy_const_generics(3)] -pub fn _mm_maskz_shrdi_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_shrdi_epi16( + k: __mmask8, + a: __m128i, + b: __m128i, +) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); let shf = _mm_shrdi_epi16::(a, b).as_i16x8(); @@ -2262,6 +2442,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; @@ -2269,7 +2450,7 @@ mod tests { use crate::hint::black_box; #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_compress_epi16() { + fn test_mm512_mask_compress_epi16() { let src = _mm512_set1_epi16(200); #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -2284,7 +2465,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_compress_epi16() { + fn test_mm512_maskz_compress_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -2298,7 +2479,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_compress_epi16() { + fn test_mm256_mask_compress_epi16() { let src = _mm256_set1_epi16(200); let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_mask_compress_epi16(src, 0b01010101_01010101, a); @@ -2309,7 +2490,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_compress_epi16() { + fn test_mm256_maskz_compress_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_compress_epi16(0b01010101_01010101, a); let e = _mm256_set_epi16(0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 15); @@ -2317,7 +2498,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_compress_epi16() { + fn test_mm_mask_compress_epi16() { let src = _mm_set1_epi16(200); let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_mask_compress_epi16(src, 0b01010101, a); @@ -2326,7 +2507,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_compress_epi16() { + fn test_mm_maskz_compress_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_maskz_compress_epi16(0b01010101, a); let e = _mm_set_epi16(0, 0, 0, 0, 1, 3, 5, 7); @@ -2334,7 +2515,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_compress_epi8() { + fn test_mm512_mask_compress_epi8() { let src = _mm512_set1_epi8(100); #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -2357,7 +2538,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_compress_epi8() { + fn test_mm512_maskz_compress_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -2378,7 +2559,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_compress_epi8() { + fn test_mm256_mask_compress_epi8() { let src = _mm256_set1_epi8(100); #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -2393,7 +2574,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_compress_epi8() { + fn test_mm256_maskz_compress_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -2407,7 +2588,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_compress_epi8() { + fn test_mm_mask_compress_epi8() { let src = _mm_set1_epi8(100); let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_mask_compress_epi8(src, 0b01010101_01010101, a); @@ -2418,7 +2599,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_compress_epi8() { + fn test_mm_maskz_compress_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_compress_epi8(0b01010101_01010101, a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 15); @@ -2426,7 +2607,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_expand_epi16() { + fn test_mm512_mask_expand_epi16() { let src = _mm512_set1_epi16(200); #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -2441,7 +2622,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_expand_epi16() { + fn test_mm512_maskz_expand_epi16() { #[rustfmt::skip] let a = _mm512_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -2453,7 +2634,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_expand_epi16() { + fn test_mm256_mask_expand_epi16() { let src = _mm256_set1_epi16(200); let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_mask_expand_epi16(src, 0b01010101_01010101, a); @@ -2464,7 +2645,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_expand_epi16() { + fn test_mm256_maskz_expand_epi16() { let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_expand_epi16(0b01010101_01010101, a); let e = _mm256_set_epi16(0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15); @@ -2472,7 +2653,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_expand_epi16() { + fn test_mm_mask_expand_epi16() { let src = _mm_set1_epi16(200); let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_mask_expand_epi16(src, 0b01010101, a); @@ -2481,7 +2662,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_expand_epi16() { + fn test_mm_maskz_expand_epi16() { let a = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_maskz_expand_epi16(0b01010101, a); let e = _mm_set_epi16(0, 4, 0, 5, 0, 6, 0, 7); @@ -2489,7 +2670,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_expand_epi8() { + fn test_mm512_mask_expand_epi8() { let src = _mm512_set1_epi8(100); #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -2512,7 +2693,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_expand_epi8() { + fn test_mm512_maskz_expand_epi8() { #[rustfmt::skip] let a = _mm512_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -2533,7 +2714,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_expand_epi8() { + fn test_mm256_mask_expand_epi8() { let src = _mm256_set1_epi8(100); #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -2548,7 +2729,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_expand_epi8() { + fn test_mm256_maskz_expand_epi8() { #[rustfmt::skip] let a = _mm256_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); @@ -2562,7 +2743,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_expand_epi8() { + fn test_mm_mask_expand_epi8() { let src = _mm_set1_epi8(100); let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_mask_expand_epi8(src, 0b01010101_01010101, a); @@ -2573,7 +2754,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_expand_epi8() { + fn test_mm_maskz_expand_epi8() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_expand_epi8(0b01010101_01010101, a); let e = _mm_set_epi8(0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15); @@ -2581,7 +2762,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shldv_epi64() { + const fn test_mm512_shldv_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(1 << 63); let c = _mm512_set1_epi64(2); @@ -2591,7 +2772,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shldv_epi64() { + const fn test_mm512_mask_shldv_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(1 << 63); let c = _mm512_set1_epi64(2); @@ -2603,7 +2784,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shldv_epi64() { + const fn test_mm512_maskz_shldv_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(1 << 63); let c = _mm512_set1_epi64(2); @@ -2615,7 +2796,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shldv_epi64() { + const fn test_mm256_shldv_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(1 << 63); let c = _mm256_set1_epi64x(2); @@ -2625,7 +2806,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shldv_epi64() { + const fn test_mm256_mask_shldv_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(1 << 63); let c = _mm256_set1_epi64x(2); @@ -2637,7 +2818,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shldv_epi64() { + const fn test_mm256_maskz_shldv_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(1 << 63); let c = _mm256_set1_epi64x(2); @@ -2649,7 +2830,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shldv_epi64() { + const fn test_mm_shldv_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(1 << 63); let c = _mm_set1_epi64x(2); @@ -2659,7 +2840,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shldv_epi64() { + const fn test_mm_mask_shldv_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(1 << 63); let c = _mm_set1_epi64x(2); @@ -2671,7 +2852,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shldv_epi64() { + const fn test_mm_maskz_shldv_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(1 << 63); let c = _mm_set1_epi64x(2); @@ -2683,7 +2864,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shldv_epi32() { + const fn test_mm512_shldv_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(1 << 31); let c = _mm512_set1_epi32(2); @@ -2693,7 +2874,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shldv_epi32() { + const fn test_mm512_mask_shldv_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(1 << 31); let c = _mm512_set1_epi32(2); @@ -2705,7 +2886,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shldv_epi32() { + const fn test_mm512_maskz_shldv_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(1 << 31); let c = _mm512_set1_epi32(2); @@ -2717,7 +2898,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shldv_epi32() { + const fn test_mm256_shldv_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(1 << 31); let c = _mm256_set1_epi32(2); @@ -2727,7 +2908,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shldv_epi32() { + const fn test_mm256_mask_shldv_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(1 << 31); let c = _mm256_set1_epi32(2); @@ -2739,7 +2920,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shldv_epi32() { + const fn test_mm256_maskz_shldv_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(1 << 31); let c = _mm256_set1_epi32(2); @@ -2751,7 +2932,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shldv_epi32() { + const fn test_mm_shldv_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(1 << 31); let c = _mm_set1_epi32(2); @@ -2761,7 +2942,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shldv_epi32() { + const fn test_mm_mask_shldv_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(1 << 31); let c = _mm_set1_epi32(2); @@ -2773,7 +2954,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shldv_epi32() { + const fn test_mm_maskz_shldv_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(1 << 31); let c = _mm_set1_epi32(2); @@ -2785,7 +2966,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shldv_epi16() { + const fn test_mm512_shldv_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1 << 15); let c = _mm512_set1_epi16(2); @@ -2795,7 +2976,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shldv_epi16() { + const fn test_mm512_mask_shldv_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1 << 15); let c = _mm512_set1_epi16(2); @@ -2807,7 +2988,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shldv_epi16() { + const fn test_mm512_maskz_shldv_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1 << 15); let c = _mm512_set1_epi16(2); @@ -2819,7 +3000,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shldv_epi16() { + const fn test_mm256_shldv_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1 << 15); let c = _mm256_set1_epi16(2); @@ -2829,7 +3010,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shldv_epi16() { + const fn test_mm256_mask_shldv_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1 << 15); let c = _mm256_set1_epi16(2); @@ -2841,7 +3022,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shldv_epi16() { + const fn test_mm256_maskz_shldv_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1 << 15); let c = _mm256_set1_epi16(2); @@ -2853,7 +3034,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shldv_epi16() { + const fn test_mm_shldv_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1 << 15); let c = _mm_set1_epi16(2); @@ -2863,7 +3044,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shldv_epi16() { + const fn test_mm_mask_shldv_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1 << 15); let c = _mm_set1_epi16(2); @@ -2875,7 +3056,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shldv_epi16() { + const fn test_mm_maskz_shldv_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1 << 15); let c = _mm_set1_epi16(2); @@ -2887,7 +3068,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shrdv_epi64() { + const fn test_mm512_shrdv_epi64() { let a = _mm512_set1_epi64(2); let b = _mm512_set1_epi64(8); let c = _mm512_set1_epi64(1); @@ -2897,7 +3078,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shrdv_epi64() { + const fn test_mm512_mask_shrdv_epi64() { let a = _mm512_set1_epi64(2); let b = _mm512_set1_epi64(8); let c = _mm512_set1_epi64(1); @@ -2909,7 +3090,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shrdv_epi64() { + const fn test_mm512_maskz_shrdv_epi64() { let a = _mm512_set1_epi64(2); let b = _mm512_set1_epi64(8); let c = _mm512_set1_epi64(1); @@ -2921,7 +3102,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shrdv_epi64() { + const fn test_mm256_shrdv_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(8); let c = _mm256_set1_epi64x(1); @@ -2931,7 +3112,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shrdv_epi64() { + const fn test_mm256_mask_shrdv_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(8); let c = _mm256_set1_epi64x(1); @@ -2943,7 +3124,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shrdv_epi64() { + const fn test_mm256_maskz_shrdv_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(8); let c = _mm256_set1_epi64x(1); @@ -2955,7 +3136,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shrdv_epi64() { + const fn test_mm_shrdv_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(8); let c = _mm_set1_epi64x(1); @@ -2965,7 +3146,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shrdv_epi64() { + const fn test_mm_mask_shrdv_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(8); let c = _mm_set1_epi64x(1); @@ -2977,7 +3158,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shrdv_epi64() { + const fn test_mm_maskz_shrdv_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(8); let c = _mm_set1_epi64x(1); @@ -2989,7 +3170,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shrdv_epi32() { + const fn test_mm512_shrdv_epi32() { let a = _mm512_set1_epi32(2); let b = _mm512_set1_epi32(8); let c = _mm512_set1_epi32(1); @@ -2999,7 +3180,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shrdv_epi32() { + const fn test_mm512_mask_shrdv_epi32() { let a = _mm512_set1_epi32(2); let b = _mm512_set1_epi32(8); let c = _mm512_set1_epi32(1); @@ -3011,7 +3192,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shrdv_epi32() { + const fn test_mm512_maskz_shrdv_epi32() { let a = _mm512_set1_epi32(2); let b = _mm512_set1_epi32(8); let c = _mm512_set1_epi32(1); @@ -3023,7 +3204,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shrdv_epi32() { + const fn test_mm256_shrdv_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(8); let c = _mm256_set1_epi32(1); @@ -3033,7 +3214,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shrdv_epi32() { + const fn test_mm256_mask_shrdv_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(8); let c = _mm256_set1_epi32(1); @@ -3045,7 +3226,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shrdv_epi32() { + const fn test_mm256_maskz_shrdv_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(8); let c = _mm256_set1_epi32(1); @@ -3057,7 +3238,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shrdv_epi32() { + const fn test_mm_shrdv_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(8); let c = _mm_set1_epi32(1); @@ -3067,7 +3248,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shrdv_epi32() { + const fn test_mm_mask_shrdv_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(8); let c = _mm_set1_epi32(1); @@ -3079,7 +3260,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shrdv_epi32() { + const fn test_mm_maskz_shrdv_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(8); let c = _mm_set1_epi32(1); @@ -3091,7 +3272,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shrdv_epi16() { + const fn test_mm512_shrdv_epi16() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(8); let c = _mm512_set1_epi16(1); @@ -3101,7 +3282,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shrdv_epi16() { + const fn test_mm512_mask_shrdv_epi16() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(8); let c = _mm512_set1_epi16(1); @@ -3113,7 +3294,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shrdv_epi16() { + const fn test_mm512_maskz_shrdv_epi16() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(8); let c = _mm512_set1_epi16(1); @@ -3125,7 +3306,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shrdv_epi16() { + const fn test_mm256_shrdv_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(8); let c = _mm256_set1_epi16(1); @@ -3135,7 +3316,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shrdv_epi16() { + const fn test_mm256_mask_shrdv_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(8); let c = _mm256_set1_epi16(1); @@ -3147,7 +3328,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shrdv_epi16() { + const fn test_mm256_maskz_shrdv_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(8); let c = _mm256_set1_epi16(1); @@ -3159,7 +3340,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shrdv_epi16() { + const fn test_mm_shrdv_epi16() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(8); let c = _mm_set1_epi16(1); @@ -3169,7 +3350,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shrdv_epi16() { + const fn test_mm_mask_shrdv_epi16() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(8); let c = _mm_set1_epi16(1); @@ -3181,7 +3362,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shrdv_epi16() { + const fn test_mm_maskz_shrdv_epi16() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(8); let c = _mm_set1_epi16(1); @@ -3193,7 +3374,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shldi_epi64() { + const fn test_mm512_shldi_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(1 << 63); let r = _mm512_shldi_epi64::<2>(a, b); @@ -3202,7 +3383,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shldi_epi64() { + const fn test_mm512_mask_shldi_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(1 << 63); let r = _mm512_mask_shldi_epi64::<2>(a, 0, a, b); @@ -3213,7 +3394,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shldi_epi64() { + const fn test_mm512_maskz_shldi_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(1 << 63); let r = _mm512_maskz_shldi_epi64::<2>(0, a, b); @@ -3224,7 +3405,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shldi_epi64() { + const fn test_mm256_shldi_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(1 << 63); let r = _mm256_shldi_epi64::<2>(a, b); @@ -3233,7 +3414,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shldi_epi64() { + const fn test_mm256_mask_shldi_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(1 << 63); let r = _mm256_mask_shldi_epi64::<2>(a, 0, a, b); @@ -3244,7 +3425,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shldi_epi64() { + const fn test_mm256_maskz_shldi_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(1 << 63); let r = _mm256_maskz_shldi_epi64::<2>(0, a, b); @@ -3255,7 +3436,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shldi_epi64() { + const fn test_mm_shldi_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(1 << 63); let r = _mm_shldi_epi64::<2>(a, b); @@ -3264,7 +3445,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shldi_epi64() { + const fn test_mm_mask_shldi_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(1 << 63); let r = _mm_mask_shldi_epi64::<2>(a, 0, a, b); @@ -3275,7 +3456,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shldi_epi64() { + const fn test_mm_maskz_shldi_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(1 << 63); let r = _mm_maskz_shldi_epi64::<2>(0, a, b); @@ -3286,7 +3467,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shldi_epi32() { + const fn test_mm512_shldi_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(1 << 31); let r = _mm512_shldi_epi32::<2>(a, b); @@ -3295,7 +3476,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shldi_epi32() { + const fn test_mm512_mask_shldi_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(1 << 31); let r = _mm512_mask_shldi_epi32::<2>(a, 0, a, b); @@ -3306,7 +3487,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shldi_epi32() { + const fn test_mm512_maskz_shldi_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_set1_epi32(1 << 31); let r = _mm512_maskz_shldi_epi32::<2>(0, a, b); @@ -3317,7 +3498,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shldi_epi32() { + const fn test_mm256_shldi_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(1 << 31); let r = _mm256_shldi_epi32::<2>(a, b); @@ -3326,7 +3507,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shldi_epi32() { + const fn test_mm256_mask_shldi_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(1 << 31); let r = _mm256_mask_shldi_epi32::<2>(a, 0, a, b); @@ -3337,7 +3518,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shldi_epi32() { + const fn test_mm256_maskz_shldi_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set1_epi32(1 << 31); let r = _mm256_maskz_shldi_epi32::<2>(0, a, b); @@ -3348,7 +3529,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shldi_epi32() { + const fn test_mm_shldi_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(1 << 31); let r = _mm_shldi_epi32::<2>(a, b); @@ -3357,7 +3538,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shldi_epi32() { + const fn test_mm_mask_shldi_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(1 << 31); let r = _mm_mask_shldi_epi32::<2>(a, 0, a, b); @@ -3368,7 +3549,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shldi_epi32() { + const fn test_mm_maskz_shldi_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set1_epi32(1 << 31); let r = _mm_maskz_shldi_epi32::<2>(0, a, b); @@ -3379,7 +3560,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shldi_epi16() { + const fn test_mm512_shldi_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1 << 15); let r = _mm512_shldi_epi16::<2>(a, b); @@ -3388,7 +3569,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shldi_epi16() { + const fn test_mm512_mask_shldi_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1 << 15); let r = _mm512_mask_shldi_epi16::<2>(a, 0, a, b); @@ -3399,7 +3580,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shldi_epi16() { + const fn test_mm512_maskz_shldi_epi16() { let a = _mm512_set1_epi16(1); let b = _mm512_set1_epi16(1 << 15); let r = _mm512_maskz_shldi_epi16::<2>(0, a, b); @@ -3410,7 +3591,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shldi_epi16() { + const fn test_mm256_shldi_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1 << 15); let r = _mm256_shldi_epi16::<2>(a, b); @@ -3419,7 +3600,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shldi_epi16() { + const fn test_mm256_mask_shldi_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1 << 15); let r = _mm256_mask_shldi_epi16::<2>(a, 0, a, b); @@ -3430,7 +3611,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shldi_epi16() { + const fn test_mm256_maskz_shldi_epi16() { let a = _mm256_set1_epi16(1); let b = _mm256_set1_epi16(1 << 15); let r = _mm256_maskz_shldi_epi16::<2>(0, a, b); @@ -3441,7 +3622,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shldi_epi16() { + const fn test_mm_shldi_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1 << 15); let r = _mm_shldi_epi16::<2>(a, b); @@ -3450,7 +3631,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shldi_epi16() { + const fn test_mm_mask_shldi_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1 << 15); let r = _mm_mask_shldi_epi16::<2>(a, 0, a, b); @@ -3461,7 +3642,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shldi_epi16() { + const fn test_mm_maskz_shldi_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(1 << 15); let r = _mm_maskz_shldi_epi16::<2>(0, a, b); @@ -3472,7 +3653,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shrdi_epi64() { + const fn test_mm512_shrdi_epi64() { let a = _mm512_set1_epi64(2); let b = _mm512_set1_epi64(8); let r = _mm512_shrdi_epi64::<1>(a, b); @@ -3481,7 +3662,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shrdi_epi64() { + const fn test_mm512_mask_shrdi_epi64() { let a = _mm512_set1_epi64(2); let b = _mm512_set1_epi64(8); let r = _mm512_mask_shrdi_epi64::<1>(a, 0, a, b); @@ -3492,7 +3673,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shrdi_epi64() { + const fn test_mm512_maskz_shrdi_epi64() { let a = _mm512_set1_epi64(2); let b = _mm512_set1_epi64(8); let r = _mm512_maskz_shrdi_epi64::<1>(0, a, b); @@ -3503,7 +3684,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shrdi_epi64() { + const fn test_mm256_shrdi_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(8); let r = _mm256_shrdi_epi64::<1>(a, b); @@ -3512,7 +3693,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shrdi_epi64() { + const fn test_mm256_mask_shrdi_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(8); let r = _mm256_mask_shrdi_epi64::<1>(a, 0, a, b); @@ -3523,7 +3704,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shrdi_epi64() { + const fn test_mm256_maskz_shrdi_epi64() { let a = _mm256_set1_epi64x(2); let b = _mm256_set1_epi64x(8); let r = _mm256_maskz_shrdi_epi64::<1>(0, a, b); @@ -3534,7 +3715,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shrdi_epi64() { + const fn test_mm_shrdi_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(8); let r = _mm_shrdi_epi64::<1>(a, b); @@ -3543,7 +3724,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shrdi_epi64() { + const fn test_mm_mask_shrdi_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(8); let r = _mm_mask_shrdi_epi64::<1>(a, 0, a, b); @@ -3554,7 +3735,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shrdi_epi64() { + const fn test_mm_maskz_shrdi_epi64() { let a = _mm_set1_epi64x(2); let b = _mm_set1_epi64x(8); let r = _mm_maskz_shrdi_epi64::<1>(0, a, b); @@ -3565,7 +3746,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shrdi_epi32() { + const fn test_mm512_shrdi_epi32() { let a = _mm512_set1_epi32(2); let b = _mm512_set1_epi32(8); let r = _mm512_shrdi_epi32::<1>(a, b); @@ -3574,7 +3755,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shrdi_epi32() { + const fn test_mm512_mask_shrdi_epi32() { let a = _mm512_set1_epi32(2); let b = _mm512_set1_epi32(8); let r = _mm512_mask_shrdi_epi32::<1>(a, 0, a, b); @@ -3585,7 +3766,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shrdi_epi32() { + const fn test_mm512_maskz_shrdi_epi32() { let a = _mm512_set1_epi32(2); let b = _mm512_set1_epi32(8); let r = _mm512_maskz_shrdi_epi32::<1>(0, a, b); @@ -3596,7 +3777,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shrdi_epi32() { + const fn test_mm256_shrdi_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(8); let r = _mm256_shrdi_epi32::<1>(a, b); @@ -3605,7 +3786,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shrdi_epi32() { + const fn test_mm256_mask_shrdi_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(8); let r = _mm256_mask_shrdi_epi32::<1>(a, 0, a, b); @@ -3616,7 +3797,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shrdi_epi32() { + const fn test_mm256_maskz_shrdi_epi32() { let a = _mm256_set1_epi32(2); let b = _mm256_set1_epi32(8); let r = _mm256_maskz_shrdi_epi32::<1>(0, a, b); @@ -3627,7 +3808,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shrdi_epi32() { + const fn test_mm_shrdi_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(8); let r = _mm_shrdi_epi32::<1>(a, b); @@ -3636,7 +3817,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shrdi_epi32() { + const fn test_mm_mask_shrdi_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(8); let r = _mm_mask_shrdi_epi32::<1>(a, 0, a, b); @@ -3647,7 +3828,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shrdi_epi32() { + const fn test_mm_maskz_shrdi_epi32() { let a = _mm_set1_epi32(2); let b = _mm_set1_epi32(8); let r = _mm_maskz_shrdi_epi32::<1>(0, a, b); @@ -3658,7 +3839,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_shrdi_epi16() { + const fn test_mm512_shrdi_epi16() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(8); let r = _mm512_shrdi_epi16::<1>(a, b); @@ -3667,7 +3848,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_mask_shrdi_epi16() { + const fn test_mm512_mask_shrdi_epi16() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(8); let r = _mm512_mask_shrdi_epi16::<1>(a, 0, a, b); @@ -3678,7 +3859,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2")] - unsafe fn test_mm512_maskz_shrdi_epi16() { + const fn test_mm512_maskz_shrdi_epi16() { let a = _mm512_set1_epi16(2); let b = _mm512_set1_epi16(8); let r = _mm512_maskz_shrdi_epi16::<1>(0, a, b); @@ -3689,7 +3870,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_shrdi_epi16() { + const fn test_mm256_shrdi_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(8); let r = _mm256_shrdi_epi16::<1>(a, b); @@ -3698,7 +3879,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_mask_shrdi_epi16() { + const fn test_mm256_mask_shrdi_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(8); let r = _mm256_mask_shrdi_epi16::<1>(a, 0, a, b); @@ -3709,7 +3890,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm256_maskz_shrdi_epi16() { + const fn test_mm256_maskz_shrdi_epi16() { let a = _mm256_set1_epi16(2); let b = _mm256_set1_epi16(8); let r = _mm256_maskz_shrdi_epi16::<1>(0, a, b); @@ -3720,7 +3901,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_shrdi_epi16() { + const fn test_mm_shrdi_epi16() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(8); let r = _mm_shrdi_epi16::<1>(a, b); @@ -3729,7 +3910,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_mask_shrdi_epi16() { + const fn test_mm_mask_shrdi_epi16() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(8); let r = _mm_mask_shrdi_epi16::<1>(a, 0, a, b); @@ -3740,7 +3921,7 @@ mod tests { } #[simd_test(enable = "avx512vbmi2,avx512vl")] - unsafe fn test_mm_maskz_shrdi_epi16() { + const fn test_mm_maskz_shrdi_epi16() { let a = _mm_set1_epi16(2); let b = _mm_set1_epi16(8); let r = _mm_maskz_shrdi_epi16::<1>(0, a, b); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs b/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs index 93ea01cbb45b..49b790b15104 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512vnni.rs @@ -970,7 +970,7 @@ mod tests { use stdarch_test::simd_test; #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_dpwssd_epi32() { + fn test_mm512_dpwssd_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 16 | 1 << 0); let b = _mm512_set1_epi32(1 << 16 | 1 << 0); @@ -980,7 +980,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_mask_dpwssd_epi32() { + fn test_mm512_mask_dpwssd_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 16 | 1 << 0); let b = _mm512_set1_epi32(1 << 16 | 1 << 0); @@ -992,7 +992,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_maskz_dpwssd_epi32() { + fn test_mm512_maskz_dpwssd_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 16 | 1 << 0); let b = _mm512_set1_epi32(1 << 16 | 1 << 0); @@ -1004,7 +1004,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm256_dpwssd_avx_epi32() { + fn test_mm256_dpwssd_avx_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1014,7 +1014,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_dpwssd_epi32() { + fn test_mm256_dpwssd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1024,7 +1024,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_mask_dpwssd_epi32() { + fn test_mm256_mask_dpwssd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1036,7 +1036,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_maskz_dpwssd_epi32() { + fn test_mm256_maskz_dpwssd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1048,7 +1048,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm_dpwssd_avx_epi32() { + fn test_mm_dpwssd_avx_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1058,7 +1058,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_dpwssd_epi32() { + fn test_mm_dpwssd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1068,7 +1068,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_mask_dpwssd_epi32() { + fn test_mm_mask_dpwssd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1080,7 +1080,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_maskz_dpwssd_epi32() { + fn test_mm_maskz_dpwssd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1092,7 +1092,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_dpwssds_epi32() { + fn test_mm512_dpwssds_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 16 | 1 << 0); let b = _mm512_set1_epi32(1 << 16 | 1 << 0); @@ -1102,7 +1102,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_mask_dpwssds_epi32() { + fn test_mm512_mask_dpwssds_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 16 | 1 << 0); let b = _mm512_set1_epi32(1 << 16 | 1 << 0); @@ -1114,7 +1114,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_maskz_dpwssds_epi32() { + fn test_mm512_maskz_dpwssds_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 16 | 1 << 0); let b = _mm512_set1_epi32(1 << 16 | 1 << 0); @@ -1126,7 +1126,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm256_dpwssds_avx_epi32() { + fn test_mm256_dpwssds_avx_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1136,7 +1136,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_dpwssds_epi32() { + fn test_mm256_dpwssds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1146,7 +1146,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_mask_dpwssds_epi32() { + fn test_mm256_mask_dpwssds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1158,7 +1158,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_maskz_dpwssds_epi32() { + fn test_mm256_maskz_dpwssds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1170,7 +1170,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm_dpwssds_avx_epi32() { + fn test_mm_dpwssds_avx_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1180,7 +1180,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_dpwssds_epi32() { + fn test_mm_dpwssds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1190,7 +1190,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_mask_dpwssds_epi32() { + fn test_mm_mask_dpwssds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1202,7 +1202,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_maskz_dpwssds_epi32() { + fn test_mm_maskz_dpwssds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1214,7 +1214,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_dpbusd_epi32() { + fn test_mm512_dpbusd_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1224,7 +1224,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_mask_dpbusd_epi32() { + fn test_mm512_mask_dpbusd_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1236,7 +1236,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_maskz_dpbusd_epi32() { + fn test_mm512_maskz_dpbusd_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1248,7 +1248,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm256_dpbusd_avx_epi32() { + fn test_mm256_dpbusd_avx_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1258,7 +1258,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_dpbusd_epi32() { + fn test_mm256_dpbusd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1268,7 +1268,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_mask_dpbusd_epi32() { + fn test_mm256_mask_dpbusd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1280,7 +1280,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_maskz_dpbusd_epi32() { + fn test_mm256_maskz_dpbusd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1292,7 +1292,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm_dpbusd_avx_epi32() { + fn test_mm_dpbusd_avx_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1302,7 +1302,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_dpbusd_epi32() { + fn test_mm_dpbusd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1312,7 +1312,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_mask_dpbusd_epi32() { + fn test_mm_mask_dpbusd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1324,7 +1324,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_maskz_dpbusd_epi32() { + fn test_mm_maskz_dpbusd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1336,7 +1336,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_dpbusds_epi32() { + fn test_mm512_dpbusds_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1346,7 +1346,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_mask_dpbusds_epi32() { + fn test_mm512_mask_dpbusds_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1358,7 +1358,7 @@ mod tests { } #[simd_test(enable = "avx512vnni")] - unsafe fn test_mm512_maskz_dpbusds_epi32() { + fn test_mm512_maskz_dpbusds_epi32() { let src = _mm512_set1_epi32(1); let a = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm512_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1370,7 +1370,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm256_dpbusds_avx_epi32() { + fn test_mm256_dpbusds_avx_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1380,7 +1380,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_dpbusds_epi32() { + fn test_mm256_dpbusds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1390,7 +1390,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_mask_dpbusds_epi32() { + fn test_mm256_mask_dpbusds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1402,7 +1402,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm256_maskz_dpbusds_epi32() { + fn test_mm256_maskz_dpbusds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1414,7 +1414,7 @@ mod tests { } #[simd_test(enable = "avxvnni")] - unsafe fn test_mm_dpbusds_avx_epi32() { + fn test_mm_dpbusds_avx_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1424,7 +1424,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_dpbusds_epi32() { + fn test_mm_dpbusds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1434,7 +1434,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_mask_dpbusds_epi32() { + fn test_mm_mask_dpbusds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1446,7 +1446,7 @@ mod tests { } #[simd_test(enable = "avx512vnni,avx512vl")] - unsafe fn test_mm_maskz_dpbusds_epi32() { + fn test_mm_maskz_dpbusds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1458,7 +1458,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm_dpbssd_epi32() { + fn test_mm_dpbssd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1468,7 +1468,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm256_dpbssd_epi32() { + fn test_mm256_dpbssd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1478,7 +1478,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm_dpbssds_epi32() { + fn test_mm_dpbssds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1488,7 +1488,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm256_dpbssds_epi32() { + fn test_mm256_dpbssds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1498,7 +1498,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm_dpbsud_epi32() { + fn test_mm_dpbsud_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1508,7 +1508,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm256_dpbsud_epi32() { + fn test_mm256_dpbsud_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1518,7 +1518,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm_dpbsuds_epi32() { + fn test_mm_dpbsuds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1528,7 +1528,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm256_dpbsuds_epi32() { + fn test_mm256_dpbsuds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1538,7 +1538,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm_dpbuud_epi32() { + fn test_mm_dpbuud_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1548,7 +1548,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm256_dpbuud_epi32() { + fn test_mm256_dpbuud_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1558,7 +1558,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm_dpbuuds_epi32() { + fn test_mm_dpbuuds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1568,7 +1568,7 @@ mod tests { } #[simd_test(enable = "avxvnniint8")] - unsafe fn test_mm256_dpbuuds_epi32() { + fn test_mm256_dpbuuds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); let b = _mm256_set1_epi32(1 << 24 | 1 << 16 | 1 << 8 | 1 << 0); @@ -1578,7 +1578,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm_dpwsud_epi32() { + fn test_mm_dpwsud_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1588,7 +1588,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm256_dpwsud_epi32() { + fn test_mm256_dpwsud_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1598,7 +1598,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm_dpwsuds_epi32() { + fn test_mm_dpwsuds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1608,7 +1608,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm256_dpwsuds_epi32() { + fn test_mm256_dpwsuds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1618,7 +1618,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm_dpwusd_epi32() { + fn test_mm_dpwusd_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1628,7 +1628,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm256_dpwusd_epi32() { + fn test_mm256_dpwusd_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1638,7 +1638,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm_dpwusds_epi32() { + fn test_mm_dpwusds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1648,7 +1648,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm256_dpwusds_epi32() { + fn test_mm256_dpwusds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1658,7 +1658,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm_dpwuud_epi32() { + fn test_mm_dpwuud_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1668,7 +1668,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm256_dpwuud_epi32() { + fn test_mm256_dpwuud_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); @@ -1678,7 +1678,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm_dpwuuds_epi32() { + fn test_mm_dpwuuds_epi32() { let src = _mm_set1_epi32(1); let a = _mm_set1_epi32(1 << 16 | 1 << 0); let b = _mm_set1_epi32(1 << 16 | 1 << 0); @@ -1688,7 +1688,7 @@ mod tests { } #[simd_test(enable = "avxvnniint16")] - unsafe fn test_mm256_dpwuuds_epi32() { + fn test_mm256_dpwuuds_epi32() { let src = _mm256_set1_epi32(1); let a = _mm256_set1_epi32(1 << 16 | 1 << 0); let b = _mm256_set1_epi32(1 << 16 | 1 << 0); diff --git a/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs b/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs index e47a14b24dfc..476640fab561 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx512vpopcntdq.rs @@ -5,7 +5,7 @@ //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref]. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf use crate::core_arch::simd::*; use crate::core_arch::x86::__m128i; @@ -26,7 +26,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "avx512vpopcntdq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm512_popcnt_epi32(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_popcnt_epi32(a: __m512i) -> __m512i { unsafe { transmute(simd_ctpop(a.as_i32x16())) } } @@ -40,7 +41,8 @@ pub fn _mm512_popcnt_epi32(a: __m512i) -> __m512i { #[target_feature(enable = "avx512vpopcntdq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -60,7 +62,8 @@ pub fn _mm512_maskz_popcnt_epi32(k: __mmask16, a: __m512i) -> __m512i { #[target_feature(enable = "avx512vpopcntdq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -77,7 +80,8 @@ pub fn _mm512_mask_popcnt_epi32(src: __m512i, k: __mmask16, a: __m512i) -> __m51 #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm256_popcnt_epi32(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_popcnt_epi32(a: __m256i) -> __m256i { unsafe { transmute(simd_ctpop(a.as_i32x8())) } } @@ -91,7 +95,8 @@ pub fn _mm256_popcnt_epi32(a: __m256i) -> __m256i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -111,7 +116,8 @@ pub fn _mm256_maskz_popcnt_epi32(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -128,7 +134,8 @@ pub fn _mm256_mask_popcnt_epi32(src: __m256i, k: __mmask8, a: __m256i) -> __m256 #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm_popcnt_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_popcnt_epi32(a: __m128i) -> __m128i { unsafe { transmute(simd_ctpop(a.as_i32x4())) } } @@ -142,7 +149,8 @@ pub fn _mm_popcnt_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -162,7 +170,8 @@ pub fn _mm_maskz_popcnt_epi32(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntd))] -pub fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -179,7 +188,8 @@ pub fn _mm_mask_popcnt_epi32(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512vpopcntdq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm512_popcnt_epi64(a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_popcnt_epi64(a: __m512i) -> __m512i { unsafe { transmute(simd_ctpop(a.as_i64x8())) } } @@ -193,7 +203,8 @@ pub fn _mm512_popcnt_epi64(a: __m512i) -> __m512i { #[target_feature(enable = "avx512vpopcntdq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -213,7 +224,8 @@ pub fn _mm512_maskz_popcnt_epi64(k: __mmask8, a: __m512i) -> __m512i { #[target_feature(enable = "avx512vpopcntdq")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512i { unsafe { transmute(simd_select_bitmask( k, @@ -230,7 +242,8 @@ pub fn _mm512_mask_popcnt_epi64(src: __m512i, k: __mmask8, a: __m512i) -> __m512 #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm256_popcnt_epi64(a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_popcnt_epi64(a: __m256i) -> __m256i { unsafe { transmute(simd_ctpop(a.as_i64x4())) } } @@ -244,7 +257,8 @@ pub fn _mm256_popcnt_epi64(a: __m256i) -> __m256i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -264,7 +278,8 @@ pub fn _mm256_maskz_popcnt_epi64(k: __mmask8, a: __m256i) -> __m256i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256i { unsafe { transmute(simd_select_bitmask( k, @@ -281,7 +296,8 @@ pub fn _mm256_mask_popcnt_epi64(src: __m256i, k: __mmask8, a: __m256i) -> __m256 #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm_popcnt_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_popcnt_epi64(a: __m128i) -> __m128i { unsafe { transmute(simd_ctpop(a.as_i64x2())) } } @@ -295,7 +311,8 @@ pub fn _mm_popcnt_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -315,7 +332,8 @@ pub fn _mm_maskz_popcnt_epi64(k: __mmask8, a: __m128i) -> __m128i { #[target_feature(enable = "avx512vpopcntdq,avx512vl")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vpopcntq))] -pub fn _mm_mask_popcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mask_popcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { unsafe { transmute(simd_select_bitmask( k, @@ -327,12 +345,13 @@ pub fn _mm_mask_popcnt_epi64(src: __m128i, k: __mmask8, a: __m128i) -> __m128i { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "avx512vpopcntdq,avx512f")] - unsafe fn test_mm512_popcnt_epi32() { + const fn test_mm512_popcnt_epi32() { let test_data = _mm512_set_epi32( 0, 1, @@ -358,7 +377,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f")] - unsafe fn test_mm512_mask_popcnt_epi32() { + const fn test_mm512_mask_popcnt_epi32() { let test_data = _mm512_set_epi32( 0, 1, @@ -401,7 +420,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f")] - unsafe fn test_mm512_maskz_popcnt_epi32() { + const fn test_mm512_maskz_popcnt_epi32() { let test_data = _mm512_set_epi32( 0, 1, @@ -427,7 +446,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")] - unsafe fn test_mm256_popcnt_epi32() { + const fn test_mm256_popcnt_epi32() { let test_data = _mm256_set_epi32(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100); let actual_result = _mm256_popcnt_epi32(test_data); let reference_result = _mm256_set_epi32(0, 1, 32, 1, 3, 15, 31, 28); @@ -435,7 +454,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")] - unsafe fn test_mm256_mask_popcnt_epi32() { + const fn test_mm256_mask_popcnt_epi32() { let test_data = _mm256_set_epi32(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100); let mask = 0xF0; let actual_result = _mm256_mask_popcnt_epi32(test_data, mask, test_data); @@ -444,7 +463,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")] - unsafe fn test_mm256_maskz_popcnt_epi32() { + const fn test_mm256_maskz_popcnt_epi32() { let test_data = _mm256_set_epi32(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF, -100); let mask = 0xF0; let actual_result = _mm256_maskz_popcnt_epi32(mask, test_data); @@ -453,7 +472,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")] - unsafe fn test_mm_popcnt_epi32() { + const fn test_mm_popcnt_epi32() { let test_data = _mm_set_epi32(0, 1, -1, -100); let actual_result = _mm_popcnt_epi32(test_data); let reference_result = _mm_set_epi32(0, 1, 32, 28); @@ -461,7 +480,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")] - unsafe fn test_mm_mask_popcnt_epi32() { + const fn test_mm_mask_popcnt_epi32() { let test_data = _mm_set_epi32(0, 1, -1, -100); let mask = 0xE; let actual_result = _mm_mask_popcnt_epi32(test_data, mask, test_data); @@ -470,7 +489,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f,avx512vl")] - unsafe fn test_mm_maskz_popcnt_epi32() { + const fn test_mm_maskz_popcnt_epi32() { let test_data = _mm_set_epi32(0, 1, -1, -100); let mask = 0xE; let actual_result = _mm_maskz_popcnt_epi32(mask, test_data); @@ -479,7 +498,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f")] - unsafe fn test_mm512_popcnt_epi64() { + const fn test_mm512_popcnt_epi64() { let test_data = _mm512_set_epi64(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100); let actual_result = _mm512_popcnt_epi64(test_data); let reference_result = _mm512_set_epi64(0, 1, 64, 1, 3, 15, 63, 60); @@ -487,7 +506,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f")] - unsafe fn test_mm512_mask_popcnt_epi64() { + const fn test_mm512_mask_popcnt_epi64() { let test_data = _mm512_set_epi64(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100); let mask = 0xF0; let actual_result = _mm512_mask_popcnt_epi64(test_data, mask, test_data); @@ -497,7 +516,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512f")] - unsafe fn test_mm512_maskz_popcnt_epi64() { + const fn test_mm512_maskz_popcnt_epi64() { let test_data = _mm512_set_epi64(0, 1, -1, 2, 7, 0xFF_FE, 0x7F_FF_FF_FF_FF_FF_FF_FF, -100); let mask = 0xF0; let actual_result = _mm512_maskz_popcnt_epi64(mask, test_data); @@ -506,7 +525,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512vl")] - unsafe fn test_mm256_popcnt_epi64() { + const fn test_mm256_popcnt_epi64() { let test_data = _mm256_set_epi64x(0, 1, -1, -100); let actual_result = _mm256_popcnt_epi64(test_data); let reference_result = _mm256_set_epi64x(0, 1, 64, 60); @@ -514,7 +533,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512vl")] - unsafe fn test_mm256_mask_popcnt_epi64() { + const fn test_mm256_mask_popcnt_epi64() { let test_data = _mm256_set_epi64x(0, 1, -1, -100); let mask = 0xE; let actual_result = _mm256_mask_popcnt_epi64(test_data, mask, test_data); @@ -523,7 +542,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512vl")] - unsafe fn test_mm256_maskz_popcnt_epi64() { + const fn test_mm256_maskz_popcnt_epi64() { let test_data = _mm256_set_epi64x(0, 1, -1, -100); let mask = 0xE; let actual_result = _mm256_maskz_popcnt_epi64(mask, test_data); @@ -532,7 +551,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512vl")] - unsafe fn test_mm_popcnt_epi64() { + const fn test_mm_popcnt_epi64() { let test_data = _mm_set_epi64x(0, 1); let actual_result = _mm_popcnt_epi64(test_data); let reference_result = _mm_set_epi64x(0, 1); @@ -544,7 +563,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512vl")] - unsafe fn test_mm_mask_popcnt_epi64() { + const fn test_mm_mask_popcnt_epi64() { let test_data = _mm_set_epi64x(0, -100); let mask = 0x2; let actual_result = _mm_mask_popcnt_epi64(test_data, mask, test_data); @@ -558,7 +577,7 @@ mod tests { } #[simd_test(enable = "avx512vpopcntdq,avx512vl")] - unsafe fn test_mm_maskz_popcnt_epi64() { + const fn test_mm_maskz_popcnt_epi64() { let test_data = _mm_set_epi64x(0, 1); let mask = 0x2; let actual_result = _mm_maskz_popcnt_epi64(mask, test_data); diff --git a/library/stdarch/crates/core_arch/src/x86/avxneconvert.rs b/library/stdarch/crates/core_arch/src/x86/avxneconvert.rs index b92ec823ec64..a53d6d97e8a0 100644 --- a/library/stdarch/crates/core_arch/src/x86/avxneconvert.rs +++ b/library/stdarch/crates/core_arch/src/x86/avxneconvert.rs @@ -87,7 +87,7 @@ pub unsafe fn _mm256_cvtneebf16_ps(a: *const __m256bh) -> __m256 { #[inline] #[target_feature(enable = "avxneconvert")] #[cfg_attr(test, assert_instr(vcvtneeph2ps))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub unsafe fn _mm_cvtneeph_ps(a: *const __m128h) -> __m128 { transmute(cvtneeph2ps_128(a)) } @@ -99,7 +99,7 @@ pub unsafe fn _mm_cvtneeph_ps(a: *const __m128h) -> __m128 { #[inline] #[target_feature(enable = "avxneconvert")] #[cfg_attr(test, assert_instr(vcvtneeph2ps))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub unsafe fn _mm256_cvtneeph_ps(a: *const __m256h) -> __m256 { transmute(cvtneeph2ps_256(a)) } @@ -135,7 +135,7 @@ pub unsafe fn _mm256_cvtneobf16_ps(a: *const __m256bh) -> __m256 { #[inline] #[target_feature(enable = "avxneconvert")] #[cfg_attr(test, assert_instr(vcvtneoph2ps))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub unsafe fn _mm_cvtneoph_ps(a: *const __m128h) -> __m128 { transmute(cvtneoph2ps_128(a)) } @@ -147,7 +147,7 @@ pub unsafe fn _mm_cvtneoph_ps(a: *const __m128h) -> __m128 { #[inline] #[target_feature(enable = "avxneconvert")] #[cfg_attr(test, assert_instr(vcvtneoph2ps))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub unsafe fn _mm256_cvtneoph_ps(a: *const __m256h) -> __m256 { transmute(cvtneoph2ps_256(a)) } diff --git a/library/stdarch/crates/core_arch/src/x86/bmi1.rs b/library/stdarch/crates/core_arch/src/x86/bmi1.rs index eb7242944abc..432051abd1cf 100644 --- a/library/stdarch/crates/core_arch/src/x86/bmi1.rs +++ b/library/stdarch/crates/core_arch/src/x86/bmi1.rs @@ -6,7 +6,7 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions //! available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf //! [wikipedia_bmi]: https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 #[cfg(test)] @@ -46,7 +46,8 @@ pub fn _bextr2_u32(a: u32, control: u32) -> u32 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(andn))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _andn_u32(a: u32, b: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _andn_u32(a: u32, b: u32) -> u32 { !a & b } @@ -57,7 +58,8 @@ pub fn _andn_u32(a: u32, b: u32) -> u32 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(blsi))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsi_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsi_u32(x: u32) -> u32 { x & x.wrapping_neg() } @@ -68,7 +70,8 @@ pub fn _blsi_u32(x: u32) -> u32 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(blsmsk))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsmsk_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsmsk_u32(x: u32) -> u32 { x ^ (x.wrapping_sub(1_u32)) } @@ -81,7 +84,8 @@ pub fn _blsmsk_u32(x: u32) -> u32 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(blsr))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsr_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsr_u32(x: u32) -> u32 { x & (x.wrapping_sub(1)) } @@ -94,7 +98,8 @@ pub fn _blsr_u32(x: u32) -> u32 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(tzcnt))] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub fn _tzcnt_u16(x: u16) -> u16 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _tzcnt_u16(x: u16) -> u16 { x.trailing_zeros() as u16 } @@ -107,7 +112,8 @@ pub fn _tzcnt_u16(x: u16) -> u16 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(tzcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _tzcnt_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _tzcnt_u32(x: u32) -> u32 { x.trailing_zeros() } @@ -120,7 +126,8 @@ pub fn _tzcnt_u32(x: u32) -> u32 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(tzcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_tzcnt_32(x: u32) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_tzcnt_32(x: u32) -> i32 { x.trailing_zeros() as i32 } @@ -131,18 +138,19 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "bmi1")] - unsafe fn test_bextr_u32() { + fn test_bextr_u32() { let r = _bextr_u32(0b0101_0000u32, 4, 4); assert_eq!(r, 0b0000_0101u32); } #[simd_test(enable = "bmi1")] - unsafe fn test_andn_u32() { + const fn test_andn_u32() { assert_eq!(_andn_u32(0, 0), 0); assert_eq!(_andn_u32(0, 1), 1); assert_eq!(_andn_u32(1, 0), 0); @@ -165,32 +173,32 @@ mod tests { } #[simd_test(enable = "bmi1")] - unsafe fn test_blsi_u32() { + const fn test_blsi_u32() { assert_eq!(_blsi_u32(0b1101_0000u32), 0b0001_0000u32); } #[simd_test(enable = "bmi1")] - unsafe fn test_blsmsk_u32() { + const fn test_blsmsk_u32() { let r = _blsmsk_u32(0b0011_0000u32); assert_eq!(r, 0b0001_1111u32); } #[simd_test(enable = "bmi1")] - unsafe fn test_blsr_u32() { + const fn test_blsr_u32() { // TODO: test the behavior when the input is `0`. let r = _blsr_u32(0b0011_0000u32); assert_eq!(r, 0b0010_0000u32); } #[simd_test(enable = "bmi1")] - unsafe fn test_tzcnt_u16() { + const fn test_tzcnt_u16() { assert_eq!(_tzcnt_u16(0b0000_0001u16), 0u16); assert_eq!(_tzcnt_u16(0b0000_0000u16), 16u16); assert_eq!(_tzcnt_u16(0b1001_0000u16), 4u16); } #[simd_test(enable = "bmi1")] - unsafe fn test_tzcnt_u32() { + const fn test_tzcnt_u32() { assert_eq!(_tzcnt_u32(0b0000_0001u32), 0u32); assert_eq!(_tzcnt_u32(0b0000_0000u32), 32u32); assert_eq!(_tzcnt_u32(0b1001_0000u32), 4u32); diff --git a/library/stdarch/crates/core_arch/src/x86/bmi2.rs b/library/stdarch/crates/core_arch/src/x86/bmi2.rs index 83cf650923f7..5320640d9687 100644 --- a/library/stdarch/crates/core_arch/src/x86/bmi2.rs +++ b/library/stdarch/crates/core_arch/src/x86/bmi2.rs @@ -6,7 +6,7 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions //! available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf //! [wikipedia_bmi]: //! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 @@ -25,7 +25,8 @@ use stdarch_test::assert_instr; #[cfg_attr(all(test, target_arch = "x86"), assert_instr(mul))] #[target_feature(enable = "bmi2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mulx_u32(a: u32, b: u32, hi: &mut u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mulx_u32(a: u32, b: u32, hi: &mut u32) -> u32 { let result: u64 = (a as u64) * (b as u64); *hi = (result >> 32) as u32; result as u32 @@ -77,12 +78,13 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "bmi2")] - unsafe fn test_pext_u32() { + fn test_pext_u32() { let n = 0b1011_1110_1001_0011u32; let m0 = 0b0110_0011_1000_0101u32; @@ -96,7 +98,7 @@ mod tests { } #[simd_test(enable = "bmi2")] - unsafe fn test_pdep_u32() { + fn test_pdep_u32() { let n = 0b1011_1110_1001_0011u32; let m0 = 0b0110_0011_1000_0101u32; @@ -110,14 +112,14 @@ mod tests { } #[simd_test(enable = "bmi2")] - unsafe fn test_bzhi_u32() { + fn test_bzhi_u32() { let n = 0b1111_0010u32; let s = 0b0001_0010u32; assert_eq!(_bzhi_u32(n, 5), s); } #[simd_test(enable = "bmi2")] - unsafe fn test_mulx_u32() { + const fn test_mulx_u32() { let a: u32 = 4_294_967_200; let b: u32 = 2; let mut hi = 0; diff --git a/library/stdarch/crates/core_arch/src/x86/bswap.rs b/library/stdarch/crates/core_arch/src/x86/bswap.rs index ea07a7d6229a..f8e177f7c278 100644 --- a/library/stdarch/crates/core_arch/src/x86/bswap.rs +++ b/library/stdarch/crates/core_arch/src/x86/bswap.rs @@ -10,16 +10,20 @@ use stdarch_test::assert_instr; #[inline] #[cfg_attr(test, assert_instr(bswap))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _bswap(x: i32) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _bswap(x: i32) -> i32 { x.swap_bytes() } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; + use stdarch_test::simd_test; + use super::*; - #[test] - fn test_bswap() { + #[simd_test] + const fn test_bswap() { assert_eq!(_bswap(0x0EADBE0F), 0x0FBEAD0E); assert_eq!(_bswap(0x00000000), 0x00000000); } diff --git a/library/stdarch/crates/core_arch/src/x86/cpuid.rs b/library/stdarch/crates/core_arch/src/x86/cpuid.rs index 0634f10a99fd..3f13ea8369bb 100644 --- a/library/stdarch/crates/core_arch/src/x86/cpuid.rs +++ b/library/stdarch/crates/core_arch/src/x86/cpuid.rs @@ -28,12 +28,21 @@ pub struct CpuidResult { /// Returns the result of the `cpuid` instruction for a given `leaf` (`EAX`) /// and `sub_leaf` (`ECX`). /// -/// The highest-supported leaf value is returned by the first tuple argument of -/// [`__get_cpuid_max(0)`](fn.__get_cpuid_max.html). For leaves containing -/// sub-leaves, the second tuple argument returns the highest-supported -/// sub-leaf value. +/// There are two types of information leaves - basic leaves (with `leaf < 0x8000000`) +/// and extended leaves (with `leaf >= 0x80000000`). The highest supported basic and +/// extended leaves can be obtained by calling CPUID with `0` and `0x80000000`, +/// respectively, and reading the value in the `EAX` register. If the leaf supports +/// more than one sub-leaf, then the procedure of obtaining the highest supported +/// sub-leaf, as well as the behavior if a invalid sub-leaf value is passed, depends +/// on the specific leaf. /// -/// The [CPUID Wikipedia page][wiki_cpuid] contains how to query which +/// If the `leaf` value is higher than the maximum supported basic or extended leaf +/// for the processor, this returns the information for the highest supported basic +/// information leaf (with the passed `sub_leaf` value). If the `leaf` value is less +/// than or equal to the highest basic or extended leaf value, but the leaf is not +/// supported on the processor, all zeros are returned. +/// +/// The [CPUID Wikipedia page][wiki_cpuid] contains information on how to query which /// information using the `EAX` and `ECX` registers, and the interpretation of /// the results returned in `EAX`, `EBX`, `ECX`, and `EDX`. /// @@ -45,11 +54,15 @@ pub struct CpuidResult { /// /// [wiki_cpuid]: https://en.wikipedia.org/wiki/CPUID /// [intel64_ref]: https://cdrdv2-public.intel.com/671110/325383-sdm-vol-2abcd.pdf -/// [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +/// [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 #[inline] #[cfg_attr(test, assert_instr(cpuid))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult { +pub fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult { + if cfg!(target_env = "sgx") { + panic!("`__cpuid` cannot be used in SGX"); + } + let eax; let ebx; let ecx; @@ -58,7 +71,7 @@ pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult { // LLVM sometimes reserves `ebx` for its internal use, we so we need to use // a scratch register for it instead. #[cfg(target_arch = "x86")] - { + unsafe { asm!( "mov {0}, ebx", "cpuid", @@ -71,7 +84,7 @@ pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult { ); } #[cfg(target_arch = "x86_64")] - { + unsafe { asm!( "mov {0:r}, rbx", "cpuid", @@ -86,27 +99,26 @@ pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult { CpuidResult { eax, ebx, ecx, edx } } +/// Calls CPUID with the provided `leaf` value, with `sub_leaf` set to 0. /// See [`__cpuid_count`](fn.__cpuid_count.html). #[inline] #[cfg_attr(test, assert_instr(cpuid))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn __cpuid(leaf: u32) -> CpuidResult { +pub fn __cpuid(leaf: u32) -> CpuidResult { __cpuid_count(leaf, 0) } -/// Returns the highest-supported `leaf` (`EAX`) and sub-leaf (`ECX`) `cpuid` -/// values. +/// Returns the EAX and EBX register after calling CPUID with the provided `leaf`, +/// with `sub_leaf` set to 0. /// -/// If `cpuid` is supported, and `leaf` is zero, then the first tuple argument -/// contains the highest `leaf` value that `cpuid` supports. For `leaf`s -/// containing sub-leafs, the second tuple argument contains the -/// highest-supported sub-leaf value. +/// If `leaf` if 0 or `0x80000000`, the first tuple argument contains the maximum +/// supported basic or extended leaf, respectively. /// /// See also [`__cpuid`](fn.__cpuid.html) and /// [`__cpuid_count`](fn.__cpuid_count.html). #[inline] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn __get_cpuid_max(leaf: u32) -> (u32, u32) { +pub fn __get_cpuid_max(leaf: u32) -> (u32, u32) { let CpuidResult { eax, ebx, .. } = __cpuid(leaf); (eax, ebx) } diff --git a/library/stdarch/crates/core_arch/src/x86/f16c.rs b/library/stdarch/crates/core_arch/src/x86/f16c.rs index 519cc38294a3..0a26a9ff8d25 100644 --- a/library/stdarch/crates/core_arch/src/x86/f16c.rs +++ b/library/stdarch/crates/core_arch/src/x86/f16c.rs @@ -25,7 +25,8 @@ unsafe extern "unadjusted" { #[target_feature(enable = "f16c")] #[cfg_attr(test, assert_instr("vcvtph2ps"))] #[stable(feature = "x86_f16c_intrinsics", since = "1.68.0")] -pub fn _mm_cvtph_ps(a: __m128i) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtph_ps(a: __m128i) -> __m128 { unsafe { let a: f16x8 = transmute(a); let a: f16x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -41,7 +42,8 @@ pub fn _mm_cvtph_ps(a: __m128i) -> __m128 { #[target_feature(enable = "f16c")] #[cfg_attr(test, assert_instr("vcvtph2ps"))] #[stable(feature = "x86_f16c_intrinsics", since = "1.68.0")] -pub fn _mm256_cvtph_ps(a: __m128i) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_cvtph_ps(a: __m128i) -> __m256 { unsafe { let a: f16x8 = transmute(a); simd_cast(a) @@ -103,6 +105,7 @@ pub fn _mm256_cvtps_ph(a: __m256) -> __m128i { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::{core_arch::x86::*, mem::transmute}; use stdarch_test::simd_test; @@ -116,7 +119,7 @@ mod tests { const F16_EIGHT: i16 = 0x4800; #[simd_test(enable = "f16c")] - unsafe fn test_mm_cvtph_ps() { + const fn test_mm_cvtph_ps() { let a = _mm_set_epi16(0, 0, 0, 0, F16_ONE, F16_TWO, F16_THREE, F16_FOUR); let r = _mm_cvtph_ps(a); let e = _mm_set_ps(1.0, 2.0, 3.0, 4.0); @@ -124,7 +127,7 @@ mod tests { } #[simd_test(enable = "f16c")] - unsafe fn test_mm256_cvtph_ps() { + const fn test_mm256_cvtph_ps() { let a = _mm_set_epi16( F16_ONE, F16_TWO, F16_THREE, F16_FOUR, F16_FIVE, F16_SIX, F16_SEVEN, F16_EIGHT, ); @@ -134,7 +137,7 @@ mod tests { } #[simd_test(enable = "f16c")] - unsafe fn test_mm_cvtps_ph() { + fn test_mm_cvtps_ph() { let a = _mm_set_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_cvtps_ph::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm_set_epi16(0, 0, 0, 0, F16_ONE, F16_TWO, F16_THREE, F16_FOUR); @@ -142,7 +145,7 @@ mod tests { } #[simd_test(enable = "f16c")] - unsafe fn test_mm256_cvtps_ph() { + fn test_mm256_cvtps_ph() { let a = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm256_cvtps_ph::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm_set_epi16( diff --git a/library/stdarch/crates/core_arch/src/x86/fma.rs b/library/stdarch/crates/core_arch/src/x86/fma.rs index d3988422b9a4..b95bb331dfb0 100644 --- a/library/stdarch/crates/core_arch/src/x86/fma.rs +++ b/library/stdarch/crates/core_arch/src/x86/fma.rs @@ -14,8 +14,8 @@ //! Wikipedia's [FMA][wiki_fma] page provides a quick overview of the //! instructions available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate use crate::core_arch::x86::*; @@ -33,7 +33,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_fma(a, b, c) } } @@ -45,7 +46,8 @@ pub fn _mm_fmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_fma(a, b, c) } } @@ -57,7 +59,8 @@ pub fn _mm256_fmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_fma(a, b, c) } } @@ -69,7 +72,8 @@ pub fn _mm_fmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_fma(a, b, c) } } @@ -83,7 +87,8 @@ pub fn _mm256_fmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_insert!( a, @@ -103,7 +108,8 @@ pub fn _mm_fmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_insert!( a, @@ -122,7 +128,8 @@ pub fn _mm_fmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmaddsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -139,7 +146,8 @@ pub fn _mm_fmaddsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmaddsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -156,7 +164,8 @@ pub fn _mm256_fmaddsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmaddsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmaddsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmaddsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -173,7 +182,8 @@ pub fn _mm_fmaddsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmaddsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmaddsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmaddsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -189,7 +199,8 @@ pub fn _mm256_fmaddsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -201,7 +212,8 @@ pub fn _mm_fmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -213,7 +225,8 @@ pub fn _mm256_fmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsub213ps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -225,7 +238,8 @@ pub fn _mm_fmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsub213ps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_fma(a, b, simd_neg(c)) } } @@ -239,7 +253,8 @@ pub fn _mm256_fmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_insert!( a, @@ -259,7 +274,8 @@ pub fn _mm_fmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_insert!( a, @@ -278,7 +294,8 @@ pub fn _mm_fmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsubadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -295,7 +312,8 @@ pub fn _mm_fmsubadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsubadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -312,7 +330,8 @@ pub fn _mm256_fmsubadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsubadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fmsubadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fmsubadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -329,7 +348,8 @@ pub fn _mm_fmsubadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfmsubadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fmsubadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fmsubadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { let add = simd_fma(a, b, c); let sub = simd_fma(a, b, simd_neg(c)); @@ -345,7 +365,8 @@ pub fn _mm256_fmsubadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -357,7 +378,8 @@ pub fn _mm_fnmadd_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -369,7 +391,8 @@ pub fn _mm256_fnmadd_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -381,7 +404,8 @@ pub fn _mm_fnmadd_ps(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fnmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fnmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_fma(simd_neg(a), b, c) } } @@ -395,7 +419,8 @@ pub fn _mm256_fnmadd_ps(a: __m256, b: __m256, c: __m256) -> __m256 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_insert!( a, @@ -415,7 +440,8 @@ pub fn _mm_fnmadd_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmadd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_insert!( a, @@ -434,7 +460,8 @@ pub fn _mm_fnmadd_ss(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -447,7 +474,8 @@ pub fn _mm_fnmsub_pd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -460,7 +488,8 @@ pub fn _mm256_fnmsub_pd(a: __m256d, b: __m256d, c: __m256d) -> __m256d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -473,7 +502,8 @@ pub fn _mm_fnmsub_ps(a: __m128, b: __m128, c: __m128) -> __m128 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_fnmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_fnmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { unsafe { simd_fma(simd_neg(a), b, simd_neg(c)) } } @@ -488,7 +518,8 @@ pub fn _mm256_fnmsub_ps(a: __m256, b: __m256, c: __m256) -> __m256 { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { unsafe { simd_insert!( a, @@ -509,7 +540,8 @@ pub fn _mm_fnmsub_sd(a: __m128d, b: __m128d, c: __m128d) -> __m128d { #[target_feature(enable = "fma")] #[cfg_attr(test, assert_instr(vfnmsub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_fnmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_fnmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 { unsafe { simd_insert!( a, @@ -521,13 +553,14 @@ pub fn _mm_fnmsub_ss(a: __m128, b: __m128, c: __m128) -> __m128 { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "fma")] - unsafe fn test_mm_fmadd_pd() { + const fn test_mm_fmadd_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -536,7 +569,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmadd_pd() { + const fn test_mm256_fmadd_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 3., 7., 2.); let c = _mm256_setr_pd(4., 9., 1., 7.); @@ -545,7 +578,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmadd_ps() { + const fn test_mm_fmadd_ps() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -554,7 +587,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmadd_ps() { + const fn test_mm256_fmadd_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.); let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.); let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.); @@ -563,7 +596,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmadd_sd() { + const fn test_mm_fmadd_sd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -572,7 +605,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmadd_ss() { + const fn test_mm_fmadd_ss() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -581,7 +614,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmaddsub_pd() { + const fn test_mm_fmaddsub_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -590,7 +623,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmaddsub_pd() { + const fn test_mm256_fmaddsub_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 3., 7., 2.); let c = _mm256_setr_pd(4., 9., 1., 7.); @@ -599,7 +632,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmaddsub_ps() { + const fn test_mm_fmaddsub_ps() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -608,7 +641,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmaddsub_ps() { + const fn test_mm256_fmaddsub_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.); let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.); let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.); @@ -617,7 +650,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmsub_pd() { + const fn test_mm_fmsub_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -626,7 +659,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmsub_pd() { + const fn test_mm256_fmsub_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 3., 7., 2.); let c = _mm256_setr_pd(4., 9., 1., 7.); @@ -635,7 +668,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmsub_ps() { + const fn test_mm_fmsub_ps() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -644,7 +677,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmsub_ps() { + const fn test_mm256_fmsub_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.); let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.); let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.); @@ -653,7 +686,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmsub_sd() { + const fn test_mm_fmsub_sd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -662,7 +695,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmsub_ss() { + const fn test_mm_fmsub_ss() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -671,7 +704,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmsubadd_pd() { + const fn test_mm_fmsubadd_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -680,7 +713,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmsubadd_pd() { + const fn test_mm256_fmsubadd_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 3., 7., 2.); let c = _mm256_setr_pd(4., 9., 1., 7.); @@ -689,7 +722,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fmsubadd_ps() { + const fn test_mm_fmsubadd_ps() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -698,7 +731,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fmsubadd_ps() { + const fn test_mm256_fmsubadd_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.); let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.); let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.); @@ -707,7 +740,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmadd_pd() { + const fn test_mm_fnmadd_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -716,7 +749,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fnmadd_pd() { + const fn test_mm256_fnmadd_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 3., 7., 2.); let c = _mm256_setr_pd(4., 9., 1., 7.); @@ -725,7 +758,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmadd_ps() { + const fn test_mm_fnmadd_ps() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -734,7 +767,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fnmadd_ps() { + const fn test_mm256_fnmadd_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.); let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.); let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.); @@ -743,7 +776,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmadd_sd() { + const fn test_mm_fnmadd_sd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -752,7 +785,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmadd_ss() { + const fn test_mm_fnmadd_ss() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -761,7 +794,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmsub_pd() { + const fn test_mm_fnmsub_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -770,7 +803,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fnmsub_pd() { + const fn test_mm256_fnmsub_pd() { let a = _mm256_setr_pd(1., 2., 3., 4.); let b = _mm256_setr_pd(5., 3., 7., 2.); let c = _mm256_setr_pd(4., 9., 1., 7.); @@ -779,7 +812,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmsub_ps() { + const fn test_mm_fnmsub_ps() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); @@ -788,7 +821,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm256_fnmsub_ps() { + const fn test_mm256_fnmsub_ps() { let a = _mm256_setr_ps(1., 2., 3., 4., 0., 10., -1., -2.); let b = _mm256_setr_ps(5., 3., 7., 2., 4., -6., 0., 14.); let c = _mm256_setr_ps(4., 9., 1., 7., -5., 11., -2., -3.); @@ -797,7 +830,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmsub_sd() { + const fn test_mm_fnmsub_sd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(5., 3.); let c = _mm_setr_pd(4., 9.); @@ -806,7 +839,7 @@ mod tests { } #[simd_test(enable = "fma")] - unsafe fn test_mm_fnmsub_ss() { + const fn test_mm_fnmsub_ss() { let a = _mm_setr_ps(1., 2., 3., 4.); let b = _mm_setr_ps(5., 3., 7., 2.); let c = _mm_setr_ps(4., 9., 1., 7.); diff --git a/library/stdarch/crates/core_arch/src/x86/gfni.rs b/library/stdarch/crates/core_arch/src/x86/gfni.rs index 8c4d097fee9e..681b8ae330d4 100644 --- a/library/stdarch/crates/core_arch/src/x86/gfni.rs +++ b/library/stdarch/crates/core_arch/src/x86/gfni.rs @@ -5,7 +5,7 @@ //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref]. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf use crate::core_arch::simd::i8x16; use crate::core_arch::simd::i8x32; diff --git a/library/stdarch/crates/core_arch/src/x86/mod.rs b/library/stdarch/crates/core_arch/src/x86/mod.rs index 79a593e647f1..c40fbd3ca317 100644 --- a/library/stdarch/crates/core_arch/src/x86/mod.rs +++ b/library/stdarch/crates/core_arch/src/x86/mod.rs @@ -401,7 +401,7 @@ types! { } types! { - #![unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] + #![stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] /// 128-bit wide set of 8 `f16` types, x86-specific /// @@ -520,14 +520,14 @@ macro_rules! as_transmute { ($from:ty => $as_from:ident, $($as_to:ident -> $to:ident),* $(,)?) => { impl $from {$( #[inline] - pub(crate) fn $as_to(self) -> crate::core_arch::simd::$to { + pub(crate) const fn $as_to(self) -> crate::core_arch::simd::$to { unsafe { transmute(self) } } )*} $( impl crate::core_arch::simd::$to { #[inline] - pub(crate) fn $as_from(self) -> $from { + pub(crate) const fn $as_from(self) -> $from { unsafe { transmute(self) } } } @@ -768,7 +768,7 @@ mod avxneconvert; pub use self::avxneconvert::*; mod avx512fp16; -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub use self::avx512fp16::*; mod kl; diff --git a/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs b/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs index cce6a51e2cd6..0f2769257f95 100644 --- a/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs +++ b/library/stdarch/crates/core_arch/src/x86/pclmulqdq.rs @@ -3,7 +3,7 @@ //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref] (p. 4-241). //! -//! [intel64_ref]: http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf use crate::core_arch::x86::__m128i; @@ -45,7 +45,7 @@ mod tests { use crate::core_arch::x86::*; #[simd_test(enable = "pclmulqdq")] - unsafe fn test_mm_clmulepi64_si128() { + fn test_mm_clmulepi64_si128() { // Constants taken from https://software.intel.com/sites/default/files/managed/72/cc/clmul-wp-rev-2.02-2014-04-20.pdf let a = _mm_set_epi64x(0x7b5b546573745665, 0x63746f725d53475d); let b = _mm_set_epi64x(0x4869285368617929, 0x5b477565726f6e5d); diff --git a/library/stdarch/crates/core_arch/src/x86/rtm.rs b/library/stdarch/crates/core_arch/src/x86/rtm.rs index b807305d6aa8..b37e7571eb8f 100644 --- a/library/stdarch/crates/core_arch/src/x86/rtm.rs +++ b/library/stdarch/crates/core_arch/src/x86/rtm.rs @@ -9,7 +9,7 @@ //! Intel's [programming considerations][intel_consid] details what sorts of instructions within a //! transaction are likely to cause an abort. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf //! [wikipedia_rtm]: https://en.wikipedia.org/wiki/Transactional_Synchronization_Extensions#Restricted_Transactional_Memory //! [intel_consid]: https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-intel-transactional-synchronization-extensions-intel-tsx-programming-considerations diff --git a/library/stdarch/crates/core_arch/src/x86/sha.rs b/library/stdarch/crates/core_arch/src/x86/sha.rs index 9ad1a9f14c15..f8a3295d1958 100644 --- a/library/stdarch/crates/core_arch/src/x86/sha.rs +++ b/library/stdarch/crates/core_arch/src/x86/sha.rs @@ -286,7 +286,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha1msg1_epu32() { + fn test_mm_sha1msg1_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let expected = _mm_set_epi64x(0x98829f34f74ad457, 0xda2b1a44d0b5ad3c); @@ -296,7 +296,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha1msg2_epu32() { + fn test_mm_sha1msg2_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let expected = _mm_set_epi64x(0xf714b202d863d47d, 0x90c30d946b3d3b35); @@ -306,7 +306,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha1nexte_epu32() { + fn test_mm_sha1nexte_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let expected = _mm_set_epi64x(0x2589d5be923f82a4, 0x59f111f13956c25b); @@ -316,7 +316,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha1rnds4_epu32() { + fn test_mm_sha1rnds4_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let expected = _mm_set_epi64x(0x32b13cd8322f5268, 0xc54420862bd9246f); @@ -338,7 +338,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha256msg1_epu32() { + fn test_mm_sha256msg1_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let expected = _mm_set_epi64x(0xeb84973fd5cda67d, 0x2857b88f406b09ee); @@ -348,7 +348,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha256msg2_epu32() { + fn test_mm_sha256msg2_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let expected = _mm_set_epi64x(0xb58777ce887fd851, 0x15d1ec8b73ac8450); @@ -358,7 +358,7 @@ mod tests { #[simd_test(enable = "sha")] #[allow(overflowing_literals)] - unsafe fn test_mm_sha256rnds2_epu32() { + fn test_mm_sha256rnds2_epu32() { let a = _mm_set_epi64x(0xe9b5dba5b5c0fbcf, 0x71374491428a2f98); let b = _mm_set_epi64x(0xab1c5ed5923f82a4, 0x59f111f13956c25b); let k = _mm_set_epi64x(0, 0x12835b01d807aa98); @@ -381,7 +381,7 @@ mod tests { ]; #[simd_test(enable = "sha512,avx")] - unsafe fn test_mm256_sha512msg1_epi64() { + fn test_mm256_sha512msg1_epi64() { fn s0(word: u64) -> u64 { word.rotate_right(1) ^ word.rotate_right(8) ^ (word >> 7) } @@ -389,8 +389,8 @@ mod tests { let A = &DATA_64[0..4]; let B = &DATA_64[4..6]; - let a = _mm256_loadu_si256(A.as_ptr().cast()); - let b = _mm_loadu_si128(B.as_ptr().cast()); + let a = unsafe { _mm256_loadu_si256(A.as_ptr().cast()) }; + let b = unsafe { _mm_loadu_si128(B.as_ptr().cast()) }; let r = _mm256_sha512msg1_epi64(a, b); @@ -405,7 +405,7 @@ mod tests { } #[simd_test(enable = "sha512,avx")] - unsafe fn test_mm256_sha512msg2_epi64() { + fn test_mm256_sha512msg2_epi64() { fn s1(word: u64) -> u64 { word.rotate_right(19) ^ word.rotate_right(61) ^ (word >> 6) } @@ -413,8 +413,8 @@ mod tests { let A = &DATA_64[0..4]; let B = &DATA_64[4..8]; - let a = _mm256_loadu_si256(A.as_ptr().cast()); - let b = _mm256_loadu_si256(B.as_ptr().cast()); + let a = unsafe { _mm256_loadu_si256(A.as_ptr().cast()) }; + let b = unsafe { _mm256_loadu_si256(B.as_ptr().cast()) }; let r = _mm256_sha512msg2_epi64(a, b); @@ -431,7 +431,7 @@ mod tests { } #[simd_test(enable = "sha512,avx")] - unsafe fn test_mm256_sha512rnds2_epi64() { + fn test_mm256_sha512rnds2_epi64() { fn cap_sigma0(word: u64) -> u64 { word.rotate_right(28) ^ word.rotate_right(34) ^ word.rotate_right(39) } @@ -452,9 +452,9 @@ mod tests { let B = &DATA_64[4..8]; let K = &DATA_64[8..10]; - let a = _mm256_loadu_si256(A.as_ptr().cast()); - let b = _mm256_loadu_si256(B.as_ptr().cast()); - let k = _mm_loadu_si128(K.as_ptr().cast()); + let a = unsafe { _mm256_loadu_si256(A.as_ptr().cast()) }; + let b = unsafe { _mm256_loadu_si256(B.as_ptr().cast()) }; + let k = unsafe { _mm_loadu_si128(K.as_ptr().cast()) }; let r = _mm256_sha512rnds2_epi64(a, b, k); @@ -482,7 +482,7 @@ mod tests { ]; #[simd_test(enable = "sm3,avx")] - unsafe fn test_mm_sm3msg1_epi32() { + fn test_mm_sm3msg1_epi32() { fn p1(x: u32) -> u32 { x ^ x.rotate_left(15) ^ x.rotate_left(23) } @@ -490,9 +490,9 @@ mod tests { let B = &DATA_32[4..8]; let C = &DATA_32[8..12]; - let a = _mm_loadu_si128(A.as_ptr().cast()); - let b = _mm_loadu_si128(B.as_ptr().cast()); - let c = _mm_loadu_si128(C.as_ptr().cast()); + let a = unsafe { _mm_loadu_si128(A.as_ptr().cast()) }; + let b = unsafe { _mm_loadu_si128(B.as_ptr().cast()) }; + let c = unsafe { _mm_loadu_si128(C.as_ptr().cast()) }; let r = _mm_sm3msg1_epi32(a, b, c); @@ -507,14 +507,14 @@ mod tests { } #[simd_test(enable = "sm3,avx")] - unsafe fn test_mm_sm3msg2_epi32() { + fn test_mm_sm3msg2_epi32() { let A = &DATA_32[0..4]; let B = &DATA_32[4..8]; let C = &DATA_32[8..12]; - let a = _mm_loadu_si128(A.as_ptr().cast()); - let b = _mm_loadu_si128(B.as_ptr().cast()); - let c = _mm_loadu_si128(C.as_ptr().cast()); + let a = unsafe { _mm_loadu_si128(A.as_ptr().cast()) }; + let b = unsafe { _mm_loadu_si128(B.as_ptr().cast()) }; + let c = unsafe { _mm_loadu_si128(C.as_ptr().cast()) }; let r = _mm_sm3msg2_epi32(a, b, c); @@ -535,7 +535,7 @@ mod tests { } #[simd_test(enable = "sm3,avx")] - unsafe fn test_mm_sm3rnds2_epi32() { + fn test_mm_sm3rnds2_epi32() { fn p0(x: u32) -> u32 { x ^ x.rotate_left(9) ^ x.rotate_left(17) } @@ -560,9 +560,9 @@ mod tests { let B = &DATA_32[4..8]; let C = &DATA_32[8..12]; - let a = _mm_loadu_si128(A.as_ptr().cast()); - let b = _mm_loadu_si128(B.as_ptr().cast()); - let c = _mm_loadu_si128(C.as_ptr().cast()); + let a = unsafe { _mm_loadu_si128(A.as_ptr().cast()) }; + let b = unsafe { _mm_loadu_si128(B.as_ptr().cast()) }; + let c = unsafe { _mm_loadu_si128(C.as_ptr().cast()) }; let r = _mm_sm3rnds2_epi32::<{ ROUND as i32 }>(a, b, c); @@ -641,7 +641,7 @@ mod tests { } #[simd_test(enable = "sm4,avx")] - unsafe fn test_mm_sm4key4_epi32() { + fn test_mm_sm4key4_epi32() { fn l_key(x: u32) -> u32 { x ^ x.rotate_left(13) ^ x.rotate_left(23) } @@ -652,8 +652,8 @@ mod tests { let A = &DATA_32[0..4]; let B = &DATA_32[4..8]; - let a = _mm_loadu_si128(A.as_ptr().cast()); - let b = _mm_loadu_si128(B.as_ptr().cast()); + let a = unsafe { _mm_loadu_si128(A.as_ptr().cast()) }; + let b = unsafe { _mm_loadu_si128(B.as_ptr().cast()) }; let r = _mm_sm4key4_epi32(a, b); @@ -667,11 +667,11 @@ mod tests { } #[simd_test(enable = "sm4,avx")] - unsafe fn test_mm256_sm4key4_epi32() { - let a_low = _mm_loadu_si128(DATA_32.as_ptr().cast()); - let a_high = _mm_loadu_si128(DATA_32[4..].as_ptr().cast()); - let b_low = _mm_loadu_si128(DATA_32[8..].as_ptr().cast()); - let b_high = _mm_loadu_si128(DATA_32[12..].as_ptr().cast()); + fn test_mm256_sm4key4_epi32() { + let a_low = unsafe { _mm_loadu_si128(DATA_32.as_ptr().cast()) }; + let a_high = unsafe { _mm_loadu_si128(DATA_32[4..].as_ptr().cast()) }; + let b_low = unsafe { _mm_loadu_si128(DATA_32[8..].as_ptr().cast()) }; + let b_high = unsafe { _mm_loadu_si128(DATA_32[12..].as_ptr().cast()) }; let a = _mm256_set_m128i(a_high, a_low); let b = _mm256_set_m128i(b_high, b_low); @@ -686,7 +686,7 @@ mod tests { } #[simd_test(enable = "sm4,avx")] - unsafe fn test_mm_sm4rnds4_epi32() { + fn test_mm_sm4rnds4_epi32() { fn l_rnd(x: u32) -> u32 { x ^ x.rotate_left(2) ^ x.rotate_left(10) ^ x.rotate_left(18) ^ x.rotate_left(24) } @@ -697,8 +697,8 @@ mod tests { let A = &DATA_32[0..4]; let B = &DATA_32[4..8]; - let a = _mm_loadu_si128(A.as_ptr().cast()); - let b = _mm_loadu_si128(B.as_ptr().cast()); + let a = unsafe { _mm_loadu_si128(A.as_ptr().cast()) }; + let b = unsafe { _mm_loadu_si128(B.as_ptr().cast()) }; let r = _mm_sm4rnds4_epi32(a, b); @@ -712,11 +712,11 @@ mod tests { } #[simd_test(enable = "sm4,avx")] - unsafe fn test_mm256_sm4rnds4_epi32() { - let a_low = _mm_loadu_si128(DATA_32.as_ptr().cast()); - let a_high = _mm_loadu_si128(DATA_32[4..].as_ptr().cast()); - let b_low = _mm_loadu_si128(DATA_32[8..].as_ptr().cast()); - let b_high = _mm_loadu_si128(DATA_32[12..].as_ptr().cast()); + fn test_mm256_sm4rnds4_epi32() { + let a_low = unsafe { _mm_loadu_si128(DATA_32.as_ptr().cast()) }; + let a_high = unsafe { _mm_loadu_si128(DATA_32[4..].as_ptr().cast()) }; + let b_low = unsafe { _mm_loadu_si128(DATA_32[8..].as_ptr().cast()) }; + let b_high = unsafe { _mm_loadu_si128(DATA_32[12..].as_ptr().cast()) }; let a = _mm256_set_m128i(a_high, a_low); let b = _mm256_set_m128i(b_high, b_low); diff --git a/library/stdarch/crates/core_arch/src/x86/sse.rs b/library/stdarch/crates/core_arch/src/x86/sse.rs index 7dd96dd1c9d7..751f969e50c3 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse.rs @@ -18,7 +18,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(addss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_ss(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_ss(a: __m128, b: __m128) -> __m128 { unsafe { simd_insert!(a, 0, _mm_cvtss_f32(a) + _mm_cvtss_f32(b)) } } @@ -30,7 +31,8 @@ pub fn _mm_add_ss(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(addps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_add(a, b) } } @@ -42,7 +44,8 @@ pub fn _mm_add_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(subss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_ss(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_ss(a: __m128, b: __m128) -> __m128 { unsafe { simd_insert!(a, 0, _mm_cvtss_f32(a) - _mm_cvtss_f32(b)) } } @@ -54,7 +57,8 @@ pub fn _mm_sub_ss(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(subps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_sub(a, b) } } @@ -66,7 +70,8 @@ pub fn _mm_sub_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(mulss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mul_ss(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_ss(a: __m128, b: __m128) -> __m128 { unsafe { simd_insert!(a, 0, _mm_cvtss_f32(a) * _mm_cvtss_f32(b)) } } @@ -78,7 +83,8 @@ pub fn _mm_mul_ss(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(mulps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mul_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_mul(a, b) } } @@ -90,7 +96,8 @@ pub fn _mm_mul_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(divss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_div_ss(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_div_ss(a: __m128, b: __m128) -> __m128 { unsafe { simd_insert!(a, 0, _mm_cvtss_f32(a) / _mm_cvtss_f32(b)) } } @@ -102,7 +109,8 @@ pub fn _mm_div_ss(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(divps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_div_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_div_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_div(a, b) } } @@ -241,7 +249,8 @@ pub fn _mm_max_ps(a: __m128, b: __m128) -> __m128 { assert_instr(andps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_and_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_and_ps(a: __m128, b: __m128) -> __m128 { unsafe { let a: __m128i = mem::transmute(a); let b: __m128i = mem::transmute(b); @@ -264,7 +273,8 @@ pub fn _mm_and_ps(a: __m128, b: __m128) -> __m128 { assert_instr(andnps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_andnot_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_andnot_ps(a: __m128, b: __m128) -> __m128 { unsafe { let a: __m128i = mem::transmute(a); let b: __m128i = mem::transmute(b); @@ -284,7 +294,8 @@ pub fn _mm_andnot_ps(a: __m128, b: __m128) -> __m128 { assert_instr(orps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_or_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_or_ps(a: __m128, b: __m128) -> __m128 { unsafe { let a: __m128i = mem::transmute(a); let b: __m128i = mem::transmute(b); @@ -304,7 +315,8 @@ pub fn _mm_or_ps(a: __m128, b: __m128) -> __m128 { assert_instr(xorps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_xor_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_xor_ps(a: __m128, b: __m128) -> __m128 { unsafe { let a: __m128i = mem::transmute(a); let b: __m128i = mem::transmute(b); @@ -866,7 +878,8 @@ pub fn _mm_cvtt_ss2si(a: __m128) -> i32 { // No point in using assert_instrs. In Unix x86_64 calling convention this is a // no-op, and on msvc it's just a `mov`. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtss_f32(a: __m128) -> f32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtss_f32(a: __m128) -> f32 { unsafe { simd_extract!(a, 0) } } @@ -881,7 +894,8 @@ pub fn _mm_cvtss_f32(a: __m128) -> f32 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(cvtsi2ss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi32_ss(a: __m128, b: i32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi32_ss(a: __m128, b: i32) -> __m128 { unsafe { simd_insert!(a, 0, b as f32) } } @@ -904,7 +918,8 @@ pub fn _mm_cvt_si2ss(a: __m128, b: i32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_ss(a: f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_ss(a: f32) -> __m128 { __m128([a, 0.0, 0.0, 0.0]) } @@ -915,7 +930,8 @@ pub fn _mm_set_ss(a: f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(shufps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set1_ps(a: f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_ps(a: f32) -> __m128 { __m128([a, a, a, a]) } @@ -926,7 +942,8 @@ pub fn _mm_set1_ps(a: f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(shufps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_ps1(a: f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_ps1(a: f32) -> __m128 { _mm_set1_ps(a) } @@ -953,7 +970,8 @@ pub fn _mm_set_ps1(a: f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(unpcklps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 { __m128([d, c, b, a]) } @@ -979,7 +997,8 @@ pub fn _mm_set_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 { assert_instr(movaps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setr_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setr_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 { __m128([a, b, c, d]) } @@ -990,7 +1009,8 @@ pub fn _mm_setr_ps(a: f32, b: f32, c: f32, d: f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(xorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setzero_ps() -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setzero_ps() -> __m128 { const { unsafe { mem::zeroed() } } } @@ -1021,7 +1041,8 @@ pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 { #[cfg_attr(test, assert_instr(shufps, MASK = 3))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_shuffle_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shuffle_ps(a: __m128, b: __m128) -> __m128 { static_assert_uimm_bits!(MASK, 8); unsafe { simd_shuffle!( @@ -1045,7 +1066,8 @@ pub fn _mm_shuffle_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(unpckhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpackhi_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpackhi_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_shuffle!(a, b, [2, 6, 3, 7]) } } @@ -1057,7 +1079,8 @@ pub fn _mm_unpackhi_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(unpcklps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpacklo_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpacklo_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_shuffle!(a, b, [0, 4, 1, 5]) } } @@ -1069,7 +1092,8 @@ pub fn _mm_unpacklo_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movhlps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movehl_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movehl_ps(a: __m128, b: __m128) -> __m128 { // TODO; figure why this is a different instruction on msvc? unsafe { simd_shuffle!(a, b, [6, 7, 2, 3]) } } @@ -1082,7 +1106,8 @@ pub fn _mm_movehl_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movlhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movelh_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movelh_ps(a: __m128, b: __m128) -> __m128 { unsafe { simd_shuffle!(a, b, [0, 1, 4, 5]) } } @@ -1096,12 +1121,13 @@ pub fn _mm_movelh_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movmskps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movemask_ps(a: __m128) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movemask_ps(a: __m128) -> i32 { // Propagate the highest bit to the rest, because simd_bitmask // requires all-1 or all-0. unsafe { let mask: i32x4 = simd_lt(transmute(a), i32x4::ZERO); - simd_bitmask::(mask).into() + simd_bitmask::(mask) as i32 } } @@ -1115,7 +1141,8 @@ pub fn _mm_movemask_ps(a: __m128) -> i32 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load_ss(p: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_ss(p: *const f32) -> __m128 { __m128([*p, 0.0, 0.0, 0.0]) } @@ -1130,7 +1157,8 @@ pub unsafe fn _mm_load_ss(p: *const f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load1_ps(p: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load1_ps(p: *const f32) -> __m128 { let a = *p; __m128([a, a, a, a]) } @@ -1142,7 +1170,8 @@ pub unsafe fn _mm_load1_ps(p: *const f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load_ps1(p: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_ps1(p: *const f32) -> __m128 { _mm_load1_ps(p) } @@ -1166,7 +1195,8 @@ pub unsafe fn _mm_load_ps1(p: *const f32) -> __m128 { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_load_ps(p: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_ps(p: *const f32) -> __m128 { *(p as *const __m128) } @@ -1183,7 +1213,8 @@ pub unsafe fn _mm_load_ps(p: *const f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movups))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadu_ps(p: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_ps(p: *const f32) -> __m128 { // Note: Using `*p` would require `f32` alignment, but `movups` has no // alignment restrictions. let mut dst = _mm_undefined_ps(); @@ -1223,7 +1254,8 @@ pub unsafe fn _mm_loadu_ps(p: *const f32) -> __m128 { assert_instr(movaps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadr_ps(p: *const f32) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadr_ps(p: *const f32) -> __m128 { let a = _mm_load_ps(p); simd_shuffle!(a, a, [3, 2, 1, 0]) } @@ -1237,7 +1269,8 @@ pub unsafe fn _mm_loadr_ps(p: *const f32) -> __m128 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_store_ss(p: *mut f32, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_ss(p: *mut f32, a: __m128) { *p = simd_extract!(a, 0); } @@ -1267,7 +1300,8 @@ pub unsafe fn _mm_store_ss(p: *mut f32, a: __m128) { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_store1_ps(p: *mut f32, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store1_ps(p: *mut f32, a: __m128) { let b: __m128 = simd_shuffle!(a, a, [0, 0, 0, 0]); *(p as *mut __m128) = b; } @@ -1282,7 +1316,8 @@ pub unsafe fn _mm_store1_ps(p: *mut f32, a: __m128) { assert_instr(movaps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_store_ps1(p: *mut f32, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_ps1(p: *mut f32, a: __m128) { _mm_store1_ps(p, a); } @@ -1305,7 +1340,8 @@ pub unsafe fn _mm_store_ps1(p: *mut f32, a: __m128) { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_store_ps(p: *mut f32, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_ps(p: *mut f32, a: __m128) { *(p as *mut __m128) = a; } @@ -1320,7 +1356,8 @@ pub unsafe fn _mm_store_ps(p: *mut f32, a: __m128) { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movups))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_storeu_ps(p: *mut f32, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_ps(p: *mut f32, a: __m128) { ptr::copy_nonoverlapping( ptr::addr_of!(a) as *const u8, p as *mut u8, @@ -1352,7 +1389,8 @@ pub unsafe fn _mm_storeu_ps(p: *mut f32, a: __m128) { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_storer_ps(p: *mut f32, a: __m128) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storer_ps(p: *mut f32, a: __m128) { let b: __m128 = simd_shuffle!(a, a, [3, 2, 1, 0]); *(p as *mut __m128) = b; } @@ -1370,7 +1408,8 @@ pub unsafe fn _mm_storer_ps(p: *mut f32, a: __m128) { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(movss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_move_ss(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_move_ss(a: __m128, b: __m128) -> __m128 { unsafe { simd_shuffle!(a, b, [4, 1, 2, 3]) } } @@ -1908,7 +1947,7 @@ pub fn _mm_prefetch(p: *const i8) { } } -/// Returns vector of type __m128 with indeterminate elements.with indetermination elements. +/// Returns vector of type __m128 with indeterminate elements. /// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically /// picks some valid value and is not equivalent to [`mem::MaybeUninit`]. /// In practice, this is typically equivalent to [`mem::zeroed`]. @@ -1917,7 +1956,8 @@ pub fn _mm_prefetch(p: *const i8) { #[inline] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_undefined_ps() -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_undefined_ps() -> __m128 { const { unsafe { mem::zeroed() } } } @@ -1928,7 +1968,8 @@ pub fn _mm_undefined_ps() -> __m128 { #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _MM_TRANSPOSE4_PS( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _MM_TRANSPOSE4_PS( row0: &mut __m128, row1: &mut __m128, row2: &mut __m128, @@ -2037,6 +2078,7 @@ pub unsafe fn _mm_stream_ps(mem_addr: *mut f32, a: __m128) { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::{hint::black_box, mem::transmute, ptr}; use std::boxed; use stdarch_test::simd_test; @@ -2046,7 +2088,7 @@ mod tests { const NAN: f32 = f32::NAN; #[simd_test(enable = "sse")] - unsafe fn test_mm_add_ps() { + const fn test_mm_add_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_add_ps(a, b); @@ -2054,7 +2096,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_add_ss() { + const fn test_mm_add_ss() { let a = _mm_set_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_set_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_add_ss(a, b); @@ -2062,7 +2104,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_sub_ps() { + const fn test_mm_sub_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_sub_ps(a, b); @@ -2070,7 +2112,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_sub_ss() { + const fn test_mm_sub_ss() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_sub_ss(a, b); @@ -2078,7 +2120,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_mul_ps() { + const fn test_mm_mul_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_mul_ps(a, b); @@ -2086,7 +2128,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_mul_ss() { + const fn test_mm_mul_ss() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_mul_ss(a, b); @@ -2094,7 +2136,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_div_ps() { + const fn test_mm_div_ps() { let a = _mm_setr_ps(-1.0, 5.0, 2.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.2, -5.0); let r = _mm_div_ps(a, b); @@ -2102,7 +2144,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_div_ss() { + const fn test_mm_div_ss() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_div_ss(a, b); @@ -2110,7 +2152,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_sqrt_ss() { + fn test_mm_sqrt_ss() { let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0); let r = _mm_sqrt_ss(a); let e = _mm_setr_ps(2.0, 13.0, 16.0, 100.0); @@ -2118,7 +2160,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_sqrt_ps() { + fn test_mm_sqrt_ps() { let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0); let r = _mm_sqrt_ps(a); let e = _mm_setr_ps(2.0, 3.6055512, 4.0, 10.0); @@ -2126,7 +2168,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_rcp_ss() { + fn test_mm_rcp_ss() { let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0); let r = _mm_rcp_ss(a); let e = _mm_setr_ps(0.24993896, 13.0, 16.0, 100.0); @@ -2138,7 +2180,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_rcp_ps() { + fn test_mm_rcp_ps() { let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0); let r = _mm_rcp_ps(a); let e = _mm_setr_ps(0.24993896, 0.0769043, 0.06248474, 0.0099983215); @@ -2149,7 +2191,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_rsqrt_ss() { + fn test_mm_rsqrt_ss() { let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0); let r = _mm_rsqrt_ss(a); let e = _mm_setr_ps(0.49987793, 13.0, 16.0, 100.0); @@ -2160,7 +2202,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_rsqrt_ps() { + fn test_mm_rsqrt_ps() { let a = _mm_setr_ps(4.0, 13.0, 16.0, 100.0); let r = _mm_rsqrt_ps(a); let e = _mm_setr_ps(0.49987793, 0.2772827, 0.24993896, 0.099990845); @@ -2171,7 +2213,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_min_ss() { + fn test_mm_min_ss() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_min_ss(a, b); @@ -2202,7 +2244,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_max_ss() { + fn test_mm_max_ss() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_max_ss(a, b); @@ -2229,7 +2271,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_and_ps() { + const unsafe fn test_mm_and_ps() { let a = transmute(u32x4::splat(0b0011)); let b = transmute(u32x4::splat(0b0101)); let r = _mm_and_ps(*black_box(&a), *black_box(&b)); @@ -2238,7 +2280,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_andnot_ps() { + const unsafe fn test_mm_andnot_ps() { let a = transmute(u32x4::splat(0b0011)); let b = transmute(u32x4::splat(0b0101)); let r = _mm_andnot_ps(*black_box(&a), *black_box(&b)); @@ -2247,7 +2289,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_or_ps() { + const unsafe fn test_mm_or_ps() { let a = transmute(u32x4::splat(0b0011)); let b = transmute(u32x4::splat(0b0101)); let r = _mm_or_ps(*black_box(&a), *black_box(&b)); @@ -2256,7 +2298,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_xor_ps() { + const unsafe fn test_mm_xor_ps() { let a = transmute(u32x4::splat(0b0011)); let b = transmute(u32x4::splat(0b0101)); let r = _mm_xor_ps(*black_box(&a), *black_box(&b)); @@ -2707,7 +2749,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_comieq_ss() { + fn test_mm_comieq_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2728,7 +2770,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_comilt_ss() { + fn test_mm_comilt_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2749,7 +2791,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_comile_ss() { + fn test_mm_comile_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2770,7 +2812,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_comigt_ss() { + fn test_mm_comigt_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2791,7 +2833,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_comineq_ss() { + fn test_mm_comineq_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2812,7 +2854,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_ucomieq_ss() { + fn test_mm_ucomieq_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2833,7 +2875,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_ucomilt_ss() { + fn test_mm_ucomilt_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2854,7 +2896,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_ucomile_ss() { + fn test_mm_ucomile_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2875,7 +2917,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_ucomigt_ss() { + fn test_mm_ucomigt_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2896,7 +2938,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_ucomige_ss() { + fn test_mm_ucomige_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2917,7 +2959,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_ucomineq_ss() { + fn test_mm_ucomineq_ss() { let aa = &[3.0f32, 12.0, 23.0, NAN]; let bb = &[3.0f32, 47.5, 1.5, NAN]; @@ -2938,7 +2980,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_cvtss_si32() { + fn test_mm_cvtss_si32() { let inputs = &[42.0f32, -3.1, 4.0e10, 4.0e-20, NAN, 2147483500.1]; let result = &[42i32, -3, i32::MIN, 0, i32::MIN, 2147483520]; for i in 0..inputs.len() { @@ -2954,7 +2996,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_cvttss_si32() { + fn test_mm_cvttss_si32() { let inputs = &[ (42.0f32, 42i32), (-31.4, -31), @@ -2979,36 +3021,40 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_cvtsi32_ss() { - let inputs = &[ - (4555i32, 4555.0f32), - (322223333, 322223330.0), - (-432, -432.0), - (-322223333, -322223330.0), - ]; + const fn test_mm_cvtsi32_ss() { + let a = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); - for &(x, f) in inputs.iter() { - let a = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); - let r = _mm_cvtsi32_ss(a, x); - let e = _mm_setr_ps(f, 6.0, 7.0, 8.0); - assert_eq_m128(e, r); - } + let r = _mm_cvtsi32_ss(a, 4555); + let e = _mm_setr_ps(4555.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi32_ss(a, 322223333); + let e = _mm_setr_ps(322223333.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi32_ss(a, -432); + let e = _mm_setr_ps(-432.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi32_ss(a, -322223333); + let e = _mm_setr_ps(-322223333.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); } #[simd_test(enable = "sse")] - unsafe fn test_mm_cvtss_f32() { + const fn test_mm_cvtss_f32() { let a = _mm_setr_ps(312.0134, 5.0, 6.0, 7.0); assert_eq!(_mm_cvtss_f32(a), 312.0134); } #[simd_test(enable = "sse")] - unsafe fn test_mm_set_ss() { + const fn test_mm_set_ss() { let r = _mm_set_ss(black_box(4.25)); assert_eq_m128(r, _mm_setr_ps(4.25, 0.0, 0.0, 0.0)); } #[simd_test(enable = "sse")] - unsafe fn test_mm_set1_ps() { + const fn test_mm_set1_ps() { let r1 = _mm_set1_ps(black_box(4.25)); let r2 = _mm_set_ps1(black_box(4.25)); assert_eq!(get_m128(r1, 0), 4.25); @@ -3022,7 +3068,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_set_ps() { + const fn test_mm_set_ps() { let r = _mm_set_ps( black_box(1.0), black_box(2.0), @@ -3036,7 +3082,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_setr_ps() { + const fn test_mm_setr_ps() { let r = _mm_setr_ps( black_box(1.0), black_box(2.0), @@ -3047,21 +3093,21 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_setzero_ps() { + const fn test_mm_setzero_ps() { let r = *black_box(&_mm_setzero_ps()); assert_eq_m128(r, _mm_set1_ps(0.0)); } - #[test] + #[simd_test] #[allow(non_snake_case)] - fn test_MM_SHUFFLE() { + const fn test_MM_SHUFFLE() { assert_eq!(_MM_SHUFFLE(0, 1, 1, 3), 0b00_01_01_11); assert_eq!(_MM_SHUFFLE(3, 1, 1, 0), 0b11_01_01_00); assert_eq!(_MM_SHUFFLE(1, 2, 2, 1), 0b01_10_10_01); } #[simd_test(enable = "sse")] - unsafe fn test_mm_shuffle_ps() { + const fn test_mm_shuffle_ps() { let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); let r = _mm_shuffle_ps::<0b00_01_01_11>(a, b); @@ -3069,7 +3115,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_unpackhi_ps() { + const fn test_mm_unpackhi_ps() { let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); let r = _mm_unpackhi_ps(a, b); @@ -3077,7 +3123,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_unpacklo_ps() { + const fn test_mm_unpacklo_ps() { let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); let r = _mm_unpacklo_ps(a, b); @@ -3085,7 +3131,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_movehl_ps() { + const fn test_mm_movehl_ps() { let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); let r = _mm_movehl_ps(a, b); @@ -3093,7 +3139,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_movelh_ps() { + const fn test_mm_movelh_ps() { let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); let r = _mm_movelh_ps(a, b); @@ -3101,43 +3147,35 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_load_ss() { + const unsafe fn test_mm_load_ss() { let a = 42.0f32; let r = _mm_load_ss(ptr::addr_of!(a)); assert_eq_m128(r, _mm_setr_ps(42.0, 0.0, 0.0, 0.0)); } #[simd_test(enable = "sse")] - unsafe fn test_mm_load1_ps() { + const unsafe fn test_mm_load1_ps() { let a = 42.0f32; let r = _mm_load1_ps(ptr::addr_of!(a)); assert_eq_m128(r, _mm_setr_ps(42.0, 42.0, 42.0, 42.0)); } #[simd_test(enable = "sse")] - unsafe fn test_mm_load_ps() { - let vals = &[1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; + const unsafe fn test_mm_load_ps() { + let vals = Memory { + data: [1.0f32, 2.0, 3.0, 4.0], + }; - let mut p = vals.as_ptr(); - let mut fixup = 0.0f32; - - // Make sure p is aligned, otherwise we might get a - // (signal: 11, SIGSEGV: invalid memory reference) - - let unalignment = (p as usize) & 0xf; - if unalignment != 0 { - let delta = (16 - unalignment) >> 2; - fixup = delta as f32; - p = p.add(delta); - } + // guaranteed to be aligned to 16 bytes + let p = vals.data.as_ptr(); let r = _mm_load_ps(p); - let e = _mm_add_ps(_mm_setr_ps(1.0, 2.0, 3.0, 4.0), _mm_set1_ps(fixup)); + let e = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); assert_eq_m128(r, e); } #[simd_test(enable = "sse")] - unsafe fn test_mm_loadu_ps() { + const unsafe fn test_mm_loadu_ps() { let vals = &[1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; let p = vals.as_ptr().add(3); let r = _mm_loadu_ps(black_box(p)); @@ -3145,29 +3183,21 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_loadr_ps() { - let vals = &[1.0f32, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]; + const unsafe fn test_mm_loadr_ps() { + let vals = Memory { + data: [1.0f32, 2.0, 3.0, 4.0], + }; - let mut p = vals.as_ptr(); - let mut fixup = 0.0f32; - - // Make sure p is aligned, otherwise we might get a - // (signal: 11, SIGSEGV: invalid memory reference) - - let unalignment = (p as usize) & 0xf; - if unalignment != 0 { - let delta = (16 - unalignment) >> 2; - fixup = delta as f32; - p = p.add(delta); - } + // guaranteed to be aligned to 16 bytes + let p = vals.data.as_ptr(); let r = _mm_loadr_ps(p); - let e = _mm_add_ps(_mm_setr_ps(4.0, 3.0, 2.0, 1.0), _mm_set1_ps(fixup)); + let e = _mm_setr_ps(4.0, 3.0, 2.0, 1.0); assert_eq_m128(r, e); } #[simd_test(enable = "sse")] - unsafe fn test_mm_store_ss() { + const unsafe fn test_mm_store_ss() { let mut vals = [0.0f32; 8]; let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); _mm_store_ss(vals.as_mut_ptr().add(1), a); @@ -3178,110 +3208,65 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_store1_ps() { - let mut vals = [0.0f32; 8]; + const unsafe fn test_mm_store1_ps() { + let mut vals = Memory { data: [0.0f32; 4] }; let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); - let mut ofs = 0; - let mut p = vals.as_mut_ptr(); - - if (p as usize) & 0xf != 0 { - ofs = (16 - ((p as usize) & 0xf)) >> 2; - p = p.add(ofs); - } + // guaranteed to be aligned to 16 bytes + let p = vals.data.as_mut_ptr(); _mm_store1_ps(p, *black_box(&a)); - if ofs > 0 { - assert_eq!(vals[ofs - 1], 0.0); - } - assert_eq!(vals[ofs + 0], 1.0); - assert_eq!(vals[ofs + 1], 1.0); - assert_eq!(vals[ofs + 2], 1.0); - assert_eq!(vals[ofs + 3], 1.0); - assert_eq!(vals[ofs + 4], 0.0); + assert_eq!(vals.data, [1.0, 1.0, 1.0, 1.0]); } #[simd_test(enable = "sse")] - unsafe fn test_mm_store_ps() { - let mut vals = [0.0f32; 8]; + const unsafe fn test_mm_store_ps() { + let mut vals = Memory { data: [0.0f32; 4] }; let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); - let mut ofs = 0; - let mut p = vals.as_mut_ptr(); - - // Align p to 16-byte boundary - if (p as usize) & 0xf != 0 { - ofs = (16 - ((p as usize) & 0xf)) >> 2; - p = p.add(ofs); - } + // guaranteed to be aligned to 16 bytes + let p = vals.data.as_mut_ptr(); _mm_store_ps(p, *black_box(&a)); - if ofs > 0 { - assert_eq!(vals[ofs - 1], 0.0); - } - assert_eq!(vals[ofs + 0], 1.0); - assert_eq!(vals[ofs + 1], 2.0); - assert_eq!(vals[ofs + 2], 3.0); - assert_eq!(vals[ofs + 3], 4.0); - assert_eq!(vals[ofs + 4], 0.0); + assert_eq!(vals.data, [1.0, 2.0, 3.0, 4.0]); } #[simd_test(enable = "sse")] - unsafe fn test_mm_storer_ps() { - let mut vals = [0.0f32; 8]; + const unsafe fn test_mm_storer_ps() { + let mut vals = Memory { data: [0.0f32; 4] }; let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); - let mut ofs = 0; - let mut p = vals.as_mut_ptr(); - - // Align p to 16-byte boundary - if (p as usize) & 0xf != 0 { - ofs = (16 - ((p as usize) & 0xf)) >> 2; - p = p.add(ofs); - } + // guaranteed to be aligned to 16 bytes + let p = vals.data.as_mut_ptr(); _mm_storer_ps(p, *black_box(&a)); - if ofs > 0 { - assert_eq!(vals[ofs - 1], 0.0); - } - assert_eq!(vals[ofs + 0], 4.0); - assert_eq!(vals[ofs + 1], 3.0); - assert_eq!(vals[ofs + 2], 2.0); - assert_eq!(vals[ofs + 3], 1.0); - assert_eq!(vals[ofs + 4], 0.0); + assert_eq!(vals.data, [4.0, 3.0, 2.0, 1.0]); } #[simd_test(enable = "sse")] - unsafe fn test_mm_storeu_ps() { - let mut vals = [0.0f32; 8]; + const unsafe fn test_mm_storeu_ps() { + #[repr(align(16))] + struct Memory8 { + data: [f32; 8], + } + + // guaranteed to be aligned to 16 bytes + let mut vals = Memory8 { data: [0.0f32; 8] }; let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); - let mut ofs = 0; - let mut p = vals.as_mut_ptr(); - - // Make sure p is **not** aligned to 16-byte boundary - if (p as usize) & 0xf == 0 { - ofs = 1; - p = p.add(1); - } + // guaranteed to be *not* aligned to 16 bytes + let p = vals.data.as_mut_ptr().offset(1); _mm_storeu_ps(p, *black_box(&a)); - if ofs > 0 { - assert_eq!(vals[ofs - 1], 0.0); - } - assert_eq!(vals[ofs + 0], 1.0); - assert_eq!(vals[ofs + 1], 2.0); - assert_eq!(vals[ofs + 2], 3.0); - assert_eq!(vals[ofs + 3], 4.0); - assert_eq!(vals[ofs + 4], 0.0); + assert_eq!(vals.data, [0.0, 1.0, 2.0, 3.0, 4.0, 0.0, 0.0, 0.0]); } #[simd_test(enable = "sse")] - unsafe fn test_mm_move_ss() { + const fn test_mm_move_ss() { let a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); @@ -3291,7 +3276,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_movemask_ps() { + const fn test_mm_movemask_ps() { let r = _mm_movemask_ps(_mm_setr_ps(-1.0, 5.0, -5.0, 0.0)); assert_eq!(r, 0b0101); @@ -3302,12 +3287,12 @@ mod tests { #[simd_test(enable = "sse")] // Miri cannot support this until it is clear how it fits in the Rust memory model #[cfg_attr(miri, ignore)] - unsafe fn test_mm_sfence() { + fn test_mm_sfence() { _mm_sfence(); } #[simd_test(enable = "sse")] - unsafe fn test_MM_TRANSPOSE4_PS() { + const fn test_MM_TRANSPOSE4_PS() { let mut a = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let mut b = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); let mut c = _mm_setr_ps(9.0, 10.0, 11.0, 12.0); diff --git a/library/stdarch/crates/core_arch/src/x86/sse2.rs b/library/stdarch/crates/core_arch/src/x86/sse2.rs index 11335856fb22..eec01ce1db7c 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse2.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse2.rs @@ -76,7 +76,8 @@ pub fn _mm_mfence() { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_add(a.as_i8x16(), b.as_i8x16())) } } @@ -87,7 +88,8 @@ pub fn _mm_add_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_add(a.as_i16x8(), b.as_i16x8())) } } @@ -98,7 +100,8 @@ pub fn _mm_add_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_add(a.as_i32x4(), b.as_i32x4())) } } @@ -109,7 +112,8 @@ pub fn _mm_add_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_add(a.as_i64x2(), b.as_i64x2())) } } @@ -120,7 +124,8 @@ pub fn _mm_add_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_adds_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_adds_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_add(a.as_i8x16(), b.as_i8x16())) } } @@ -131,7 +136,8 @@ pub fn _mm_adds_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_adds_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_adds_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_add(a.as_i16x8(), b.as_i16x8())) } } @@ -142,7 +148,8 @@ pub fn _mm_adds_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddusb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_adds_epu8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_adds_epu8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_add(a.as_u8x16(), b.as_u8x16())) } } @@ -153,7 +160,8 @@ pub fn _mm_adds_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(paddusw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_adds_epu16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_adds_epu16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_add(a.as_u16x8(), b.as_u16x8())) } } @@ -164,7 +172,8 @@ pub fn _mm_adds_epu16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pavgb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_avg_epu8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_avg_epu8(a: __m128i, b: __m128i) -> __m128i { unsafe { let a = simd_cast::<_, u16x16>(a.as_u8x16()); let b = simd_cast::<_, u16x16>(b.as_u8x16()); @@ -180,7 +189,8 @@ pub fn _mm_avg_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pavgw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_avg_epu16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_avg_epu16(a: __m128i, b: __m128i) -> __m128i { unsafe { let a = simd_cast::<_, u32x8>(a.as_u16x8()); let b = simd_cast::<_, u32x8>(b.as_u16x8()); @@ -201,12 +211,19 @@ pub fn _mm_avg_epu16(a: __m128i, b: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pmaddwd))] #[stable(feature = "simd_x86", since = "1.27.0")] pub fn _mm_madd_epi16(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let r: i32x8 = simd_mul(simd_cast(a.as_i16x8()), simd_cast(b.as_i16x8())); - let even: i32x4 = simd_shuffle!(r, r, [0, 2, 4, 6]); - let odd: i32x4 = simd_shuffle!(r, r, [1, 3, 5, 7]); - simd_add(even, odd).as_m128i() - } + // It's a trick used in the Adler-32 algorithm to perform a widening addition. + // + // ```rust + // #[target_feature(enable = "sse2")] + // unsafe fn widening_add(mad: __m128i) -> __m128i { + // _mm_madd_epi16(mad, _mm_set1_epi16(1)) + // } + // ``` + // + // If we implement this using generic vector intrinsics, the optimizer + // will eliminate this pattern, and `pmaddwd` will no longer be emitted. + // For this reason, we use x86 intrinsics. + unsafe { transmute(pmaddwd(a.as_i16x8(), b.as_i16x8())) } } /// Compares packed 16-bit integers in `a` and `b`, and returns the packed @@ -217,12 +234,9 @@ pub fn _mm_madd_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmaxsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_max_epi16(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i16x8(); - let b = b.as_i16x8(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epi16(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_i16x8(), b.as_i16x8()).as_m128i() } } /// Compares packed unsigned 8-bit integers in `a` and `b`, and returns the @@ -233,12 +247,9 @@ pub fn _mm_max_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmaxub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_max_epu8(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u8x16(); - let b = b.as_u8x16(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epu8(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_u8x16(), b.as_u8x16()).as_m128i() } } /// Compares packed 16-bit integers in `a` and `b`, and returns the packed @@ -249,12 +260,9 @@ pub fn _mm_max_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pminsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_min_epi16(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i16x8(); - let b = b.as_i16x8(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epi16(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_i16x8(), b.as_i16x8()).as_m128i() } } /// Compares packed unsigned 8-bit integers in `a` and `b`, and returns the @@ -265,12 +273,9 @@ pub fn _mm_min_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pminub))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_min_epu8(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u8x16(); - let b = b.as_u8x16(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epu8(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_u8x16(), b.as_u8x16()).as_m128i() } } /// Multiplies the packed 16-bit integers in `a` and `b`. @@ -283,7 +288,8 @@ pub fn _mm_min_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmulhw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mulhi_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mulhi_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { let a = simd_cast::<_, i32x8>(a.as_i16x8()); let b = simd_cast::<_, i32x8>(b.as_i16x8()); @@ -302,7 +308,8 @@ pub fn _mm_mulhi_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmulhuw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mulhi_epu16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mulhi_epu16(a: __m128i, b: __m128i) -> __m128i { unsafe { let a = simd_cast::<_, u32x8>(a.as_u16x8()); let b = simd_cast::<_, u32x8>(b.as_u16x8()); @@ -321,7 +328,8 @@ pub fn _mm_mulhi_epu16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmullw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mullo_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mullo_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_mul(a.as_i16x8(), b.as_i16x8())) } } @@ -335,11 +343,12 @@ pub fn _mm_mullo_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmuludq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mul_epu32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_epu32(a: __m128i, b: __m128i) -> __m128i { unsafe { let a = a.as_u64x2(); let b = b.as_u64x2(); - let mask = u64x2::splat(u32::MAX.into()); + let mask = u64x2::splat(u32::MAX as u64); transmute(simd_mul(simd_and(a, mask), simd_and(b, mask))) } } @@ -367,7 +376,8 @@ pub fn _mm_sad_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_sub(a.as_i8x16(), b.as_i8x16())) } } @@ -378,7 +388,8 @@ pub fn _mm_sub_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_sub(a.as_i16x8(), b.as_i16x8())) } } @@ -389,7 +400,8 @@ pub fn _mm_sub_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_sub(a.as_i32x4(), b.as_i32x4())) } } @@ -400,7 +412,8 @@ pub fn _mm_sub_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_sub(a.as_i64x2(), b.as_i64x2())) } } @@ -412,7 +425,8 @@ pub fn _mm_sub_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_subs_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_subs_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_sub(a.as_i8x16(), b.as_i8x16())) } } @@ -424,7 +438,8 @@ pub fn _mm_subs_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_subs_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_subs_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_sub(a.as_i16x8(), b.as_i16x8())) } } @@ -436,7 +451,8 @@ pub fn _mm_subs_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubusb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_subs_epu8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_subs_epu8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_sub(a.as_u8x16(), b.as_u8x16())) } } @@ -448,7 +464,8 @@ pub fn _mm_subs_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(psubusw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_subs_epu16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_subs_epu16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_saturating_sub(a.as_u16x8(), b.as_u16x8())) } } @@ -460,7 +477,8 @@ pub fn _mm_subs_epu16(a: __m128i, b: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pslldq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_slli_si128(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_slli_si128(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { _mm_slli_si128_impl::(a) } } @@ -469,7 +487,8 @@ pub fn _mm_slli_si128(a: __m128i) -> __m128i { /// `_mm_slli_si128` intrinsic into a compile-time constant. #[inline] #[target_feature(enable = "sse2")] -unsafe fn _mm_slli_si128_impl(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +const unsafe fn _mm_slli_si128_impl(a: __m128i) -> __m128i { const fn mask(shift: i32, i: u32) -> u32 { let shift = shift as u32 & 0xff; if shift > 15 { i } else { 16 - shift + i } @@ -506,7 +525,8 @@ unsafe fn _mm_slli_si128_impl(a: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pslldq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_bslli_si128(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_bslli_si128(a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); _mm_slli_si128_impl::(a) @@ -521,7 +541,8 @@ pub fn _mm_bslli_si128(a: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psrldq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_bsrli_si128(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_bsrli_si128(a: __m128i) -> __m128i { unsafe { static_assert_uimm_bits!(IMM8, 8); _mm_srli_si128_impl::(a) @@ -536,7 +557,8 @@ pub fn _mm_bsrli_si128(a: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psllw, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_slli_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_slli_epi16(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 16 { @@ -567,7 +589,8 @@ pub fn _mm_sll_epi16(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pslld, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_slli_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_slli_epi32(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 32 { @@ -598,7 +621,8 @@ pub fn _mm_sll_epi32(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psllq, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_slli_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_slli_epi64(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 64 { @@ -630,7 +654,8 @@ pub fn _mm_sll_epi64(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psraw, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srai_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srai_epi16(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { transmute(simd_shr(a.as_i16x8(), i16x8::splat(IMM8.min(15) as i16))) } } @@ -656,7 +681,8 @@ pub fn _mm_sra_epi16(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psrad, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srai_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srai_epi32(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { transmute(simd_shr(a.as_i32x4(), i32x4::splat(IMM8.min(31)))) } } @@ -681,7 +707,8 @@ pub fn _mm_sra_epi32(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psrldq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srli_si128(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srli_si128(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { _mm_srli_si128_impl::(a) } } @@ -690,7 +717,8 @@ pub fn _mm_srli_si128(a: __m128i) -> __m128i { /// `_mm_srli_si128` intrinsic into a compile-time constant. #[inline] #[target_feature(enable = "sse2")] -unsafe fn _mm_srli_si128_impl(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +const unsafe fn _mm_srli_si128_impl(a: __m128i) -> __m128i { const fn mask(shift: i32, i: u32) -> u32 { if (shift as u32) > 15 { i + 16 @@ -732,7 +760,8 @@ unsafe fn _mm_srli_si128_impl(a: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psrlw, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srli_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srli_epi16(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 16 { @@ -764,7 +793,8 @@ pub fn _mm_srl_epi16(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psrld, IMM8 = 8))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srli_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srli_epi32(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 32 { @@ -796,7 +826,8 @@ pub fn _mm_srl_epi32(a: __m128i, count: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(psrlq, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_srli_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_srli_epi64(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { if IMM8 >= 64 { @@ -827,7 +858,8 @@ pub fn _mm_srl_epi64(a: __m128i, count: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(andps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_and_si128(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_and_si128(a: __m128i, b: __m128i) -> __m128i { unsafe { simd_and(a, b) } } @@ -839,7 +871,8 @@ pub fn _mm_and_si128(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(andnps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_andnot_si128(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_andnot_si128(a: __m128i, b: __m128i) -> __m128i { unsafe { simd_and(simd_xor(_mm_set1_epi8(-1), a), b) } } @@ -851,7 +884,8 @@ pub fn _mm_andnot_si128(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(orps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_or_si128(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_or_si128(a: __m128i, b: __m128i) -> __m128i { unsafe { simd_or(a, b) } } @@ -863,7 +897,8 @@ pub fn _mm_or_si128(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(xorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_xor_si128(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_xor_si128(a: __m128i, b: __m128i) -> __m128i { unsafe { simd_xor(a, b) } } @@ -874,7 +909,8 @@ pub fn _mm_xor_si128(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpeqb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpeq_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_eq(a.as_i8x16(), b.as_i8x16())) } } @@ -885,7 +921,8 @@ pub fn _mm_cmpeq_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpeqw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpeq_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_eq(a.as_i16x8(), b.as_i16x8())) } } @@ -896,7 +933,8 @@ pub fn _mm_cmpeq_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpeqd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpeq_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_eq(a.as_i32x4(), b.as_i32x4())) } } @@ -907,7 +945,8 @@ pub fn _mm_cmpeq_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpgtb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpgt_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_gt(a.as_i8x16(), b.as_i8x16())) } } @@ -918,7 +957,8 @@ pub fn _mm_cmpgt_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpgtw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpgt_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_gt(a.as_i16x8(), b.as_i16x8())) } } @@ -929,7 +969,8 @@ pub fn _mm_cmpgt_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpgtd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpgt_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_gt(a.as_i32x4(), b.as_i32x4())) } } @@ -940,7 +981,8 @@ pub fn _mm_cmpgt_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpgtb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmplt_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_lt(a.as_i8x16(), b.as_i8x16())) } } @@ -951,7 +993,8 @@ pub fn _mm_cmplt_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpgtw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmplt_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_lt(a.as_i16x8(), b.as_i16x8())) } } @@ -962,7 +1005,8 @@ pub fn _mm_cmplt_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pcmpgtd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmplt_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmplt_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_lt(a.as_i32x4(), b.as_i32x4())) } } @@ -974,7 +1018,8 @@ pub fn _mm_cmplt_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtdq2pd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi32_pd(a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi32_pd(a: __m128i) -> __m128d { unsafe { let a = a.as_i32x4(); simd_cast::(simd_shuffle!(a, a, [0, 1])) @@ -989,7 +1034,8 @@ pub fn _mm_cvtepi32_pd(a: __m128i) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtsi2sd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi32_sd(a: __m128d, b: i32) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi32_sd(a: __m128d, b: i32) -> __m128d { unsafe { simd_insert!(a, 0, b as f64) } } @@ -1001,7 +1047,8 @@ pub fn _mm_cvtsi32_sd(a: __m128d, b: i32) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtdq2ps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi32_ps(a: __m128i) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi32_ps(a: __m128i) -> __m128 { unsafe { transmute(simd_cast::<_, f32x4>(a.as_i32x4())) } } @@ -1024,7 +1071,8 @@ pub fn _mm_cvtps_epi32(a: __m128) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi32_si128(a: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi32_si128(a: i32) -> __m128i { unsafe { transmute(i32x4::new(a, 0, 0, 0)) } } @@ -1034,7 +1082,8 @@ pub fn _mm_cvtsi32_si128(a: i32) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi128_si32(a: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi128_si32(a: __m128i) -> i32 { unsafe { simd_extract!(a.as_i32x4(), 0) } } @@ -1046,7 +1095,8 @@ pub fn _mm_cvtsi128_si32(a: __m128i) -> i32 { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_epi64x(e1: i64, e0: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_epi64x(e1: i64, e0: i64) -> __m128i { unsafe { transmute(i64x2::new(e0, e1)) } } @@ -1057,7 +1107,8 @@ pub fn _mm_set_epi64x(e1: i64, e0: i64) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i { unsafe { transmute(i32x4::new(e0, e1, e2, e3)) } } @@ -1068,7 +1119,8 @@ pub fn _mm_set_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_epi16( e7: i16, e6: i16, e5: i16, @@ -1088,7 +1140,8 @@ pub fn _mm_set_epi16( #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_epi8( e15: i8, e14: i8, e13: i8, @@ -1121,7 +1174,8 @@ pub fn _mm_set_epi8( #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set1_epi64x(a: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_epi64x(a: i64) -> __m128i { _mm_set_epi64x(a, a) } @@ -1132,7 +1186,8 @@ pub fn _mm_set1_epi64x(a: i64) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set1_epi32(a: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_epi32(a: i32) -> __m128i { _mm_set_epi32(a, a, a, a) } @@ -1143,7 +1198,8 @@ pub fn _mm_set1_epi32(a: i32) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set1_epi16(a: i16) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_epi16(a: i16) -> __m128i { _mm_set_epi16(a, a, a, a, a, a, a, a) } @@ -1154,7 +1210,8 @@ pub fn _mm_set1_epi16(a: i16) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set1_epi8(a: i8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_epi8(a: i8) -> __m128i { _mm_set_epi8(a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a) } @@ -1165,7 +1222,8 @@ pub fn _mm_set1_epi8(a: i8) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setr_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setr_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i { _mm_set_epi32(e0, e1, e2, e3) } @@ -1176,7 +1234,8 @@ pub fn _mm_setr_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i { #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setr_epi16( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setr_epi16( e7: i16, e6: i16, e5: i16, @@ -1196,7 +1255,8 @@ pub fn _mm_setr_epi16( #[target_feature(enable = "sse2")] // no particular instruction to test #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setr_epi8( +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setr_epi8( e15: i8, e14: i8, e13: i8, @@ -1227,7 +1287,8 @@ pub fn _mm_setr_epi8( #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(xorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setzero_si128() -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setzero_si128() -> __m128i { const { unsafe { mem::zeroed() } } } @@ -1237,7 +1298,8 @@ pub fn _mm_setzero_si128() -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadl_epi64(mem_addr: *const __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadl_epi64(mem_addr: *const __m128i) -> __m128i { _mm_set_epi64x(0, ptr::read_unaligned(mem_addr as *const i64)) } @@ -1253,7 +1315,8 @@ pub unsafe fn _mm_loadl_epi64(mem_addr: *const __m128i) -> __m128i { assert_instr(movaps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load_si128(mem_addr: *const __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_si128(mem_addr: *const __m128i) -> __m128i { *mem_addr } @@ -1266,7 +1329,8 @@ pub unsafe fn _mm_load_si128(mem_addr: *const __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movups))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadu_si128(mem_addr: *const __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_si128(mem_addr: *const __m128i) -> __m128i { let mut dst: __m128i = _mm_undefined_si128(); ptr::copy_nonoverlapping( mem_addr as *const u8, @@ -1315,7 +1379,8 @@ pub unsafe fn _mm_maskmoveu_si128(a: __m128i, mask: __m128i, mem_addr: *mut i8) assert_instr(movaps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_store_si128(mem_addr: *mut __m128i, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_si128(mem_addr: *mut __m128i, a: __m128i) { *mem_addr = a; } @@ -1328,7 +1393,8 @@ pub unsafe fn _mm_store_si128(mem_addr: *mut __m128i, a: __m128i) { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movups))] // FIXME movdqu expected #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_storeu_si128(mem_addr: *mut __m128i, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_si128(mem_addr: *mut __m128i, a: __m128i) { mem_addr.write_unaligned(a); } @@ -1340,7 +1406,8 @@ pub unsafe fn _mm_storeu_si128(mem_addr: *mut __m128i, a: __m128i) { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_storel_epi64(mem_addr: *mut __m128i, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storel_epi64(mem_addr: *mut __m128i, a: __m128i) { ptr::copy_nonoverlapping(ptr::addr_of!(a) as *const u8, mem_addr as *mut u8, 8); } @@ -1409,7 +1476,8 @@ pub unsafe fn _mm_stream_si32(mem_addr: *mut i32, a: i32) { // FIXME movd on msvc, movd on i686 #[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(movq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_move_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_move_epi64(a: __m128i) -> __m128i { unsafe { let r: i64x2 = simd_shuffle!(a.as_i64x2(), i64x2::ZERO, [0, 2]); transmute(r) @@ -1460,7 +1528,8 @@ pub fn _mm_packus_epi16(a: __m128i, b: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pextrw, IMM8 = 7))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_extract_epi16(a: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_extract_epi16(a: __m128i) -> i32 { static_assert_uimm_bits!(IMM8, 3); unsafe { simd_extract!(a.as_u16x8(), IMM8 as u32, u16) as i32 } } @@ -1473,7 +1542,8 @@ pub fn _mm_extract_epi16(a: __m128i) -> i32 { #[cfg_attr(test, assert_instr(pinsrw, IMM8 = 7))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_insert_epi16(a: __m128i, i: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_insert_epi16(a: __m128i, i: i32) -> __m128i { static_assert_uimm_bits!(IMM8, 3); unsafe { transmute(simd_insert!(a.as_i16x8(), IMM8 as u32, i as i16)) } } @@ -1485,7 +1555,8 @@ pub fn _mm_insert_epi16(a: __m128i, i: i32) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(pmovmskb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movemask_epi8(a: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movemask_epi8(a: __m128i) -> i32 { unsafe { let z = i8x16::ZERO; let m: i8x16 = simd_lt(a.as_i8x16(), z); @@ -1501,7 +1572,8 @@ pub fn _mm_movemask_epi8(a: __m128i) -> i32 { #[cfg_attr(test, assert_instr(pshufd, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_shuffle_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shuffle_epi32(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i32x4(); @@ -1531,7 +1603,8 @@ pub fn _mm_shuffle_epi32(a: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pshufhw, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_shufflehi_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shufflehi_epi16(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i16x8(); @@ -1565,7 +1638,8 @@ pub fn _mm_shufflehi_epi16(a: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pshuflw, IMM8 = 9))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_shufflelo_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shufflelo_epi16(a: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { let a = a.as_i16x8(); @@ -1594,7 +1668,8 @@ pub fn _mm_shufflelo_epi16(a: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(punpckhbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpackhi_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpackhi_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_shuffle!( a.as_i8x16(), @@ -1611,7 +1686,8 @@ pub fn _mm_unpackhi_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(punpckhwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpackhi_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpackhi_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { let x = simd_shuffle!(a.as_i16x8(), b.as_i16x8(), [4, 12, 5, 13, 6, 14, 7, 15]); transmute::(x) @@ -1625,7 +1701,8 @@ pub fn _mm_unpackhi_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(unpckhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpackhi_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpackhi_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_shuffle!(a.as_i32x4(), b.as_i32x4(), [2, 6, 3, 7])) } } @@ -1636,7 +1713,8 @@ pub fn _mm_unpackhi_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(unpckhpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpackhi_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpackhi_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_shuffle!(a.as_i64x2(), b.as_i64x2(), [1, 3])) } } @@ -1647,7 +1725,8 @@ pub fn _mm_unpackhi_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(punpcklbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpacklo_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpacklo_epi8(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_shuffle!( a.as_i8x16(), @@ -1664,7 +1743,8 @@ pub fn _mm_unpacklo_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(punpcklwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpacklo_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpacklo_epi16(a: __m128i, b: __m128i) -> __m128i { unsafe { let x = simd_shuffle!(a.as_i16x8(), b.as_i16x8(), [0, 8, 1, 9, 2, 10, 3, 11]); transmute::(x) @@ -1678,7 +1758,8 @@ pub fn _mm_unpacklo_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(unpcklps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpacklo_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpacklo_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_shuffle!(a.as_i32x4(), b.as_i32x4(), [0, 4, 1, 5])) } } @@ -1689,7 +1770,8 @@ pub fn _mm_unpacklo_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movlhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpacklo_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpacklo_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute::(simd_shuffle!(a.as_i64x2(), b.as_i64x2(), [0, 2])) } } @@ -1701,7 +1783,8 @@ pub fn _mm_unpacklo_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(addsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_sd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_sd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_insert!(a, 0, _mm_cvtsd_f64(a) + _mm_cvtsd_f64(b)) } } @@ -1713,7 +1796,8 @@ pub fn _mm_add_sd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(addpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_add_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_add_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_add(a, b) } } @@ -1725,7 +1809,8 @@ pub fn _mm_add_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(divsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_div_sd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_div_sd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_insert!(a, 0, _mm_cvtsd_f64(a) / _mm_cvtsd_f64(b)) } } @@ -1737,7 +1822,8 @@ pub fn _mm_div_sd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(divpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_div_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_div_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_div(a, b) } } @@ -1797,7 +1883,8 @@ pub fn _mm_min_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(mulsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mul_sd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_sd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_insert!(a, 0, _mm_cvtsd_f64(a) * _mm_cvtsd_f64(b)) } } @@ -1809,7 +1896,8 @@ pub fn _mm_mul_sd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(mulpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mul_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_mul(a, b) } } @@ -1844,7 +1932,8 @@ pub fn _mm_sqrt_pd(a: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(subsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_sd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_sd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_insert!(a, 0, _mm_cvtsd_f64(a) - _mm_cvtsd_f64(b)) } } @@ -1856,7 +1945,8 @@ pub fn _mm_sub_sd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(subpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_sub_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_sub_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_sub(a, b) } } @@ -1868,7 +1958,8 @@ pub fn _mm_sub_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(andps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_and_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_and_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let a: __m128i = transmute(a); let b: __m128i = transmute(b); @@ -1883,7 +1974,8 @@ pub fn _mm_and_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(andnps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_andnot_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_andnot_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let a: __m128i = transmute(a); let b: __m128i = transmute(b); @@ -1898,7 +1990,8 @@ pub fn _mm_andnot_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(orps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_or_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_or_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let a: __m128i = transmute(a); let b: __m128i = transmute(b); @@ -1913,7 +2006,8 @@ pub fn _mm_or_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(xorps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_xor_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_xor_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let a: __m128i = transmute(a); let b: __m128i = transmute(b); @@ -2341,7 +2435,8 @@ pub fn _mm_ucomineq_sd(a: __m128d, b: __m128d) -> i32 { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtpd2ps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtpd_ps(a: __m128d) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtpd_ps(a: __m128d) -> __m128 { unsafe { let r = simd_cast::<_, f32x2>(a.as_f64x2()); let zero = f32x2::ZERO; @@ -2358,7 +2453,8 @@ pub fn _mm_cvtpd_ps(a: __m128d) -> __m128 { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtps2pd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtps_pd(a: __m128) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtps_pd(a: __m128) -> __m128d { unsafe { let a = a.as_f32x4(); transmute(simd_cast::(simd_shuffle!(a, a, [0, 1]))) @@ -2409,7 +2505,8 @@ pub fn _mm_cvtsd_ss(a: __m128, b: __m128d) -> __m128 { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsd_f64(a: __m128d) -> f64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsd_f64(a: __m128d) -> f64 { unsafe { simd_extract!(a, 0) } } @@ -2423,7 +2520,8 @@ pub fn _mm_cvtsd_f64(a: __m128d) -> f64 { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtss2sd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtss_sd(a: __m128d, b: __m128) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtss_sd(a: __m128d, b: __m128) -> __m128d { unsafe { let elt: f32 = simd_extract!(b, 0); simd_insert!(a, 0, elt as f64) @@ -2473,7 +2571,8 @@ pub fn _mm_cvttps_epi32(a: __m128) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_sd(a: f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_sd(a: f64) -> __m128d { _mm_set_pd(0.0, a) } @@ -2484,7 +2583,8 @@ pub fn _mm_set_sd(a: f64) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set1_pd(a: f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set1_pd(a: f64) -> __m128d { _mm_set_pd(a, a) } @@ -2495,7 +2595,8 @@ pub fn _mm_set1_pd(a: f64) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_pd1(a: f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_pd1(a: f64) -> __m128d { _mm_set_pd(a, a) } @@ -2506,7 +2607,8 @@ pub fn _mm_set_pd1(a: f64) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_set_pd(a: f64, b: f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_set_pd(a: f64, b: f64) -> __m128d { __m128d([b, a]) } @@ -2517,7 +2619,8 @@ pub fn _mm_set_pd(a: f64, b: f64) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setr_pd(a: f64, b: f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setr_pd(a: f64, b: f64) -> __m128d { _mm_set_pd(b, a) } @@ -2529,7 +2632,8 @@ pub fn _mm_setr_pd(a: f64, b: f64) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(xorp))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_setzero_pd() -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_setzero_pd() -> __m128d { const { unsafe { mem::zeroed() } } } @@ -2543,12 +2647,13 @@ pub fn _mm_setzero_pd() -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movmskpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movemask_pd(a: __m128d) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movemask_pd(a: __m128d) -> i32 { // Propagate the highest bit to the rest, because simd_bitmask // requires all-1 or all-0. unsafe { let mask: i64x2 = simd_lt(transmute(a), i64x2::ZERO); - simd_bitmask::(mask).into() + simd_bitmask::(mask) as i32 } } @@ -2566,7 +2671,8 @@ pub fn _mm_movemask_pd(a: __m128d) -> i32 { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_load_pd(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_pd(mem_addr: *const f64) -> __m128d { *(mem_addr as *const __m128d) } @@ -2578,7 +2684,8 @@ pub unsafe fn _mm_load_pd(mem_addr: *const f64) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load_sd(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_sd(mem_addr: *const f64) -> __m128d { _mm_setr_pd(*mem_addr, 0.) } @@ -2591,7 +2698,8 @@ pub unsafe fn _mm_load_sd(mem_addr: *const f64) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadh_pd(a: __m128d, mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadh_pd(a: __m128d, mem_addr: *const f64) -> __m128d { _mm_setr_pd(simd_extract!(a, 0), *mem_addr) } @@ -2604,7 +2712,8 @@ pub unsafe fn _mm_loadh_pd(a: __m128d, mem_addr: *const f64) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movlps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadl_pd(a: __m128d, mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadl_pd(a: __m128d, mem_addr: *const f64) -> __m128d { _mm_setr_pd(*mem_addr, simd_extract!(a, 1)) } @@ -2646,7 +2755,8 @@ pub unsafe fn _mm_stream_pd(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movlps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_store_sd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_sd(mem_addr: *mut f64, a: __m128d) { *mem_addr = simd_extract!(a, 0) } @@ -2663,7 +2773,8 @@ pub unsafe fn _mm_store_sd(mem_addr: *mut f64, a: __m128d) { )] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_store_pd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_pd(mem_addr: *mut f64, a: __m128d) { *(mem_addr as *mut __m128d) = a; } @@ -2676,7 +2787,8 @@ pub unsafe fn _mm_store_pd(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movups))] // FIXME movupd expected #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_storeu_pd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_pd(mem_addr: *mut f64, a: __m128d) { mem_addr.cast::<__m128d>().write_unaligned(a); } @@ -2688,7 +2800,8 @@ pub unsafe fn _mm_storeu_pd(mem_addr: *mut f64, a: __m128d) { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub unsafe fn _mm_storeu_si16(mem_addr: *mut u8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_si16(mem_addr: *mut u8, a: __m128i) { ptr::write_unaligned(mem_addr as *mut i16, simd_extract(a.as_i16x8(), 0)) } @@ -2700,7 +2813,8 @@ pub unsafe fn _mm_storeu_si16(mem_addr: *mut u8, a: __m128i) { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub unsafe fn _mm_storeu_si32(mem_addr: *mut u8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_si32(mem_addr: *mut u8, a: __m128i) { ptr::write_unaligned(mem_addr as *mut i32, simd_extract(a.as_i32x4(), 0)) } @@ -2712,7 +2826,8 @@ pub unsafe fn _mm_storeu_si32(mem_addr: *mut u8, a: __m128i) { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub unsafe fn _mm_storeu_si64(mem_addr: *mut u8, a: __m128i) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeu_si64(mem_addr: *mut u8, a: __m128i) { ptr::write_unaligned(mem_addr as *mut i64, simd_extract(a.as_i64x2(), 0)) } @@ -2725,7 +2840,8 @@ pub unsafe fn _mm_storeu_si64(mem_addr: *mut u8, a: __m128i) { #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_store1_pd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store1_pd(mem_addr: *mut f64, a: __m128d) { let b: __m128d = simd_shuffle!(a, a, [0, 0]); *(mem_addr as *mut __m128d) = b; } @@ -2739,7 +2855,8 @@ pub unsafe fn _mm_store1_pd(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_store_pd1(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_store_pd1(mem_addr: *mut f64, a: __m128d) { let b: __m128d = simd_shuffle!(a, a, [0, 0]); *(mem_addr as *mut __m128d) = b; } @@ -2754,7 +2871,8 @@ pub unsafe fn _mm_store_pd1(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] #[allow(clippy::cast_ptr_alignment)] -pub unsafe fn _mm_storer_pd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storer_pd(mem_addr: *mut f64, a: __m128d) { let b: __m128d = simd_shuffle!(a, a, [1, 0]); *(mem_addr as *mut __m128d) = b; } @@ -2767,7 +2885,8 @@ pub unsafe fn _mm_storer_pd(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_storeh_pd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storeh_pd(mem_addr: *mut f64, a: __m128d) { *mem_addr = simd_extract!(a, 1); } @@ -2779,7 +2898,8 @@ pub unsafe fn _mm_storeh_pd(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movlps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_storel_pd(mem_addr: *mut f64, a: __m128d) { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_storel_pd(mem_addr: *mut f64, a: __m128d) { *mem_addr = simd_extract!(a, 0); } @@ -2791,7 +2911,8 @@ pub unsafe fn _mm_storel_pd(mem_addr: *mut f64, a: __m128d) { #[target_feature(enable = "sse2")] // #[cfg_attr(test, assert_instr(movapd))] // FIXME LLVM uses different codegen #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load1_pd(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load1_pd(mem_addr: *const f64) -> __m128d { let d = *mem_addr; _mm_setr_pd(d, d) } @@ -2804,7 +2925,8 @@ pub unsafe fn _mm_load1_pd(mem_addr: *const f64) -> __m128d { #[target_feature(enable = "sse2")] // #[cfg_attr(test, assert_instr(movapd))] // FIXME same as _mm_load1_pd #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_load_pd1(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_load_pd1(mem_addr: *const f64) -> __m128d { _mm_load1_pd(mem_addr) } @@ -2820,7 +2942,8 @@ pub unsafe fn _mm_load_pd1(mem_addr: *const f64) -> __m128d { assert_instr(movaps) )] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadr_pd(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadr_pd(mem_addr: *const f64) -> __m128d { let a = _mm_load_pd(mem_addr); simd_shuffle!(a, a, [1, 0]) } @@ -2834,7 +2957,8 @@ pub unsafe fn _mm_loadr_pd(mem_addr: *const f64) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movups))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loadu_pd(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_pd(mem_addr: *const f64) -> __m128d { let mut dst = _mm_undefined_pd(); ptr::copy_nonoverlapping( mem_addr as *const u8, @@ -2852,7 +2976,8 @@ pub unsafe fn _mm_loadu_pd(mem_addr: *const f64) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub unsafe fn _mm_loadu_si16(mem_addr: *const u8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_si16(mem_addr: *const u8) -> __m128i { transmute(i16x8::new( ptr::read_unaligned(mem_addr as *const i16), 0, @@ -2873,7 +2998,8 @@ pub unsafe fn _mm_loadu_si16(mem_addr: *const u8) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86_updates", since = "1.82.0")] -pub unsafe fn _mm_loadu_si32(mem_addr: *const u8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_si32(mem_addr: *const u8) -> __m128i { transmute(i32x4::new( ptr::read_unaligned(mem_addr as *const i32), 0, @@ -2890,7 +3016,8 @@ pub unsafe fn _mm_loadu_si32(mem_addr: *const u8) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86_mm_loadu_si64", since = "1.46.0")] -pub unsafe fn _mm_loadu_si64(mem_addr: *const u8) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loadu_si64(mem_addr: *const u8) -> __m128i { transmute(i64x2::new(ptr::read_unaligned(mem_addr as *const i64), 0)) } @@ -2904,7 +3031,8 @@ pub unsafe fn _mm_loadu_si64(mem_addr: *const u8) -> __m128i { #[cfg_attr(test, assert_instr(shufps, MASK = 2))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_shuffle_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_shuffle_pd(a: __m128d, b: __m128d) -> __m128d { static_assert_uimm_bits!(MASK, 8); unsafe { simd_shuffle!(a, b, [MASK as u32 & 0b1, ((MASK as u32 >> 1) & 0b1) + 2]) } } @@ -2918,7 +3046,8 @@ pub fn _mm_shuffle_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_move_sd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_move_sd(a: __m128d, b: __m128d) -> __m128d { unsafe { _mm_setr_pd(simd_extract!(b, 0), simd_extract!(a, 1)) } } @@ -2929,7 +3058,8 @@ pub fn _mm_move_sd(a: __m128d, b: __m128d) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_castpd_ps(a: __m128d) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castpd_ps(a: __m128d) -> __m128 { unsafe { transmute(a) } } @@ -2940,7 +3070,8 @@ pub fn _mm_castpd_ps(a: __m128d) -> __m128 { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_castpd_si128(a: __m128d) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castpd_si128(a: __m128d) -> __m128i { unsafe { transmute(a) } } @@ -2951,7 +3082,8 @@ pub fn _mm_castpd_si128(a: __m128d) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_castps_pd(a: __m128) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castps_pd(a: __m128) -> __m128d { unsafe { transmute(a) } } @@ -2962,7 +3094,8 @@ pub fn _mm_castps_pd(a: __m128) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_castps_si128(a: __m128) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castps_si128(a: __m128) -> __m128i { unsafe { transmute(a) } } @@ -2973,7 +3106,8 @@ pub fn _mm_castps_si128(a: __m128) -> __m128i { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_castsi128_pd(a: __m128i) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castsi128_pd(a: __m128i) -> __m128d { unsafe { transmute(a) } } @@ -2984,7 +3118,8 @@ pub fn _mm_castsi128_pd(a: __m128i) -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_castsi128_ps(a: __m128i) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_castsi128_ps(a: __m128i) -> __m128 { unsafe { transmute(a) } } @@ -2997,7 +3132,8 @@ pub fn _mm_castsi128_ps(a: __m128i) -> __m128 { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_undefined_pd() -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_undefined_pd() -> __m128d { const { unsafe { mem::zeroed() } } } @@ -3010,7 +3146,8 @@ pub fn _mm_undefined_pd() -> __m128d { #[inline] #[target_feature(enable = "sse2")] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_undefined_si128() -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_undefined_si128() -> __m128i { const { unsafe { mem::zeroed() } } } @@ -3025,7 +3162,8 @@ pub fn _mm_undefined_si128() -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(unpckhpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpackhi_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpackhi_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_shuffle!(a, b, [1, 3]) } } @@ -3040,7 +3178,8 @@ pub fn _mm_unpackhi_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movlhps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_unpacklo_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_unpacklo_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { simd_shuffle!(a, b, [0, 2]) } } @@ -3054,6 +3193,8 @@ unsafe extern "C" { fn lfence(); #[link_name = "llvm.x86.sse2.mfence"] fn mfence(); + #[link_name = "llvm.x86.sse2.pmadd.wd"] + fn pmaddwd(a: i16x8, b: i16x8) -> i32x4; #[link_name = "llvm.x86.sse2.psad.bw"] fn psadbw(a: u8x16, b: u8x16) -> u64x2; #[link_name = "llvm.x86.sse2.psll.w"] @@ -3134,6 +3275,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::{ core_arch::{simd::*, x86::*}, hint::black_box, @@ -3161,19 +3303,19 @@ mod tests { #[simd_test(enable = "sse2")] // Miri cannot support this until it is clear how it fits in the Rust memory model #[cfg_attr(miri, ignore)] - unsafe fn test_mm_lfence() { + fn test_mm_lfence() { _mm_lfence(); } #[simd_test(enable = "sse2")] // Miri cannot support this until it is clear how it fits in the Rust memory model #[cfg_attr(miri, ignore)] - unsafe fn test_mm_mfence() { + fn test_mm_mfence() { _mm_mfence(); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_epi8() { + const fn test_mm_add_epi8() { let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let b = _mm_setr_epi8( @@ -3188,7 +3330,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_epi8_overflow() { + fn test_mm_add_epi8_overflow() { let a = _mm_set1_epi8(0x7F); let b = _mm_set1_epi8(1); let r = _mm_add_epi8(a, b); @@ -3196,7 +3338,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_epi16() { + const fn test_mm_add_epi16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_add_epi16(a, b); @@ -3205,7 +3347,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_epi32() { + const fn test_mm_add_epi32() { let a = _mm_setr_epi32(0, 1, 2, 3); let b = _mm_setr_epi32(4, 5, 6, 7); let r = _mm_add_epi32(a, b); @@ -3214,7 +3356,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_epi64() { + const fn test_mm_add_epi64() { let a = _mm_setr_epi64x(0, 1); let b = _mm_setr_epi64x(2, 3); let r = _mm_add_epi64(a, b); @@ -3223,7 +3365,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epi8() { + const fn test_mm_adds_epi8() { let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let b = _mm_setr_epi8( @@ -3238,7 +3380,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epi8_saturate_positive() { + fn test_mm_adds_epi8_saturate_positive() { let a = _mm_set1_epi8(0x7F); let b = _mm_set1_epi8(1); let r = _mm_adds_epi8(a, b); @@ -3246,7 +3388,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epi8_saturate_negative() { + fn test_mm_adds_epi8_saturate_negative() { let a = _mm_set1_epi8(-0x80); let b = _mm_set1_epi8(-1); let r = _mm_adds_epi8(a, b); @@ -3254,7 +3396,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epi16() { + const fn test_mm_adds_epi16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_adds_epi16(a, b); @@ -3263,7 +3405,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epi16_saturate_positive() { + fn test_mm_adds_epi16_saturate_positive() { let a = _mm_set1_epi16(0x7FFF); let b = _mm_set1_epi16(1); let r = _mm_adds_epi16(a, b); @@ -3271,7 +3413,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epi16_saturate_negative() { + fn test_mm_adds_epi16_saturate_negative() { let a = _mm_set1_epi16(-0x8000); let b = _mm_set1_epi16(-1); let r = _mm_adds_epi16(a, b); @@ -3279,7 +3421,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epu8() { + const fn test_mm_adds_epu8() { let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); #[rustfmt::skip] let b = _mm_setr_epi8( @@ -3294,7 +3436,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epu8_saturate() { + fn test_mm_adds_epu8_saturate() { let a = _mm_set1_epi8(!0); let b = _mm_set1_epi8(1); let r = _mm_adds_epu8(a, b); @@ -3302,7 +3444,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epu16() { + const fn test_mm_adds_epu16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_adds_epu16(a, b); @@ -3311,7 +3453,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_adds_epu16_saturate() { + fn test_mm_adds_epu16_saturate() { let a = _mm_set1_epi16(!0); let b = _mm_set1_epi16(1); let r = _mm_adds_epu16(a, b); @@ -3319,21 +3461,21 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_avg_epu8() { + const fn test_mm_avg_epu8() { let (a, b) = (_mm_set1_epi8(3), _mm_set1_epi8(9)); let r = _mm_avg_epu8(a, b); assert_eq_m128i(r, _mm_set1_epi8(6)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_avg_epu16() { + const fn test_mm_avg_epu16() { let (a, b) = (_mm_set1_epi16(3), _mm_set1_epi16(9)); let r = _mm_avg_epu16(a, b); assert_eq_m128i(r, _mm_set1_epi16(6)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_madd_epi16() { + fn test_mm_madd_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_setr_epi16(9, 10, 11, 12, 13, 14, 15, 16); let r = _mm_madd_epi16(a, b); @@ -3368,7 +3510,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_max_epi16() { + const fn test_mm_max_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(-1); let r = _mm_max_epi16(a, b); @@ -3376,7 +3518,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_max_epu8() { + const fn test_mm_max_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(!0); let r = _mm_max_epu8(a, b); @@ -3384,7 +3526,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_min_epi16() { + const fn test_mm_min_epi16() { let a = _mm_set1_epi16(1); let b = _mm_set1_epi16(-1); let r = _mm_min_epi16(a, b); @@ -3392,7 +3534,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_min_epu8() { + const fn test_mm_min_epu8() { let a = _mm_set1_epi8(1); let b = _mm_set1_epi8(!0); let r = _mm_min_epu8(a, b); @@ -3400,28 +3542,28 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_mulhi_epi16() { + const fn test_mm_mulhi_epi16() { let (a, b) = (_mm_set1_epi16(1000), _mm_set1_epi16(-1001)); let r = _mm_mulhi_epi16(a, b); assert_eq_m128i(r, _mm_set1_epi16(-16)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_mulhi_epu16() { + const fn test_mm_mulhi_epu16() { let (a, b) = (_mm_set1_epi16(1000), _mm_set1_epi16(1001)); let r = _mm_mulhi_epu16(a, b); assert_eq_m128i(r, _mm_set1_epi16(15)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_mullo_epi16() { + const fn test_mm_mullo_epi16() { let (a, b) = (_mm_set1_epi16(1000), _mm_set1_epi16(-1001)); let r = _mm_mullo_epi16(a, b); assert_eq_m128i(r, _mm_set1_epi16(-17960)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_mul_epu32() { + const fn test_mm_mul_epu32() { let a = _mm_setr_epi64x(1_000_000_000, 1 << 34); let b = _mm_setr_epi64x(1_000_000_000, 1 << 35); let r = _mm_mul_epu32(a, b); @@ -3430,7 +3572,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sad_epu8() { + fn test_mm_sad_epu8() { #[rustfmt::skip] let a = _mm_setr_epi8( 255u8 as i8, 254u8 as i8, 253u8 as i8, 252u8 as i8, @@ -3445,42 +3587,42 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sub_epi8() { + const fn test_mm_sub_epi8() { let (a, b) = (_mm_set1_epi8(5), _mm_set1_epi8(6)); let r = _mm_sub_epi8(a, b); assert_eq_m128i(r, _mm_set1_epi8(-1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sub_epi16() { + const fn test_mm_sub_epi16() { let (a, b) = (_mm_set1_epi16(5), _mm_set1_epi16(6)); let r = _mm_sub_epi16(a, b); assert_eq_m128i(r, _mm_set1_epi16(-1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sub_epi32() { + const fn test_mm_sub_epi32() { let (a, b) = (_mm_set1_epi32(5), _mm_set1_epi32(6)); let r = _mm_sub_epi32(a, b); assert_eq_m128i(r, _mm_set1_epi32(-1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sub_epi64() { + const fn test_mm_sub_epi64() { let (a, b) = (_mm_set1_epi64x(5), _mm_set1_epi64x(6)); let r = _mm_sub_epi64(a, b); assert_eq_m128i(r, _mm_set1_epi64x(-1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epi8() { + const fn test_mm_subs_epi8() { let (a, b) = (_mm_set1_epi8(5), _mm_set1_epi8(2)); let r = _mm_subs_epi8(a, b); assert_eq_m128i(r, _mm_set1_epi8(3)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epi8_saturate_positive() { + fn test_mm_subs_epi8_saturate_positive() { let a = _mm_set1_epi8(0x7F); let b = _mm_set1_epi8(-1); let r = _mm_subs_epi8(a, b); @@ -3488,7 +3630,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epi8_saturate_negative() { + fn test_mm_subs_epi8_saturate_negative() { let a = _mm_set1_epi8(-0x80); let b = _mm_set1_epi8(1); let r = _mm_subs_epi8(a, b); @@ -3496,14 +3638,14 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epi16() { + const fn test_mm_subs_epi16() { let (a, b) = (_mm_set1_epi16(5), _mm_set1_epi16(2)); let r = _mm_subs_epi16(a, b); assert_eq_m128i(r, _mm_set1_epi16(3)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epi16_saturate_positive() { + fn test_mm_subs_epi16_saturate_positive() { let a = _mm_set1_epi16(0x7FFF); let b = _mm_set1_epi16(-1); let r = _mm_subs_epi16(a, b); @@ -3511,7 +3653,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epi16_saturate_negative() { + fn test_mm_subs_epi16_saturate_negative() { let a = _mm_set1_epi16(-0x8000); let b = _mm_set1_epi16(1); let r = _mm_subs_epi16(a, b); @@ -3519,14 +3661,14 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epu8() { + const fn test_mm_subs_epu8() { let (a, b) = (_mm_set1_epi8(5), _mm_set1_epi8(2)); let r = _mm_subs_epu8(a, b); assert_eq_m128i(r, _mm_set1_epi8(3)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epu8_saturate() { + fn test_mm_subs_epu8_saturate() { let a = _mm_set1_epi8(0); let b = _mm_set1_epi8(1); let r = _mm_subs_epu8(a, b); @@ -3534,14 +3676,14 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epu16() { + const fn test_mm_subs_epu16() { let (a, b) = (_mm_set1_epi16(5), _mm_set1_epi16(2)); let r = _mm_subs_epu16(a, b); assert_eq_m128i(r, _mm_set1_epi16(3)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_subs_epu16_saturate() { + fn test_mm_subs_epu16_saturate() { let a = _mm_set1_epi16(0); let b = _mm_set1_epi16(1); let r = _mm_subs_epu16(a, b); @@ -3549,7 +3691,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_slli_si128() { + const fn test_mm_slli_si128() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, @@ -3575,7 +3717,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_slli_epi16() { + const fn test_mm_slli_epi16() { let a = _mm_setr_epi16(0xCC, -0xCC, 0xDD, -0xDD, 0xEE, -0xEE, 0xFF, -0xFF); let r = _mm_slli_epi16::<4>(a); assert_eq_m128i( @@ -3603,7 +3745,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_slli_epi32() { + const fn test_mm_slli_epi32() { let a = _mm_setr_epi32(0xEEEE, -0xEEEE, 0xFFFF, -0xFFFF); let r = _mm_slli_epi32::<4>(a); assert_eq_m128i(r, _mm_setr_epi32(0xEEEE0, -0xEEEE0, 0xFFFF0, -0xFFFF0)); @@ -3612,7 +3754,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sll_epi32() { + fn test_mm_sll_epi32() { let a = _mm_setr_epi32(0xEEEE, -0xEEEE, 0xFFFF, -0xFFFF); let r = _mm_sll_epi32(a, _mm_set_epi64x(0, 4)); assert_eq_m128i(r, _mm_setr_epi32(0xEEEE0, -0xEEEE0, 0xFFFF0, -0xFFFF0)); @@ -3625,7 +3767,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_slli_epi64() { + const fn test_mm_slli_epi64() { let a = _mm_set_epi64x(0xFFFFFFFF, -0xFFFFFFFF); let r = _mm_slli_epi64::<4>(a); assert_eq_m128i(r, _mm_set_epi64x(0xFFFFFFFF0, -0xFFFFFFFF0)); @@ -3634,7 +3776,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sll_epi64() { + fn test_mm_sll_epi64() { let a = _mm_set_epi64x(0xFFFFFFFF, -0xFFFFFFFF); let r = _mm_sll_epi64(a, _mm_set_epi64x(0, 4)); assert_eq_m128i(r, _mm_set_epi64x(0xFFFFFFFF0, -0xFFFFFFFF0)); @@ -3647,7 +3789,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srai_epi16() { + const fn test_mm_srai_epi16() { let a = _mm_setr_epi16(0xCC, -0xCC, 0xDD, -0xDD, 0xEE, -0xEE, 0xFF, -0xFF); let r = _mm_srai_epi16::<4>(a); assert_eq_m128i( @@ -3659,7 +3801,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sra_epi16() { + fn test_mm_sra_epi16() { let a = _mm_setr_epi16(0xCC, -0xCC, 0xDD, -0xDD, 0xEE, -0xEE, 0xFF, -0xFF); let r = _mm_sra_epi16(a, _mm_set_epi64x(0, 4)); assert_eq_m128i( @@ -3675,7 +3817,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srai_epi32() { + const fn test_mm_srai_epi32() { let a = _mm_setr_epi32(0xEEEE, -0xEEEE, 0xFFFF, -0xFFFF); let r = _mm_srai_epi32::<4>(a); assert_eq_m128i(r, _mm_setr_epi32(0xEEE, -0xEEF, 0xFFF, -0x1000)); @@ -3684,7 +3826,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sra_epi32() { + fn test_mm_sra_epi32() { let a = _mm_setr_epi32(0xEEEE, -0xEEEE, 0xFFFF, -0xFFFF); let r = _mm_sra_epi32(a, _mm_set_epi64x(0, 4)); assert_eq_m128i(r, _mm_setr_epi32(0xEEE, -0xEEF, 0xFFF, -0x1000)); @@ -3697,7 +3839,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srli_si128() { + const fn test_mm_srli_si128() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, @@ -3726,7 +3868,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srli_epi16() { + const fn test_mm_srli_epi16() { let a = _mm_setr_epi16(0xCC, -0xCC, 0xDD, -0xDD, 0xEE, -0xEE, 0xFF, -0xFF); let r = _mm_srli_epi16::<4>(a); assert_eq_m128i( @@ -3738,7 +3880,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srl_epi16() { + fn test_mm_srl_epi16() { let a = _mm_setr_epi16(0xCC, -0xCC, 0xDD, -0xDD, 0xEE, -0xEE, 0xFF, -0xFF); let r = _mm_srl_epi16(a, _mm_set_epi64x(0, 4)); assert_eq_m128i( @@ -3754,7 +3896,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srli_epi32() { + const fn test_mm_srli_epi32() { let a = _mm_setr_epi32(0xEEEE, -0xEEEE, 0xFFFF, -0xFFFF); let r = _mm_srli_epi32::<4>(a); assert_eq_m128i(r, _mm_setr_epi32(0xEEE, 0xFFFF111, 0xFFF, 0xFFFF000)); @@ -3763,7 +3905,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srl_epi32() { + fn test_mm_srl_epi32() { let a = _mm_setr_epi32(0xEEEE, -0xEEEE, 0xFFFF, -0xFFFF); let r = _mm_srl_epi32(a, _mm_set_epi64x(0, 4)); assert_eq_m128i(r, _mm_setr_epi32(0xEEE, 0xFFFF111, 0xFFF, 0xFFFF000)); @@ -3776,7 +3918,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srli_epi64() { + const fn test_mm_srli_epi64() { let a = _mm_set_epi64x(0xFFFFFFFF, -0xFFFFFFFF); let r = _mm_srli_epi64::<4>(a); assert_eq_m128i(r, _mm_set_epi64x(0xFFFFFFF, 0xFFFFFFFF0000000)); @@ -3785,7 +3927,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_srl_epi64() { + fn test_mm_srl_epi64() { let a = _mm_set_epi64x(0xFFFFFFFF, -0xFFFFFFFF); let r = _mm_srl_epi64(a, _mm_set_epi64x(0, 4)); assert_eq_m128i(r, _mm_set_epi64x(0xFFFFFFF, 0xFFFFFFFF0000000)); @@ -3798,7 +3940,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_and_si128() { + const fn test_mm_and_si128() { let a = _mm_set1_epi8(5); let b = _mm_set1_epi8(3); let r = _mm_and_si128(a, b); @@ -3806,7 +3948,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_andnot_si128() { + const fn test_mm_andnot_si128() { let a = _mm_set1_epi8(5); let b = _mm_set1_epi8(3); let r = _mm_andnot_si128(a, b); @@ -3814,7 +3956,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_or_si128() { + const fn test_mm_or_si128() { let a = _mm_set1_epi8(5); let b = _mm_set1_epi8(3); let r = _mm_or_si128(a, b); @@ -3822,7 +3964,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_xor_si128() { + const fn test_mm_xor_si128() { let a = _mm_set1_epi8(5); let b = _mm_set1_epi8(3); let r = _mm_xor_si128(a, b); @@ -3830,7 +3972,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpeq_epi8() { + const fn test_mm_cmpeq_epi8() { let a = _mm_setr_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let b = _mm_setr_epi8(15, 14, 2, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); let r = _mm_cmpeq_epi8(a, b); @@ -3844,7 +3986,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpeq_epi16() { + const fn test_mm_cmpeq_epi16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_setr_epi16(7, 6, 2, 4, 3, 2, 1, 0); let r = _mm_cmpeq_epi16(a, b); @@ -3852,7 +3994,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpeq_epi32() { + const fn test_mm_cmpeq_epi32() { let a = _mm_setr_epi32(0, 1, 2, 3); let b = _mm_setr_epi32(3, 2, 2, 0); let r = _mm_cmpeq_epi32(a, b); @@ -3860,7 +4002,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpgt_epi8() { + const fn test_mm_cmpgt_epi8() { let a = _mm_set_epi8(5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); let b = _mm_set1_epi8(0); let r = _mm_cmpgt_epi8(a, b); @@ -3869,7 +4011,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpgt_epi16() { + const fn test_mm_cmpgt_epi16() { let a = _mm_set_epi16(5, 0, 0, 0, 0, 0, 0, 0); let b = _mm_set1_epi16(0); let r = _mm_cmpgt_epi16(a, b); @@ -3878,7 +4020,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpgt_epi32() { + const fn test_mm_cmpgt_epi32() { let a = _mm_set_epi32(5, 0, 0, 0); let b = _mm_set1_epi32(0); let r = _mm_cmpgt_epi32(a, b); @@ -3886,7 +4028,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmplt_epi8() { + const fn test_mm_cmplt_epi8() { let a = _mm_set1_epi8(0); let b = _mm_set_epi8(5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); let r = _mm_cmplt_epi8(a, b); @@ -3895,7 +4037,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmplt_epi16() { + const fn test_mm_cmplt_epi16() { let a = _mm_set1_epi16(0); let b = _mm_set_epi16(5, 0, 0, 0, 0, 0, 0, 0); let r = _mm_cmplt_epi16(a, b); @@ -3904,7 +4046,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmplt_epi32() { + const fn test_mm_cmplt_epi32() { let a = _mm_set1_epi32(0); let b = _mm_set_epi32(5, 0, 0, 0); let r = _mm_cmplt_epi32(a, b); @@ -3912,21 +4054,21 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtepi32_pd() { + const fn test_mm_cvtepi32_pd() { let a = _mm_set_epi32(35, 25, 15, 5); let r = _mm_cvtepi32_pd(a); assert_eq_m128d(r, _mm_setr_pd(5.0, 15.0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsi32_sd() { + const fn test_mm_cvtsi32_sd() { let a = _mm_set1_pd(3.5); let r = _mm_cvtsi32_sd(a, 5); assert_eq_m128d(r, _mm_setr_pd(5.0, 3.5)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtepi32_ps() { + const fn test_mm_cvtepi32_ps() { let a = _mm_setr_epi32(1, 2, 3, 4); let r = _mm_cvtepi32_ps(a); assert_eq_m128(r, _mm_setr_ps(1.0, 2.0, 3.0, 4.0)); @@ -3940,37 +4082,37 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsi32_si128() { + const fn test_mm_cvtsi32_si128() { let r = _mm_cvtsi32_si128(5); assert_eq_m128i(r, _mm_setr_epi32(5, 0, 0, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsi128_si32() { + const fn test_mm_cvtsi128_si32() { let r = _mm_cvtsi128_si32(_mm_setr_epi32(5, 0, 0, 0)); assert_eq!(r, 5); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_epi64x() { + const fn test_mm_set_epi64x() { let r = _mm_set_epi64x(0, 1); assert_eq_m128i(r, _mm_setr_epi64x(1, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_epi32() { + const fn test_mm_set_epi32() { let r = _mm_set_epi32(0, 1, 2, 3); assert_eq_m128i(r, _mm_setr_epi32(3, 2, 1, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_epi16() { + const fn test_mm_set_epi16() { let r = _mm_set_epi16(0, 1, 2, 3, 4, 5, 6, 7); assert_eq_m128i(r, _mm_setr_epi16(7, 6, 5, 4, 3, 2, 1, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_epi8() { + const fn test_mm_set_epi8() { #[rustfmt::skip] let r = _mm_set_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -3984,43 +4126,43 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set1_epi64x() { + const fn test_mm_set1_epi64x() { let r = _mm_set1_epi64x(1); assert_eq_m128i(r, _mm_set1_epi64x(1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set1_epi32() { + const fn test_mm_set1_epi32() { let r = _mm_set1_epi32(1); assert_eq_m128i(r, _mm_set1_epi32(1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set1_epi16() { + const fn test_mm_set1_epi16() { let r = _mm_set1_epi16(1); assert_eq_m128i(r, _mm_set1_epi16(1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set1_epi8() { + const fn test_mm_set1_epi8() { let r = _mm_set1_epi8(1); assert_eq_m128i(r, _mm_set1_epi8(1)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_setr_epi32() { + const fn test_mm_setr_epi32() { let r = _mm_setr_epi32(0, 1, 2, 3); assert_eq_m128i(r, _mm_setr_epi32(0, 1, 2, 3)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_setr_epi16() { + const fn test_mm_setr_epi16() { let r = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); assert_eq_m128i(r, _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_setr_epi8() { + const fn test_mm_setr_epi8() { #[rustfmt::skip] let r = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -4034,27 +4176,27 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_setzero_si128() { + const fn test_mm_setzero_si128() { let r = _mm_setzero_si128(); assert_eq_m128i(r, _mm_set1_epi64x(0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadl_epi64() { + const unsafe fn test_mm_loadl_epi64() { let a = _mm_setr_epi64x(6, 5); let r = _mm_loadl_epi64(ptr::addr_of!(a)); assert_eq_m128i(r, _mm_setr_epi64x(6, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_load_si128() { + const unsafe fn test_mm_load_si128() { let a = _mm_set_epi64x(5, 6); let r = _mm_load_si128(ptr::addr_of!(a) as *const _); assert_eq_m128i(a, r); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadu_si128() { + const unsafe fn test_mm_loadu_si128() { let a = _mm_set_epi64x(5, 6); let r = _mm_loadu_si128(ptr::addr_of!(a) as *const _); assert_eq_m128i(a, r); @@ -4079,7 +4221,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_store_si128() { + const unsafe fn test_mm_store_si128() { let a = _mm_set1_epi8(9); let mut r = _mm_set1_epi8(0); _mm_store_si128(&mut r, a); @@ -4087,7 +4229,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storeu_si128() { + const unsafe fn test_mm_storeu_si128() { let a = _mm_set1_epi8(9); let mut r = _mm_set1_epi8(0); _mm_storeu_si128(&mut r, a); @@ -4095,7 +4237,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storel_epi64() { + const unsafe fn test_mm_storel_epi64() { let a = _mm_setr_epi64x(2, 9); let mut r = _mm_set1_epi8(0); _mm_storel_epi64(&mut r, a); @@ -4127,14 +4269,14 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_move_epi64() { + const fn test_mm_move_epi64() { let a = _mm_setr_epi64x(5, 6); let r = _mm_move_epi64(a); assert_eq_m128i(r, _mm_setr_epi64x(5, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_packs_epi16() { + fn test_mm_packs_epi16() { let a = _mm_setr_epi16(0x80, -0x81, 0, 0, 0, 0, 0, 0); let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -0x81, 0x80); let r = _mm_packs_epi16(a, b); @@ -4148,7 +4290,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_packs_epi32() { + fn test_mm_packs_epi32() { let a = _mm_setr_epi32(0x8000, -0x8001, 0, 0); let b = _mm_setr_epi32(0, 0, -0x8001, 0x8000); let r = _mm_packs_epi32(a, b); @@ -4159,7 +4301,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_packus_epi16() { + fn test_mm_packus_epi16() { let a = _mm_setr_epi16(0x100, -1, 0, 0, 0, 0, 0, 0); let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -1, 0x100); let r = _mm_packus_epi16(a, b); @@ -4170,7 +4312,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_extract_epi16() { + const fn test_mm_extract_epi16() { let a = _mm_setr_epi16(-1, 1, 2, 3, 4, 5, 6, 7); let r1 = _mm_extract_epi16::<0>(a); let r2 = _mm_extract_epi16::<3>(a); @@ -4179,7 +4321,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_insert_epi16() { + const fn test_mm_insert_epi16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm_insert_epi16::<0>(a, 9); let e = _mm_setr_epi16(9, 1, 2, 3, 4, 5, 6, 7); @@ -4187,7 +4329,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_movemask_epi8() { + const fn test_mm_movemask_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 0b1000_0000u8 as i8, 0b0, 0b1000_0000u8 as i8, 0b01, @@ -4200,7 +4342,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_shuffle_epi32() { + const fn test_mm_shuffle_epi32() { let a = _mm_setr_epi32(5, 10, 15, 20); let r = _mm_shuffle_epi32::<0b00_01_01_11>(a); let e = _mm_setr_epi32(20, 10, 10, 5); @@ -4208,7 +4350,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_shufflehi_epi16() { + const fn test_mm_shufflehi_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 10, 15, 20); let r = _mm_shufflehi_epi16::<0b00_01_01_11>(a); let e = _mm_setr_epi16(1, 2, 3, 4, 20, 10, 10, 5); @@ -4216,7 +4358,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_shufflelo_epi16() { + const fn test_mm_shufflelo_epi16() { let a = _mm_setr_epi16(5, 10, 15, 20, 1, 2, 3, 4); let r = _mm_shufflelo_epi16::<0b00_01_01_11>(a); let e = _mm_setr_epi16(20, 10, 10, 5, 1, 2, 3, 4); @@ -4224,7 +4366,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpackhi_epi8() { + const fn test_mm_unpackhi_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4243,7 +4385,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpackhi_epi16() { + const fn test_mm_unpackhi_epi16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_unpackhi_epi16(a, b); @@ -4252,7 +4394,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpackhi_epi32() { + const fn test_mm_unpackhi_epi32() { let a = _mm_setr_epi32(0, 1, 2, 3); let b = _mm_setr_epi32(4, 5, 6, 7); let r = _mm_unpackhi_epi32(a, b); @@ -4261,7 +4403,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpackhi_epi64() { + const fn test_mm_unpackhi_epi64() { let a = _mm_setr_epi64x(0, 1); let b = _mm_setr_epi64x(2, 3); let r = _mm_unpackhi_epi64(a, b); @@ -4270,7 +4412,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpacklo_epi8() { + const fn test_mm_unpacklo_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -4290,7 +4432,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpacklo_epi16() { + const fn test_mm_unpacklo_epi16() { let a = _mm_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm_setr_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_unpacklo_epi16(a, b); @@ -4299,7 +4441,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpacklo_epi32() { + const fn test_mm_unpacklo_epi32() { let a = _mm_setr_epi32(0, 1, 2, 3); let b = _mm_setr_epi32(4, 5, 6, 7); let r = _mm_unpacklo_epi32(a, b); @@ -4308,7 +4450,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpacklo_epi64() { + const fn test_mm_unpacklo_epi64() { let a = _mm_setr_epi64x(0, 1); let b = _mm_setr_epi64x(2, 3); let r = _mm_unpacklo_epi64(a, b); @@ -4317,7 +4459,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_sd() { + const fn test_mm_add_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_add_sd(a, b); @@ -4325,7 +4467,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_add_pd() { + const fn test_mm_add_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_add_pd(a, b); @@ -4333,7 +4475,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_div_sd() { + const fn test_mm_div_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_div_sd(a, b); @@ -4341,7 +4483,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_div_pd() { + const fn test_mm_div_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_div_pd(a, b); @@ -4349,7 +4491,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_max_sd() { + fn test_mm_max_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_max_sd(a, b); @@ -4357,7 +4499,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_max_pd() { + fn test_mm_max_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_max_pd(a, b); @@ -4366,17 +4508,18 @@ mod tests { // Check SSE(2)-specific semantics for -0.0 handling. let a = _mm_setr_pd(-0.0, 0.0); let b = _mm_setr_pd(0.0, 0.0); - let r1: [u8; 16] = transmute(_mm_max_pd(a, b)); - let r2: [u8; 16] = transmute(_mm_max_pd(b, a)); - let a: [u8; 16] = transmute(a); - let b: [u8; 16] = transmute(b); - assert_eq!(r1, b); - assert_eq!(r2, a); - assert_ne!(a, b); // sanity check that -0.0 is actually present + // Cast to __m128i to compare exact bit patterns + let r1 = _mm_castpd_si128(_mm_max_pd(a, b)); + let r2 = _mm_castpd_si128(_mm_max_pd(b, a)); + let a = _mm_castpd_si128(a); + let b = _mm_castpd_si128(b); + assert_eq_m128i(r1, b); + assert_eq_m128i(r2, a); + assert_ne!(a.as_u8x16(), b.as_u8x16()); // sanity check that -0.0 is actually present } #[simd_test(enable = "sse2")] - unsafe fn test_mm_min_sd() { + fn test_mm_min_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_min_sd(a, b); @@ -4384,7 +4527,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_min_pd() { + fn test_mm_min_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_min_pd(a, b); @@ -4393,17 +4536,18 @@ mod tests { // Check SSE(2)-specific semantics for -0.0 handling. let a = _mm_setr_pd(-0.0, 0.0); let b = _mm_setr_pd(0.0, 0.0); - let r1: [u8; 16] = transmute(_mm_min_pd(a, b)); - let r2: [u8; 16] = transmute(_mm_min_pd(b, a)); - let a: [u8; 16] = transmute(a); - let b: [u8; 16] = transmute(b); - assert_eq!(r1, b); - assert_eq!(r2, a); - assert_ne!(a, b); // sanity check that -0.0 is actually present + // Cast to __m128i to compare exact bit patterns + let r1 = _mm_castpd_si128(_mm_min_pd(a, b)); + let r2 = _mm_castpd_si128(_mm_min_pd(b, a)); + let a = _mm_castpd_si128(a); + let b = _mm_castpd_si128(b); + assert_eq_m128i(r1, b); + assert_eq_m128i(r2, a); + assert_ne!(a.as_u8x16(), b.as_u8x16()); // sanity check that -0.0 is actually present } #[simd_test(enable = "sse2")] - unsafe fn test_mm_mul_sd() { + const fn test_mm_mul_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_mul_sd(a, b); @@ -4411,7 +4555,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_mul_pd() { + const fn test_mm_mul_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_mul_pd(a, b); @@ -4419,7 +4563,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sqrt_sd() { + fn test_mm_sqrt_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_sqrt_sd(a, b); @@ -4427,13 +4571,13 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sqrt_pd() { + fn test_mm_sqrt_pd() { let r = _mm_sqrt_pd(_mm_setr_pd(1.0, 2.0)); assert_eq_m128d(r, _mm_setr_pd(1.0f64.sqrt(), 2.0f64.sqrt())); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sub_sd() { + const fn test_mm_sub_sd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_sub_sd(a, b); @@ -4441,7 +4585,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_sub_pd() { + const fn test_mm_sub_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(5.0, 10.0); let r = _mm_sub_pd(a, b); @@ -4449,7 +4593,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_and_pd() { + const unsafe fn test_mm_and_pd() { let a = transmute(u64x2::splat(5)); let b = transmute(u64x2::splat(3)); let r = _mm_and_pd(a, b); @@ -4458,7 +4602,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_andnot_pd() { + const unsafe fn test_mm_andnot_pd() { let a = transmute(u64x2::splat(5)); let b = transmute(u64x2::splat(3)); let r = _mm_andnot_pd(a, b); @@ -4467,7 +4611,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_or_pd() { + const unsafe fn test_mm_or_pd() { let a = transmute(u64x2::splat(5)); let b = transmute(u64x2::splat(3)); let r = _mm_or_pd(a, b); @@ -4476,7 +4620,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_xor_pd() { + const unsafe fn test_mm_xor_pd() { let a = transmute(u64x2::splat(5)); let b = transmute(u64x2::splat(3)); let r = _mm_xor_pd(a, b); @@ -4485,199 +4629,199 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpeq_sd() { + fn test_mm_cmpeq_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpeq_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpeq_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmplt_sd() { + fn test_mm_cmplt_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmplt_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmplt_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmple_sd() { + fn test_mm_cmple_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmple_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmple_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpgt_sd() { + fn test_mm_cmpgt_sd() { let (a, b) = (_mm_setr_pd(5.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpgt_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpgt_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpge_sd() { + fn test_mm_cmpge_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpge_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpge_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpord_sd() { + fn test_mm_cmpord_sd() { let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpord_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpord_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpunord_sd() { + fn test_mm_cmpunord_sd() { let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpunord_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpunord_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpneq_sd() { + fn test_mm_cmpneq_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(!0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpneq_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpneq_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpnlt_sd() { + fn test_mm_cmpnlt_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpnlt_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpnlt_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpnle_sd() { + fn test_mm_cmpnle_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpnle_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpnle_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpngt_sd() { + fn test_mm_cmpngt_sd() { let (a, b) = (_mm_setr_pd(5.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpngt_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpngt_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpnge_sd() { + fn test_mm_cmpnge_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, 2.0f64.to_bits() as i64); - let r = transmute::<_, __m128i>(_mm_cmpnge_sd(a, b)); + let r = _mm_castpd_si128(_mm_cmpnge_sd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpeq_pd() { + fn test_mm_cmpeq_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, 0); - let r = transmute::<_, __m128i>(_mm_cmpeq_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpeq_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmplt_pd() { + fn test_mm_cmplt_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, !0); - let r = transmute::<_, __m128i>(_mm_cmplt_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmplt_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmple_pd() { + fn test_mm_cmple_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, !0); - let r = transmute::<_, __m128i>(_mm_cmple_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmple_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpgt_pd() { + fn test_mm_cmpgt_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, 0); - let r = transmute::<_, __m128i>(_mm_cmpgt_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpgt_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpge_pd() { + fn test_mm_cmpge_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(!0, 0); - let r = transmute::<_, __m128i>(_mm_cmpge_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpge_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpord_pd() { + fn test_mm_cmpord_pd() { let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(0, !0); - let r = transmute::<_, __m128i>(_mm_cmpord_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpord_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpunord_pd() { + fn test_mm_cmpunord_pd() { let (a, b) = (_mm_setr_pd(NAN, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(!0, 0); - let r = transmute::<_, __m128i>(_mm_cmpunord_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpunord_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpneq_pd() { + fn test_mm_cmpneq_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(!0, !0); - let r = transmute::<_, __m128i>(_mm_cmpneq_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpneq_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpnlt_pd() { + fn test_mm_cmpnlt_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(5.0, 3.0)); let e = _mm_setr_epi64x(0, 0); - let r = transmute::<_, __m128i>(_mm_cmpnlt_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpnlt_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpnle_pd() { + fn test_mm_cmpnle_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, 0); - let r = transmute::<_, __m128i>(_mm_cmpnle_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpnle_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpngt_pd() { + fn test_mm_cmpngt_pd() { let (a, b) = (_mm_setr_pd(5.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, !0); - let r = transmute::<_, __m128i>(_mm_cmpngt_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpngt_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cmpnge_pd() { + fn test_mm_cmpnge_pd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); let e = _mm_setr_epi64x(0, !0); - let r = transmute::<_, __m128i>(_mm_cmpnge_pd(a, b)); + let r = _mm_castpd_si128(_mm_cmpnge_pd(a, b)); assert_eq_m128i(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_comieq_sd() { + fn test_mm_comieq_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_comieq_sd(a, b) != 0); @@ -4686,37 +4830,37 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_comilt_sd() { + fn test_mm_comilt_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_comilt_sd(a, b) == 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_comile_sd() { + fn test_mm_comile_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_comile_sd(a, b) != 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_comigt_sd() { + fn test_mm_comigt_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_comigt_sd(a, b) == 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_comige_sd() { + fn test_mm_comige_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_comige_sd(a, b) != 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_comineq_sd() { + fn test_mm_comineq_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_comineq_sd(a, b) == 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_ucomieq_sd() { + fn test_mm_ucomieq_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_ucomieq_sd(a, b) != 0); @@ -4725,37 +4869,37 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_ucomilt_sd() { + fn test_mm_ucomilt_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_ucomilt_sd(a, b) == 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_ucomile_sd() { + fn test_mm_ucomile_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_ucomile_sd(a, b) != 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_ucomigt_sd() { + fn test_mm_ucomigt_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_ucomigt_sd(a, b) == 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_ucomige_sd() { + fn test_mm_ucomige_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_ucomige_sd(a, b) != 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_ucomineq_sd() { + fn test_mm_ucomineq_sd() { let (a, b) = (_mm_setr_pd(1.0, 2.0), _mm_setr_pd(1.0, 3.0)); assert!(_mm_ucomineq_sd(a, b) == 0); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_movemask_pd() { + const fn test_mm_movemask_pd() { let r = _mm_movemask_pd(_mm_setr_pd(-1.0, 5.0)); assert_eq!(r, 0b01); @@ -4769,7 +4913,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_load_pd() { + const unsafe fn test_mm_load_pd() { let mem = Memory { data: [1.0f64, 2.0, 3.0, 4.0], }; @@ -4781,7 +4925,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_load_sd() { + const unsafe fn test_mm_load_sd() { let a = 1.; let expected = _mm_setr_pd(a, 0.); let r = _mm_load_sd(&a); @@ -4789,7 +4933,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadh_pd() { + const unsafe fn test_mm_loadh_pd() { let a = _mm_setr_pd(1., 2.); let b = 3.; let expected = _mm_setr_pd(_mm_cvtsd_f64(a), 3.); @@ -4798,7 +4942,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadl_pd() { + const unsafe fn test_mm_loadl_pd() { let a = _mm_setr_pd(1., 2.); let b = 3.; let expected = _mm_setr_pd(3., get_m128d(a, 1)); @@ -4826,7 +4970,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_store_sd() { + const unsafe fn test_mm_store_sd() { let mut dest = 0.; let a = _mm_setr_pd(1., 2.); _mm_store_sd(&mut dest, a); @@ -4834,7 +4978,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_store_pd() { + const unsafe fn test_mm_store_pd() { let mut mem = Memory { data: [0.0f64; 4] }; let vals = &mut mem.data; let a = _mm_setr_pd(1.0, 2.0); @@ -4846,31 +4990,21 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storeu_pd() { + const unsafe fn test_mm_storeu_pd() { + // guaranteed to be aligned to 16 bytes let mut mem = Memory { data: [0.0f64; 4] }; let vals = &mut mem.data; let a = _mm_setr_pd(1.0, 2.0); - let mut ofs = 0; - let mut p = vals.as_mut_ptr(); - - // Make sure p is **not** aligned to 16-byte boundary - if (p as usize) & 0xf == 0 { - ofs = 1; - p = p.add(1); - } - + // so p is *not* aligned to 16 bytes + let p = vals.as_mut_ptr().offset(1); _mm_storeu_pd(p, *black_box(&a)); - if ofs > 0 { - assert_eq!(vals[ofs - 1], 0.0); - } - assert_eq!(vals[ofs + 0], 1.0); - assert_eq!(vals[ofs + 1], 2.0); + assert_eq!(*vals, [0.0, 1.0, 2.0, 0.0]); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storeu_si16() { + const unsafe fn test_mm_storeu_si16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let mut r = _mm_setr_epi16(9, 10, 11, 12, 13, 14, 15, 16); _mm_storeu_si16(ptr::addr_of_mut!(r).cast(), a); @@ -4879,7 +5013,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storeu_si32() { + const unsafe fn test_mm_storeu_si32() { let a = _mm_setr_epi32(1, 2, 3, 4); let mut r = _mm_setr_epi32(5, 6, 7, 8); _mm_storeu_si32(ptr::addr_of_mut!(r).cast(), a); @@ -4888,7 +5022,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storeu_si64() { + const unsafe fn test_mm_storeu_si64() { let a = _mm_setr_epi64x(1, 2); let mut r = _mm_setr_epi64x(3, 4); _mm_storeu_si64(ptr::addr_of_mut!(r).cast(), a); @@ -4897,7 +5031,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_store1_pd() { + const unsafe fn test_mm_store1_pd() { let mut mem = Memory { data: [0.0f64; 4] }; let vals = &mut mem.data; let a = _mm_setr_pd(1.0, 2.0); @@ -4909,7 +5043,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_store_pd1() { + const unsafe fn test_mm_store_pd1() { let mut mem = Memory { data: [0.0f64; 4] }; let vals = &mut mem.data; let a = _mm_setr_pd(1.0, 2.0); @@ -4921,7 +5055,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storer_pd() { + const unsafe fn test_mm_storer_pd() { let mut mem = Memory { data: [0.0f64; 4] }; let vals = &mut mem.data; let a = _mm_setr_pd(1.0, 2.0); @@ -4933,7 +5067,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storeh_pd() { + const unsafe fn test_mm_storeh_pd() { let mut dest = 0.; let a = _mm_setr_pd(1., 2.); _mm_storeh_pd(&mut dest, a); @@ -4941,7 +5075,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_storel_pd() { + const unsafe fn test_mm_storel_pd() { let mut dest = 0.; let a = _mm_setr_pd(1., 2.); _mm_storel_pd(&mut dest, a); @@ -4949,7 +5083,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadr_pd() { + const unsafe fn test_mm_loadr_pd() { let mut mem = Memory { data: [1.0f64, 2.0, 3.0, 4.0], }; @@ -4961,48 +5095,44 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadu_pd() { + const unsafe fn test_mm_loadu_pd() { + // guaranteed to be aligned to 16 bytes let mut mem = Memory { data: [1.0f64, 2.0, 3.0, 4.0], }; let vals = &mut mem.data; - let mut d = vals.as_ptr(); - // make sure d is not aligned to 16-byte boundary - let mut offset = 0; - if (d as usize) & 0xf == 0 { - offset = 1; - d = d.add(offset); - } + // so this will *not* be aligned to 16 bytes + let d = vals.as_ptr().offset(1); let r = _mm_loadu_pd(d); - let e = _mm_add_pd(_mm_setr_pd(1.0, 2.0), _mm_set1_pd(offset as f64)); + let e = _mm_setr_pd(2.0, 3.0); assert_eq_m128d(r, e); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadu_si16() { + const unsafe fn test_mm_loadu_si16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm_loadu_si16(ptr::addr_of!(a) as *const _); assert_eq_m128i(r, _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadu_si32() { + const unsafe fn test_mm_loadu_si32() { let a = _mm_setr_epi32(1, 2, 3, 4); let r = _mm_loadu_si32(ptr::addr_of!(a) as *const _); assert_eq_m128i(r, _mm_setr_epi32(1, 0, 0, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_loadu_si64() { + const unsafe fn test_mm_loadu_si64() { let a = _mm_setr_epi64x(5, 6); let r = _mm_loadu_si64(ptr::addr_of!(a) as *const _); assert_eq_m128i(r, _mm_setr_epi64x(5, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtpd_ps() { + const fn test_mm_cvtpd_ps() { let r = _mm_cvtpd_ps(_mm_setr_pd(-1.0, 5.0)); assert_eq_m128(r, _mm_setr_ps(-1.0, 5.0, 0.0, 0.0)); @@ -5017,7 +5147,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtps_pd() { + const fn test_mm_cvtps_pd() { let r = _mm_cvtps_pd(_mm_setr_ps(-1.0, 2.0, -3.0, 5.0)); assert_eq_m128d(r, _mm_setr_pd(-1.0, 2.0)); @@ -5031,7 +5161,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtpd_epi32() { + fn test_mm_cvtpd_epi32() { let r = _mm_cvtpd_epi32(_mm_setr_pd(-1.0, 5.0)); assert_eq_m128i(r, _mm_setr_epi32(-1, 5, 0, 0)); @@ -5049,7 +5179,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsd_si32() { + fn test_mm_cvtsd_si32() { let r = _mm_cvtsd_si32(_mm_setr_pd(-2.0, 5.0)); assert_eq!(r, -2); @@ -5061,7 +5191,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsd_ss() { + fn test_mm_cvtsd_ss() { let a = _mm_setr_ps(-1.1, -2.2, 3.3, 4.4); let b = _mm_setr_pd(2.0, -5.0); @@ -5086,13 +5216,13 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsd_f64() { + const fn test_mm_cvtsd_f64() { let r = _mm_cvtsd_f64(_mm_setr_pd(-1.1, 2.2)); assert_eq!(r, -1.1); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtss_sd() { + const fn test_mm_cvtss_sd() { let a = _mm_setr_pd(-1.1, 2.2); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); @@ -5107,7 +5237,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvttpd_epi32() { + fn test_mm_cvttpd_epi32() { let a = _mm_setr_pd(-1.1, 2.2); let r = _mm_cvttpd_epi32(a); assert_eq_m128i(r, _mm_setr_epi32(-1, 2, 0, 0)); @@ -5118,7 +5248,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvttsd_si32() { + fn test_mm_cvttsd_si32() { let a = _mm_setr_pd(-1.1, 2.2); let r = _mm_cvttsd_si32(a); assert_eq!(r, -1); @@ -5129,7 +5259,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvttps_epi32() { + fn test_mm_cvttps_epi32() { let a = _mm_setr_ps(-1.1, 2.2, -3.3, 6.6); let r = _mm_cvttps_epi32(a); assert_eq_m128i(r, _mm_setr_epi32(-1, 2, -3, 6)); @@ -5140,57 +5270,57 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_sd() { + const fn test_mm_set_sd() { let r = _mm_set_sd(-1.0_f64); assert_eq_m128d(r, _mm_setr_pd(-1.0_f64, 0_f64)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set1_pd() { + const fn test_mm_set1_pd() { let r = _mm_set1_pd(-1.0_f64); assert_eq_m128d(r, _mm_setr_pd(-1.0_f64, -1.0_f64)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_pd1() { + const fn test_mm_set_pd1() { let r = _mm_set_pd1(-2.0_f64); assert_eq_m128d(r, _mm_setr_pd(-2.0_f64, -2.0_f64)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_set_pd() { + const fn test_mm_set_pd() { let r = _mm_set_pd(1.0_f64, 5.0_f64); assert_eq_m128d(r, _mm_setr_pd(5.0_f64, 1.0_f64)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_setr_pd() { + const fn test_mm_setr_pd() { let r = _mm_setr_pd(1.0_f64, -5.0_f64); assert_eq_m128d(r, _mm_setr_pd(1.0_f64, -5.0_f64)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_setzero_pd() { + const fn test_mm_setzero_pd() { let r = _mm_setzero_pd(); assert_eq_m128d(r, _mm_setr_pd(0_f64, 0_f64)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_load1_pd() { + const unsafe fn test_mm_load1_pd() { let d = -5.0; let r = _mm_load1_pd(&d); assert_eq_m128d(r, _mm_setr_pd(d, d)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_load_pd1() { + const unsafe fn test_mm_load_pd1() { let d = -5.0; let r = _mm_load_pd1(&d); assert_eq_m128d(r, _mm_setr_pd(d, d)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpackhi_pd() { + const fn test_mm_unpackhi_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(3.0, 4.0); let r = _mm_unpackhi_pd(a, b); @@ -5198,7 +5328,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_unpacklo_pd() { + const fn test_mm_unpacklo_pd() { let a = _mm_setr_pd(1.0, 2.0); let b = _mm_setr_pd(3.0, 4.0); let r = _mm_unpacklo_pd(a, b); @@ -5206,7 +5336,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_shuffle_pd() { + const fn test_mm_shuffle_pd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(3., 4.); let expected = _mm_setr_pd(1., 3.); @@ -5215,7 +5345,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_move_sd() { + const fn test_mm_move_sd() { let a = _mm_setr_pd(1., 2.); let b = _mm_setr_pd(3., 4.); let expected = _mm_setr_pd(3., 2.); @@ -5224,7 +5354,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_castpd_ps() { + const fn test_mm_castpd_ps() { let a = _mm_set1_pd(0.); let expected = _mm_set1_ps(0.); let r = _mm_castpd_ps(a); @@ -5232,7 +5362,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_castpd_si128() { + const fn test_mm_castpd_si128() { let a = _mm_set1_pd(0.); let expected = _mm_set1_epi64x(0); let r = _mm_castpd_si128(a); @@ -5240,7 +5370,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_castps_pd() { + const fn test_mm_castps_pd() { let a = _mm_set1_ps(0.); let expected = _mm_set1_pd(0.); let r = _mm_castps_pd(a); @@ -5248,7 +5378,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_castps_si128() { + const fn test_mm_castps_si128() { let a = _mm_set1_ps(0.); let expected = _mm_set1_epi32(0); let r = _mm_castps_si128(a); @@ -5256,7 +5386,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_castsi128_pd() { + const fn test_mm_castsi128_pd() { let a = _mm_set1_epi64x(0); let expected = _mm_set1_pd(0.); let r = _mm_castsi128_pd(a); @@ -5264,7 +5394,7 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_castsi128_ps() { + const fn test_mm_castsi128_ps() { let a = _mm_set1_epi32(0); let expected = _mm_set1_ps(0.); let r = _mm_castsi128_ps(a); diff --git a/library/stdarch/crates/core_arch/src/x86/sse3.rs b/library/stdarch/crates/core_arch/src/x86/sse3.rs index 79be7a7e9b2c..68817856f44a 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse3.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse3.rs @@ -14,7 +14,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(addsubps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_addsub_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_addsub_ps(a: __m128, b: __m128) -> __m128 { unsafe { let a = a.as_f32x4(); let b = b.as_f32x4(); @@ -32,7 +33,8 @@ pub fn _mm_addsub_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(addsubpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_addsub_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_addsub_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let a = a.as_f64x2(); let b = b.as_f64x2(); @@ -50,7 +52,8 @@ pub fn _mm_addsub_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(haddpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hadd_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hadd_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let even = simd_shuffle!(a, b, [0, 2]); let odd = simd_shuffle!(a, b, [1, 3]); @@ -66,7 +69,8 @@ pub fn _mm_hadd_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(haddps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hadd_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hadd_ps(a: __m128, b: __m128) -> __m128 { unsafe { let even = simd_shuffle!(a, b, [0, 2, 4, 6]); let odd = simd_shuffle!(a, b, [1, 3, 5, 7]); @@ -82,7 +86,8 @@ pub fn _mm_hadd_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(hsubpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hsub_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hsub_pd(a: __m128d, b: __m128d) -> __m128d { unsafe { let even = simd_shuffle!(a, b, [0, 2]); let odd = simd_shuffle!(a, b, [1, 3]); @@ -98,7 +103,8 @@ pub fn _mm_hsub_pd(a: __m128d, b: __m128d) -> __m128d { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(hsubps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hsub_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hsub_ps(a: __m128, b: __m128) -> __m128 { unsafe { let even = simd_shuffle!(a, b, [0, 2, 4, 6]); let odd = simd_shuffle!(a, b, [1, 3, 5, 7]); @@ -127,7 +133,8 @@ pub unsafe fn _mm_lddqu_si128(mem_addr: *const __m128i) -> __m128i { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(movddup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movedup_pd(a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movedup_pd(a: __m128d) -> __m128d { unsafe { simd_shuffle!(a, a, [0, 0]) } } @@ -139,7 +146,8 @@ pub fn _mm_movedup_pd(a: __m128d) -> __m128d { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(movddup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm_loaddup_pd(mem_addr: *const f64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const unsafe fn _mm_loaddup_pd(mem_addr: *const f64) -> __m128d { _mm_load1_pd(mem_addr) } @@ -151,7 +159,8 @@ pub unsafe fn _mm_loaddup_pd(mem_addr: *const f64) -> __m128d { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(movshdup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_movehdup_ps(a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_movehdup_ps(a: __m128) -> __m128 { unsafe { simd_shuffle!(a, a, [1, 1, 3, 3]) } } @@ -163,7 +172,8 @@ pub fn _mm_movehdup_ps(a: __m128) -> __m128 { #[target_feature(enable = "sse3")] #[cfg_attr(test, assert_instr(movsldup))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_moveldup_ps(a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_moveldup_ps(a: __m128) -> __m128 { unsafe { simd_shuffle!(a, a, [0, 0, 2, 2]) } } @@ -175,12 +185,13 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "sse3")] - unsafe fn test_mm_addsub_ps() { + const fn test_mm_addsub_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_addsub_ps(a, b); @@ -188,7 +199,7 @@ mod tests { } #[simd_test(enable = "sse3")] - unsafe fn test_mm_addsub_pd() { + const fn test_mm_addsub_pd() { let a = _mm_setr_pd(-1.0, 5.0); let b = _mm_setr_pd(-100.0, 20.0); let r = _mm_addsub_pd(a, b); @@ -196,7 +207,7 @@ mod tests { } #[simd_test(enable = "sse3")] - unsafe fn test_mm_hadd_pd() { + const fn test_mm_hadd_pd() { let a = _mm_setr_pd(-1.0, 5.0); let b = _mm_setr_pd(-100.0, 20.0); let r = _mm_hadd_pd(a, b); @@ -204,7 +215,7 @@ mod tests { } #[simd_test(enable = "sse3")] - unsafe fn test_mm_hadd_ps() { + const fn test_mm_hadd_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_hadd_ps(a, b); @@ -212,7 +223,7 @@ mod tests { } #[simd_test(enable = "sse3")] - unsafe fn test_mm_hsub_pd() { + const fn test_mm_hsub_pd() { let a = _mm_setr_pd(-1.0, 5.0); let b = _mm_setr_pd(-100.0, 20.0); let r = _mm_hsub_pd(a, b); @@ -220,7 +231,7 @@ mod tests { } #[simd_test(enable = "sse3")] - unsafe fn test_mm_hsub_ps() { + const fn test_mm_hsub_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let b = _mm_setr_ps(-100.0, 20.0, 0.0, -5.0); let r = _mm_hsub_ps(a, b); @@ -241,28 +252,28 @@ mod tests { } #[simd_test(enable = "sse3")] - unsafe fn test_mm_movedup_pd() { + const fn test_mm_movedup_pd() { let a = _mm_setr_pd(-1.0, 5.0); let r = _mm_movedup_pd(a); assert_eq_m128d(r, _mm_setr_pd(-1.0, -1.0)); } #[simd_test(enable = "sse3")] - unsafe fn test_mm_movehdup_ps() { + const fn test_mm_movehdup_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let r = _mm_movehdup_ps(a); assert_eq_m128(r, _mm_setr_ps(5.0, 5.0, -10.0, -10.0)); } #[simd_test(enable = "sse3")] - unsafe fn test_mm_moveldup_ps() { + const fn test_mm_moveldup_ps() { let a = _mm_setr_ps(-1.0, 5.0, 0.0, -10.0); let r = _mm_moveldup_ps(a); assert_eq_m128(r, _mm_setr_ps(-1.0, -1.0, 0.0, 0.0)); } #[simd_test(enable = "sse3")] - unsafe fn test_mm_loaddup_pd() { + const unsafe fn test_mm_loaddup_pd() { let d = -5.0; let r = _mm_loaddup_pd(&d); assert_eq_m128d(r, _mm_setr_pd(d, d)); diff --git a/library/stdarch/crates/core_arch/src/x86/sse41.rs b/library/stdarch/crates/core_arch/src/x86/sse41.rs index f457c74aa9c1..a499bf898b80 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse41.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse41.rs @@ -59,7 +59,8 @@ pub const _MM_FROUND_NEARBYINT: i32 = _MM_FROUND_NO_EXC | _MM_FROUND_CUR_DIRECTI #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pblendvb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blendv_epi8(a: __m128i, b: __m128i, mask: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blendv_epi8(a: __m128i, b: __m128i, mask: __m128i) -> __m128i { unsafe { let mask: i8x16 = simd_lt(mask.as_i8x16(), i8x16::ZERO); transmute(simd_select(mask, b.as_i8x16(), a.as_i8x16())) @@ -78,7 +79,8 @@ pub fn _mm_blendv_epi8(a: __m128i, b: __m128i, mask: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(pblendw, IMM8 = 0xB1))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blend_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blend_epi16(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); unsafe { transmute::(simd_shuffle!( @@ -106,7 +108,8 @@ pub fn _mm_blend_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(blendvpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blendv_pd(a: __m128d, b: __m128d, mask: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blendv_pd(a: __m128d, b: __m128d, mask: __m128d) -> __m128d { unsafe { let mask: i64x2 = simd_lt(transmute::<_, i64x2>(mask), i64x2::ZERO); transmute(simd_select(mask, b.as_f64x2(), a.as_f64x2())) @@ -121,7 +124,8 @@ pub fn _mm_blendv_pd(a: __m128d, b: __m128d, mask: __m128d) -> __m128d { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(blendvps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blendv_ps(a: __m128, b: __m128, mask: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blendv_ps(a: __m128, b: __m128, mask: __m128) -> __m128 { unsafe { let mask: i32x4 = simd_lt(transmute::<_, i32x4>(mask), i32x4::ZERO); transmute(simd_select(mask, b.as_f32x4(), a.as_f32x4())) @@ -140,7 +144,8 @@ pub fn _mm_blendv_ps(a: __m128, b: __m128, mask: __m128) -> __m128 { #[cfg_attr(test, assert_instr(blendps, IMM2 = 0b10))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blend_pd(a: __m128d, b: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blend_pd(a: __m128d, b: __m128d) -> __m128d { static_assert_uimm_bits!(IMM2, 2); unsafe { transmute::(simd_shuffle!( @@ -160,7 +165,8 @@ pub fn _mm_blend_pd(a: __m128d, b: __m128d) -> __m128d { #[cfg_attr(test, assert_instr(blendps, IMM4 = 0b0101))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_blend_ps(a: __m128, b: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_blend_ps(a: __m128, b: __m128) -> __m128 { static_assert_uimm_bits!(IMM4, 4); unsafe { transmute::(simd_shuffle!( @@ -207,7 +213,8 @@ pub fn _mm_blend_ps(a: __m128, b: __m128) -> __m128 { #[cfg_attr(test, assert_instr(extractps, IMM8 = 0))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_extract_ps(a: __m128) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_extract_ps(a: __m128) -> i32 { static_assert_uimm_bits!(IMM8, 2); unsafe { simd_extract!(a, IMM8 as u32, f32).to_bits() as i32 } } @@ -223,7 +230,8 @@ pub fn _mm_extract_ps(a: __m128) -> i32 { #[cfg_attr(test, assert_instr(pextrb, IMM8 = 0))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_extract_epi8(a: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_extract_epi8(a: __m128i) -> i32 { static_assert_uimm_bits!(IMM8, 4); unsafe { simd_extract!(a.as_u8x16(), IMM8 as u32, u8) as i32 } } @@ -236,7 +244,8 @@ pub fn _mm_extract_epi8(a: __m128i) -> i32 { #[cfg_attr(test, assert_instr(extractps, IMM8 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_extract_epi32(a: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_extract_epi32(a: __m128i) -> i32 { static_assert_uimm_bits!(IMM8, 2); unsafe { simd_extract!(a.as_i32x4(), IMM8 as u32, i32) } } @@ -284,7 +293,8 @@ pub fn _mm_insert_ps(a: __m128, b: __m128) -> __m128 { #[cfg_attr(test, assert_instr(pinsrb, IMM8 = 0))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_insert_epi8(a: __m128i, i: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_insert_epi8(a: __m128i, i: i32) -> __m128i { static_assert_uimm_bits!(IMM8, 4); unsafe { transmute(simd_insert!(a.as_i8x16(), IMM8 as u32, i as i8)) } } @@ -298,7 +308,8 @@ pub fn _mm_insert_epi8(a: __m128i, i: i32) -> __m128i { #[cfg_attr(test, assert_instr(pinsrd, IMM8 = 0))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_insert_epi32(a: __m128i, i: i32) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_insert_epi32(a: __m128i, i: i32) -> __m128i { static_assert_uimm_bits!(IMM8, 2); unsafe { transmute(simd_insert!(a.as_i32x4(), IMM8 as u32, i)) } } @@ -311,12 +322,9 @@ pub fn _mm_insert_epi32(a: __m128i, i: i32) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmaxsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_max_epi8(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i8x16(); - let b = b.as_i8x16(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epi8(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_i8x16(), b.as_i8x16()).as_m128i() } } /// Compares packed unsigned 16-bit integers in `a` and `b`, and returns packed @@ -327,12 +335,9 @@ pub fn _mm_max_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmaxuw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_max_epu16(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u16x8(); - let b = b.as_u16x8(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epu16(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_u16x8(), b.as_u16x8()).as_m128i() } } /// Compares packed 32-bit integers in `a` and `b`, and returns packed maximum @@ -343,12 +348,9 @@ pub fn _mm_max_epu16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmaxsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_max_epi32(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i32x4(); - let b = b.as_i32x4(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epi32(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_i32x4(), b.as_i32x4()).as_m128i() } } /// Compares packed unsigned 32-bit integers in `a` and `b`, and returns packed @@ -359,12 +361,9 @@ pub fn _mm_max_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmaxud))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_max_epu32(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u32x4(); - let b = b.as_u32x4(); - transmute(simd_select::(simd_gt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_max_epu32(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imax(a.as_u32x4(), b.as_u32x4()).as_m128i() } } /// Compares packed 8-bit integers in `a` and `b` and returns packed minimum @@ -375,12 +374,9 @@ pub fn _mm_max_epu32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pminsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_min_epi8(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i8x16(); - let b = b.as_i8x16(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epi8(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_i8x16(), b.as_i8x16()).as_m128i() } } /// Compares packed unsigned 16-bit integers in `a` and `b`, and returns packed @@ -391,12 +387,9 @@ pub fn _mm_min_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pminuw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_min_epu16(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u16x8(); - let b = b.as_u16x8(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epu16(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_u16x8(), b.as_u16x8()).as_m128i() } } /// Compares packed 32-bit integers in `a` and `b`, and returns packed minimum @@ -407,12 +400,9 @@ pub fn _mm_min_epu16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pminsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_min_epi32(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_i32x4(); - let b = b.as_i32x4(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epi32(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_i32x4(), b.as_i32x4()).as_m128i() } } /// Compares packed unsigned 32-bit integers in `a` and `b`, and returns packed @@ -423,12 +413,9 @@ pub fn _mm_min_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pminud))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i { - unsafe { - let a = a.as_u32x4(); - let b = b.as_u32x4(); - transmute(simd_select::(simd_lt(a, b), a, b)) - } +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i { + unsafe { simd_imin(a.as_u32x4(), b.as_u32x4()).as_m128i() } } /// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers @@ -450,7 +437,8 @@ pub fn _mm_packus_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pcmpeqq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpeq_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpeq_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_eq::<_, i64x2>(a.as_i64x2(), b.as_i64x2())) } } @@ -461,7 +449,8 @@ pub fn _mm_cmpeq_epi64(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovsxbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi8_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi8_epi16(a: __m128i) -> __m128i { unsafe { let a = a.as_i8x16(); let a: i8x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -476,7 +465,8 @@ pub fn _mm_cvtepi8_epi16(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovsxbd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi8_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi8_epi32(a: __m128i) -> __m128i { unsafe { let a = a.as_i8x16(); let a: i8x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -492,7 +482,8 @@ pub fn _mm_cvtepi8_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovsxbq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi8_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi8_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_i8x16(); let a: i8x2 = simd_shuffle!(a, a, [0, 1]); @@ -507,7 +498,8 @@ pub fn _mm_cvtepi8_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovsxwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi16_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi16_epi32(a: __m128i) -> __m128i { unsafe { let a = a.as_i16x8(); let a: i16x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -522,7 +514,8 @@ pub fn _mm_cvtepi16_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovsxwq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi16_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi16_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_i16x8(); let a: i16x2 = simd_shuffle!(a, a, [0, 1]); @@ -537,7 +530,8 @@ pub fn _mm_cvtepi16_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovsxdq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepi32_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepi32_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_i32x4(); let a: i32x2 = simd_shuffle!(a, a, [0, 1]); @@ -552,7 +546,8 @@ pub fn _mm_cvtepi32_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovzxbw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepu8_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu8_epi16(a: __m128i) -> __m128i { unsafe { let a = a.as_u8x16(); let a: u8x8 = simd_shuffle!(a, a, [0, 1, 2, 3, 4, 5, 6, 7]); @@ -567,7 +562,8 @@ pub fn _mm_cvtepu8_epi16(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovzxbd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepu8_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu8_epi32(a: __m128i) -> __m128i { unsafe { let a = a.as_u8x16(); let a: u8x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -582,7 +578,8 @@ pub fn _mm_cvtepu8_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovzxbq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepu8_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu8_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_u8x16(); let a: u8x2 = simd_shuffle!(a, a, [0, 1]); @@ -598,7 +595,8 @@ pub fn _mm_cvtepu8_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovzxwd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepu16_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu16_epi32(a: __m128i) -> __m128i { unsafe { let a = a.as_u16x8(); let a: u16x4 = simd_shuffle!(a, a, [0, 1, 2, 3]); @@ -614,7 +612,8 @@ pub fn _mm_cvtepu16_epi32(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovzxwq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepu16_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu16_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_u16x8(); let a: u16x2 = simd_shuffle!(a, a, [0, 1]); @@ -630,7 +629,8 @@ pub fn _mm_cvtepu16_epi64(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmovzxdq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtepu32_epi64(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtepu32_epi64(a: __m128i) -> __m128i { unsafe { let a = a.as_u32x4(); let a: u32x2 = simd_shuffle!(a, a, [0, 1]); @@ -687,7 +687,8 @@ pub fn _mm_dp_ps(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(roundpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_floor_pd(a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_floor_pd(a: __m128d) -> __m128d { unsafe { simd_floor(a) } } @@ -700,7 +701,8 @@ pub fn _mm_floor_pd(a: __m128d) -> __m128d { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(roundps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_floor_ps(a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_floor_ps(a: __m128) -> __m128 { unsafe { simd_floor(a) } } @@ -743,7 +745,8 @@ pub fn _mm_floor_ss(a: __m128, b: __m128) -> __m128 { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(roundpd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_ceil_pd(a: __m128d) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_ceil_pd(a: __m128d) -> __m128d { unsafe { simd_ceil(a) } } @@ -756,7 +759,8 @@ pub fn _mm_ceil_pd(a: __m128d) -> __m128d { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(roundps))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_ceil_ps(a: __m128) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_ceil_ps(a: __m128) -> __m128 { unsafe { simd_ceil(a) } } @@ -919,7 +923,8 @@ pub fn _mm_minpos_epu16(a: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmuldq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mul_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mul_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { let a = simd_cast::<_, i64x2>(simd_cast::<_, i32x2>(a.as_i64x2())); let b = simd_cast::<_, i64x2>(simd_cast::<_, i32x2>(b.as_i64x2())); @@ -939,7 +944,8 @@ pub fn _mm_mul_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(pmulld))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_mullo_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_mullo_epi32(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_mul(a.as_i32x4(), b.as_i32x4())) } } @@ -1005,7 +1011,8 @@ pub fn _mm_mpsadbw_epu8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(ptest))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_testz_si128(a: __m128i, mask: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testz_si128(a: __m128i, mask: __m128i) -> i32 { unsafe { let r = simd_reduce_or(simd_and(a.as_i64x2(), mask.as_i64x2())); (0i64 == r) as i32 @@ -1031,7 +1038,8 @@ pub fn _mm_testz_si128(a: __m128i, mask: __m128i) -> i32 { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(ptest))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_testc_si128(a: __m128i, mask: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_testc_si128(a: __m128i, mask: __m128i) -> i32 { unsafe { let r = simd_reduce_or(simd_and( simd_xor(a.as_i64x2(), i64x2::splat(!0)), @@ -1083,7 +1091,8 @@ pub fn _mm_testnzc_si128(a: __m128i, mask: __m128i) -> i32 { #[target_feature(enable = "sse4.1")] #[cfg_attr(test, assert_instr(ptest))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_test_all_zeros(a: __m128i, mask: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_test_all_zeros(a: __m128i, mask: __m128i) -> i32 { _mm_testz_si128(a, mask) } @@ -1105,7 +1114,8 @@ pub fn _mm_test_all_zeros(a: __m128i, mask: __m128i) -> i32 { #[cfg_attr(test, assert_instr(pcmpeqd))] #[cfg_attr(test, assert_instr(ptest))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_test_all_ones(a: __m128i) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_test_all_ones(a: __m128i) -> i32 { _mm_testc_si128(a, _mm_cmpeq_epi32(a, a)) } @@ -1180,12 +1190,13 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use crate::core_arch::x86::*; use std::mem; use stdarch_test::simd_test; #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_blendv_epi8() { + const fn test_mm_blendv_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -1208,7 +1219,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_blendv_pd() { + const unsafe fn test_mm_blendv_pd() { let a = _mm_set1_pd(0.0); let b = _mm_set1_pd(1.0); let mask = transmute(_mm_setr_epi64x(0, -1)); @@ -1218,7 +1229,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_blendv_ps() { + const unsafe fn test_mm_blendv_ps() { let a = _mm_set1_ps(0.0); let b = _mm_set1_ps(1.0); let mask = transmute(_mm_setr_epi32(0, -1, 0, -1)); @@ -1228,7 +1239,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_blend_pd() { + const fn test_mm_blend_pd() { let a = _mm_set1_pd(0.0); let b = _mm_set1_pd(1.0); let r = _mm_blend_pd::<0b10>(a, b); @@ -1237,7 +1248,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_blend_ps() { + const fn test_mm_blend_ps() { let a = _mm_set1_ps(0.0); let b = _mm_set1_ps(1.0); let r = _mm_blend_ps::<0b1010>(a, b); @@ -1246,7 +1257,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_blend_epi16() { + const fn test_mm_blend_epi16() { let a = _mm_set1_epi16(0); let b = _mm_set1_epi16(1); let r = _mm_blend_epi16::<0b1010_1100>(a, b); @@ -1255,7 +1266,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_extract_ps() { + const fn test_mm_extract_ps() { let a = _mm_setr_ps(0.0, 1.0, 2.0, 3.0); let r: f32 = f32::from_bits(_mm_extract_ps::<1>(a) as u32); assert_eq!(r, 1.0); @@ -1264,7 +1275,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_extract_epi8() { + const fn test_mm_extract_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( -1, 1, 2, 3, 4, 5, 6, 7, @@ -1277,7 +1288,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_extract_epi32() { + const fn test_mm_extract_epi32() { let a = _mm_setr_epi32(0, 1, 2, 3); let r = _mm_extract_epi32::<1>(a); assert_eq!(r, 1); @@ -1286,7 +1297,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_insert_ps() { + fn test_mm_insert_ps() { let a = _mm_set1_ps(1.0); let b = _mm_setr_ps(1.0, 2.0, 3.0, 4.0); let r = _mm_insert_ps::<0b11_00_1100>(a, b); @@ -1302,7 +1313,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_insert_epi8() { + const fn test_mm_insert_epi8() { let a = _mm_set1_epi8(0); let e = _mm_setr_epi8(0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); let r = _mm_insert_epi8::<1>(a, 32); @@ -1313,7 +1324,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_insert_epi32() { + const fn test_mm_insert_epi32() { let a = _mm_set1_epi32(0); let e = _mm_setr_epi32(0, 32, 0, 0); let r = _mm_insert_epi32::<1>(a, 32); @@ -1324,7 +1335,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_max_epi8() { + const fn test_mm_max_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 4, 5, 8, 9, 12, 13, 16, @@ -1345,7 +1356,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_max_epu16() { + const fn test_mm_max_epu16() { let a = _mm_setr_epi16(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm_setr_epi16(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm_max_epu16(a, b); @@ -1354,7 +1365,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_max_epi32() { + const fn test_mm_max_epi32() { let a = _mm_setr_epi32(1, 4, 5, 8); let b = _mm_setr_epi32(2, 3, 6, 7); let r = _mm_max_epi32(a, b); @@ -1363,7 +1374,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_max_epu32() { + const fn test_mm_max_epu32() { let a = _mm_setr_epi32(1, 4, 5, 8); let b = _mm_setr_epi32(2, 3, 6, 7); let r = _mm_max_epu32(a, b); @@ -1372,7 +1383,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_min_epi8() { + const fn test_mm_min_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 4, 5, 8, 9, 12, 13, 16, @@ -1411,7 +1422,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_min_epu16() { + const fn test_mm_min_epu16() { let a = _mm_setr_epi16(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm_setr_epi16(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm_min_epu16(a, b); @@ -1420,7 +1431,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_min_epi32() { + const fn test_mm_min_epi32() { let a = _mm_setr_epi32(1, 4, 5, 8); let b = _mm_setr_epi32(2, 3, 6, 7); let r = _mm_min_epi32(a, b); @@ -1435,7 +1446,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_min_epu32() { + const fn test_mm_min_epu32() { let a = _mm_setr_epi32(1, 4, 5, 8); let b = _mm_setr_epi32(2, 3, 6, 7); let r = _mm_min_epu32(a, b); @@ -1444,7 +1455,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_packus_epi32() { + fn test_mm_packus_epi32() { let a = _mm_setr_epi32(1, 2, 3, 4); let b = _mm_setr_epi32(-1, -2, -3, -4); let r = _mm_packus_epi32(a, b); @@ -1453,7 +1464,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cmpeq_epi64() { + const fn test_mm_cmpeq_epi64() { let a = _mm_setr_epi64x(0, 1); let b = _mm_setr_epi64x(0, 0); let r = _mm_cmpeq_epi64(a, b); @@ -1462,7 +1473,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepi8_epi16() { + const fn test_mm_cvtepi8_epi16() { let a = _mm_set1_epi8(10); let r = _mm_cvtepi8_epi16(a); let e = _mm_set1_epi16(10); @@ -1474,7 +1485,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepi8_epi32() { + const fn test_mm_cvtepi8_epi32() { let a = _mm_set1_epi8(10); let r = _mm_cvtepi8_epi32(a); let e = _mm_set1_epi32(10); @@ -1486,7 +1497,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepi8_epi64() { + const fn test_mm_cvtepi8_epi64() { let a = _mm_set1_epi8(10); let r = _mm_cvtepi8_epi64(a); let e = _mm_set1_epi64x(10); @@ -1498,7 +1509,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepi16_epi32() { + const fn test_mm_cvtepi16_epi32() { let a = _mm_set1_epi16(10); let r = _mm_cvtepi16_epi32(a); let e = _mm_set1_epi32(10); @@ -1510,7 +1521,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepi16_epi64() { + const fn test_mm_cvtepi16_epi64() { let a = _mm_set1_epi16(10); let r = _mm_cvtepi16_epi64(a); let e = _mm_set1_epi64x(10); @@ -1522,7 +1533,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepi32_epi64() { + const fn test_mm_cvtepi32_epi64() { let a = _mm_set1_epi32(10); let r = _mm_cvtepi32_epi64(a); let e = _mm_set1_epi64x(10); @@ -1534,7 +1545,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepu8_epi16() { + const fn test_mm_cvtepu8_epi16() { let a = _mm_set1_epi8(10); let r = _mm_cvtepu8_epi16(a); let e = _mm_set1_epi16(10); @@ -1542,7 +1553,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepu8_epi32() { + const fn test_mm_cvtepu8_epi32() { let a = _mm_set1_epi8(10); let r = _mm_cvtepu8_epi32(a); let e = _mm_set1_epi32(10); @@ -1550,7 +1561,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepu8_epi64() { + const fn test_mm_cvtepu8_epi64() { let a = _mm_set1_epi8(10); let r = _mm_cvtepu8_epi64(a); let e = _mm_set1_epi64x(10); @@ -1558,7 +1569,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepu16_epi32() { + const fn test_mm_cvtepu16_epi32() { let a = _mm_set1_epi16(10); let r = _mm_cvtepu16_epi32(a); let e = _mm_set1_epi32(10); @@ -1566,7 +1577,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepu16_epi64() { + const fn test_mm_cvtepu16_epi64() { let a = _mm_set1_epi16(10); let r = _mm_cvtepu16_epi64(a); let e = _mm_set1_epi64x(10); @@ -1574,7 +1585,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_cvtepu32_epi64() { + const fn test_mm_cvtepu32_epi64() { let a = _mm_set1_epi32(10); let r = _mm_cvtepu32_epi64(a); let e = _mm_set1_epi64x(10); @@ -1582,7 +1593,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_dp_pd() { + fn test_mm_dp_pd() { let a = _mm_setr_pd(2.0, 3.0); let b = _mm_setr_pd(1.0, 4.0); let e = _mm_setr_pd(14.0, 0.0); @@ -1590,7 +1601,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_dp_ps() { + fn test_mm_dp_ps() { let a = _mm_setr_ps(2.0, 3.0, 1.0, 10.0); let b = _mm_setr_ps(1.0, 4.0, 0.5, 10.0); let e = _mm_setr_ps(14.5, 0.0, 14.5, 0.0); @@ -1598,7 +1609,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_floor_pd() { + const fn test_mm_floor_pd() { let a = _mm_setr_pd(2.5, 4.5); let r = _mm_floor_pd(a); let e = _mm_setr_pd(2.0, 4.0); @@ -1606,7 +1617,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_floor_ps() { + const fn test_mm_floor_ps() { let a = _mm_setr_ps(2.5, 4.5, 8.5, 16.5); let r = _mm_floor_ps(a); let e = _mm_setr_ps(2.0, 4.0, 8.0, 16.0); @@ -1614,7 +1625,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_floor_sd() { + fn test_mm_floor_sd() { let a = _mm_setr_pd(2.5, 4.5); let b = _mm_setr_pd(-1.5, -3.5); let r = _mm_floor_sd(a, b); @@ -1623,7 +1634,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_floor_ss() { + fn test_mm_floor_ss() { let a = _mm_setr_ps(2.5, 4.5, 8.5, 16.5); let b = _mm_setr_ps(-1.5, -3.5, -7.5, -15.5); let r = _mm_floor_ss(a, b); @@ -1632,7 +1643,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_ceil_pd() { + const fn test_mm_ceil_pd() { let a = _mm_setr_pd(1.5, 3.5); let r = _mm_ceil_pd(a); let e = _mm_setr_pd(2.0, 4.0); @@ -1640,7 +1651,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_ceil_ps() { + const fn test_mm_ceil_ps() { let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5); let r = _mm_ceil_ps(a); let e = _mm_setr_ps(2.0, 4.0, 8.0, 16.0); @@ -1648,7 +1659,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_ceil_sd() { + fn test_mm_ceil_sd() { let a = _mm_setr_pd(1.5, 3.5); let b = _mm_setr_pd(-2.5, -4.5); let r = _mm_ceil_sd(a, b); @@ -1657,7 +1668,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_ceil_ss() { + fn test_mm_ceil_ss() { let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5); let b = _mm_setr_ps(-2.5, -4.5, -8.5, -16.5); let r = _mm_ceil_ss(a, b); @@ -1666,7 +1677,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_round_pd() { + fn test_mm_round_pd() { let a = _mm_setr_pd(1.25, 3.75); let r = _mm_round_pd::<_MM_FROUND_TO_NEAREST_INT>(a); let e = _mm_setr_pd(1.0, 4.0); @@ -1674,7 +1685,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_round_ps() { + fn test_mm_round_ps() { let a = _mm_setr_ps(2.25, 4.75, -1.75, -4.25); let r = _mm_round_ps::<_MM_FROUND_TO_ZERO>(a); let e = _mm_setr_ps(2.0, 4.0, -1.0, -4.0); @@ -1682,7 +1693,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_round_sd() { + fn test_mm_round_sd() { let a = _mm_setr_pd(1.5, 3.5); let b = _mm_setr_pd(-2.5, -4.5); let r = _mm_round_sd::<_MM_FROUND_TO_NEAREST_INT>(a, b); @@ -1709,7 +1720,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_round_ss() { + fn test_mm_round_ss() { let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5); let b = _mm_setr_ps(-1.75, -4.5, -8.5, -16.5); let r = _mm_round_ss::<_MM_FROUND_TO_NEAREST_INT>(a, b); @@ -1736,7 +1747,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_minpos_epu16_1() { + fn test_mm_minpos_epu16_1() { let a = _mm_setr_epi16(23, 18, 44, 97, 50, 13, 67, 66); let r = _mm_minpos_epu16(a); let e = _mm_setr_epi16(13, 5, 0, 0, 0, 0, 0, 0); @@ -1744,7 +1755,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_minpos_epu16_2() { + fn test_mm_minpos_epu16_2() { let a = _mm_setr_epi16(0, 18, 44, 97, 50, 13, 67, 66); let r = _mm_minpos_epu16(a); let e = _mm_setr_epi16(0, 0, 0, 0, 0, 0, 0, 0); @@ -1752,7 +1763,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_minpos_epu16_3() { + fn test_mm_minpos_epu16_3() { // Case where the minimum value is repeated let a = _mm_setr_epi16(23, 18, 44, 97, 50, 13, 67, 13); let r = _mm_minpos_epu16(a); @@ -1761,7 +1772,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_mul_epi32() { + const fn test_mm_mul_epi32() { { let a = _mm_setr_epi32(1, 1, 1, 1); let b = _mm_setr_epi32(1, 2, 3, 4); @@ -1782,7 +1793,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_mullo_epi32() { + const fn test_mm_mullo_epi32() { { let a = _mm_setr_epi32(1, 1, 1, 1); let b = _mm_setr_epi32(1, 2, 3, 4); @@ -1803,7 +1814,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_minpos_epu16() { + fn test_mm_minpos_epu16() { let a = _mm_setr_epi16(8, 7, 6, 5, 4, 1, 2, 3); let r = _mm_minpos_epu16(a); let e = _mm_setr_epi16(1, 5, 0, 0, 0, 0, 0, 0); @@ -1811,7 +1822,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_mpsadbw_epu8() { + fn test_mm_mpsadbw_epu8() { #[rustfmt::skip] let a = _mm_setr_epi8( 0, 1, 2, 3, 4, 5, 6, 7, @@ -1840,7 +1851,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_testz_si128() { + const fn test_mm_testz_si128() { let a = _mm_set1_epi8(1); let mask = _mm_set1_epi8(0); let r = _mm_testz_si128(a, mask); @@ -1856,7 +1867,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_testc_si128() { + const fn test_mm_testc_si128() { let a = _mm_set1_epi8(-1); let mask = _mm_set1_epi8(0); let r = _mm_testc_si128(a, mask); @@ -1872,7 +1883,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_testnzc_si128() { + fn test_mm_testnzc_si128() { let a = _mm_set1_epi8(0); let mask = _mm_set1_epi8(1); let r = _mm_testnzc_si128(a, mask); @@ -1892,7 +1903,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_test_all_zeros() { + const fn test_mm_test_all_zeros() { let a = _mm_set1_epi8(1); let mask = _mm_set1_epi8(0); let r = _mm_test_all_zeros(a, mask); @@ -1908,7 +1919,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_test_all_ones() { + const fn test_mm_test_all_ones() { let a = _mm_set1_epi8(-1); let r = _mm_test_all_ones(a); assert_eq!(r, 1); @@ -1918,7 +1929,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_test_mix_ones_zeros() { + fn test_mm_test_mix_ones_zeros() { let a = _mm_set1_epi8(0); let mask = _mm_set1_epi8(1); let r = _mm_test_mix_ones_zeros(a, mask); diff --git a/library/stdarch/crates/core_arch/src/x86/sse42.rs b/library/stdarch/crates/core_arch/src/x86/sse42.rs index 83c51f2b70eb..65d1fe4d6233 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse42.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse42.rs @@ -563,7 +563,8 @@ pub fn _mm_crc32_u32(crc: u32, v: u32) -> u32 { #[target_feature(enable = "sse4.2")] #[cfg_attr(test, assert_instr(pcmpgtq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cmpgt_epi64(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cmpgt_epi64(a: __m128i, b: __m128i) -> __m128i { unsafe { transmute(simd_gt::<_, i64x2>(a.as_i64x2(), b.as_i64x2())) } } @@ -609,6 +610,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; @@ -617,18 +619,17 @@ mod tests { // Currently one cannot `load` a &[u8] that is less than 16 // in length. This makes loading strings less than 16 in length // a bit difficult. Rather than `load` and mutate the __m128i, - // it is easier to memcpy the given string to a local slice with - // length 16 and `load` the local slice. - #[target_feature(enable = "sse4.2")] - unsafe fn str_to_m128i(s: &[u8]) -> __m128i { + // it is easier to memcpy the given string to a zero-padded + // 16-byte array and transmute it to `__m128i`. + fn str_to_m128i(s: &[u8]) -> __m128i { assert!(s.len() <= 16); - let slice = &mut [0u8; 16]; - ptr::copy_nonoverlapping(s.as_ptr(), slice.as_mut_ptr(), s.len()); - _mm_loadu_si128(slice.as_ptr() as *const _) + let mut array = [0u8; 16]; + array[..s.len()].copy_from_slice(s); + unsafe { transmute(array) } } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistrm() { + fn test_mm_cmpistrm() { let a = str_to_m128i(b"Hello! Good-Bye!"); let b = str_to_m128i(b"hello! good-bye!"); let i = _mm_cmpistrm::<_SIDD_UNIT_MASK>(a, b); @@ -641,7 +642,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistri() { + fn test_mm_cmpistri() { let a = str_to_m128i(b"Hello"); let b = str_to_m128i(b" Hello "); let i = _mm_cmpistri::<_SIDD_CMP_EQUAL_ORDERED>(a, b); @@ -649,7 +650,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistrz() { + fn test_mm_cmpistrz() { let a = str_to_m128i(b""); let b = str_to_m128i(b"Hello"); let i = _mm_cmpistrz::<_SIDD_CMP_EQUAL_ORDERED>(a, b); @@ -657,7 +658,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistrc() { + fn test_mm_cmpistrc() { let a = str_to_m128i(b" "); let b = str_to_m128i(b" ! "); let i = _mm_cmpistrc::<_SIDD_UNIT_MASK>(a, b); @@ -665,7 +666,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistrs() { + fn test_mm_cmpistrs() { let a = str_to_m128i(b"Hello"); let b = str_to_m128i(b""); let i = _mm_cmpistrs::<_SIDD_CMP_EQUAL_ORDERED>(a, b); @@ -673,7 +674,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistro() { + fn test_mm_cmpistro() { #[rustfmt::skip] let a_bytes = _mm_setr_epi8( 0x00, 0x47, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, @@ -691,7 +692,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpistra() { + fn test_mm_cmpistra() { let a = str_to_m128i(b""); let b = str_to_m128i(b"Hello!!!!!!!!!!!"); let i = _mm_cmpistra::<_SIDD_UNIT_MASK>(a, b); @@ -699,7 +700,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestrm() { + fn test_mm_cmpestrm() { let a = str_to_m128i(b"Hello!"); let b = str_to_m128i(b"Hello."); let i = _mm_cmpestrm::<_SIDD_UNIT_MASK>(a, 5, b, 5); @@ -712,7 +713,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestri() { + fn test_mm_cmpestri() { let a = str_to_m128i(b"bar - garbage"); let b = str_to_m128i(b"foobar"); let i = _mm_cmpestri::<_SIDD_CMP_EQUAL_ORDERED>(a, 3, b, 6); @@ -720,7 +721,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestrz() { + fn test_mm_cmpestrz() { let a = str_to_m128i(b""); let b = str_to_m128i(b"Hello"); let i = _mm_cmpestrz::<_SIDD_CMP_EQUAL_ORDERED>(a, 16, b, 6); @@ -728,7 +729,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestrc() { + fn test_mm_cmpestrc() { let va = str_to_m128i(b"!!!!!!!!"); let vb = str_to_m128i(b" "); let i = _mm_cmpestrc::<_SIDD_UNIT_MASK>(va, 7, vb, 7); @@ -736,7 +737,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestrs() { + fn test_mm_cmpestrs() { #[rustfmt::skip] let a_bytes = _mm_setr_epi8( 0x00, 0x48, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, @@ -749,7 +750,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestro() { + fn test_mm_cmpestro() { let a = str_to_m128i(b"Hello"); let b = str_to_m128i(b"World"); let i = _mm_cmpestro::<_SIDD_UBYTE_OPS>(a, 5, b, 5); @@ -757,7 +758,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpestra() { + fn test_mm_cmpestra() { let a = str_to_m128i(b"Cannot match a"); let b = str_to_m128i(b"Null after 14"); let i = _mm_cmpestra::<{ _SIDD_CMP_EQUAL_EACH | _SIDD_UNIT_MASK }>(a, 14, b, 16); @@ -765,7 +766,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_crc32_u8() { + fn test_mm_crc32_u8() { let crc = 0x2aa1e72b; let v = 0x2a; let i = _mm_crc32_u8(crc, v); @@ -773,7 +774,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_crc32_u16() { + fn test_mm_crc32_u16() { let crc = 0x8ecec3b5; let v = 0x22b; let i = _mm_crc32_u16(crc, v); @@ -781,7 +782,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_crc32_u32() { + fn test_mm_crc32_u32() { let crc = 0xae2912c8; let v = 0x845fed; let i = _mm_crc32_u32(crc, v); @@ -789,7 +790,7 @@ mod tests { } #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_cmpgt_epi64() { + const fn test_mm_cmpgt_epi64() { let a = _mm_setr_epi64x(0, 0x2a); let b = _mm_set1_epi64x(0x00); let i = _mm_cmpgt_epi64(a, b); diff --git a/library/stdarch/crates/core_arch/src/x86/sse4a.rs b/library/stdarch/crates/core_arch/src/x86/sse4a.rs index 7978d018e466..020baeff152d 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse4a.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse4a.rs @@ -151,7 +151,7 @@ mod tests { use stdarch_test::simd_test; #[simd_test(enable = "sse4a")] - unsafe fn test_mm_extract_si64() { + fn test_mm_extract_si64() { let b = 0b0110_0000_0000_i64; // ^^^^ bit range extracted let x = _mm_setr_epi64x(b, 0); @@ -164,7 +164,7 @@ mod tests { } #[simd_test(enable = "sse4a")] - unsafe fn test_mm_extracti_si64() { + fn test_mm_extracti_si64() { let a = _mm_setr_epi64x(0x0123456789abcdef, 0); let r = _mm_extracti_si64::<8, 8>(a); let e = _mm_setr_epi64x(0xcd, 0); @@ -172,7 +172,7 @@ mod tests { } #[simd_test(enable = "sse4a")] - unsafe fn test_mm_insert_si64() { + fn test_mm_insert_si64() { let i = 0b0110_i64; // ^^^^ bit range inserted let z = 0b1010_1010_1010i64; @@ -189,7 +189,7 @@ mod tests { } #[simd_test(enable = "sse4a")] - unsafe fn test_mm_inserti_si64() { + fn test_mm_inserti_si64() { let a = _mm_setr_epi64x(0x0123456789abcdef, 0); let b = _mm_setr_epi64x(0x0011223344556677, 0); let r = _mm_inserti_si64::<8, 8>(a, b); diff --git a/library/stdarch/crates/core_arch/src/x86/ssse3.rs b/library/stdarch/crates/core_arch/src/x86/ssse3.rs index ac067bd4b5a7..4426a3274c38 100644 --- a/library/stdarch/crates/core_arch/src/x86/ssse3.rs +++ b/library/stdarch/crates/core_arch/src/x86/ssse3.rs @@ -16,7 +16,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(pabsb))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_abs_epi8(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_abs_epi8(a: __m128i) -> __m128i { unsafe { let a = a.as_i8x16(); let zero = i8x16::ZERO; @@ -34,7 +35,8 @@ pub fn _mm_abs_epi8(a: __m128i) -> __m128i { #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(pabsw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_abs_epi16(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_abs_epi16(a: __m128i) -> __m128i { unsafe { let a = a.as_i16x8(); let zero = i16x8::ZERO; @@ -52,7 +54,8 @@ pub fn _mm_abs_epi16(a: __m128i) -> __m128i { #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(pabsd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_abs_epi32(a: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_abs_epi32(a: __m128i) -> __m128i { unsafe { let a = a.as_i32x4(); let zero = i32x4::ZERO; @@ -104,7 +107,8 @@ pub fn _mm_shuffle_epi8(a: __m128i, b: __m128i) -> __m128i { #[cfg_attr(test, assert_instr(palignr, IMM8 = 15))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_alignr_epi8(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_alignr_epi8(a: __m128i, b: __m128i) -> __m128i { static_assert_uimm_bits!(IMM8, 8); // If palignr is shifting the pair of vectors more than the size of two // lanes, emit zero. @@ -163,7 +167,8 @@ pub fn _mm_alignr_epi8(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(phaddw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hadd_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hadd_epi16(a: __m128i, b: __m128i) -> __m128i { let a = a.as_i16x8(); let b = b.as_i16x8(); unsafe { @@ -194,7 +199,8 @@ pub fn _mm_hadds_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(phaddd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hadd_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hadd_epi32(a: __m128i, b: __m128i) -> __m128i { let a = a.as_i32x4(); let b = b.as_i32x4(); unsafe { @@ -212,7 +218,8 @@ pub fn _mm_hadd_epi32(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(phsubw))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hsub_epi16(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hsub_epi16(a: __m128i, b: __m128i) -> __m128i { let a = a.as_i16x8(); let b = b.as_i16x8(); unsafe { @@ -244,7 +251,8 @@ pub fn _mm_hsubs_epi16(a: __m128i, b: __m128i) -> __m128i { #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(phsubd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_hsub_epi32(a: __m128i, b: __m128i) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_hsub_epi32(a: __m128i, b: __m128i) -> __m128i { let a = a.as_i32x4(); let b = b.as_i32x4(); unsafe { @@ -353,30 +361,31 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "ssse3")] - unsafe fn test_mm_abs_epi8() { + const fn test_mm_abs_epi8() { let r = _mm_abs_epi8(_mm_set1_epi8(-5)); assert_eq_m128i(r, _mm_set1_epi8(5)); } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_abs_epi16() { + const fn test_mm_abs_epi16() { let r = _mm_abs_epi16(_mm_set1_epi16(-5)); assert_eq_m128i(r, _mm_set1_epi16(5)); } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_abs_epi32() { + const fn test_mm_abs_epi32() { let r = _mm_abs_epi32(_mm_set1_epi32(-5)); assert_eq_m128i(r, _mm_set1_epi32(5)); } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_shuffle_epi8() { + fn test_mm_shuffle_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -400,7 +409,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_alignr_epi8() { + const fn test_mm_alignr_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -440,7 +449,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_hadd_epi16() { + const fn test_mm_hadd_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_setr_epi16(4, 128, 4, 3, 24, 12, 6, 19); let expected = _mm_setr_epi16(3, 7, 11, 15, 132, 7, 36, 25); @@ -465,7 +474,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_hadds_epi16() { + fn test_mm_hadds_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_setr_epi16(4, 128, 4, 3, 32767, 1, -32768, -1); let expected = _mm_setr_epi16(3, 7, 11, 15, 132, 7, 32767, -32768); @@ -490,7 +499,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_hadd_epi32() { + const fn test_mm_hadd_epi32() { let a = _mm_setr_epi32(1, 2, 3, 4); let b = _mm_setr_epi32(4, 128, 4, 3); let expected = _mm_setr_epi32(3, 7, 132, 7); @@ -506,7 +515,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_hsub_epi16() { + const fn test_mm_hsub_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_setr_epi16(4, 128, 4, 3, 24, 12, 6, 19); let expected = _mm_setr_epi16(-1, -1, -1, -1, -124, 1, 12, -13); @@ -531,7 +540,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_hsubs_epi16() { + fn test_mm_hsubs_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_setr_epi16(4, 128, 4, 3, 32767, -1, -32768, 1); let expected = _mm_setr_epi16(-1, -1, -1, -1, -124, 1, 32767, -32768); @@ -556,7 +565,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_hsub_epi32() { + const fn test_mm_hsub_epi32() { let a = _mm_setr_epi32(1, 2, 3, 4); let b = _mm_setr_epi32(4, 128, 4, 3); let expected = _mm_setr_epi32(-1, -1, -124, 1); @@ -572,7 +581,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_maddubs_epi16() { + fn test_mm_maddubs_epi16() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -612,7 +621,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_mulhrs_epi16() { + fn test_mm_mulhrs_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm_setr_epi16(4, 128, 4, 3, 32767, -1, -32768, 1); let expected = _mm_setr_epi16(0, 0, 0, 0, 5, 0, -7, 0); @@ -628,7 +637,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_sign_epi8() { + fn test_mm_sign_epi8() { #[rustfmt::skip] let a = _mm_setr_epi8( 1, 2, 3, 4, 5, 6, 7, 8, @@ -649,7 +658,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_sign_epi16() { + fn test_mm_sign_epi16() { let a = _mm_setr_epi16(1, 2, 3, 4, -5, -6, 7, 8); let b = _mm_setr_epi16(4, 128, 0, 3, 1, -1, -2, 1); let expected = _mm_setr_epi16(1, 2, 0, 4, -5, 6, -7, 8); @@ -658,7 +667,7 @@ mod tests { } #[simd_test(enable = "ssse3")] - unsafe fn test_mm_sign_epi32() { + fn test_mm_sign_epi32() { let a = _mm_setr_epi32(-1, 2, 3, 4); let b = _mm_setr_epi32(1, -1, 1, 0); let expected = _mm_setr_epi32(-1, -2, 3, 0); diff --git a/library/stdarch/crates/core_arch/src/x86/tbm.rs b/library/stdarch/crates/core_arch/src/x86/tbm.rs index 5a01752d8ac2..0ba4572dcd02 100644 --- a/library/stdarch/crates/core_arch/src/x86/tbm.rs +++ b/library/stdarch/crates/core_arch/src/x86/tbm.rs @@ -6,7 +6,7 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the available //! instructions. //! -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wikipedia_bmi]: //! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 @@ -42,7 +42,8 @@ pub fn _bextri_u32(a: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcfill))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcfill_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcfill_u32(x: u32) -> u32 { x & (x.wrapping_add(1)) } @@ -53,7 +54,8 @@ pub fn _blcfill_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blci))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blci_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blci_u32(x: u32) -> u32 { x | !x.wrapping_add(1) } @@ -64,7 +66,8 @@ pub fn _blci_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcic))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcic_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcic_u32(x: u32) -> u32 { !x & x.wrapping_add(1) } @@ -76,7 +79,8 @@ pub fn _blcic_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcmsk))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcmsk_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcmsk_u32(x: u32) -> u32 { x ^ x.wrapping_add(1) } @@ -87,7 +91,8 @@ pub fn _blcmsk_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcs))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcs_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcs_u32(x: u32) -> u32 { x | x.wrapping_add(1) } @@ -98,7 +103,8 @@ pub fn _blcs_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blsfill))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsfill_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsfill_u32(x: u32) -> u32 { x | x.wrapping_sub(1) } @@ -109,7 +115,8 @@ pub fn _blsfill_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blsic))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsic_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsic_u32(x: u32) -> u32 { !x | x.wrapping_sub(1) } @@ -121,7 +128,8 @@ pub fn _blsic_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(t1mskc))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _t1mskc_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _t1mskc_u32(x: u32) -> u32 { !x | x.wrapping_add(1) } @@ -133,29 +141,31 @@ pub fn _t1mskc_u32(x: u32) -> u32 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(tzmsk))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _tzmsk_u32(x: u32) -> u32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _tzmsk_u32(x: u32) -> u32 { !x & x.wrapping_sub(1) } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86::*; #[simd_test(enable = "tbm")] - unsafe fn test_bextri_u32() { + fn test_bextri_u32() { assert_eq!(_bextri_u32::<0x0404>(0b0101_0000u32), 0b0000_0101u32); } #[simd_test(enable = "tbm")] - unsafe fn test_blcfill_u32() { + const fn test_blcfill_u32() { assert_eq!(_blcfill_u32(0b0101_0111u32), 0b0101_0000u32); assert_eq!(_blcfill_u32(0b1111_1111u32), 0u32); } #[simd_test(enable = "tbm")] - unsafe fn test_blci_u32() { + const fn test_blci_u32() { assert_eq!( _blci_u32(0b0101_0000u32), 0b1111_1111_1111_1111_1111_1111_1111_1110u32 @@ -167,25 +177,25 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_blcic_u32() { + const fn test_blcic_u32() { assert_eq!(_blcic_u32(0b0101_0001u32), 0b0000_0010u32); assert_eq!(_blcic_u32(0b1111_1111u32), 0b1_0000_0000u32); } #[simd_test(enable = "tbm")] - unsafe fn test_blcmsk_u32() { + const fn test_blcmsk_u32() { assert_eq!(_blcmsk_u32(0b0101_0001u32), 0b0000_0011u32); assert_eq!(_blcmsk_u32(0b1111_1111u32), 0b1_1111_1111u32); } #[simd_test(enable = "tbm")] - unsafe fn test_blcs_u32() { + const fn test_blcs_u32() { assert_eq!(_blcs_u32(0b0101_0001u32), 0b0101_0011u32); assert_eq!(_blcs_u32(0b1111_1111u32), 0b1_1111_1111u32); } #[simd_test(enable = "tbm")] - unsafe fn test_blsfill_u32() { + const fn test_blsfill_u32() { assert_eq!(_blsfill_u32(0b0101_0100u32), 0b0101_0111u32); assert_eq!( _blsfill_u32(0u32), @@ -194,7 +204,7 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_blsic_u32() { + const fn test_blsic_u32() { assert_eq!( _blsic_u32(0b0101_0100u32), 0b1111_1111_1111_1111_1111_1111_1111_1011u32 @@ -206,7 +216,7 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_t1mskc_u32() { + const fn test_t1mskc_u32() { assert_eq!( _t1mskc_u32(0b0101_0111u32), 0b1111_1111_1111_1111_1111_1111_1111_1000u32 @@ -218,7 +228,7 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_tzmsk_u32() { + const fn test_tzmsk_u32() { assert_eq!(_tzmsk_u32(0b0101_1000u32), 0b0000_0111u32); assert_eq!(_tzmsk_u32(0b0101_1001u32), 0b0000_0000u32); } diff --git a/library/stdarch/crates/core_arch/src/x86/test.rs b/library/stdarch/crates/core_arch/src/x86/test.rs index fec25ce2bc7c..4b2ef26044e8 100644 --- a/library/stdarch/crates/core_arch/src/x86/test.rs +++ b/library/stdarch/crates/core_arch/src/x86/test.rs @@ -1,115 +1,125 @@ //! Utilities used in testing the x86 intrinsics +use crate::core_arch::assert_eq_const as assert_eq; +use crate::core_arch::simd::*; use crate::core_arch::x86::*; use std::mem::transmute; #[track_caller] -#[target_feature(enable = "sse2")] -pub unsafe fn assert_eq_m128i(a: __m128i, b: __m128i) { - assert_eq!(transmute::<_, [u64; 2]>(a), transmute::<_, [u64; 2]>(b)) +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m128i(a: __m128i, b: __m128i) { + assert_eq!(a.as_u32x4(), b.as_u32x4()); } #[track_caller] -#[target_feature(enable = "sse2")] -pub unsafe fn assert_eq_m128d(a: __m128d, b: __m128d) { - if _mm_movemask_pd(_mm_cmpeq_pd(a, b)) != 0b11 { - panic!("{:?} != {:?}", a, b); - } -} - -#[target_feature(enable = "sse2")] -pub unsafe fn get_m128d(a: __m128d, idx: usize) -> f64 { - transmute::<_, [f64; 2]>(a)[idx] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m128(a: __m128, b: __m128) { + assert_eq!(a.as_f32x4(), b.as_f32x4()); } #[track_caller] -#[target_feature(enable = "sse")] -pub unsafe fn assert_eq_m128(a: __m128, b: __m128) { - let r = _mm_cmpeq_ps(a, b); - if _mm_movemask_ps(r) != 0b1111 { - panic!("{:?} != {:?}", a, b); - } +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m128d(a: __m128d, b: __m128d) { + assert_eq!(a.as_f64x2(), b.as_f64x2()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m128h(a: __m128h, b: __m128h) { + assert_eq!(a.as_f16x8(), b.as_f16x8()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m256i(a: __m256i, b: __m256i) { + assert_eq!(a.as_u32x8(), b.as_u32x8()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m256(a: __m256, b: __m256) { + assert_eq!(a.as_f32x8(), b.as_f32x8()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m256d(a: __m256d, b: __m256d) { + assert_eq!(a.as_f64x4(), b.as_f64x4()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m256h(a: __m256h, b: __m256h) { + assert_eq!(a.as_f16x16(), b.as_f16x16()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m512i(a: __m512i, b: __m512i) { + assert_eq!(a.as_i64x8(), b.as_i64x8()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m512(a: __m512, b: __m512) { + assert_eq!(a.as_f32x16(), b.as_f32x16()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m512d(a: __m512d, b: __m512d) { + assert_eq!(a.as_f64x8(), b.as_f64x8()); +} + +#[track_caller] +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub(crate) const fn assert_eq_m512h(a: __m512h, b: __m512h) { + assert_eq!(a.as_f16x32(), b.as_f16x32()); +} + +#[target_feature(enable = "sse2")] +pub(crate) const fn get_m128d(a: __m128d, idx: usize) -> f64 { + a.as_f64x2().extract(idx) } #[target_feature(enable = "sse")] -pub unsafe fn get_m128(a: __m128, idx: usize) -> f32 { - transmute::<_, [f32; 4]>(a)[idx] +pub(crate) const fn get_m128(a: __m128, idx: usize) -> f32 { + a.as_f32x4().extract(idx) } -#[track_caller] -#[target_feature(enable = "avx512fp16,avx512vl")] -pub unsafe fn assert_eq_m128h(a: __m128h, b: __m128h) { - let r = _mm_cmp_ph_mask::<_CMP_EQ_OQ>(a, b); - if r != 0b1111_1111 { - panic!("{:?} != {:?}", a, b); - } +#[target_feature(enable = "avx")] +pub(crate) const fn get_m256d(a: __m256d, idx: usize) -> f64 { + a.as_f64x4().extract(idx) } -// not actually an intrinsic but useful in various tests as we proted from +#[target_feature(enable = "avx")] +pub(crate) const fn get_m256(a: __m256, idx: usize) -> f32 { + a.as_f32x8().extract(idx) +} + +#[target_feature(enable = "avx512f")] +pub(crate) const fn get_m512(a: __m512, idx: usize) -> f32 { + a.as_f32x16().extract(idx) +} + +#[target_feature(enable = "avx512f")] +pub(crate) const fn get_m512d(a: __m512d, idx: usize) -> f64 { + a.as_f64x8().extract(idx) +} + +#[target_feature(enable = "avx512f")] +pub(crate) const fn get_m512i(a: __m512i, idx: usize) -> i64 { + a.as_i64x8().extract(idx) +} + +// not actually an intrinsic but useful in various tests as we ported from // `i64x2::new` which is backwards from `_mm_set_epi64x` #[target_feature(enable = "sse2")] -pub unsafe fn _mm_setr_epi64x(a: i64, b: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] +pub const fn _mm_setr_epi64x(a: i64, b: i64) -> __m128i { _mm_set_epi64x(b, a) } -#[track_caller] -#[target_feature(enable = "avx")] -pub unsafe fn assert_eq_m256i(a: __m256i, b: __m256i) { - assert_eq!(transmute::<_, [u64; 4]>(a), transmute::<_, [u64; 4]>(b)) -} - -#[track_caller] -#[target_feature(enable = "avx")] -pub unsafe fn assert_eq_m256d(a: __m256d, b: __m256d) { - let cmp = _mm256_cmp_pd::<_CMP_EQ_OQ>(a, b); - if _mm256_movemask_pd(cmp) != 0b1111 { - panic!("{:?} != {:?}", a, b); - } -} - -#[target_feature(enable = "avx")] -pub unsafe fn get_m256d(a: __m256d, idx: usize) -> f64 { - transmute::<_, [f64; 4]>(a)[idx] -} - -#[track_caller] -#[target_feature(enable = "avx")] -pub unsafe fn assert_eq_m256(a: __m256, b: __m256) { - let cmp = _mm256_cmp_ps::<_CMP_EQ_OQ>(a, b); - if _mm256_movemask_ps(cmp) != 0b11111111 { - panic!("{:?} != {:?}", a, b); - } -} - -#[target_feature(enable = "avx")] -pub unsafe fn get_m256(a: __m256, idx: usize) -> f32 { - transmute::<_, [f32; 8]>(a)[idx] -} - -#[track_caller] -#[target_feature(enable = "avx512fp16,avx512vl")] -pub unsafe fn assert_eq_m256h(a: __m256h, b: __m256h) { - let r = _mm256_cmp_ph_mask::<_CMP_EQ_OQ>(a, b); - if r != 0b11111111_11111111 { - panic!("{:?} != {:?}", a, b); - } -} - -#[target_feature(enable = "avx512f")] -pub unsafe fn get_m512(a: __m512, idx: usize) -> f32 { - transmute::<_, [f32; 16]>(a)[idx] -} - -#[target_feature(enable = "avx512f")] -pub unsafe fn get_m512d(a: __m512d, idx: usize) -> f64 { - transmute::<_, [f64; 8]>(a)[idx] -} - -#[target_feature(enable = "avx512f")] -pub unsafe fn get_m512i(a: __m512i, idx: usize) -> i64 { - transmute::<_, [i64; 8]>(a)[idx] -} - // These intrinsics doesn't exist on x86 b/c it requires a 64-bit register, // which doesn't exist on x86! #[cfg(target_arch = "x86")] @@ -118,16 +128,18 @@ mod x86_polyfill { use crate::intrinsics::simd::*; #[rustc_legacy_const_generics(2)] - pub unsafe fn _mm_insert_epi64(a: __m128i, val: i64) -> __m128i { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + pub const fn _mm_insert_epi64(a: __m128i, val: i64) -> __m128i { static_assert_uimm_bits!(INDEX, 1); - transmute(simd_insert!(a.as_i64x2(), INDEX as u32, val)) + unsafe { transmute(simd_insert!(a.as_i64x2(), INDEX as u32, val)) } } #[target_feature(enable = "avx2")] #[rustc_legacy_const_generics(2)] - pub unsafe fn _mm256_insert_epi64(a: __m256i, val: i64) -> __m256i { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + pub const fn _mm256_insert_epi64(a: __m256i, val: i64) -> __m256i { static_assert_uimm_bits!(INDEX, 2); - transmute(simd_insert!(a.as_i64x4(), INDEX as u32, val)) + unsafe { transmute(simd_insert!(a.as_i64x4(), INDEX as u32, val)) } } } @@ -136,33 +148,3 @@ mod x86_polyfill { pub use crate::core_arch::x86_64::{_mm_insert_epi64, _mm256_insert_epi64}; } pub use self::x86_polyfill::*; - -#[track_caller] -pub unsafe fn assert_eq_m512i(a: __m512i, b: __m512i) { - assert_eq!(transmute::<_, [i32; 16]>(a), transmute::<_, [i32; 16]>(b)) -} - -#[track_caller] -pub unsafe fn assert_eq_m512(a: __m512, b: __m512) { - let cmp = _mm512_cmp_ps_mask::<_CMP_EQ_OQ>(a, b); - if cmp != 0b11111111_11111111 { - panic!("{:?} != {:?}", a, b); - } -} - -#[track_caller] -pub unsafe fn assert_eq_m512d(a: __m512d, b: __m512d) { - let cmp = _mm512_cmp_pd_mask::<_CMP_EQ_OQ>(a, b); - if cmp != 0b11111111 { - panic!("{:?} != {:?}", a, b); - } -} - -#[track_caller] -#[target_feature(enable = "avx512fp16")] -pub unsafe fn assert_eq_m512h(a: __m512h, b: __m512h) { - let r = _mm512_cmp_ph_mask::<_CMP_EQ_OQ>(a, b); - if r != 0b11111111_11111111_11111111_11111111 { - panic!("{:?} != {:?}", a, b); - } -} diff --git a/library/stdarch/crates/core_arch/src/x86/vaes.rs b/library/stdarch/crates/core_arch/src/x86/vaes.rs index b1fe193e3f5d..864b1d56d105 100644 --- a/library/stdarch/crates/core_arch/src/x86/vaes.rs +++ b/library/stdarch/crates/core_arch/src/x86/vaes.rs @@ -5,7 +5,7 @@ //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref]. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf use crate::core_arch::x86::__m256i; use crate::core_arch::x86::__m512i; @@ -146,9 +146,9 @@ mod tests { // ideally we'd be using quickcheck here instead #[target_feature(enable = "avx2")] - unsafe fn helper_for_256_vaes( - linear: unsafe fn(__m128i, __m128i) -> __m128i, - vectorized: unsafe fn(__m256i, __m256i) -> __m256i, + fn helper_for_256_vaes( + linear: fn(__m128i, __m128i) -> __m128i, + vectorized: fn(__m256i, __m256i) -> __m256i, ) { let a = _mm256_set_epi64x( 0xDCB4DB3657BF0B7D, @@ -178,7 +178,7 @@ mod tests { } #[target_feature(enable = "sse2")] - unsafe fn setup_state_key(broadcast: unsafe fn(__m128i) -> T) -> (T, T) { + fn setup_state_key(broadcast: fn(__m128i) -> T) -> (T, T) { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx. let a = _mm_set_epi64x(0x0123456789abcdef, 0x8899aabbccddeeff); let k = _mm_set_epi64x(0x1133557799bbddff, 0x0022446688aaccee); @@ -186,17 +186,17 @@ mod tests { } #[target_feature(enable = "avx2")] - unsafe fn setup_state_key_256() -> (__m256i, __m256i) { + fn setup_state_key_256() -> (__m256i, __m256i) { setup_state_key(_mm256_broadcastsi128_si256) } #[target_feature(enable = "avx512f")] - unsafe fn setup_state_key_512() -> (__m512i, __m512i) { + fn setup_state_key_512() -> (__m512i, __m512i) { setup_state_key(_mm512_broadcast_i32x4) } #[simd_test(enable = "vaes,avx512vl")] - unsafe fn test_mm256_aesdec_epi128() { + fn test_mm256_aesdec_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx. let (a, k) = setup_state_key_256(); let e = _mm_set_epi64x(0x044e4f5176fec48f, 0xb57ecfa381da39ee); @@ -208,7 +208,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512vl")] - unsafe fn test_mm256_aesdeclast_epi128() { + fn test_mm256_aesdeclast_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714178.aspx. let (a, k) = setup_state_key_256(); let e = _mm_set_epi64x(0x36cad57d9072bf9e, 0xf210dd981fa4a493); @@ -220,7 +220,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512vl")] - unsafe fn test_mm256_aesenc_epi128() { + fn test_mm256_aesenc_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664810.aspx. // they are repeated appropriately let (a, k) = setup_state_key_256(); @@ -233,7 +233,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512vl")] - unsafe fn test_mm256_aesenclast_epi128() { + fn test_mm256_aesenclast_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714136.aspx. let (a, k) = setup_state_key_256(); let e = _mm_set_epi64x(0xb6dd7df25d7ab320, 0x4b04f98cf4c860f8); @@ -245,9 +245,9 @@ mod tests { } #[target_feature(enable = "avx512f")] - unsafe fn helper_for_512_vaes( - linear: unsafe fn(__m128i, __m128i) -> __m128i, - vectorized: unsafe fn(__m512i, __m512i) -> __m512i, + fn helper_for_512_vaes( + linear: fn(__m128i, __m128i) -> __m128i, + vectorized: fn(__m512i, __m512i) -> __m512i, ) { let a = _mm512_set_epi64( 0xDCB4DB3657BF0B7D, @@ -291,7 +291,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512f")] - unsafe fn test_mm512_aesdec_epi128() { + fn test_mm512_aesdec_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664949.aspx. let (a, k) = setup_state_key_512(); let e = _mm_set_epi64x(0x044e4f5176fec48f, 0xb57ecfa381da39ee); @@ -303,7 +303,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512f")] - unsafe fn test_mm512_aesdeclast_epi128() { + fn test_mm512_aesdeclast_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714178.aspx. let (a, k) = setup_state_key_512(); let e = _mm_set_epi64x(0x36cad57d9072bf9e, 0xf210dd981fa4a493); @@ -315,7 +315,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512f")] - unsafe fn test_mm512_aesenc_epi128() { + fn test_mm512_aesenc_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc664810.aspx. let (a, k) = setup_state_key_512(); let e = _mm_set_epi64x(0x16ab0e57dfc442ed, 0x28e4ee1884504333); @@ -327,7 +327,7 @@ mod tests { } #[simd_test(enable = "vaes,avx512f")] - unsafe fn test_mm512_aesenclast_epi128() { + fn test_mm512_aesenclast_epi128() { // Constants taken from https://msdn.microsoft.com/en-us/library/cc714136.aspx. let (a, k) = setup_state_key_512(); let e = _mm_set_epi64x(0xb6dd7df25d7ab320, 0x4b04f98cf4c860f8); diff --git a/library/stdarch/crates/core_arch/src/x86/vpclmulqdq.rs b/library/stdarch/crates/core_arch/src/x86/vpclmulqdq.rs index b1f23bd2f45c..ad44e59f3ada 100644 --- a/library/stdarch/crates/core_arch/src/x86/vpclmulqdq.rs +++ b/library/stdarch/crates/core_arch/src/x86/vpclmulqdq.rs @@ -124,9 +124,9 @@ mod tests { // this function tests one of the possible 4 instances // with different inputs across lanes #[target_feature(enable = "vpclmulqdq,avx512f")] - unsafe fn verify_512_helper( - linear: unsafe fn(__m128i, __m128i) -> __m128i, - vectorized: unsafe fn(__m512i, __m512i) -> __m512i, + fn verify_512_helper( + linear: fn(__m128i, __m128i) -> __m128i, + vectorized: fn(__m512i, __m512i) -> __m512i, ) { let a = _mm512_set_epi64( 0xDCB4DB3657BF0B7D, @@ -165,9 +165,9 @@ mod tests { // this function tests one of the possible 4 instances // with different inputs across lanes for the VL version #[target_feature(enable = "vpclmulqdq,avx512vl")] - unsafe fn verify_256_helper( - linear: unsafe fn(__m128i, __m128i) -> __m128i, - vectorized: unsafe fn(__m256i, __m256i) -> __m256i, + fn verify_256_helper( + linear: fn(__m128i, __m128i) -> __m128i, + vectorized: fn(__m256i, __m256i) -> __m256i, ) { let a = _mm512_set_epi64( 0xDCB4DB3657BF0B7D, @@ -207,7 +207,7 @@ mod tests { } #[simd_test(enable = "vpclmulqdq,avx512f")] - unsafe fn test_mm512_clmulepi64_epi128() { + fn test_mm512_clmulepi64_epi128() { verify_kat_pclmul!( _mm512_broadcast_i32x4, _mm512_clmulepi64_epi128, @@ -233,7 +233,7 @@ mod tests { } #[simd_test(enable = "vpclmulqdq,avx512vl")] - unsafe fn test_mm256_clmulepi64_epi128() { + fn test_mm256_clmulepi64_epi128() { verify_kat_pclmul!( _mm256_broadcastsi128_si256, _mm256_clmulepi64_epi128, diff --git a/library/stdarch/crates/core_arch/src/x86/xsave.rs b/library/stdarch/crates/core_arch/src/x86/xsave.rs index 190cef929e47..653eb28c4268 100644 --- a/library/stdarch/crates/core_arch/src/x86/xsave.rs +++ b/library/stdarch/crates/core_arch/src/x86/xsave.rs @@ -184,7 +184,7 @@ mod tests { // `CPUID.(EAX=0DH,ECX=0):ECX` contains the size required to hold all supported xsave // components. `EBX` contains the size required to hold all xsave components currently // enabled in `XCR0`. We are using `ECX` to ensure enough space in all scenarios - let CpuidResult { ecx, .. } = unsafe { __cpuid(0x0d) }; + let CpuidResult { ecx, .. } = __cpuid(0x0d); XsaveArea { data: vec![AlignedArray([0; 64]); ecx.div_ceil(64) as usize].into_boxed_slice(), diff --git a/library/stdarch/crates/core_arch/src/x86_64/abm.rs b/library/stdarch/crates/core_arch/src/x86_64/abm.rs index bf59cc463218..21b5f26a9b4f 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/abm.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/abm.rs @@ -12,8 +12,8 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions //! available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wikipedia_bmi]: //! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 @@ -29,7 +29,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "lzcnt")] #[cfg_attr(test, assert_instr(lzcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _lzcnt_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _lzcnt_u64(x: u64) -> u64 { x.leading_zeros() as u64 } @@ -40,23 +41,25 @@ pub fn _lzcnt_u64(x: u64) -> u64 { #[target_feature(enable = "popcnt")] #[cfg_attr(test, assert_instr(popcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _popcnt64(x: i64) -> i32 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _popcnt64(x: i64) -> i32 { x.count_ones() as i32 } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::arch::x86_64::*; #[simd_test(enable = "lzcnt")] - unsafe fn test_lzcnt_u64() { + const fn test_lzcnt_u64() { assert_eq!(_lzcnt_u64(0b0101_1010), 57); } #[simd_test(enable = "popcnt")] - unsafe fn test_popcnt64() { + const fn test_popcnt64() { assert_eq!(_popcnt64(0b0101_1010), 4); } } diff --git a/library/stdarch/crates/core_arch/src/x86_64/amx.rs b/library/stdarch/crates/core_arch/src/x86_64/amx.rs index 3e0ac8f47cea..f372f7066d51 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/amx.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/amx.rs @@ -510,7 +510,7 @@ mod tests { use syscalls::{Sysno, syscall}; #[allow(non_camel_case_types)] - #[repr(packed)] + #[repr(C, packed)] #[derive(Copy, Clone, Default, Debug, PartialEq)] struct __tilecfg { /// 0 `or` 1 diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx.rs b/library/stdarch/crates/core_arch/src/x86_64/avx.rs index b494385e4a61..b626c1a59299 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/avx.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/avx.rs @@ -9,8 +9,8 @@ //! //! [Wikipedia][wiki] provides a quick overview of the instructions available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wiki]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions use crate::{core_arch::x86::*, mem::transmute}; @@ -24,7 +24,8 @@ use crate::{core_arch::x86::*, mem::transmute}; #[target_feature(enable = "avx")] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_insert_epi64(a: __m256i, i: i64) -> __m256i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_insert_epi64(a: __m256i, i: i64) -> __m256i { static_assert_uimm_bits!(INDEX, 2); unsafe { transmute(simd_insert!(a.as_i64x4(), INDEX as u32, i)) } } @@ -37,19 +38,21 @@ pub fn _mm256_insert_epi64(a: __m256i, i: i64) -> __m256i { #[rustc_legacy_const_generics(1)] // This intrinsic has no corresponding instruction. #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm256_extract_epi64(a: __m256i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm256_extract_epi64(a: __m256i) -> i64 { static_assert_uimm_bits!(INDEX, 2); unsafe { simd_extract!(a.as_i64x4(), INDEX as u32) } } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::arch::x86_64::*; #[simd_test(enable = "avx")] - unsafe fn test_mm256_insert_epi64() { + const fn test_mm256_insert_epi64() { let a = _mm256_setr_epi64x(1, 2, 3, 4); let r = _mm256_insert_epi64::<3>(a, 0); let e = _mm256_setr_epi64x(1, 2, 3, 0); @@ -57,7 +60,7 @@ mod tests { } #[simd_test(enable = "avx")] - unsafe fn test_mm256_extract_epi64() { + const fn test_mm256_extract_epi64() { let a = _mm256_setr_epi64x(0, 1, 2, 3); let r = _mm256_extract_epi64::<3>(a); assert_eq!(r, 3); diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx512bw.rs b/library/stdarch/crates/core_arch/src/x86_64/avx512bw.rs index 466c36ef31e5..3450f6e194d5 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/avx512bw.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/avx512bw.rs @@ -6,7 +6,8 @@ use crate::core_arch::x86::*; #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtmask64_u64(a: __mmask64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtmask64_u64(a: __mmask64) -> u64 { a } @@ -16,19 +17,21 @@ pub fn _cvtmask64_u64(a: __mmask64) -> u64 { #[inline] #[target_feature(enable = "avx512bw")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] -pub fn _cvtu64_mask64(a: u64) -> __mmask64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _cvtu64_mask64(a: u64) -> __mmask64 { a } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::{x86::*, x86_64::*}; #[simd_test(enable = "avx512bw")] - unsafe fn test_cvtmask64_u64() { + const fn test_cvtmask64_u64() { let a: __mmask64 = 0b11001100_00110011_01100110_10011001; let r = _cvtmask64_u64(a); let e: u64 = 0b11001100_00110011_01100110_10011001; @@ -36,7 +39,7 @@ mod tests { } #[simd_test(enable = "avx512bw")] - unsafe fn test_cvtu64_mask64() { + const fn test_cvtu64_mask64() { let a: u64 = 0b11001100_00110011_01100110_10011001; let r = _cvtu64_mask64(a); let e: __mmask64 = 0b11001100_00110011_01100110_10011001; diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs b/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs index a2656c853563..368fb0c238e4 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/avx512f.rs @@ -57,7 +57,8 @@ pub fn _mm_cvtsd_u64(a: __m128d) -> u64 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtsi2ss))] -pub fn _mm_cvti64_ss(a: __m128, b: i64) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvti64_ss(a: __m128, b: i64) -> __m128 { unsafe { let b = b as f32; simd_insert!(a, 0, b) @@ -71,7 +72,8 @@ pub fn _mm_cvti64_ss(a: __m128, b: i64) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtsi2sd))] -pub fn _mm_cvti64_sd(a: __m128d, b: i64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvti64_sd(a: __m128d, b: i64) -> __m128d { unsafe { let b = b as f64; simd_insert!(a, 0, b) @@ -85,7 +87,8 @@ pub fn _mm_cvti64_sd(a: __m128d, b: i64) -> __m128d { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtusi2ss))] -pub fn _mm_cvtu64_ss(a: __m128, b: u64) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtu64_ss(a: __m128, b: u64) -> __m128 { unsafe { let b = b as f32; simd_insert!(a, 0, b) @@ -99,7 +102,8 @@ pub fn _mm_cvtu64_ss(a: __m128, b: u64) -> __m128 { #[target_feature(enable = "avx512f")] #[stable(feature = "stdarch_x86_avx512", since = "1.89")] #[cfg_attr(test, assert_instr(vcvtusi2sd))] -pub fn _mm_cvtu64_sd(a: __m128d, b: u64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtu64_sd(a: __m128d, b: u64) -> __m128d { unsafe { let b = b as f64; simd_insert!(a, 0, b) @@ -554,6 +558,7 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; @@ -562,7 +567,7 @@ mod tests { use crate::hint::black_box; #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_abs_epi64() { + const fn test_mm512_abs_epi64() { let a = _mm512_set_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let r = _mm512_abs_epi64(a); let e = _mm512_set_epi64(0, 1, 1, i64::MAX, i64::MAX.wrapping_add(1), 100, 100, 32); @@ -570,7 +575,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_abs_epi64() { + const fn test_mm512_mask_abs_epi64() { let a = _mm512_set_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let r = _mm512_mask_abs_epi64(a, 0, a); assert_eq_m512i(r, a); @@ -580,7 +585,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_abs_epi64() { + const fn test_mm512_maskz_abs_epi64() { let a = _mm512_set_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let r = _mm512_maskz_abs_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -590,7 +595,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_abs_epi64() { + const fn test_mm256_abs_epi64() { let a = _mm256_set_epi64x(i64::MAX, i64::MIN, 100, -100); let r = _mm256_abs_epi64(a); let e = _mm256_set_epi64x(i64::MAX, i64::MAX.wrapping_add(1), 100, 100); @@ -598,7 +603,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_abs_epi64() { + const fn test_mm256_mask_abs_epi64() { let a = _mm256_set_epi64x(i64::MAX, i64::MIN, 100, -100); let r = _mm256_mask_abs_epi64(a, 0, a); assert_eq_m256i(r, a); @@ -608,7 +613,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_abs_epi64() { + const fn test_mm256_maskz_abs_epi64() { let a = _mm256_set_epi64x(i64::MAX, i64::MIN, 100, -100); let r = _mm256_maskz_abs_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -618,7 +623,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_abs_epi64() { + const fn test_mm_abs_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let r = _mm_abs_epi64(a); let e = _mm_set_epi64x(i64::MAX, i64::MAX.wrapping_add(1)); @@ -630,7 +635,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_abs_epi64() { + const fn test_mm_mask_abs_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let r = _mm_mask_abs_epi64(a, 0, a); assert_eq_m128i(r, a); @@ -644,7 +649,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_abs_epi64() { + const fn test_mm_maskz_abs_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let r = _mm_maskz_abs_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -658,7 +663,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_abs_pd() { + const fn test_mm512_abs_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let r = _mm512_abs_pd(a); let e = _mm512_setr_pd(0., 1., 1., f64::MAX, f64::MAX, 100., 100., 32.); @@ -666,7 +671,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_abs_pd() { + const fn test_mm512_mask_abs_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let r = _mm512_mask_abs_pd(a, 0, a); assert_eq_m512d(r, a); @@ -676,7 +681,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mov_epi64() { + const fn test_mm512_mask_mov_epi64() { let src = _mm512_set1_epi64(1); let a = _mm512_set1_epi64(2); let r = _mm512_mask_mov_epi64(src, 0, a); @@ -686,7 +691,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mov_epi64() { + const fn test_mm512_maskz_mov_epi64() { let a = _mm512_set1_epi64(2); let r = _mm512_maskz_mov_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -695,7 +700,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mov_epi64() { + const fn test_mm256_mask_mov_epi64() { let src = _mm256_set1_epi64x(1); let a = _mm256_set1_epi64x(2); let r = _mm256_mask_mov_epi64(src, 0, a); @@ -705,7 +710,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mov_epi64() { + const fn test_mm256_maskz_mov_epi64() { let a = _mm256_set1_epi64x(2); let r = _mm256_maskz_mov_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -714,7 +719,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mov_epi64() { + const fn test_mm_mask_mov_epi64() { let src = _mm_set1_epi64x(1); let a = _mm_set1_epi64x(2); let r = _mm_mask_mov_epi64(src, 0, a); @@ -724,7 +729,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mov_epi64() { + const fn test_mm_maskz_mov_epi64() { let a = _mm_set1_epi64x(2); let r = _mm_maskz_mov_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -733,7 +738,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mov_pd() { + const fn test_mm512_mask_mov_pd() { let src = _mm512_set1_pd(1.); let a = _mm512_set1_pd(2.); let r = _mm512_mask_mov_pd(src, 0, a); @@ -743,7 +748,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mov_pd() { + const fn test_mm512_maskz_mov_pd() { let a = _mm512_set1_pd(2.); let r = _mm512_maskz_mov_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -752,7 +757,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mov_pd() { + const fn test_mm256_mask_mov_pd() { let src = _mm256_set1_pd(1.); let a = _mm256_set1_pd(2.); let r = _mm256_mask_mov_pd(src, 0, a); @@ -762,7 +767,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mov_pd() { + const fn test_mm256_maskz_mov_pd() { let a = _mm256_set1_pd(2.); let r = _mm256_maskz_mov_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -771,7 +776,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mov_pd() { + const fn test_mm_mask_mov_pd() { let src = _mm_set1_pd(1.); let a = _mm_set1_pd(2.); let r = _mm_mask_mov_pd(src, 0, a); @@ -781,7 +786,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mov_pd() { + const fn test_mm_maskz_mov_pd() { let a = _mm_set1_pd(2.); let r = _mm_maskz_mov_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -790,7 +795,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_add_epi64() { + const fn test_mm512_add_epi64() { let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let b = _mm512_set1_epi64(1); let r = _mm512_add_epi64(a, b); @@ -799,7 +804,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_add_epi64() { + const fn test_mm512_mask_add_epi64() { let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let b = _mm512_set1_epi64(1); let r = _mm512_mask_add_epi64(a, 0, a, b); @@ -810,7 +815,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_add_epi64() { + const fn test_mm512_maskz_add_epi64() { let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let b = _mm512_set1_epi64(1); let r = _mm512_maskz_add_epi64(0, a, b); @@ -821,7 +826,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_add_epi64() { + const fn test_mm256_mask_add_epi64() { let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN); let b = _mm256_set1_epi64x(1); let r = _mm256_mask_add_epi64(a, 0, a, b); @@ -832,7 +837,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_add_epi64() { + const fn test_mm256_maskz_add_epi64() { let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN); let b = _mm256_set1_epi64x(1); let r = _mm256_maskz_add_epi64(0, a, b); @@ -843,7 +848,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_add_epi64() { + const fn test_mm_mask_add_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let b = _mm_set1_epi64x(1); let r = _mm_mask_add_epi64(a, 0, a, b); @@ -854,7 +859,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_add_epi64() { + const fn test_mm_maskz_add_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let b = _mm_set1_epi64x(1); let r = _mm_maskz_add_epi64(0, a, b); @@ -865,7 +870,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_add_pd() { + const fn test_mm512_add_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let b = _mm512_set1_pd(1.); let r = _mm512_add_pd(a, b); @@ -874,7 +879,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_add_pd() { + const fn test_mm512_mask_add_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let b = _mm512_set1_pd(1.); let r = _mm512_mask_add_pd(a, 0, a, b); @@ -885,7 +890,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_add_pd() { + const fn test_mm512_maskz_add_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let b = _mm512_set1_pd(1.); let r = _mm512_maskz_add_pd(0, a, b); @@ -896,7 +901,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_add_pd() { + const fn test_mm256_mask_add_pd() { let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN); let b = _mm256_set1_pd(1.); let r = _mm256_mask_add_pd(a, 0, a, b); @@ -907,7 +912,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_add_pd() { + const fn test_mm256_maskz_add_pd() { let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN); let b = _mm256_set1_pd(1.); let r = _mm256_maskz_add_pd(0, a, b); @@ -918,7 +923,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_add_pd() { + const fn test_mm_mask_add_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set1_pd(1.); let r = _mm_mask_add_pd(a, 0, a, b); @@ -929,7 +934,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_add_pd() { + const fn test_mm_maskz_add_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set1_pd(1.); let r = _mm_maskz_add_pd(0, a, b); @@ -940,7 +945,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sub_epi64() { + const fn test_mm512_sub_epi64() { let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let b = _mm512_set1_epi64(1); let r = _mm512_sub_epi64(a, b); @@ -949,7 +954,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sub_epi64() { + const fn test_mm512_mask_sub_epi64() { let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let b = _mm512_set1_epi64(1); let r = _mm512_mask_sub_epi64(a, 0, a, b); @@ -960,7 +965,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sub_epi64() { + const fn test_mm512_maskz_sub_epi64() { let a = _mm512_setr_epi64(0, 1, -1, i64::MAX, i64::MIN, 100, -100, -32); let b = _mm512_set1_epi64(1); let r = _mm512_maskz_sub_epi64(0, a, b); @@ -971,7 +976,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sub_epi64() { + const fn test_mm256_mask_sub_epi64() { let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN); let b = _mm256_set1_epi64x(1); let r = _mm256_mask_sub_epi64(a, 0, a, b); @@ -982,7 +987,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sub_epi64() { + const fn test_mm256_maskz_sub_epi64() { let a = _mm256_set_epi64x(1, -1, i64::MAX, i64::MIN); let b = _mm256_set1_epi64x(1); let r = _mm256_maskz_sub_epi64(0, a, b); @@ -993,7 +998,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sub_epi64() { + const fn test_mm_mask_sub_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let b = _mm_set1_epi64x(1); let r = _mm_mask_sub_epi64(a, 0, a, b); @@ -1004,7 +1009,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sub_epi64() { + const fn test_mm_maskz_sub_epi64() { let a = _mm_set_epi64x(i64::MAX, i64::MIN); let b = _mm_set1_epi64x(1); let r = _mm_maskz_sub_epi64(0, a, b); @@ -1015,7 +1020,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sub_pd() { + const fn test_mm512_sub_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let b = _mm512_set1_pd(1.); let r = _mm512_sub_pd(a, b); @@ -1024,7 +1029,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sub_pd() { + const fn test_mm512_mask_sub_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let b = _mm512_set1_pd(1.); let r = _mm512_mask_sub_pd(a, 0, a, b); @@ -1035,7 +1040,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sub_pd() { + const fn test_mm512_maskz_sub_pd() { let a = _mm512_setr_pd(0., 1., -1., f64::MAX, f64::MIN, 100., -100., -32.); let b = _mm512_set1_pd(1.); let r = _mm512_maskz_sub_pd(0, a, b); @@ -1046,7 +1051,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sub_pd() { + const fn test_mm256_mask_sub_pd() { let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN); let b = _mm256_set1_pd(1.); let r = _mm256_mask_sub_pd(a, 0, a, b); @@ -1057,7 +1062,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sub_pd() { + const fn test_mm256_maskz_sub_pd() { let a = _mm256_set_pd(1., -1., f64::MAX, f64::MIN); let b = _mm256_set1_pd(1.); let r = _mm256_maskz_sub_pd(0, a, b); @@ -1068,7 +1073,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sub_pd() { + const fn test_mm_mask_sub_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set1_pd(1.); let r = _mm_mask_sub_pd(a, 0, a, b); @@ -1079,7 +1084,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sub_pd() { + const fn test_mm_maskz_sub_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set1_pd(1.); let r = _mm_maskz_sub_pd(0, a, b); @@ -1090,7 +1095,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mul_epi32() { + const fn test_mm512_mul_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mul_epi32(a, b); @@ -1099,7 +1104,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mul_epi32() { + const fn test_mm512_mask_mul_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_mul_epi32(a, 0, a, b); @@ -1114,7 +1119,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mul_epi32() { + const fn test_mm512_maskz_mul_epi32() { let a = _mm512_set1_epi32(1); let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_mul_epi32(0, a, b); @@ -1125,7 +1130,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mul_epi32() { + const fn test_mm256_mask_mul_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_mask_mul_epi32(a, 0, a, b); @@ -1136,7 +1141,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mul_epi32() { + const fn test_mm256_maskz_mul_epi32() { let a = _mm256_set1_epi32(1); let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_mul_epi32(0, a, b); @@ -1147,7 +1152,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mul_epi32() { + const fn test_mm_mask_mul_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set_epi32(1, 2, 3, 4); let r = _mm_mask_mul_epi32(a, 0, a, b); @@ -1158,7 +1163,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mul_epi32() { + const fn test_mm_maskz_mul_epi32() { let a = _mm_set1_epi32(1); let b = _mm_set_epi32(1, 2, 3, 4); let r = _mm_maskz_mul_epi32(0, a, b); @@ -1169,7 +1174,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mul_epu32() { + const fn test_mm512_mul_epu32() { let a = _mm512_set1_epi32(1); let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mul_epu32(a, b); @@ -1178,7 +1183,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mul_epu32() { + const fn test_mm512_mask_mul_epu32() { let a = _mm512_set1_epi32(1); let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_mask_mul_epu32(a, 0, a, b); @@ -1193,7 +1198,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mul_epu32() { + const fn test_mm512_maskz_mul_epu32() { let a = _mm512_set1_epi32(1); let b = _mm512_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let r = _mm512_maskz_mul_epu32(0, a, b); @@ -1204,7 +1209,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mul_epu32() { + const fn test_mm256_mask_mul_epu32() { let a = _mm256_set1_epi32(1); let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_mask_mul_epu32(a, 0, a, b); @@ -1215,7 +1220,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mul_epu32() { + const fn test_mm256_maskz_mul_epu32() { let a = _mm256_set1_epi32(1); let b = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm256_maskz_mul_epu32(0, a, b); @@ -1226,7 +1231,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mul_epu32() { + const fn test_mm_mask_mul_epu32() { let a = _mm_set1_epi32(1); let b = _mm_set_epi32(1, 2, 3, 4); let r = _mm_mask_mul_epu32(a, 0, a, b); @@ -1237,7 +1242,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mul_epu32() { + const fn test_mm_maskz_mul_epu32() { let a = _mm_set1_epi32(1); let b = _mm_set_epi32(1, 2, 3, 4); let r = _mm_maskz_mul_epu32(0, a, b); @@ -1248,7 +1253,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mullox_epi64() { + const fn test_mm512_mullox_epi64() { let a = _mm512_setr_epi64(0, 1, i64::MAX, i64::MIN, i64::MAX, 100, -100, -32); let b = _mm512_set1_epi64(2); let r = _mm512_mullox_epi64(a, b); @@ -1257,7 +1262,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mullox_epi64() { + const fn test_mm512_mask_mullox_epi64() { let a = _mm512_setr_epi64(0, 1, i64::MAX, i64::MIN, i64::MAX, 100, -100, -32); let b = _mm512_set1_epi64(2); let r = _mm512_mask_mullox_epi64(a, 0, a, b); @@ -1268,7 +1273,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mul_pd() { + const fn test_mm512_mul_pd() { let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.); let b = _mm512_set1_pd(2.); let r = _mm512_mul_pd(a, b); @@ -1281,7 +1286,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mul_pd() { + const fn test_mm512_mask_mul_pd() { let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.); let b = _mm512_set1_pd(2.); let r = _mm512_mask_mul_pd(a, 0, a, b); @@ -1296,7 +1301,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mul_pd() { + const fn test_mm512_maskz_mul_pd() { let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.); let b = _mm512_set1_pd(2.); let r = _mm512_maskz_mul_pd(0, a, b); @@ -1307,7 +1312,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_mul_pd() { + const fn test_mm256_mask_mul_pd() { let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN); let b = _mm256_set1_pd(2.); let r = _mm256_mask_mul_pd(a, 0, a, b); @@ -1318,7 +1323,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_mul_pd() { + const fn test_mm256_maskz_mul_pd() { let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN); let b = _mm256_set1_pd(2.); let r = _mm256_maskz_mul_pd(0, a, b); @@ -1329,7 +1334,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_mul_pd() { + const fn test_mm_mask_mul_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set1_pd(2.); let r = _mm_mask_mul_pd(a, 0, a, b); @@ -1340,7 +1345,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_mul_pd() { + const fn test_mm_maskz_mul_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set1_pd(2.); let r = _mm_maskz_mul_pd(0, a, b); @@ -1351,7 +1356,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_div_pd() { + const fn test_mm512_div_pd() { let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.); let b = _mm512_setr_pd(2., 2., 0., 0., 0., 0., 2., 2.); let r = _mm512_div_pd(a, b); @@ -1364,7 +1369,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_div_pd() { + const fn test_mm512_mask_div_pd() { let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.); let b = _mm512_setr_pd(2., 2., 0., 0., 0., 0., 2., 2.); let r = _mm512_mask_div_pd(a, 0, a, b); @@ -1379,7 +1384,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_div_pd() { + const fn test_mm512_maskz_div_pd() { let a = _mm512_setr_pd(0., 1., f64::MAX, f64::MIN, f64::MAX, f64::MIN, -100., -32.); let b = _mm512_setr_pd(2., 2., 0., 0., 0., 0., 2., 2.); let r = _mm512_maskz_div_pd(0, a, b); @@ -1390,7 +1395,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_div_pd() { + const fn test_mm256_mask_div_pd() { let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN); let b = _mm256_set_pd(2., 2., 0., 0.); let r = _mm256_mask_div_pd(a, 0, a, b); @@ -1401,7 +1406,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_div_pd() { + const fn test_mm256_maskz_div_pd() { let a = _mm256_set_pd(0., 1., f64::MAX, f64::MIN); let b = _mm256_set_pd(2., 2., 0., 0.); let r = _mm256_maskz_div_pd(0, a, b); @@ -1412,7 +1417,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_div_pd() { + const fn test_mm_mask_div_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set_pd(0., 0.); let r = _mm_mask_div_pd(a, 0, a, b); @@ -1423,7 +1428,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_div_pd() { + const fn test_mm_maskz_div_pd() { let a = _mm_set_pd(f64::MAX, f64::MIN); let b = _mm_set_pd(0., 0.); let r = _mm_maskz_div_pd(0, a, b); @@ -1434,7 +1439,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_epi64() { + const fn test_mm512_max_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_max_epi64(a, b); @@ -1443,7 +1448,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_epi64() { + const fn test_mm512_mask_max_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_max_epi64(a, 0, a, b); @@ -1454,7 +1459,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_epi64() { + const fn test_mm512_maskz_max_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_max_epi64(0, a, b); @@ -1465,7 +1470,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_max_epi64() { + const fn test_mm256_max_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_max_epi64(a, b); @@ -1474,7 +1479,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_max_epi64() { + const fn test_mm256_mask_max_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_mask_max_epi64(a, 0, a, b); @@ -1485,7 +1490,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_max_epi64() { + const fn test_mm256_maskz_max_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_maskz_max_epi64(0, a, b); @@ -1496,7 +1501,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_max_epi64() { + const fn test_mm_max_epi64() { let a = _mm_set_epi64x(2, 3); let b = _mm_set_epi64x(3, 2); let r = _mm_max_epi64(a, b); @@ -1505,7 +1510,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_max_epi64() { + const fn test_mm_mask_max_epi64() { let a = _mm_set_epi64x(2, 3); let b = _mm_set_epi64x(3, 2); let r = _mm_mask_max_epi64(a, 0, a, b); @@ -1516,7 +1521,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_max_epi64() { + const fn test_mm_maskz_max_epi64() { let a = _mm_set_epi64x(2, 3); let b = _mm_set_epi64x(3, 2); let r = _mm_maskz_max_epi64(0, a, b); @@ -1527,7 +1532,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_pd() { + fn test_mm512_max_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_max_pd(a, b); @@ -1536,7 +1541,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_pd() { + fn test_mm512_mask_max_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_mask_max_pd(a, 0, a, b); @@ -1547,7 +1552,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_pd() { + fn test_mm512_maskz_max_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_maskz_max_pd(0, a, b); @@ -1558,7 +1563,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_max_pd() { + fn test_mm256_mask_max_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let b = _mm256_set_pd(3., 2., 1., 0.); let r = _mm256_mask_max_pd(a, 0, a, b); @@ -1569,7 +1574,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_max_pd() { + fn test_mm256_maskz_max_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let b = _mm256_set_pd(3., 2., 1., 0.); let r = _mm256_maskz_max_pd(0, a, b); @@ -1580,7 +1585,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_max_pd() { + fn test_mm_mask_max_pd() { let a = _mm_set_pd(2., 3.); let b = _mm_set_pd(3., 2.); let r = _mm_mask_max_pd(a, 0, a, b); @@ -1591,7 +1596,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_max_pd() { + fn test_mm_maskz_max_pd() { let a = _mm_set_pd(2., 3.); let b = _mm_set_pd(3., 2.); let r = _mm_maskz_max_pd(0, a, b); @@ -1602,7 +1607,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_epu64() { + const fn test_mm512_max_epu64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_max_epu64(a, b); @@ -1611,7 +1616,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_epu64() { + const fn test_mm512_mask_max_epu64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_max_epu64(a, 0, a, b); @@ -1622,7 +1627,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_epu64() { + const fn test_mm512_maskz_max_epu64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_max_epu64(0, a, b); @@ -1633,7 +1638,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_max_epu64() { + const fn test_mm256_max_epu64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_max_epu64(a, b); @@ -1642,7 +1647,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_max_epu64() { + const fn test_mm256_mask_max_epu64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_mask_max_epu64(a, 0, a, b); @@ -1653,7 +1658,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_max_epu64() { + const fn test_mm256_maskz_max_epu64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_maskz_max_epu64(0, a, b); @@ -1664,7 +1669,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_max_epu64() { + const fn test_mm_max_epu64() { let a = _mm_set_epi64x(2, 3); let b = _mm_set_epi64x(3, 2); let r = _mm_max_epu64(a, b); @@ -1673,7 +1678,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_max_epu64() { + const fn test_mm_mask_max_epu64() { let a = _mm_set_epi64x(2, 3); let b = _mm_set_epi64x(3, 2); let r = _mm_mask_max_epu64(a, 0, a, b); @@ -1684,7 +1689,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_max_epu64() { + const fn test_mm_maskz_max_epu64() { let a = _mm_set_epi64x(2, 3); let b = _mm_set_epi64x(3, 2); let r = _mm_maskz_max_epu64(0, a, b); @@ -1695,7 +1700,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_epi64() { + const fn test_mm512_min_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_min_epi64(a, b); @@ -1704,7 +1709,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_epi64() { + const fn test_mm512_mask_min_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_min_epi64(a, 0, a, b); @@ -1715,7 +1720,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_epi64() { + const fn test_mm512_maskz_min_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_min_epi64(0, a, b); @@ -1726,7 +1731,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_min_epi64() { + const fn test_mm256_min_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_min_epi64(a, b); @@ -1735,7 +1740,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_min_epi64() { + const fn test_mm256_mask_min_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_mask_min_epi64(a, 0, a, b); @@ -1746,7 +1751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_min_epi64() { + const fn test_mm256_maskz_min_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_maskz_min_epi64(0, a, b); @@ -1757,7 +1762,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_min_epi64() { + const fn test_mm_min_epi64() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(3, 2); let r = _mm_min_epi64(a, b); @@ -1771,7 +1776,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_min_epi64() { + const fn test_mm_mask_min_epi64() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(3, 2); let r = _mm_mask_min_epi64(a, 0, a, b); @@ -1782,7 +1787,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_min_epi64() { + const fn test_mm_maskz_min_epi64() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(3, 2); let r = _mm_maskz_min_epi64(0, a, b); @@ -1793,7 +1798,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_pd() { + fn test_mm512_min_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_min_pd(a, b); @@ -1802,7 +1807,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_pd() { + fn test_mm512_mask_min_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_mask_min_pd(a, 0, a, b); @@ -1813,7 +1818,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_pd() { + fn test_mm512_maskz_min_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_maskz_min_pd(0, a, b); @@ -1824,7 +1829,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_min_pd() { + fn test_mm256_mask_min_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let b = _mm256_set_pd(3., 2., 1., 0.); let r = _mm256_mask_min_pd(a, 0, a, b); @@ -1835,7 +1840,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_min_pd() { + fn test_mm256_maskz_min_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let b = _mm256_set_pd(3., 2., 1., 0.); let r = _mm256_maskz_min_pd(0, a, b); @@ -1846,7 +1851,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_min_pd() { + fn test_mm_mask_min_pd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(1., 0.); let r = _mm_mask_min_pd(a, 0, a, b); @@ -1857,7 +1862,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_min_pd() { + fn test_mm_maskz_min_pd() { let a = _mm_set_pd(0., 1.); let b = _mm_set_pd(1., 0.); let r = _mm_maskz_min_pd(0, a, b); @@ -1868,7 +1873,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_epu64() { + const fn test_mm512_min_epu64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_min_epu64(a, b); @@ -1877,7 +1882,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_epu64() { + const fn test_mm512_mask_min_epu64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_mask_min_epu64(a, 0, a, b); @@ -1888,7 +1893,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_epu64() { + const fn test_mm512_maskz_min_epu64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let b = _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0); let r = _mm512_maskz_min_epu64(0, a, b); @@ -1899,7 +1904,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_min_epu64() { + const fn test_mm256_min_epu64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_min_epu64(a, b); @@ -1908,7 +1913,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_min_epu64() { + const fn test_mm256_mask_min_epu64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_mask_min_epu64(a, 0, a, b); @@ -1919,7 +1924,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_min_epu64() { + const fn test_mm256_maskz_min_epu64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_maskz_min_epu64(0, a, b); @@ -1930,7 +1935,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_min_epu64() { + const fn test_mm_min_epu64() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(1, 0); let r = _mm_min_epu64(a, b); @@ -1939,7 +1944,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_min_epu64() { + const fn test_mm_mask_min_epu64() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(1, 0); let r = _mm_mask_min_epu64(a, 0, a, b); @@ -1950,7 +1955,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_min_epu64() { + const fn test_mm_maskz_min_epu64() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(1, 0); let r = _mm_maskz_min_epu64(0, a, b); @@ -1961,7 +1966,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sqrt_pd() { + fn test_mm512_sqrt_pd() { let a = _mm512_setr_pd(0., 1., 4., 9., 16., 25., 36., 49.); let r = _mm512_sqrt_pd(a); let e = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); @@ -1969,7 +1974,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sqrt_pd() { + fn test_mm512_mask_sqrt_pd() { let a = _mm512_setr_pd(0., 1., 4., 9., 16., 25., 36., 49.); let r = _mm512_mask_sqrt_pd(a, 0, a); assert_eq_m512d(r, a); @@ -1979,7 +1984,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sqrt_pd() { + fn test_mm512_maskz_sqrt_pd() { let a = _mm512_setr_pd(0., 1., 4., 9., 16., 25., 36., 49.); let r = _mm512_maskz_sqrt_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -1989,7 +1994,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sqrt_pd() { + fn test_mm256_mask_sqrt_pd() { let a = _mm256_set_pd(0., 1., 4., 9.); let r = _mm256_mask_sqrt_pd(a, 0, a); assert_eq_m256d(r, a); @@ -1999,7 +2004,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sqrt_pd() { + fn test_mm256_maskz_sqrt_pd() { let a = _mm256_set_pd(0., 1., 4., 9.); let r = _mm256_maskz_sqrt_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -2009,7 +2014,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sqrt_pd() { + fn test_mm_mask_sqrt_pd() { let a = _mm_set_pd(0., 1.); let r = _mm_mask_sqrt_pd(a, 0, a); assert_eq_m128d(r, a); @@ -2019,7 +2024,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sqrt_pd() { + fn test_mm_maskz_sqrt_pd() { let a = _mm_set_pd(0., 1.); let r = _mm_maskz_sqrt_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -2029,7 +2034,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmadd_pd() { + const fn test_mm512_fmadd_pd() { let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); @@ -2039,7 +2044,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmadd_pd() { + const fn test_mm512_mask_fmadd_pd() { let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); @@ -2051,7 +2056,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmadd_pd() { + const fn test_mm512_maskz_fmadd_pd() { let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); @@ -2063,7 +2068,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmadd_pd() { + const fn test_mm512_mask3_fmadd_pd() { let a = _mm512_setr_pd(1., 1., 1., 1., 1., 1., 1., 1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.); @@ -2075,7 +2080,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmadd_pd() { + const fn test_mm256_mask_fmadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2087,7 +2092,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmadd_pd() { + const fn test_mm256_maskz_fmadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2099,7 +2104,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmadd_pd() { + const fn test_mm256_mask3_fmadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2111,7 +2116,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmadd_pd() { + const fn test_mm_mask_fmadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2123,7 +2128,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmadd_pd() { + const fn test_mm_maskz_fmadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2135,7 +2140,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmadd_pd() { + const fn test_mm_mask3_fmadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2147,7 +2152,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsub_pd() { + const fn test_mm512_fmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2157,7 +2162,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsub_pd() { + const fn test_mm512_mask_fmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2169,7 +2174,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsub_pd() { + const fn test_mm512_maskz_fmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2181,7 +2186,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsub_pd() { + const fn test_mm512_mask3_fmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.); @@ -2193,7 +2198,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmsub_pd() { + const fn test_mm256_mask_fmsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2205,7 +2210,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmsub_pd() { + const fn test_mm256_maskz_fmsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2217,7 +2222,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmsub_pd() { + const fn test_mm256_mask3_fmsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2229,7 +2234,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmsub_pd() { + const fn test_mm_mask_fmsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2241,7 +2246,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmsub_pd() { + const fn test_mm_maskz_fmsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2253,7 +2258,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmsub_pd() { + const fn test_mm_mask3_fmsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2265,7 +2270,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmaddsub_pd() { + const fn test_mm512_fmaddsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2275,7 +2280,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmaddsub_pd() { + const fn test_mm512_mask_fmaddsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2287,7 +2292,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmaddsub_pd() { + const fn test_mm512_maskz_fmaddsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2299,7 +2304,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmaddsub_pd() { + const fn test_mm512_mask3_fmaddsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.); @@ -2311,7 +2316,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmaddsub_pd() { + const fn test_mm256_mask_fmaddsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2323,7 +2328,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmaddsub_pd() { + const fn test_mm256_maskz_fmaddsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2335,7 +2340,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmaddsub_pd() { + const fn test_mm256_mask3_fmaddsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2347,7 +2352,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmaddsub_pd() { + const fn test_mm_mask_fmaddsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2359,7 +2364,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmaddsub_pd() { + const fn test_mm_maskz_fmaddsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2371,7 +2376,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmaddsub_pd() { + const fn test_mm_mask3_fmaddsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2383,7 +2388,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsubadd_pd() { + const fn test_mm512_fmsubadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2393,7 +2398,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsubadd_pd() { + const fn test_mm512_mask_fmsubadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2405,7 +2410,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsubadd_pd() { + const fn test_mm512_maskz_fmsubadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2417,7 +2422,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsubadd_pd() { + const fn test_mm512_mask3_fmsubadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.); @@ -2429,7 +2434,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fmsubadd_pd() { + const fn test_mm256_mask_fmsubadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2441,7 +2446,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fmsubadd_pd() { + const fn test_mm256_maskz_fmsubadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2453,7 +2458,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fmsubadd_pd() { + const fn test_mm256_mask3_fmsubadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2465,7 +2470,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fmsubadd_pd() { + const fn test_mm_mask_fmsubadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2477,7 +2482,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fmsubadd_pd() { + const fn test_mm_maskz_fmsubadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2489,7 +2494,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fmsubadd_pd() { + const fn test_mm_mask3_fmsubadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2501,7 +2506,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmadd_pd() { + const fn test_mm512_fnmadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2511,7 +2516,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmadd_pd() { + const fn test_mm512_mask_fnmadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2523,7 +2528,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmadd_pd() { + const fn test_mm512_maskz_fnmadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2535,7 +2540,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmadd_pd() { + const fn test_mm512_mask3_fnmadd_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.); @@ -2547,7 +2552,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fnmadd_pd() { + const fn test_mm256_mask_fnmadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2559,7 +2564,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fnmadd_pd() { + const fn test_mm256_maskz_fnmadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2571,7 +2576,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fnmadd_pd() { + const fn test_mm256_mask3_fnmadd_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2583,7 +2588,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fnmadd_pd() { + const fn test_mm_mask_fnmadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2595,7 +2600,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fnmadd_pd() { + const fn test_mm_maskz_fnmadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2607,7 +2612,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fnmadd_pd() { + const fn test_mm_mask3_fnmadd_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2619,7 +2624,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmsub_pd() { + const fn test_mm512_fnmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2629,7 +2634,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmsub_pd() { + const fn test_mm512_mask_fnmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2641,7 +2646,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmsub_pd() { + const fn test_mm512_maskz_fnmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_set1_pd(1.); @@ -2653,7 +2658,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmsub_pd() { + const fn test_mm512_mask3_fnmsub_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let c = _mm512_setr_pd(1., 1., 1., 1., 2., 2., 2., 2.); @@ -2665,7 +2670,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fnmsub_pd() { + const fn test_mm256_mask_fnmsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2677,7 +2682,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fnmsub_pd() { + const fn test_mm256_maskz_fnmsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2689,7 +2694,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask3_fnmsub_pd() { + const fn test_mm256_mask3_fnmsub_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set_pd(0., 1., 2., 3.); let c = _mm256_set1_pd(1.); @@ -2701,7 +2706,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fnmsub_pd() { + const fn test_mm_mask_fnmsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2713,7 +2718,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fnmsub_pd() { + const fn test_mm_maskz_fnmsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2725,7 +2730,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask3_fnmsub_pd() { + const fn test_mm_mask3_fnmsub_pd() { let a = _mm_set1_pd(1.); let b = _mm_set_pd(0., 1.); let c = _mm_set1_pd(1.); @@ -2737,7 +2742,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rcp14_pd() { + fn test_mm512_rcp14_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_rcp14_pd(a); let e = _mm512_set1_pd(0.3333320617675781); @@ -2745,7 +2750,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rcp14_pd() { + fn test_mm512_mask_rcp14_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_mask_rcp14_pd(a, 0, a); assert_eq_m512d(r, a); @@ -2759,7 +2764,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rcp14_pd() { + fn test_mm512_maskz_rcp14_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_maskz_rcp14_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -2773,7 +2778,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rcp14_pd() { + fn test_mm256_rcp14_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_rcp14_pd(a); let e = _mm256_set1_pd(0.3333320617675781); @@ -2781,7 +2786,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rcp14_pd() { + fn test_mm256_mask_rcp14_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_mask_rcp14_pd(a, 0, a); assert_eq_m256d(r, a); @@ -2791,7 +2796,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rcp14_pd() { + fn test_mm256_maskz_rcp14_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_maskz_rcp14_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -2801,7 +2806,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rcp14_pd() { + fn test_mm_rcp14_pd() { let a = _mm_set1_pd(3.); let r = _mm_rcp14_pd(a); let e = _mm_set1_pd(0.3333320617675781); @@ -2809,7 +2814,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rcp14_pd() { + fn test_mm_mask_rcp14_pd() { let a = _mm_set1_pd(3.); let r = _mm_mask_rcp14_pd(a, 0, a); assert_eq_m128d(r, a); @@ -2819,7 +2824,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rcp14_pd() { + fn test_mm_maskz_rcp14_pd() { let a = _mm_set1_pd(3.); let r = _mm_maskz_rcp14_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -2829,7 +2834,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rsqrt14_pd() { + fn test_mm512_rsqrt14_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_rsqrt14_pd(a); let e = _mm512_set1_pd(0.5773391723632813); @@ -2837,7 +2842,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rsqrt14_pd() { + fn test_mm512_mask_rsqrt14_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_mask_rsqrt14_pd(a, 0, a); assert_eq_m512d(r, a); @@ -2851,7 +2856,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rsqrt14_pd() { + fn test_mm512_maskz_rsqrt14_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_maskz_rsqrt14_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -2865,7 +2870,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rsqrt14_pd() { + fn test_mm256_rsqrt14_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_rsqrt14_pd(a); let e = _mm256_set1_pd(0.5773391723632813); @@ -2873,7 +2878,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rsqrt14_pd() { + fn test_mm256_mask_rsqrt14_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_mask_rsqrt14_pd(a, 0, a); assert_eq_m256d(r, a); @@ -2883,7 +2888,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rsqrt14_pd() { + fn test_mm256_maskz_rsqrt14_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_maskz_rsqrt14_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -2893,7 +2898,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rsqrt14_pd() { + fn test_mm_rsqrt14_pd() { let a = _mm_set1_pd(3.); let r = _mm_rsqrt14_pd(a); let e = _mm_set1_pd(0.5773391723632813); @@ -2901,7 +2906,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rsqrt14_pd() { + fn test_mm_mask_rsqrt14_pd() { let a = _mm_set1_pd(3.); let r = _mm_mask_rsqrt14_pd(a, 0, a); assert_eq_m128d(r, a); @@ -2911,7 +2916,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rsqrt14_pd() { + fn test_mm_maskz_rsqrt14_pd() { let a = _mm_set1_pd(3.); let r = _mm_maskz_rsqrt14_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -2921,7 +2926,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getexp_pd() { + fn test_mm512_getexp_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_getexp_pd(a); let e = _mm512_set1_pd(1.); @@ -2929,7 +2934,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getexp_pd() { + fn test_mm512_mask_getexp_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_mask_getexp_pd(a, 0, a); assert_eq_m512d(r, a); @@ -2939,7 +2944,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getexp_pd() { + fn test_mm512_maskz_getexp_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_maskz_getexp_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -2949,7 +2954,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_getexp_pd() { + fn test_mm256_getexp_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_getexp_pd(a); let e = _mm256_set1_pd(1.); @@ -2957,7 +2962,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_getexp_pd() { + fn test_mm256_mask_getexp_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_mask_getexp_pd(a, 0, a); assert_eq_m256d(r, a); @@ -2967,7 +2972,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_getexp_pd() { + fn test_mm256_maskz_getexp_pd() { let a = _mm256_set1_pd(3.); let r = _mm256_maskz_getexp_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -2977,7 +2982,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_getexp_pd() { + fn test_mm_getexp_pd() { let a = _mm_set1_pd(3.); let r = _mm_getexp_pd(a); let e = _mm_set1_pd(1.); @@ -2985,7 +2990,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_getexp_pd() { + fn test_mm_mask_getexp_pd() { let a = _mm_set1_pd(3.); let r = _mm_mask_getexp_pd(a, 0, a); assert_eq_m128d(r, a); @@ -2995,7 +3000,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_getexp_pd() { + fn test_mm_maskz_getexp_pd() { let a = _mm_set1_pd(3.); let r = _mm_maskz_getexp_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -3005,7 +3010,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_roundscale_pd() { + fn test_mm512_roundscale_pd() { let a = _mm512_set1_pd(1.1); let r = _mm512_roundscale_pd::<0b00_00_00_00>(a); let e = _mm512_set1_pd(1.0); @@ -3013,7 +3018,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_roundscale_pd() { + fn test_mm512_mask_roundscale_pd() { let a = _mm512_set1_pd(1.1); let r = _mm512_mask_roundscale_pd::<0b00_00_00_00>(a, 0, a); let e = _mm512_set1_pd(1.1); @@ -3024,7 +3029,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_roundscale_pd() { + fn test_mm512_maskz_roundscale_pd() { let a = _mm512_set1_pd(1.1); let r = _mm512_maskz_roundscale_pd::<0b00_00_00_00>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -3034,7 +3039,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_roundscale_pd() { + fn test_mm256_roundscale_pd() { let a = _mm256_set1_pd(1.1); let r = _mm256_roundscale_pd::<0b00_00_00_00>(a); let e = _mm256_set1_pd(1.0); @@ -3042,7 +3047,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_roundscale_pd() { + fn test_mm256_mask_roundscale_pd() { let a = _mm256_set1_pd(1.1); let r = _mm256_mask_roundscale_pd::<0b00_00_00_00>(a, 0, a); assert_eq_m256d(r, a); @@ -3052,7 +3057,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_roundscale_pd() { + fn test_mm256_maskz_roundscale_pd() { let a = _mm256_set1_pd(1.1); let r = _mm256_maskz_roundscale_pd::<0b00_00_00_00>(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -3062,7 +3067,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_roundscale_pd() { + fn test_mm_roundscale_pd() { let a = _mm_set1_pd(1.1); let r = _mm_roundscale_pd::<0b00_00_00_00>(a); let e = _mm_set1_pd(1.0); @@ -3070,7 +3075,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_roundscale_pd() { + fn test_mm_mask_roundscale_pd() { let a = _mm_set1_pd(1.1); let r = _mm_mask_roundscale_pd::<0b00_00_00_00>(a, 0, a); let e = _mm_set1_pd(1.1); @@ -3081,7 +3086,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_roundscale_pd() { + fn test_mm_maskz_roundscale_pd() { let a = _mm_set1_pd(1.1); let r = _mm_maskz_roundscale_pd::<0b00_00_00_00>(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -3091,7 +3096,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_scalef_pd() { + fn test_mm512_scalef_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_scalef_pd(a, b); @@ -3100,7 +3105,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_scalef_pd() { + fn test_mm512_mask_scalef_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_mask_scalef_pd(a, 0, a, b); @@ -3111,7 +3116,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_scalef_pd() { + fn test_mm512_maskz_scalef_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_maskz_scalef_pd(0, a, b); @@ -3122,7 +3127,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_scalef_pd() { + fn test_mm256_scalef_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set1_pd(3.); let r = _mm256_scalef_pd(a, b); @@ -3131,7 +3136,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_scalef_pd() { + fn test_mm256_mask_scalef_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set1_pd(3.); let r = _mm256_mask_scalef_pd(a, 0, a, b); @@ -3142,7 +3147,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_scalef_pd() { + fn test_mm256_maskz_scalef_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set1_pd(3.); let r = _mm256_maskz_scalef_pd(0, a, b); @@ -3153,7 +3158,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_scalef_pd() { + fn test_mm_scalef_pd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_scalef_pd(a, b); @@ -3162,7 +3167,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_scalef_pd() { + fn test_mm_mask_scalef_pd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_mask_scalef_pd(a, 0, a, b); @@ -3173,7 +3178,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_scalef_pd() { + fn test_mm_maskz_scalef_pd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(3.); let r = _mm_maskz_scalef_pd(0, a, b); @@ -3184,7 +3189,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fixupimm_pd() { + fn test_mm512_fixupimm_pd() { let a = _mm512_set1_pd(f64::NAN); let b = _mm512_set1_pd(f64::MAX); let c = _mm512_set1_epi64(i32::MAX as i64); @@ -3194,7 +3199,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fixupimm_pd() { + fn test_mm512_mask_fixupimm_pd() { let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.); let b = _mm512_set1_pd(f64::MAX); let c = _mm512_set1_epi64(i32::MAX as i64); @@ -3204,7 +3209,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fixupimm_pd() { + fn test_mm512_maskz_fixupimm_pd() { let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.); let b = _mm512_set1_pd(f64::MAX); let c = _mm512_set1_epi64(i32::MAX as i64); @@ -3214,7 +3219,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_fixupimm_pd() { + fn test_mm256_fixupimm_pd() { let a = _mm256_set1_pd(f64::NAN); let b = _mm256_set1_pd(f64::MAX); let c = _mm256_set1_epi64x(i32::MAX as i64); @@ -3224,7 +3229,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_fixupimm_pd() { + fn test_mm256_mask_fixupimm_pd() { let a = _mm256_set1_pd(f64::NAN); let b = _mm256_set1_pd(f64::MAX); let c = _mm256_set1_epi64x(i32::MAX as i64); @@ -3234,7 +3239,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_fixupimm_pd() { + fn test_mm256_maskz_fixupimm_pd() { let a = _mm256_set1_pd(f64::NAN); let b = _mm256_set1_pd(f64::MAX); let c = _mm256_set1_epi64x(i32::MAX as i64); @@ -3244,7 +3249,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_fixupimm_pd() { + fn test_mm_fixupimm_pd() { let a = _mm_set1_pd(f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -3254,7 +3259,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_fixupimm_pd() { + fn test_mm_mask_fixupimm_pd() { let a = _mm_set1_pd(f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -3264,7 +3269,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_fixupimm_pd() { + fn test_mm_maskz_fixupimm_pd() { let a = _mm_set1_pd(f64::NAN); let b = _mm_set1_pd(f64::MAX); let c = _mm_set1_epi64x(i32::MAX as i64); @@ -3274,7 +3279,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_ternarylogic_epi64() { + fn test_mm512_ternarylogic_epi64() { let a = _mm512_set1_epi64(1 << 2); let b = _mm512_set1_epi64(1 << 1); let c = _mm512_set1_epi64(1 << 0); @@ -3284,7 +3289,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_ternarylogic_epi64() { + fn test_mm512_mask_ternarylogic_epi64() { let src = _mm512_set1_epi64(1 << 2); let a = _mm512_set1_epi64(1 << 1); let b = _mm512_set1_epi64(1 << 0); @@ -3296,7 +3301,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_ternarylogic_epi64() { + fn test_mm512_maskz_ternarylogic_epi64() { let a = _mm512_set1_epi64(1 << 2); let b = _mm512_set1_epi64(1 << 1); let c = _mm512_set1_epi64(1 << 0); @@ -3308,7 +3313,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_ternarylogic_epi64() { + fn test_mm256_ternarylogic_epi64() { let a = _mm256_set1_epi64x(1 << 2); let b = _mm256_set1_epi64x(1 << 1); let c = _mm256_set1_epi64x(1 << 0); @@ -3318,7 +3323,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_ternarylogic_epi64() { + fn test_mm256_mask_ternarylogic_epi64() { let src = _mm256_set1_epi64x(1 << 2); let a = _mm256_set1_epi64x(1 << 1); let b = _mm256_set1_epi64x(1 << 0); @@ -3330,7 +3335,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_ternarylogic_epi64() { + fn test_mm256_maskz_ternarylogic_epi64() { let a = _mm256_set1_epi64x(1 << 2); let b = _mm256_set1_epi64x(1 << 1); let c = _mm256_set1_epi64x(1 << 0); @@ -3342,7 +3347,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_ternarylogic_epi64() { + fn test_mm_ternarylogic_epi64() { let a = _mm_set1_epi64x(1 << 2); let b = _mm_set1_epi64x(1 << 1); let c = _mm_set1_epi64x(1 << 0); @@ -3352,7 +3357,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_ternarylogic_epi64() { + fn test_mm_mask_ternarylogic_epi64() { let src = _mm_set1_epi64x(1 << 2); let a = _mm_set1_epi64x(1 << 1); let b = _mm_set1_epi64x(1 << 0); @@ -3364,7 +3369,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_ternarylogic_epi64() { + fn test_mm_maskz_ternarylogic_epi64() { let a = _mm_set1_epi64x(1 << 2); let b = _mm_set1_epi64x(1 << 1); let c = _mm_set1_epi64x(1 << 0); @@ -3376,7 +3381,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getmant_pd() { + fn test_mm512_getmant_pd() { let a = _mm512_set1_pd(10.); let r = _mm512_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a); let e = _mm512_set1_pd(1.25); @@ -3384,7 +3389,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getmant_pd() { + fn test_mm512_mask_getmant_pd() { let a = _mm512_set1_pd(10.); let r = _mm512_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a); assert_eq_m512d(r, a); @@ -3394,7 +3399,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getmant_pd() { + fn test_mm512_maskz_getmant_pd() { let a = _mm512_set1_pd(10.); let r = _mm512_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -3404,7 +3409,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_getmant_pd() { + fn test_mm256_getmant_pd() { let a = _mm256_set1_pd(10.); let r = _mm256_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a); let e = _mm256_set1_pd(1.25); @@ -3412,7 +3417,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_getmant_pd() { + fn test_mm256_mask_getmant_pd() { let a = _mm256_set1_pd(10.); let r = _mm256_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a); assert_eq_m256d(r, a); @@ -3422,7 +3427,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_getmant_pd() { + fn test_mm256_maskz_getmant_pd() { let a = _mm256_set1_pd(10.); let r = _mm256_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -3432,7 +3437,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_getmant_pd() { + fn test_mm_getmant_pd() { let a = _mm_set1_pd(10.); let r = _mm_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a); let e = _mm_set1_pd(1.25); @@ -3440,7 +3445,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_getmant_pd() { + fn test_mm_mask_getmant_pd() { let a = _mm_set1_pd(10.); let r = _mm_mask_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(a, 0, a); assert_eq_m128d(r, a); @@ -3450,7 +3455,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_getmant_pd() { + fn test_mm_maskz_getmant_pd() { let a = _mm_set1_pd(10.); let r = _mm_maskz_getmant_pd::<_MM_MANT_NORM_1_2, _MM_MANT_SIGN_SRC>(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -3460,7 +3465,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtps_pd() { + fn test_mm512_cvtps_pd() { let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvtps_pd(a); let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); @@ -3468,7 +3473,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtps_pd() { + fn test_mm512_mask_cvtps_pd() { let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm512_set1_pd(0.); let r = _mm512_mask_cvtps_pd(src, 0, a); @@ -3479,7 +3484,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtps_pd() { + fn test_mm512_maskz_cvtps_pd() { let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvtps_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -3489,7 +3494,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtpslo_pd() { + fn test_mm512_cvtpslo_pd() { let v2 = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 100., 100., 100., 100., 100., 100., 100., 100., ); @@ -3499,7 +3504,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtpslo_pd() { + fn test_mm512_mask_cvtpslo_pd() { let v2 = _mm512_setr_ps( 0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5, 100., 100., 100., 100., 100., 100., 100., 100., ); @@ -3512,7 +3517,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtpd_ps() { + fn test_mm512_cvtpd_ps() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvtpd_ps(a); let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); @@ -3520,7 +3525,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtpd_ps() { + fn test_mm512_mask_cvtpd_ps() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_ps(0.); let r = _mm512_mask_cvtpd_ps(src, 0, a); @@ -3531,7 +3536,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtpd_ps() { + fn test_mm512_maskz_cvtpd_ps() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvtpd_ps(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -3541,7 +3546,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtpd_ps() { + fn test_mm256_mask_cvtpd_ps() { let a = _mm256_set_pd(4., -5.5, 6., -7.5); let src = _mm_set1_ps(0.); let r = _mm256_mask_cvtpd_ps(src, 0, a); @@ -3552,7 +3557,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtpd_ps() { + fn test_mm256_maskz_cvtpd_ps() { let a = _mm256_set_pd(4., -5.5, 6., -7.5); let r = _mm256_maskz_cvtpd_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -3562,7 +3567,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtpd_ps() { + fn test_mm_mask_cvtpd_ps() { let a = _mm_set_pd(6., -7.5); let src = _mm_set1_ps(0.); let r = _mm_mask_cvtpd_ps(src, 0, a); @@ -3573,7 +3578,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtpd_ps() { + fn test_mm_maskz_cvtpd_ps() { let a = _mm_set_pd(6., -7.5); let r = _mm_maskz_cvtpd_ps(0, a); assert_eq_m128(r, _mm_setzero_ps()); @@ -3583,7 +3588,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtpd_epi32() { + fn test_mm512_cvtpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvtpd_epi32(a); let e = _mm256_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8); @@ -3591,7 +3596,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtpd_epi32() { + fn test_mm512_mask_cvtpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvtpd_epi32(src, 0, a); @@ -3602,7 +3607,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtpd_epi32() { + fn test_mm512_maskz_cvtpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvtpd_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -3612,7 +3617,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtpd_epi32() { + fn test_mm256_mask_cvtpd_epi32() { let a = _mm256_set_pd(4., -5.5, 6., -7.5); let src = _mm_set1_epi32(0); let r = _mm256_mask_cvtpd_epi32(src, 0, a); @@ -3623,7 +3628,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtpd_epi32() { + fn test_mm256_maskz_cvtpd_epi32() { let a = _mm256_set_pd(4., -5.5, 6., -7.5); let r = _mm256_maskz_cvtpd_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3633,7 +3638,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtpd_epi32() { + fn test_mm_mask_cvtpd_epi32() { let a = _mm_set_pd(6., -7.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtpd_epi32(src, 0, a); @@ -3644,7 +3649,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtpd_epi32() { + fn test_mm_maskz_cvtpd_epi32() { let a = _mm_set_pd(6., -7.5); let r = _mm_maskz_cvtpd_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3654,7 +3659,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtpd_epu32() { + fn test_mm512_cvtpd_epu32() { let a = _mm512_setr_pd(0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5); let r = _mm512_cvtpd_epu32(a); let e = _mm256_setr_epi32(0, 2, 2, 4, 4, 6, 6, 8); @@ -3662,7 +3667,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtpd_epu32() { + fn test_mm512_mask_cvtpd_epu32() { let a = _mm512_setr_pd(0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvtpd_epu32(src, 0, a); @@ -3673,7 +3678,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtpd_epu32() { + fn test_mm512_maskz_cvtpd_epu32() { let a = _mm512_setr_pd(0., 1.5, 2., 3.5, 4., 5.5, 6., 7.5); let r = _mm512_maskz_cvtpd_epu32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -3683,7 +3688,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtpd_epu32() { + fn test_mm256_cvtpd_epu32() { let a = _mm256_set_pd(4., 5.5, 6., 7.5); let r = _mm256_cvtpd_epu32(a); let e = _mm_set_epi32(4, 6, 6, 8); @@ -3691,7 +3696,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtpd_epu32() { + fn test_mm256_mask_cvtpd_epu32() { let a = _mm256_set_pd(4., 5.5, 6., 7.5); let src = _mm_set1_epi32(0); let r = _mm256_mask_cvtpd_epu32(src, 0, a); @@ -3702,7 +3707,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtpd_epu32() { + fn test_mm256_maskz_cvtpd_epu32() { let a = _mm256_set_pd(4., 5.5, 6., 7.5); let r = _mm256_maskz_cvtpd_epu32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3712,7 +3717,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtpd_epu32() { + fn test_mm_cvtpd_epu32() { let a = _mm_set_pd(6., 7.5); let r = _mm_cvtpd_epu32(a); let e = _mm_set_epi32(0, 0, 6, 8); @@ -3720,7 +3725,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtpd_epu32() { + fn test_mm_mask_cvtpd_epu32() { let a = _mm_set_pd(6., 7.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtpd_epu32(src, 0, a); @@ -3731,7 +3736,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtpd_epu32() { + fn test_mm_maskz_cvtpd_epu32() { let a = _mm_set_pd(6., 7.5); let r = _mm_maskz_cvtpd_epu32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3741,7 +3746,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtpd_pslo() { + fn test_mm512_cvtpd_pslo() { let v2 = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvtpd_pslo(v2); let e = _mm512_setr_ps( @@ -3751,7 +3756,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtpd_pslo() { + fn test_mm512_mask_cvtpd_pslo() { let v2 = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm512_set1_ps(0.); let r = _mm512_mask_cvtpd_pslo(src, 0, v2); @@ -3764,7 +3769,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi8_epi64() { + const fn test_mm512_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi8_epi64(a); let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); @@ -3772,7 +3777,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi8_epi64() { + const fn test_mm512_mask_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi64(-1); let r = _mm512_mask_cvtepi8_epi64(src, 0, a); @@ -3783,7 +3788,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi8_epi64() { + const fn test_mm512_maskz_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi8_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -3793,7 +3798,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi8_epi64() { + const fn test_mm256_mask_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi64x(-1); let r = _mm256_mask_cvtepi8_epi64(src, 0, a); @@ -3804,7 +3809,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi8_epi64() { + const fn test_mm256_maskz_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepi8_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -3814,7 +3819,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi8_epi64() { + const fn test_mm_mask_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi64x(-1); let r = _mm_mask_cvtepi8_epi64(src, 0, a); @@ -3825,7 +3830,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi8_epi64() { + const fn test_mm_maskz_cvtepi8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepi8_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3835,7 +3840,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu8_epi64() { + const fn test_mm512_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu8_epi64(a); let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); @@ -3843,7 +3848,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu8_epi64() { + const fn test_mm512_mask_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi64(-1); let r = _mm512_mask_cvtepu8_epi64(src, 0, a); @@ -3854,7 +3859,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu8_epi64() { + const fn test_mm512_maskz_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu8_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -3864,7 +3869,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepu8_epi64() { + const fn test_mm256_mask_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi64x(-1); let r = _mm256_mask_cvtepu8_epi64(src, 0, a); @@ -3875,7 +3880,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu8_epi64() { + const fn test_mm256_maskz_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepu8_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -3885,7 +3890,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepu8_epi64() { + const fn test_mm_mask_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi64x(-1); let r = _mm_mask_cvtepu8_epi64(src, 0, a); @@ -3896,7 +3901,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepu8_epi64() { + const fn test_mm_maskz_cvtepu8_epi64() { let a = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepu8_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3906,7 +3911,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi16_epi64() { + const fn test_mm512_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi16_epi64(a); let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); @@ -3914,7 +3919,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi16_epi64() { + const fn test_mm512_mask_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi64(-1); let r = _mm512_mask_cvtepi16_epi64(src, 0, a); @@ -3925,7 +3930,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi16_epi64() { + const fn test_mm512_maskz_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi16_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -3935,7 +3940,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi16_epi64() { + const fn test_mm256_mask_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi64x(-1); let r = _mm256_mask_cvtepi16_epi64(src, 0, a); @@ -3946,7 +3951,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi16_epi64() { + const fn test_mm256_maskz_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepi16_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -3956,7 +3961,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi16_epi64() { + const fn test_mm_mask_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi64x(-1); let r = _mm_mask_cvtepi16_epi64(src, 0, a); @@ -3967,7 +3972,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi16_epi64() { + const fn test_mm_maskz_cvtepi16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepi16_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -3977,7 +3982,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu16_epi64() { + const fn test_mm512_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu16_epi64(a); let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); @@ -3985,7 +3990,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu16_epi64() { + const fn test_mm512_mask_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi64(-1); let r = _mm512_mask_cvtepu16_epi64(src, 0, a); @@ -3996,7 +4001,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu16_epi64() { + const fn test_mm512_maskz_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu16_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -4006,7 +4011,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepu16_epi64() { + const fn test_mm256_mask_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi64x(-1); let r = _mm256_mask_cvtepu16_epi64(src, 0, a); @@ -4017,7 +4022,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu16_epi64() { + const fn test_mm256_maskz_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm256_maskz_cvtepu16_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -4027,7 +4032,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepu16_epi64() { + const fn test_mm_mask_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi64x(-1); let r = _mm_mask_cvtepu16_epi64(src, 0, a); @@ -4038,7 +4043,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepu16_epi64() { + const fn test_mm_maskz_cvtepu16_epi64() { let a = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm_maskz_cvtepu16_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4048,7 +4053,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi32_epi64() { + const fn test_mm512_cvtepi32_epi64() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi32_epi64(a); let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); @@ -4056,7 +4061,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi32_epi64() { + const fn test_mm512_mask_cvtepi32_epi64() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi64(-1); let r = _mm512_mask_cvtepi32_epi64(src, 0, a); @@ -4067,7 +4072,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi32_epi64() { + const fn test_mm512_maskz_cvtepi32_epi64() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi32_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -4077,7 +4082,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi32_epi64() { + const fn test_mm256_mask_cvtepi32_epi64() { let a = _mm_set_epi32(8, 9, 10, 11); let src = _mm256_set1_epi64x(-1); let r = _mm256_mask_cvtepi32_epi64(src, 0, a); @@ -4088,7 +4093,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi32_epi64() { + const fn test_mm256_maskz_cvtepi32_epi64() { let a = _mm_set_epi32(8, 9, 10, 11); let r = _mm256_maskz_cvtepi32_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -4098,7 +4103,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi32_epi64() { + const fn test_mm_mask_cvtepi32_epi64() { let a = _mm_set_epi32(8, 9, 10, 11); let src = _mm_set1_epi64x(0); let r = _mm_mask_cvtepi32_epi64(src, 0, a); @@ -4109,7 +4114,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi32_epi64() { + const fn test_mm_maskz_cvtepi32_epi64() { let a = _mm_set_epi32(8, 9, 10, 11); let r = _mm_maskz_cvtepi32_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4119,7 +4124,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu32_epi64() { + const fn test_mm512_cvtepu32_epi64() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu32_epi64(a); let e = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); @@ -4127,7 +4132,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu32_epi64() { + const fn test_mm512_mask_cvtepu32_epi64() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_epi64(-1); let r = _mm512_mask_cvtepu32_epi64(src, 0, a); @@ -4138,7 +4143,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu32_epi64() { + const fn test_mm512_maskz_cvtepu32_epi64() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu32_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -4148,7 +4153,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepu32_epi64() { + const fn test_mm256_mask_cvtepu32_epi64() { let a = _mm_set_epi32(12, 13, 14, 15); let src = _mm256_set1_epi64x(-1); let r = _mm256_mask_cvtepu32_epi64(src, 0, a); @@ -4159,7 +4164,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu32_epi64() { + const fn test_mm256_maskz_cvtepu32_epi64() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm256_maskz_cvtepu32_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -4169,7 +4174,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepu32_epi64() { + const fn test_mm_mask_cvtepu32_epi64() { let a = _mm_set_epi32(12, 13, 14, 15); let src = _mm_set1_epi64x(-1); let r = _mm_mask_cvtepu32_epi64(src, 0, a); @@ -4180,7 +4185,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepu32_epi64() { + const fn test_mm_maskz_cvtepu32_epi64() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm_maskz_cvtepu32_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4190,7 +4195,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi32_pd() { + const fn test_mm512_cvtepi32_pd() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi32_pd(a); let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.); @@ -4198,7 +4203,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi32_pd() { + const fn test_mm512_mask_cvtepi32_pd() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_pd(-1.); let r = _mm512_mask_cvtepi32_pd(src, 0, a); @@ -4209,7 +4214,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi32_pd() { + const fn test_mm512_maskz_cvtepi32_pd() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi32_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -4219,7 +4224,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi32_pd() { + const fn test_mm256_mask_cvtepi32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let src = _mm256_set1_pd(-1.); let r = _mm256_mask_cvtepi32_pd(src, 0, a); @@ -4230,7 +4235,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi32_pd() { + const fn test_mm256_maskz_cvtepi32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm256_maskz_cvtepi32_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -4240,7 +4245,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi32_pd() { + const fn test_mm_mask_cvtepi32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let src = _mm_set1_pd(-1.); let r = _mm_mask_cvtepi32_pd(src, 0, a); @@ -4251,7 +4256,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi32_pd() { + const fn test_mm_maskz_cvtepi32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm_maskz_cvtepi32_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -4261,7 +4266,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu32_pd() { + const fn test_mm512_cvtepu32_pd() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu32_pd(a); let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.); @@ -4269,7 +4274,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu32_pd() { + const fn test_mm512_mask_cvtepu32_pd() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_pd(-1.); let r = _mm512_mask_cvtepu32_pd(src, 0, a); @@ -4280,7 +4285,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepu32_pd() { + const fn test_mm512_maskz_cvtepu32_pd() { let a = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepu32_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -4290,7 +4295,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtepu32_pd() { + const fn test_mm256_cvtepu32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm256_cvtepu32_pd(a); let e = _mm256_set_pd(12., 13., 14., 15.); @@ -4298,7 +4303,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepu32_pd() { + const fn test_mm256_mask_cvtepu32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let src = _mm256_set1_pd(-1.); let r = _mm256_mask_cvtepu32_pd(src, 0, a); @@ -4309,7 +4314,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepu32_pd() { + const fn test_mm256_maskz_cvtepu32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm256_maskz_cvtepu32_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -4319,7 +4324,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtepu32_pd() { + const fn test_mm_cvtepu32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm_cvtepu32_pd(a); let e = _mm_set_pd(14., 15.); @@ -4327,7 +4332,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepu32_pd() { + const fn test_mm_mask_cvtepu32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let src = _mm_set1_pd(-1.); let r = _mm_mask_cvtepu32_pd(src, 0, a); @@ -4338,7 +4343,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepu32_pd() { + const fn test_mm_maskz_cvtepu32_pd() { let a = _mm_set_epi32(12, 13, 14, 15); let r = _mm_maskz_cvtepu32_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -4348,7 +4353,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi32lo_pd() { + const fn test_mm512_cvtepi32lo_pd() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi32lo_pd(a); let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.); @@ -4356,7 +4361,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi32lo_pd() { + const fn test_mm512_mask_cvtepi32lo_pd() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_pd(-1.); let r = _mm512_mask_cvtepi32lo_pd(src, 0, a); @@ -4367,7 +4372,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepu32lo_pd() { + const fn test_mm512_cvtepu32lo_pd() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepu32lo_pd(a); let e = _mm512_set_pd(8., 9., 10., 11., 12., 13., 14., 15.); @@ -4375,7 +4380,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepu32lo_pd() { + const fn test_mm512_mask_cvtepu32lo_pd() { let a = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); let src = _mm512_set1_pd(-1.); let r = _mm512_mask_cvtepu32lo_pd(src, 0, a); @@ -4386,7 +4391,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi64_epi32() { + const fn test_mm512_cvtepi64_epi32() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi64_epi32(a); let e = _mm256_set_epi32(8, 9, 10, 11, 12, 13, 14, 15); @@ -4394,7 +4399,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi64_epi32() { + const fn test_mm512_mask_cvtepi64_epi32() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm256_set1_epi32(-1); let r = _mm512_mask_cvtepi64_epi32(src, 0, a); @@ -4405,7 +4410,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi64_epi32() { + const fn test_mm512_maskz_cvtepi64_epi32() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi64_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -4415,7 +4420,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtepi64_epi32() { + const fn test_mm256_cvtepi64_epi32() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_cvtepi64_epi32(a); let e = _mm_set_epi32(1, 2, 3, 4); @@ -4423,7 +4428,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi64_epi32() { + const fn test_mm256_mask_cvtepi64_epi32() { let a = _mm256_set_epi64x(1, 2, 3, 4); let src = _mm_set1_epi32(0); let r = _mm256_mask_cvtepi64_epi32(src, 0, a); @@ -4434,7 +4439,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi64_epi32() { + const fn test_mm256_maskz_cvtepi64_epi32() { let a = _mm256_set_epi64x(1, 2, 3, 4); let r = _mm256_maskz_cvtepi64_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4444,7 +4449,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtepi64_epi32() { + fn test_mm_cvtepi64_epi32() { let a = _mm_set_epi64x(3, 4); let r = _mm_cvtepi64_epi32(a); let e = _mm_set_epi32(0, 0, 3, 4); @@ -4452,7 +4457,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi64_epi32() { + fn test_mm_mask_cvtepi64_epi32() { let a = _mm_set_epi64x(3, 4); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtepi64_epi32(src, 0, a); @@ -4463,7 +4468,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi64_epi32() { + fn test_mm_maskz_cvtepi64_epi32() { let a = _mm_set_epi64x(3, 4); let r = _mm_maskz_cvtepi64_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4473,7 +4478,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi64_epi16() { + const fn test_mm512_cvtepi64_epi16() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi64_epi16(a); let e = _mm_set_epi16(8, 9, 10, 11, 12, 13, 14, 15); @@ -4481,7 +4486,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi64_epi16() { + const fn test_mm512_mask_cvtepi64_epi16() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set1_epi16(-1); let r = _mm512_mask_cvtepi64_epi16(src, 0, a); @@ -4492,7 +4497,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi64_epi16() { + const fn test_mm512_maskz_cvtepi64_epi16() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4502,7 +4507,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtepi64_epi16() { + fn test_mm256_cvtepi64_epi16() { let a = _mm256_set_epi64x(12, 13, 14, 15); let r = _mm256_cvtepi64_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 12, 13, 14, 15); @@ -4510,7 +4515,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi64_epi16() { + fn test_mm256_mask_cvtepi64_epi16() { let a = _mm256_set_epi64x(12, 13, 14, 15); let src = _mm_set1_epi16(0); let r = _mm256_mask_cvtepi64_epi16(src, 0, a); @@ -4521,7 +4526,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi64_epi16() { + fn test_mm256_maskz_cvtepi64_epi16() { let a = _mm256_set_epi64x(12, 13, 14, 15); let r = _mm256_maskz_cvtepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4531,7 +4536,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtepi64_epi16() { + fn test_mm_cvtepi64_epi16() { let a = _mm_set_epi64x(14, 15); let r = _mm_cvtepi64_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 14, 15); @@ -4539,7 +4544,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi64_epi16() { + fn test_mm_mask_cvtepi64_epi16() { let a = _mm_set_epi64x(14, 15); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtepi64_epi16(src, 0, a); @@ -4550,7 +4555,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi64_epi16() { + fn test_mm_maskz_cvtepi64_epi16() { let a = _mm_set_epi64x(14, 15); let r = _mm_maskz_cvtepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4560,7 +4565,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtepi64_epi8() { + fn test_mm512_cvtepi64_epi8() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_cvtepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15); @@ -4568,7 +4573,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtepi64_epi8() { + fn test_mm512_mask_cvtepi64_epi8() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1); let r = _mm512_mask_cvtepi64_epi8(src, 0, a); @@ -4579,7 +4584,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtepi64_epi8() { + fn test_mm512_maskz_cvtepi64_epi8() { let a = _mm512_set_epi64(8, 9, 10, 11, 12, 13, 14, 15); let r = _mm512_maskz_cvtepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4589,7 +4594,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtepi64_epi8() { + fn test_mm256_cvtepi64_epi8() { let a = _mm256_set_epi64x(12, 13, 14, 15); let r = _mm256_cvtepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15); @@ -4597,7 +4602,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtepi64_epi8() { + fn test_mm256_mask_cvtepi64_epi8() { let a = _mm256_set_epi64x(12, 13, 14, 15); let src = _mm_set1_epi8(0); let r = _mm256_mask_cvtepi64_epi8(src, 0, a); @@ -4608,7 +4613,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtepi64_epi8() { + fn test_mm256_maskz_cvtepi64_epi8() { let a = _mm256_set_epi64x(12, 13, 14, 15); let r = _mm256_maskz_cvtepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4618,7 +4623,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtepi64_epi8() { + fn test_mm_cvtepi64_epi8() { let a = _mm_set_epi64x(14, 15); let r = _mm_cvtepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15); @@ -4626,7 +4631,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtepi64_epi8() { + fn test_mm_mask_cvtepi64_epi8() { let a = _mm_set_epi64x(14, 15); let src = _mm_set1_epi8(0); let r = _mm_mask_cvtepi64_epi8(src, 0, a); @@ -4637,7 +4642,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtepi64_epi8() { + fn test_mm_maskz_cvtepi64_epi8() { let a = _mm_set_epi64x(14, 15); let r = _mm_maskz_cvtepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4647,7 +4652,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsepi64_epi32() { + fn test_mm512_cvtsepi64_epi32() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let r = _mm512_cvtsepi64_epi32(a); let e = _mm256_set_epi32(0, 1, 2, 3, 4, 5, i32::MIN, i32::MAX); @@ -4655,7 +4660,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtsepi64_epi32() { + fn test_mm512_mask_cvtsepi64_epi32() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let src = _mm256_set1_epi32(-1); let r = _mm512_mask_cvtsepi64_epi32(src, 0, a); @@ -4666,7 +4671,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtsepi64_epi32() { + fn test_mm512_maskz_cvtsepi64_epi32() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let r = _mm512_maskz_cvtsepi64_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -4676,7 +4681,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtsepi64_epi32() { + fn test_mm256_cvtsepi64_epi32() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let r = _mm256_cvtsepi64_epi32(a); let e = _mm_set_epi32(4, 5, i32::MIN, i32::MAX); @@ -4684,7 +4689,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtsepi64_epi32() { + fn test_mm256_mask_cvtsepi64_epi32() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let src = _mm_set1_epi32(-1); let r = _mm256_mask_cvtsepi64_epi32(src, 0, a); @@ -4695,7 +4700,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtsepi64_epi32() { + fn test_mm256_maskz_cvtsepi64_epi32() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let r = _mm256_maskz_cvtsepi64_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4705,7 +4710,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtsepi64_epi32() { + fn test_mm_cvtsepi64_epi32() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let r = _mm_cvtsepi64_epi32(a); let e = _mm_set_epi32(0, 0, i32::MIN, i32::MAX); @@ -4713,7 +4718,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtsepi64_epi32() { + fn test_mm_mask_cvtsepi64_epi32() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtsepi64_epi32(src, 0, a); @@ -4724,7 +4729,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtsepi64_epi32() { + fn test_mm_maskz_cvtsepi64_epi32() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let r = _mm_maskz_cvtsepi64_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4734,7 +4739,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsepi64_epi16() { + fn test_mm512_cvtsepi64_epi16() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let r = _mm512_cvtsepi64_epi16(a); let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, i16::MIN, i16::MAX); @@ -4742,7 +4747,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtsepi64_epi16() { + fn test_mm512_mask_cvtsepi64_epi16() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let src = _mm_set1_epi16(-1); let r = _mm512_mask_cvtsepi64_epi16(src, 0, a); @@ -4753,7 +4758,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtsepi64_epi16() { + fn test_mm512_maskz_cvtsepi64_epi16() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let r = _mm512_maskz_cvtsepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4763,7 +4768,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtsepi64_epi16() { + fn test_mm256_cvtsepi64_epi16() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let r = _mm256_cvtsepi64_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, i16::MIN, i16::MAX); @@ -4771,7 +4776,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtsepi64_epi16() { + fn test_mm256_mask_cvtsepi64_epi16() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let src = _mm_set1_epi16(0); let r = _mm256_mask_cvtsepi64_epi16(src, 0, a); @@ -4782,7 +4787,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtsepi64_epi16() { + fn test_mm256_maskz_cvtsepi64_epi16() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let r = _mm256_maskz_cvtsepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4792,7 +4797,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtsepi64_epi16() { + fn test_mm_cvtsepi64_epi16() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let r = _mm_cvtsepi64_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, i16::MIN, i16::MAX); @@ -4800,7 +4805,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtsepi64_epi16() { + fn test_mm_mask_cvtsepi64_epi16() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtsepi64_epi16(src, 0, a); @@ -4811,7 +4816,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtsepi64_epi16() { + fn test_mm_maskz_cvtsepi64_epi16() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let r = _mm_maskz_cvtsepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4821,7 +4826,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtsepi64_epi8() { + fn test_mm512_cvtsepi64_epi8() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let r = _mm512_cvtsepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, i8::MIN, i8::MAX); @@ -4829,7 +4834,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtsepi64_epi8() { + fn test_mm512_mask_cvtsepi64_epi8() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1); let r = _mm512_mask_cvtsepi64_epi8(src, 0, a); @@ -4846,7 +4851,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtsepi64_epi8() { + fn test_mm512_maskz_cvtsepi64_epi8() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MAX); let r = _mm512_maskz_cvtsepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4856,7 +4861,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtsepi64_epi8() { + fn test_mm256_cvtsepi64_epi8() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let r = _mm256_cvtsepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, i8::MIN, i8::MAX); @@ -4864,7 +4869,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtsepi64_epi8() { + fn test_mm256_mask_cvtsepi64_epi8() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let src = _mm_set1_epi8(0); let r = _mm256_mask_cvtsepi64_epi8(src, 0, a); @@ -4875,7 +4880,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtsepi64_epi8() { + fn test_mm256_maskz_cvtsepi64_epi8() { let a = _mm256_set_epi64x(4, 5, i64::MIN, i64::MAX); let r = _mm256_maskz_cvtsepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4885,7 +4890,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtsepi64_epi8() { + fn test_mm_cvtsepi64_epi8() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let r = _mm_cvtsepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i8::MIN, i8::MAX); @@ -4893,7 +4898,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtsepi64_epi8() { + fn test_mm_mask_cvtsepi64_epi8() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let src = _mm_set1_epi8(0); let r = _mm_mask_cvtsepi64_epi8(src, 0, a); @@ -4904,7 +4909,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtsepi64_epi8() { + fn test_mm_maskz_cvtsepi64_epi8() { let a = _mm_set_epi64x(i64::MIN, i64::MAX); let r = _mm_maskz_cvtsepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4914,7 +4919,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtusepi64_epi32() { + fn test_mm512_cvtusepi64_epi32() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let r = _mm512_cvtusepi64_epi32(a); let e = _mm256_set_epi32(0, 1, 2, 3, 4, 5, -1, -1); @@ -4922,7 +4927,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtusepi64_epi32() { + fn test_mm512_mask_cvtusepi64_epi32() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let src = _mm256_set1_epi32(-1); let r = _mm512_mask_cvtusepi64_epi32(src, 0, a); @@ -4933,7 +4938,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtusepi64_epi32() { + fn test_mm512_maskz_cvtusepi64_epi32() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let r = _mm512_maskz_cvtusepi64_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -4943,7 +4948,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtusepi64_epi32() { + fn test_mm256_cvtusepi64_epi32() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let r = _mm256_cvtusepi64_epi32(a); let e = _mm_set_epi32(4, 5, 6, u32::MAX as i32); @@ -4951,7 +4956,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtusepi64_epi32() { + fn test_mm256_mask_cvtusepi64_epi32() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let src = _mm_set1_epi32(0); let r = _mm256_mask_cvtusepi64_epi32(src, 0, a); @@ -4962,7 +4967,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtusepi64_epi32() { + fn test_mm256_maskz_cvtusepi64_epi32() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let r = _mm256_maskz_cvtusepi64_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -4972,7 +4977,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtusepi64_epi32() { + fn test_mm_cvtusepi64_epi32() { let a = _mm_set_epi64x(6, i64::MAX); let r = _mm_cvtusepi64_epi32(a); let e = _mm_set_epi32(0, 0, 6, u32::MAX as i32); @@ -4980,7 +4985,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtusepi64_epi32() { + fn test_mm_mask_cvtusepi64_epi32() { let a = _mm_set_epi64x(6, i64::MAX); let src = _mm_set1_epi32(0); let r = _mm_mask_cvtusepi64_epi32(src, 0, a); @@ -4991,7 +4996,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtusepi64_epi32() { + fn test_mm_maskz_cvtusepi64_epi32() { let a = _mm_set_epi64x(6, i64::MAX); let r = _mm_maskz_cvtusepi64_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5001,7 +5006,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtusepi64_epi16() { + fn test_mm512_cvtusepi64_epi16() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let r = _mm512_cvtusepi64_epi16(a); let e = _mm_set_epi16(0, 1, 2, 3, 4, 5, -1, -1); @@ -5009,7 +5014,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtusepi64_epi16() { + fn test_mm512_mask_cvtusepi64_epi16() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let src = _mm_set1_epi16(-1); let r = _mm512_mask_cvtusepi64_epi16(src, 0, a); @@ -5020,7 +5025,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtusepi64_epi16() { + fn test_mm512_maskz_cvtusepi64_epi16() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let r = _mm512_maskz_cvtusepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5030,7 +5035,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtusepi64_epi16() { + fn test_mm256_cvtusepi64_epi16() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let r = _mm256_cvtusepi64_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 4, 5, 6, u16::MAX as i16); @@ -5038,7 +5043,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtusepi64_epi16() { + fn test_mm256_mask_cvtusepi64_epi16() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let src = _mm_set1_epi16(0); let r = _mm256_mask_cvtusepi64_epi16(src, 0, a); @@ -5049,7 +5054,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtusepi64_epi16() { + fn test_mm256_maskz_cvtusepi64_epi16() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let r = _mm256_maskz_cvtusepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5059,7 +5064,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtusepi64_epi16() { + fn test_mm_cvtusepi64_epi16() { let a = _mm_set_epi64x(6, i64::MAX); let r = _mm_cvtusepi64_epi16(a); let e = _mm_set_epi16(0, 0, 0, 0, 0, 0, 6, u16::MAX as i16); @@ -5067,7 +5072,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtusepi64_epi16() { + fn test_mm_mask_cvtusepi64_epi16() { let a = _mm_set_epi64x(6, i64::MAX); let src = _mm_set1_epi16(0); let r = _mm_mask_cvtusepi64_epi16(src, 0, a); @@ -5078,7 +5083,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtusepi64_epi16() { + fn test_mm_maskz_cvtusepi64_epi16() { let a = _mm_set_epi64x(6, i64::MAX); let r = _mm_maskz_cvtusepi64_epi16(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5088,7 +5093,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtusepi64_epi8() { + fn test_mm512_cvtusepi64_epi8() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let r = _mm512_cvtusepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, -1, -1); @@ -5096,7 +5101,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtusepi64_epi8() { + fn test_mm512_mask_cvtusepi64_epi8() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let src = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1); let r = _mm512_mask_cvtusepi64_epi8(src, 0, a); @@ -5107,7 +5112,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtusepi64_epi8() { + fn test_mm512_maskz_cvtusepi64_epi8() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, i64::MIN, i64::MIN); let r = _mm512_maskz_cvtusepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5117,7 +5122,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvtusepi64_epi8() { + fn test_mm256_cvtusepi64_epi8() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let r = _mm256_cvtusepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, u8::MAX as i8); @@ -5125,7 +5130,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvtusepi64_epi8() { + fn test_mm256_mask_cvtusepi64_epi8() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let src = _mm_set1_epi8(0); let r = _mm256_mask_cvtusepi64_epi8(src, 0, a); @@ -5136,7 +5141,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvtusepi64_epi8() { + fn test_mm256_maskz_cvtusepi64_epi8() { let a = _mm256_set_epi64x(4, 5, 6, i64::MAX); let r = _mm256_maskz_cvtusepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5146,7 +5151,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvtusepi64_epi8() { + fn test_mm_cvtusepi64_epi8() { let a = _mm_set_epi64x(6, i64::MAX); let r = _mm_cvtusepi64_epi8(a); let e = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, u8::MAX as i8); @@ -5154,7 +5159,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvtusepi64_epi8() { + fn test_mm_mask_cvtusepi64_epi8() { let a = _mm_set_epi64x(6, i64::MAX); let src = _mm_set1_epi8(0); let r = _mm_mask_cvtusepi64_epi8(src, 0, a); @@ -5165,7 +5170,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvtusepi64_epi8() { + fn test_mm_maskz_cvtusepi64_epi8() { let a = _mm_set_epi64x(6, i64::MAX); let r = _mm_maskz_cvtusepi64_epi8(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5175,7 +5180,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtt_roundpd_epi32() { + fn test_mm512_cvtt_roundpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(a); let e = _mm256_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7); @@ -5183,7 +5188,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtt_roundpd_epi32() { + fn test_mm512_mask_cvtt_roundpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -5194,7 +5199,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtt_roundpd_epi32() { + fn test_mm512_maskz_cvtt_roundpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvtt_roundpd_epi32::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -5204,7 +5209,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvtt_roundpd_epu32() { + fn test_mm512_cvtt_roundpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(a); let e = _mm256_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1); @@ -5212,7 +5217,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvtt_roundpd_epu32() { + fn test_mm512_mask_cvtt_roundpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(src, 0, a); @@ -5223,7 +5228,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvtt_roundpd_epu32() { + fn test_mm512_maskz_cvtt_roundpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvtt_roundpd_epu32::<_MM_FROUND_NO_EXC>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -5233,7 +5238,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvttpd_epi32() { + fn test_mm512_cvttpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvttpd_epi32(a); let e = _mm256_setr_epi32(0, -1, 2, -3, 4, -5, 6, -7); @@ -5241,7 +5246,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvttpd_epi32() { + fn test_mm512_mask_cvttpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvttpd_epi32(src, 0, a); @@ -5252,7 +5257,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvttpd_epi32() { + fn test_mm512_maskz_cvttpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvttpd_epi32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -5262,7 +5267,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvttpd_epi32() { + fn test_mm256_mask_cvttpd_epi32() { let a = _mm256_setr_pd(4., -5.5, 6., -7.5); let src = _mm_set1_epi32(0); let r = _mm256_mask_cvttpd_epi32(src, 0, a); @@ -5273,7 +5278,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvttpd_epi32() { + fn test_mm256_maskz_cvttpd_epi32() { let a = _mm256_setr_pd(4., -5.5, 6., -7.5); let r = _mm256_maskz_cvttpd_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5283,7 +5288,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvttpd_epi32() { + fn test_mm_mask_cvttpd_epi32() { let a = _mm_set_pd(6., -7.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvttpd_epi32(src, 0, a); @@ -5294,7 +5299,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvttpd_epi32() { + fn test_mm_maskz_cvttpd_epi32() { let a = _mm_set_pd(6., -7.5); let r = _mm_maskz_cvttpd_epi32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5304,7 +5309,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvttpd_epu32() { + fn test_mm512_cvttpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvttpd_epu32(a); let e = _mm256_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1); @@ -5312,7 +5317,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvttpd_epu32() { + fn test_mm512_mask_cvttpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvttpd_epu32(src, 0, a); @@ -5323,7 +5328,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvttpd_epu32() { + fn test_mm512_maskz_cvttpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvttpd_epu32(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -5333,7 +5338,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cvttpd_epu32() { + fn test_mm256_cvttpd_epu32() { let a = _mm256_set_pd(4., 5.5, 6., 7.5); let r = _mm256_cvttpd_epu32(a); let e = _mm_set_epi32(4, 5, 6, 7); @@ -5341,7 +5346,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cvttpd_epu32() { + fn test_mm256_mask_cvttpd_epu32() { let a = _mm256_set_pd(4., 5.5, 6., 7.5); let src = _mm_set1_epi32(0); let r = _mm256_mask_cvttpd_epu32(src, 0, a); @@ -5352,7 +5357,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_cvttpd_epu32() { + fn test_mm256_maskz_cvttpd_epu32() { let a = _mm256_set_pd(4., 5.5, 6., 7.5); let r = _mm256_maskz_cvttpd_epu32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5362,7 +5367,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cvttpd_epu32() { + fn test_mm_cvttpd_epu32() { let a = _mm_set_pd(6., 7.5); let r = _mm_cvttpd_epu32(a); let e = _mm_set_epi32(0, 0, 6, 7); @@ -5370,7 +5375,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cvttpd_epu32() { + fn test_mm_mask_cvttpd_epu32() { let a = _mm_set_pd(6., 7.5); let src = _mm_set1_epi32(0); let r = _mm_mask_cvttpd_epu32(src, 0, a); @@ -5381,7 +5386,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_cvttpd_epu32() { + fn test_mm_maskz_cvttpd_epu32() { let a = _mm_set_pd(6., 7.5); let r = _mm_maskz_cvttpd_epu32(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -5391,7 +5396,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_add_round_pd() { + fn test_mm512_add_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007); let b = _mm512_set1_pd(-1.); let r = _mm512_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -5403,7 +5408,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_add_round_pd() { + fn test_mm512_mask_add_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007); let b = _mm512_set1_pd(-1.); let r = _mm512_mask_add_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -5418,7 +5423,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_add_round_pd() { + fn test_mm512_maskz_add_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007); let b = _mm512_set1_pd(-1.); let r = @@ -5432,7 +5437,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sub_round_pd() { + fn test_mm512_sub_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007); let b = _mm512_set1_pd(1.); let r = _mm512_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -5444,7 +5449,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sub_round_pd() { + fn test_mm512_mask_sub_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007); let b = _mm512_set1_pd(1.); let r = _mm512_mask_sub_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -5459,7 +5464,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sub_round_pd() { + fn test_mm512_maskz_sub_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.000000000000000007); let b = _mm512_set1_pd(1.); let r = @@ -5473,7 +5478,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mul_round_pd() { + fn test_mm512_mul_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.); let b = _mm512_set1_pd(0.1); let r = _mm512_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -5494,7 +5499,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_mul_round_pd() { + fn test_mm512_mask_mul_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.); let b = _mm512_set1_pd(0.1); let r = _mm512_mask_mul_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -5518,7 +5523,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_mul_round_pd() { + fn test_mm512_maskz_mul_round_pd() { let a = _mm512_setr_pd(8., 9.5, 10., 11.5, 12., 13.5, 14., 0.); let b = _mm512_set1_pd(0.1); let r = @@ -5541,7 +5546,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_div_round_pd() { + fn test_mm512_div_round_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -5553,7 +5558,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_div_round_pd() { + fn test_mm512_mask_div_round_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_mask_div_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -5577,7 +5582,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_div_round_pd() { + fn test_mm512_maskz_div_round_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = @@ -5600,7 +5605,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sqrt_round_pd() { + fn test_mm512_sqrt_round_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); let e = _mm512_set1_pd(1.7320508075688772); @@ -5611,7 +5616,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sqrt_round_pd() { + fn test_mm512_mask_sqrt_round_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_mask_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 0, a); @@ -5633,7 +5638,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sqrt_round_pd() { + fn test_mm512_maskz_sqrt_round_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_maskz_sqrt_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(0, a); @@ -5655,7 +5660,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmadd_round_pd() { + fn test_mm512_fmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5668,7 +5673,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmadd_round_pd() { + fn test_mm512_mask_fmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5693,7 +5698,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmadd_round_pd() { + fn test_mm512_maskz_fmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5709,7 +5714,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmadd_round_pd() { + fn test_mm512_mask3_fmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5725,7 +5730,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsub_round_pd() { + fn test_mm512_fmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -5738,7 +5743,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsub_round_pd() { + fn test_mm512_mask_fmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -5763,7 +5768,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsub_round_pd() { + fn test_mm512_maskz_fmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -5779,7 +5784,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsub_round_pd() { + fn test_mm512_mask3_fmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -5795,7 +5800,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmaddsub_round_pd() { + fn test_mm512_fmaddsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5818,7 +5823,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmaddsub_round_pd() { + fn test_mm512_mask_fmaddsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5843,7 +5848,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmaddsub_round_pd() { + fn test_mm512_maskz_fmaddsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5859,7 +5864,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmaddsub_round_pd() { + fn test_mm512_mask3_fmaddsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5875,7 +5880,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fmsubadd_round_pd() { + fn test_mm512_fmsubadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5898,7 +5903,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fmsubadd_round_pd() { + fn test_mm512_mask_fmsubadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5923,7 +5928,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fmsubadd_round_pd() { + fn test_mm512_maskz_fmsubadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5939,7 +5944,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fmsubadd_round_pd() { + fn test_mm512_mask3_fmsubadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -5955,7 +5960,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmadd_round_pd() { + fn test_mm512_fnmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -5969,7 +5974,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmadd_round_pd() { + fn test_mm512_mask_fnmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -5994,7 +5999,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmadd_round_pd() { + fn test_mm512_maskz_fnmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -6010,7 +6015,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmadd_round_pd() { + fn test_mm512_mask3_fnmadd_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(1.); @@ -6026,7 +6031,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fnmsub_round_pd() { + fn test_mm512_fnmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -6040,7 +6045,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fnmsub_round_pd() { + fn test_mm512_mask_fnmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -6065,7 +6070,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fnmsub_round_pd() { + fn test_mm512_maskz_fnmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -6081,7 +6086,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask3_fnmsub_round_pd() { + fn test_mm512_mask3_fnmsub_round_pd() { let a = _mm512_set1_pd(0.000000000000000007); let b = _mm512_set1_pd(1.); let c = _mm512_set1_pd(-1.); @@ -6097,7 +6102,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_max_round_pd() { + fn test_mm512_max_round_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -6106,7 +6111,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_max_round_pd() { + fn test_mm512_mask_max_round_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_mask_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -6117,7 +6122,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_max_round_pd() { + fn test_mm512_maskz_max_round_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_maskz_max_round_pd::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -6128,7 +6133,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_min_round_pd() { + fn test_mm512_min_round_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, b); @@ -6137,7 +6142,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_min_round_pd() { + fn test_mm512_mask_min_round_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_mask_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a, b); @@ -6148,7 +6153,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_min_round_pd() { + fn test_mm512_maskz_min_round_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_setr_pd(7., 6., 5., 4., 3., 2., 1., 0.); let r = _mm512_maskz_min_round_pd::<_MM_FROUND_CUR_DIRECTION>(0, a, b); @@ -6159,7 +6164,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getexp_round_pd() { + fn test_mm512_getexp_round_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm512_set1_pd(1.); @@ -6167,7 +6172,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getexp_round_pd() { + fn test_mm512_mask_getexp_round_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_mask_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(a, 0, a); assert_eq_m512d(r, a); @@ -6177,7 +6182,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getexp_round_pd() { + fn test_mm512_maskz_getexp_round_pd() { let a = _mm512_set1_pd(3.); let r = _mm512_maskz_getexp_round_pd::<_MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -6187,7 +6192,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_roundscale_round_pd() { + fn test_mm512_roundscale_round_pd() { let a = _mm512_set1_pd(1.1); let r = _mm512_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(a); let e = _mm512_set1_pd(1.0); @@ -6195,7 +6200,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_roundscale_round_pd() { + fn test_mm512_mask_roundscale_round_pd() { let a = _mm512_set1_pd(1.1); let r = _mm512_mask_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(a, 0, a); let e = _mm512_set1_pd(1.1); @@ -6206,7 +6211,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_roundscale_round_pd() { + fn test_mm512_maskz_roundscale_round_pd() { let a = _mm512_set1_pd(1.1); let r = _mm512_maskz_roundscale_round_pd::<0, _MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -6216,7 +6221,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_scalef_round_pd() { + fn test_mm512_scalef_round_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, b); @@ -6225,7 +6230,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_scalef_round_pd() { + fn test_mm512_mask_scalef_round_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_mask_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -6240,7 +6245,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_scalef_round_pd() { + fn test_mm512_maskz_scalef_round_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(3.); let r = _mm512_maskz_scalef_round_pd::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>( @@ -6255,7 +6260,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_fixupimm_round_pd() { + fn test_mm512_fixupimm_round_pd() { let a = _mm512_set1_pd(f64::NAN); let b = _mm512_set1_pd(f64::MAX); let c = _mm512_set1_epi64(i32::MAX as i64); @@ -6265,7 +6270,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_fixupimm_round_pd() { + fn test_mm512_mask_fixupimm_round_pd() { let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.); let b = _mm512_set1_pd(f64::MAX); let c = _mm512_set1_epi64(i32::MAX as i64); @@ -6275,7 +6280,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_fixupimm_round_pd() { + fn test_mm512_maskz_fixupimm_round_pd() { let a = _mm512_set_pd(f64::NAN, f64::NAN, f64::NAN, f64::NAN, 1., 1., 1., 1.); let b = _mm512_set1_pd(f64::MAX); let c = _mm512_set1_epi64(i32::MAX as i64); @@ -6285,7 +6290,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_getmant_round_pd() { + fn test_mm512_getmant_round_pd() { let a = _mm512_set1_pd(10.); let r = _mm512_getmant_round_pd::< _MM_MANT_NORM_1_2, @@ -6297,7 +6302,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_getmant_round_pd() { + fn test_mm512_mask_getmant_round_pd() { let a = _mm512_set1_pd(10.); let r = _mm512_mask_getmant_round_pd::< _MM_MANT_NORM_1_2, @@ -6315,7 +6320,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_getmant_round_pd() { + fn test_mm512_maskz_getmant_round_pd() { let a = _mm512_set1_pd(10.); let r = _mm512_maskz_getmant_round_pd::< _MM_MANT_NORM_1_2, @@ -6333,7 +6338,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundps_pd() { + fn test_mm512_cvt_roundps_pd() { let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); @@ -6341,7 +6346,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundps_pd() { + fn test_mm512_mask_cvt_roundps_pd() { let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm512_set1_pd(0.); let r = _mm512_mask_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(src, 0, a); @@ -6352,7 +6357,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundps_pd() { + fn test_mm512_maskz_cvt_roundps_pd() { let a = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvt_roundps_pd::<_MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -6362,7 +6367,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundpd_ps() { + fn test_mm512_cvt_roundpd_ps() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm256_setr_ps(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); @@ -6370,7 +6375,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundpd_ps() { + fn test_mm512_mask_cvt_roundpd_ps() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_ps(0.); let r = _mm512_mask_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(src, 0, a); @@ -6381,7 +6386,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundpd_ps() { + fn test_mm512_maskz_cvt_roundpd_ps() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvt_roundpd_ps::<_MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m256(r, _mm256_setzero_ps()); @@ -6391,7 +6396,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundpd_epi32() { + fn test_mm512_cvt_roundpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm256_setr_epi32(0, -2, 2, -4, 4, -6, 6, -8); @@ -6399,7 +6404,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundpd_epi32() { + fn test_mm512_mask_cvt_roundpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(src, 0, a); @@ -6410,7 +6415,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundpd_epi32() { + fn test_mm512_maskz_cvt_roundpd_epi32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvt_roundpd_epi32::<_MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -6420,7 +6425,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cvt_roundpd_epu32() { + fn test_mm512_cvt_roundpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(a); let e = _mm256_setr_epi32(0, -1, 2, -1, 4, -1, 6, -1); @@ -6428,7 +6433,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cvt_roundpd_epu32() { + fn test_mm512_mask_cvt_roundpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let src = _mm256_set1_epi32(0); let r = _mm512_mask_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(src, 0, a); @@ -6439,7 +6444,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_cvt_roundpd_epu32() { + fn test_mm512_maskz_cvt_roundpd_epu32() { let a = _mm512_setr_pd(0., -1.5, 2., -3.5, 4., -5.5, 6., -7.5); let r = _mm512_maskz_cvt_roundpd_epu32::<_MM_FROUND_CUR_DIRECTION>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -6449,48 +6454,48 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setzero_pd() { + const fn test_mm512_setzero_pd() { assert_eq_m512d(_mm512_setzero_pd(), _mm512_set1_pd(0.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set1_epi64() { + const fn test_mm512_set1_epi64() { let r = _mm512_set_epi64(2, 2, 2, 2, 2, 2, 2, 2); assert_eq_m512i(r, _mm512_set1_epi64(2)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set1_pd() { + const fn test_mm512_set1_pd() { let expected = _mm512_set_pd(2., 2., 2., 2., 2., 2., 2., 2.); assert_eq_m512d(expected, _mm512_set1_pd(2.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set4_epi64() { + const fn test_mm512_set4_epi64() { let r = _mm512_set_epi64(4, 3, 2, 1, 4, 3, 2, 1); assert_eq_m512i(r, _mm512_set4_epi64(4, 3, 2, 1)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set4_pd() { + const fn test_mm512_set4_pd() { let r = _mm512_set_pd(4., 3., 2., 1., 4., 3., 2., 1.); assert_eq_m512d(r, _mm512_set4_pd(4., 3., 2., 1.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr4_epi64() { + const fn test_mm512_setr4_epi64() { let r = _mm512_set_epi64(4, 3, 2, 1, 4, 3, 2, 1); assert_eq_m512i(r, _mm512_setr4_epi64(1, 2, 3, 4)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr4_pd() { + const fn test_mm512_setr4_pd() { let r = _mm512_set_pd(4., 3., 2., 1., 4., 3., 2., 1.); assert_eq_m512d(r, _mm512_setr4_pd(1., 2., 3., 4.)); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmplt_pd_mask() { + fn test_mm512_cmplt_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6499,7 +6504,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmplt_pd_mask() { + fn test_mm512_mask_cmplt_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6509,7 +6514,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpnlt_pd_mask() { + fn test_mm512_cmpnlt_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6517,7 +6522,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpnlt_pd_mask() { + fn test_mm512_mask_cmpnlt_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6526,7 +6531,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmple_pd_mask() { + fn test_mm512_cmple_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6534,7 +6539,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmple_pd_mask() { + fn test_mm512_mask_cmple_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6543,7 +6548,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpnle_pd_mask() { + fn test_mm512_cmpnle_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6552,7 +6557,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpnle_pd_mask() { + fn test_mm512_mask_cmpnle_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., f64::MAX, f64::NAN, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6562,7 +6567,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpeq_pd_mask() { + fn test_mm512_cmpeq_pd_mask() { let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.); let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.); let m = _mm512_cmpeq_pd_mask(b, a); @@ -6570,7 +6575,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpeq_pd_mask() { + fn test_mm512_mask_cmpeq_pd_mask() { let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.); let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.); let mask = 0b01111010; @@ -6579,7 +6584,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpneq_pd_mask() { + fn test_mm512_cmpneq_pd_mask() { let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.); let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.); let m = _mm512_cmpneq_pd_mask(b, a); @@ -6587,7 +6592,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpneq_pd_mask() { + fn test_mm512_mask_cmpneq_pd_mask() { let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, f64::NAN, -100.); let b = _mm512_set_pd(0., 1., 13., 42., f64::MAX, f64::MIN, f64::NAN, -100.); let mask = 0b01111010; @@ -6596,7 +6601,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_pd_mask() { + fn test_mm512_cmp_pd_mask() { let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); let m = _mm512_cmp_pd_mask::<_CMP_LT_OQ>(a, b); @@ -6604,7 +6609,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_pd_mask() { + fn test_mm512_mask_cmp_pd_mask() { let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); let mask = 0b01100110; @@ -6613,7 +6618,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmp_pd_mask() { + fn test_mm256_cmp_pd_mask() { let a = _mm256_set_pd(0., 1., -1., 13.); let b = _mm256_set1_pd(1.); let m = _mm256_cmp_pd_mask::<_CMP_LT_OQ>(a, b); @@ -6621,7 +6626,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmp_pd_mask() { + fn test_mm256_mask_cmp_pd_mask() { let a = _mm256_set_pd(0., 1., -1., 13.); let b = _mm256_set1_pd(1.); let mask = 0b11111111; @@ -6630,7 +6635,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmp_pd_mask() { + fn test_mm_cmp_pd_mask() { let a = _mm_set_pd(0., 1.); let b = _mm_set1_pd(1.); let m = _mm_cmp_pd_mask::<_CMP_LT_OQ>(a, b); @@ -6638,7 +6643,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmp_pd_mask() { + fn test_mm_mask_cmp_pd_mask() { let a = _mm_set_pd(0., 1.); let b = _mm_set1_pd(1.); let mask = 0b11111111; @@ -6647,7 +6652,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_round_pd_mask() { + fn test_mm512_cmp_round_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6656,7 +6661,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_round_pd_mask() { + fn test_mm512_mask_cmp_round_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(0., 1., -1., 13., f64::MAX, f64::MIN, 100., -100.); let b = _mm512_set1_pd(-1.); @@ -6666,7 +6671,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpord_pd_mask() { + fn test_mm512_cmpord_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.); #[rustfmt::skip] @@ -6676,7 +6681,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpord_pd_mask() { + fn test_mm512_mask_cmpord_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.); #[rustfmt::skip] @@ -6687,7 +6692,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpunord_pd_mask() { + fn test_mm512_cmpunord_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.); #[rustfmt::skip] @@ -6698,7 +6703,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpunord_pd_mask() { + fn test_mm512_mask_cmpunord_pd_mask() { #[rustfmt::skip] let a = _mm512_set_pd(f64::NAN, f64::MAX, f64::NAN, f64::MIN, f64::NAN, -1., f64::NAN, 0.); #[rustfmt::skip] @@ -6709,7 +6714,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmplt_epu64_mask() { + const fn test_mm512_cmplt_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let m = _mm512_cmplt_epu64_mask(a, b); @@ -6717,7 +6722,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmplt_epu64_mask() { + const fn test_mm512_mask_cmplt_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01111010; @@ -6726,7 +6731,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmplt_epu64_mask() { + const fn test_mm256_cmplt_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, 100); let b = _mm256_set1_epi64x(2); let r = _mm256_cmplt_epu64_mask(a, b); @@ -6734,7 +6739,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epu64_mask() { + const fn test_mm256_mask_cmplt_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, 100); let b = _mm256_set1_epi64x(2); let mask = 0b11111111; @@ -6743,7 +6748,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmplt_epu64_mask() { + const fn test_mm_cmplt_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(2); let r = _mm_cmplt_epu64_mask(a, b); @@ -6751,7 +6756,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmplt_epu64_mask() { + const fn test_mm_mask_cmplt_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(2); let mask = 0b11111111; @@ -6760,7 +6765,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpgt_epu64_mask() { + const fn test_mm512_cmpgt_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let m = _mm512_cmpgt_epu64_mask(b, a); @@ -6768,7 +6773,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpgt_epu64_mask() { + const fn test_mm512_mask_cmpgt_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01111010; @@ -6777,7 +6782,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpgt_epu64_mask() { + const fn test_mm256_cmpgt_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set1_epi64x(1); let r = _mm256_cmpgt_epu64_mask(a, b); @@ -6785,7 +6790,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epu64_mask() { + const fn test_mm256_mask_cmpgt_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, 3); let b = _mm256_set1_epi64x(1); let mask = 0b11111111; @@ -6794,7 +6799,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpgt_epu64_mask() { + const fn test_mm_cmpgt_epu64_mask() { let a = _mm_set_epi64x(1, 2); let b = _mm_set1_epi64x(1); let r = _mm_cmpgt_epu64_mask(a, b); @@ -6802,7 +6807,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epu64_mask() { + const fn test_mm_mask_cmpgt_epu64_mask() { let a = _mm_set_epi64x(1, 2); let b = _mm_set1_epi64x(1); let mask = 0b11111111; @@ -6811,7 +6816,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmple_epu64_mask() { + const fn test_mm512_cmple_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); assert_eq!( @@ -6821,7 +6826,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmple_epu64_mask() { + const fn test_mm512_mask_cmple_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01111010; @@ -6829,7 +6834,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmple_epu64_mask() { + const fn test_mm256_cmple_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, 1); let b = _mm256_set1_epi64x(1); let r = _mm256_cmple_epu64_mask(a, b); @@ -6837,7 +6842,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmple_epu64_mask() { + const fn test_mm256_mask_cmple_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, 1); let b = _mm256_set1_epi64x(1); let mask = 0b11111111; @@ -6846,7 +6851,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmple_epu64_mask() { + const fn test_mm_cmple_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let r = _mm_cmple_epu64_mask(a, b); @@ -6854,7 +6859,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmple_epu64_mask() { + const fn test_mm_mask_cmple_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let mask = 0b11111111; @@ -6863,7 +6868,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpge_epu64_mask() { + const fn test_mm512_cmpge_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); assert_eq!( @@ -6873,7 +6878,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpge_epu64_mask() { + const fn test_mm512_mask_cmpge_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b11111111; @@ -6882,7 +6887,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpge_epu64_mask() { + const fn test_mm256_cmpge_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, u64::MAX as i64); let b = _mm256_set1_epi64x(1); let r = _mm256_cmpge_epu64_mask(a, b); @@ -6890,7 +6895,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epu64_mask() { + const fn test_mm256_mask_cmpge_epu64_mask() { let a = _mm256_set_epi64x(0, 1, 2, u64::MAX as i64); let b = _mm256_set1_epi64x(1); let mask = 0b11111111; @@ -6899,7 +6904,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpge_epu64_mask() { + const fn test_mm_cmpge_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let r = _mm_cmpge_epu64_mask(a, b); @@ -6907,7 +6912,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpge_epu64_mask() { + const fn test_mm_mask_cmpge_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let mask = 0b11111111; @@ -6916,7 +6921,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpeq_epu64_mask() { + const fn test_mm512_cmpeq_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let m = _mm512_cmpeq_epu64_mask(b, a); @@ -6924,7 +6929,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpeq_epu64_mask() { + const fn test_mm512_mask_cmpeq_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let mask = 0b01111010; @@ -6933,7 +6938,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpeq_epu64_mask() { + const fn test_mm256_cmpeq_epu64_mask() { let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64); let b = _mm256_set_epi64x(0, 1, 13, 42); let m = _mm256_cmpeq_epu64_mask(b, a); @@ -6941,7 +6946,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epu64_mask() { + const fn test_mm256_mask_cmpeq_epu64_mask() { let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64); let b = _mm256_set_epi64x(0, 1, 13, 42); let mask = 0b11111111; @@ -6950,7 +6955,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpeq_epu64_mask() { + const fn test_mm_cmpeq_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(0, 1); let m = _mm_cmpeq_epu64_mask(b, a); @@ -6958,7 +6963,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epu64_mask() { + const fn test_mm_mask_cmpeq_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(0, 1); let mask = 0b11111111; @@ -6967,7 +6972,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpneq_epu64_mask() { + const fn test_mm512_cmpneq_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let m = _mm512_cmpneq_epu64_mask(b, a); @@ -6975,7 +6980,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpneq_epu64_mask() { + const fn test_mm512_mask_cmpneq_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, -100, 100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let mask = 0b01111010; @@ -6984,7 +6989,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpneq_epu64_mask() { + const fn test_mm256_cmpneq_epu64_mask() { let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64); let b = _mm256_set_epi64x(0, 1, 13, 42); let r = _mm256_cmpneq_epu64_mask(b, a); @@ -6992,7 +6997,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epu64_mask() { + const fn test_mm256_mask_cmpneq_epu64_mask() { let a = _mm256_set_epi64x(0, 1, -1, u64::MAX as i64); let b = _mm256_set_epi64x(0, 1, 13, 42); let mask = 0b11111111; @@ -7001,7 +7006,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpneq_epu64_mask() { + const fn test_mm_cmpneq_epu64_mask() { let a = _mm_set_epi64x(-1, u64::MAX as i64); let b = _mm_set_epi64x(13, 42); let r = _mm_cmpneq_epu64_mask(b, a); @@ -7009,7 +7014,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epu64_mask() { + const fn test_mm_mask_cmpneq_epu64_mask() { let a = _mm_set_epi64x(-1, u64::MAX as i64); let b = _mm_set_epi64x(13, 42); let mask = 0b11111111; @@ -7018,7 +7023,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_epu64_mask() { + const fn test_mm512_cmp_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let m = _mm512_cmp_epu64_mask::<_MM_CMPINT_LT>(a, b); @@ -7026,7 +7031,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_epu64_mask() { + const fn test_mm512_mask_cmp_epu64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01111010; @@ -7035,7 +7040,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmp_epu64_mask() { + const fn test_mm256_cmp_epu64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 100); let b = _mm256_set1_epi64x(1); let m = _mm256_cmp_epu64_mask::<_MM_CMPINT_LT>(a, b); @@ -7043,7 +7048,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmp_epu64_mask() { + const fn test_mm256_mask_cmp_epu64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 100); let b = _mm256_set1_epi64x(1); let mask = 0b11111111; @@ -7052,7 +7057,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmp_epu64_mask() { + const fn test_mm_cmp_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let m = _mm_cmp_epu64_mask::<_MM_CMPINT_LT>(a, b); @@ -7060,7 +7065,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmp_epu64_mask() { + const fn test_mm_mask_cmp_epu64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let mask = 0b11111111; @@ -7069,7 +7074,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmplt_epi64_mask() { + const fn test_mm512_cmplt_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let m = _mm512_cmplt_epi64_mask(a, b); @@ -7077,7 +7082,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmplt_epi64_mask() { + const fn test_mm512_mask_cmplt_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01100110; @@ -7086,7 +7091,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmplt_epi64_mask() { + const fn test_mm256_cmplt_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, -13); let b = _mm256_set1_epi64x(-1); let r = _mm256_cmplt_epi64_mask(a, b); @@ -7094,7 +7099,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmplt_epi64_mask() { + const fn test_mm256_mask_cmplt_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, -13); let b = _mm256_set1_epi64x(-1); let mask = 0b11111111; @@ -7103,7 +7108,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmplt_epi64_mask() { + const fn test_mm_cmplt_epi64_mask() { let a = _mm_set_epi64x(-1, -13); let b = _mm_set1_epi64x(-1); let r = _mm_cmplt_epi64_mask(a, b); @@ -7111,7 +7116,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmplt_epi64_mask() { + const fn test_mm_mask_cmplt_epi64_mask() { let a = _mm_set_epi64x(-1, -13); let b = _mm_set1_epi64x(-1); let mask = 0b11111111; @@ -7120,7 +7125,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpgt_epi64_mask() { + const fn test_mm512_cmpgt_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let m = _mm512_cmpgt_epi64_mask(b, a); @@ -7128,7 +7133,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpgt_epi64_mask() { + const fn test_mm512_mask_cmpgt_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01100110; @@ -7137,7 +7142,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpgt_epi64_mask() { + const fn test_mm256_cmpgt_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set1_epi64x(-1); let r = _mm256_cmpgt_epi64_mask(a, b); @@ -7145,7 +7150,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpgt_epi64_mask() { + const fn test_mm256_mask_cmpgt_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set1_epi64x(-1); let mask = 0b11111111; @@ -7154,7 +7159,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpgt_epi64_mask() { + const fn test_mm_cmpgt_epi64_mask() { let a = _mm_set_epi64x(0, -1); let b = _mm_set1_epi64x(-1); let r = _mm_cmpgt_epi64_mask(a, b); @@ -7162,7 +7167,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpgt_epi64_mask() { + const fn test_mm_mask_cmpgt_epi64_mask() { let a = _mm_set_epi64x(0, -1); let b = _mm_set1_epi64x(-1); let mask = 0b11111111; @@ -7171,7 +7176,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmple_epi64_mask() { + const fn test_mm512_cmple_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); assert_eq!( @@ -7181,7 +7186,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmple_epi64_mask() { + const fn test_mm512_mask_cmple_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01111010; @@ -7189,7 +7194,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmple_epi64_mask() { + const fn test_mm256_cmple_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, i64::MAX); let b = _mm256_set1_epi64x(-1); let r = _mm256_cmple_epi64_mask(a, b); @@ -7197,7 +7202,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmple_epi64_mask() { + const fn test_mm256_mask_cmple_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, i64::MAX); let b = _mm256_set1_epi64x(-1); let mask = 0b11111111; @@ -7206,7 +7211,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmple_epi64_mask() { + const fn test_mm_cmple_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let r = _mm_cmple_epi64_mask(a, b); @@ -7214,7 +7219,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmple_epi64_mask() { + const fn test_mm_mask_cmple_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let mask = 0b11111111; @@ -7223,7 +7228,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpge_epi64_mask() { + const fn test_mm512_cmpge_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); assert_eq!( @@ -7233,7 +7238,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpge_epi64_mask() { + const fn test_mm512_mask_cmpge_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b11111111; @@ -7242,7 +7247,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpge_epi64_mask() { + const fn test_mm256_cmpge_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, i64::MAX); let b = _mm256_set1_epi64x(-1); let r = _mm256_cmpge_epi64_mask(a, b); @@ -7250,7 +7255,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpge_epi64_mask() { + const fn test_mm256_mask_cmpge_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, i64::MAX); let b = _mm256_set1_epi64x(-1); let mask = 0b11111111; @@ -7259,7 +7264,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpge_epi64_mask() { + const fn test_mm_cmpge_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(-1); let r = _mm_cmpge_epi64_mask(a, b); @@ -7267,7 +7272,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpge_epi64_mask() { + const fn test_mm_mask_cmpge_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(-1); let mask = 0b11111111; @@ -7276,7 +7281,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpeq_epi64_mask() { + const fn test_mm512_cmpeq_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let m = _mm512_cmpeq_epi64_mask(b, a); @@ -7284,7 +7289,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpeq_epi64_mask() { + const fn test_mm512_mask_cmpeq_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let mask = 0b01111010; @@ -7293,7 +7298,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpeq_epi64_mask() { + const fn test_mm256_cmpeq_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set_epi64x(0, 1, 13, 42); let m = _mm256_cmpeq_epi64_mask(b, a); @@ -7301,7 +7306,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpeq_epi64_mask() { + const fn test_mm256_mask_cmpeq_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set_epi64x(0, 1, 13, 42); let mask = 0b11111111; @@ -7310,7 +7315,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpeq_epi64_mask() { + const fn test_mm_cmpeq_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(0, 1); let m = _mm_cmpeq_epi64_mask(b, a); @@ -7318,7 +7323,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpeq_epi64_mask() { + const fn test_mm_mask_cmpeq_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set_epi64x(0, 1); let mask = 0b11111111; @@ -7327,19 +7332,19 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_set_epi64() { + const fn test_mm512_set_epi64() { let r = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); assert_eq_m512i(r, _mm512_set_epi64(7, 6, 5, 4, 3, 2, 1, 0)) } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_setr_epi64() { + const fn test_mm512_setr_epi64() { let r = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); assert_eq_m512i(r, _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0)) } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmpneq_epi64_mask() { + const fn test_mm512_cmpneq_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let m = _mm512_cmpneq_epi64_mask(b, a); @@ -7347,7 +7352,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmpneq_epi64_mask() { + const fn test_mm512_mask_cmpneq_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, -100, 100); let b = _mm512_set_epi64(0, 1, 13, 42, i64::MAX, i64::MIN, 100, -100); let mask = 0b01111010; @@ -7356,7 +7361,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmpneq_epi64_mask() { + const fn test_mm256_cmpneq_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set_epi64x(0, 1, 13, 42); let r = _mm256_cmpneq_epi64_mask(b, a); @@ -7364,7 +7369,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmpneq_epi64_mask() { + const fn test_mm256_mask_cmpneq_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set_epi64x(0, 1, 13, 42); let mask = 0b11111111; @@ -7373,7 +7378,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmpneq_epi64_mask() { + const fn test_mm_cmpneq_epi64_mask() { let a = _mm_set_epi64x(-1, 13); let b = _mm_set_epi64x(13, 42); let r = _mm_cmpneq_epi64_mask(b, a); @@ -7381,7 +7386,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmpneq_epi64_mask() { + const fn test_mm_mask_cmpneq_epi64_mask() { let a = _mm_set_epi64x(-1, 13); let b = _mm_set_epi64x(13, 42); let mask = 0b11111111; @@ -7390,7 +7395,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_cmp_epi64_mask() { + const fn test_mm512_cmp_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let m = _mm512_cmp_epi64_mask::<_MM_CMPINT_LT>(a, b); @@ -7398,7 +7403,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_cmp_epi64_mask() { + const fn test_mm512_mask_cmp_epi64_mask() { let a = _mm512_set_epi64(0, 1, -1, 13, i64::MAX, i64::MIN, 100, -100); let b = _mm512_set1_epi64(-1); let mask = 0b01100110; @@ -7407,7 +7412,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_cmp_epi64_mask() { + const fn test_mm256_cmp_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set1_epi64x(1); let m = _mm256_cmp_epi64_mask::<_MM_CMPINT_LT>(a, b); @@ -7415,7 +7420,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_cmp_epi64_mask() { + const fn test_mm256_mask_cmp_epi64_mask() { let a = _mm256_set_epi64x(0, 1, -1, 13); let b = _mm256_set1_epi64x(1); let mask = 0b11111111; @@ -7424,7 +7429,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_cmp_epi64_mask() { + const fn test_mm_cmp_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let m = _mm_cmp_epi64_mask::<_MM_CMPINT_LT>(a, b); @@ -7432,7 +7437,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_cmp_epi64_mask() { + const fn test_mm_mask_cmp_epi64_mask() { let a = _mm_set_epi64x(0, 1); let b = _mm_set1_epi64x(1); let mask = 0b11111111; @@ -8313,7 +8318,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rol_epi64() { + const fn test_mm512_rol_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 63, 1 << 32, 1 << 32, 1 << 32, @@ -8329,7 +8334,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rol_epi64() { + const fn test_mm512_mask_rol_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 63, 1 << 32, 1 << 32, 1 << 32, @@ -8347,7 +8352,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rol_epi64() { + const fn test_mm512_maskz_rol_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8361,7 +8366,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rol_epi64() { + const fn test_mm256_rol_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_rol_epi64::<1>(a); let e = _mm256_set_epi64x(1 << 0, 1 << 33, 1 << 33, 1 << 33); @@ -8369,7 +8374,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rol_epi64() { + const fn test_mm256_mask_rol_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_mask_rol_epi64::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -8379,7 +8384,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rol_epi64() { + const fn test_mm256_maskz_rol_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_maskz_rol_epi64::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -8389,7 +8394,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rol_epi64() { + const fn test_mm_rol_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let r = _mm_rol_epi64::<1>(a); let e = _mm_set_epi64x(1 << 0, 1 << 33); @@ -8397,7 +8402,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rol_epi64() { + const fn test_mm_mask_rol_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let r = _mm_mask_rol_epi64::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -8407,7 +8412,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rol_epi64() { + const fn test_mm_maskz_rol_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let r = _mm_maskz_rol_epi64::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -8417,7 +8422,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_ror_epi64() { + const fn test_mm512_ror_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 0, 1 << 32, 1 << 32, 1 << 32, @@ -8433,7 +8438,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_ror_epi64() { + const fn test_mm512_mask_ror_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 0, 1 << 32, 1 << 32, 1 << 32, @@ -8451,7 +8456,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_ror_epi64() { + const fn test_mm512_maskz_ror_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8465,7 +8470,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_ror_epi64() { + const fn test_mm256_ror_epi64() { let a = _mm256_set_epi64x(1 << 0, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_ror_epi64::<1>(a); let e = _mm256_set_epi64x(1 << 63, 1 << 31, 1 << 31, 1 << 31); @@ -8473,7 +8478,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_ror_epi64() { + const fn test_mm256_mask_ror_epi64() { let a = _mm256_set_epi64x(1 << 0, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_mask_ror_epi64::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -8483,7 +8488,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_ror_epi64() { + const fn test_mm256_maskz_ror_epi64() { let a = _mm256_set_epi64x(1 << 0, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_maskz_ror_epi64::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -8493,7 +8498,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_ror_epi64() { + const fn test_mm_ror_epi64() { let a = _mm_set_epi64x(1 << 0, 1 << 32); let r = _mm_ror_epi64::<1>(a); let e = _mm_set_epi64x(1 << 63, 1 << 31); @@ -8501,7 +8506,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_ror_epi64() { + const fn test_mm_mask_ror_epi64() { let a = _mm_set_epi64x(1 << 0, 1 << 32); let r = _mm_mask_ror_epi64::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -8511,7 +8516,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_ror_epi64() { + const fn test_mm_maskz_ror_epi64() { let a = _mm_set_epi64x(1 << 0, 1 << 32); let r = _mm_maskz_ror_epi64::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -8521,7 +8526,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_slli_epi64() { + const fn test_mm512_slli_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 63, 1 << 32, 1 << 32, 1 << 32, @@ -8537,7 +8542,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_slli_epi64() { + const fn test_mm512_mask_slli_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 63, 1 << 32, 1 << 32, 1 << 32, @@ -8555,7 +8560,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_slli_epi64() { + const fn test_mm512_maskz_slli_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8569,7 +8574,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_slli_epi64() { + const fn test_mm256_mask_slli_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_mask_slli_epi64::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -8579,7 +8584,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_slli_epi64() { + const fn test_mm256_maskz_slli_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let r = _mm256_maskz_slli_epi64::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -8589,7 +8594,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_slli_epi64() { + const fn test_mm_mask_slli_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let r = _mm_mask_slli_epi64::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -8599,7 +8604,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_slli_epi64() { + const fn test_mm_maskz_slli_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let r = _mm_maskz_slli_epi64::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -8609,7 +8614,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srli_epi64() { + const fn test_mm512_srli_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 0, 1 << 32, 1 << 32, 1 << 32, @@ -8625,7 +8630,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srli_epi64() { + const fn test_mm512_mask_srli_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 0, 1 << 32, 1 << 32, 1 << 32, @@ -8643,7 +8648,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srli_epi64() { + const fn test_mm512_maskz_srli_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8657,7 +8662,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srli_epi64() { + const fn test_mm256_mask_srli_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let r = _mm256_mask_srli_epi64::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -8667,7 +8672,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srli_epi64() { + const fn test_mm256_maskz_srli_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let r = _mm256_maskz_srli_epi64::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -8677,7 +8682,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srli_epi64() { + const fn test_mm_mask_srli_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let r = _mm_mask_srli_epi64::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -8687,7 +8692,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srli_epi64() { + const fn test_mm_maskz_srli_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let r = _mm_maskz_srli_epi64::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -8697,7 +8702,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rolv_epi64() { + const fn test_mm512_rolv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 63, 1 << 32, 1 << 32, @@ -8714,7 +8719,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rolv_epi64() { + const fn test_mm512_mask_rolv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 63, 1 << 32, 1 << 32, @@ -8733,7 +8738,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rolv_epi64() { + const fn test_mm512_maskz_rolv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8748,7 +8753,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rolv_epi64() { + const fn test_mm256_rolv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 32, 1 << 32); let b = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_rolv_epi64(a, b); @@ -8757,7 +8762,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rolv_epi64() { + const fn test_mm256_mask_rolv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 32, 1 << 32); let b = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_mask_rolv_epi64(a, 0, a, b); @@ -8768,7 +8773,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rolv_epi64() { + const fn test_mm256_maskz_rolv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 63, 1 << 32, 1 << 32); let b = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_maskz_rolv_epi64(0, a, b); @@ -8779,7 +8784,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rolv_epi64() { + const fn test_mm_rolv_epi64() { let a = _mm_set_epi64x(1 << 32, 1 << 63); let b = _mm_set_epi64x(0, 1); let r = _mm_rolv_epi64(a, b); @@ -8788,7 +8793,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rolv_epi64() { + const fn test_mm_mask_rolv_epi64() { let a = _mm_set_epi64x(1 << 32, 1 << 63); let b = _mm_set_epi64x(0, 1); let r = _mm_mask_rolv_epi64(a, 0, a, b); @@ -8799,7 +8804,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rolv_epi64() { + const fn test_mm_maskz_rolv_epi64() { let a = _mm_set_epi64x(1 << 32, 1 << 63); let b = _mm_set_epi64x(0, 1); let r = _mm_maskz_rolv_epi64(0, a, b); @@ -8810,7 +8815,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_rorv_epi64() { + const fn test_mm512_rorv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 0, 1 << 32, 1 << 32, @@ -8827,7 +8832,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_rorv_epi64() { + const fn test_mm512_mask_rorv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 0, 1 << 32, 1 << 32, @@ -8846,7 +8851,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_rorv_epi64() { + const fn test_mm512_maskz_rorv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8861,7 +8866,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_rorv_epi64() { + const fn test_mm256_rorv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 32, 1 << 32); let b = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_rorv_epi64(a, b); @@ -8870,7 +8875,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_rorv_epi64() { + const fn test_mm256_mask_rorv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 32, 1 << 32); let b = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_mask_rorv_epi64(a, 0, a, b); @@ -8881,7 +8886,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_rorv_epi64() { + const fn test_mm256_maskz_rorv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 0, 1 << 32, 1 << 32); let b = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_maskz_rorv_epi64(0, a, b); @@ -8892,7 +8897,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_rorv_epi64() { + const fn test_mm_rorv_epi64() { let a = _mm_set_epi64x(1 << 32, 1 << 0); let b = _mm_set_epi64x(0, 1); let r = _mm_rorv_epi64(a, b); @@ -8901,7 +8906,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_rorv_epi64() { + const fn test_mm_mask_rorv_epi64() { let a = _mm_set_epi64x(1 << 32, 1 << 0); let b = _mm_set_epi64x(0, 1); let r = _mm_mask_rorv_epi64(a, 0, a, b); @@ -8912,7 +8917,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_rorv_epi64() { + const fn test_mm_maskz_rorv_epi64() { let a = _mm_set_epi64x(1 << 32, 1 << 0); let b = _mm_set_epi64x(0, 1); let r = _mm_maskz_rorv_epi64(0, a, b); @@ -8923,7 +8928,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sllv_epi64() { + const fn test_mm512_sllv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 63, 1 << 32, 1 << 32, @@ -8940,7 +8945,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sllv_epi64() { + const fn test_mm512_mask_sllv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 63, 1 << 32, @@ -8959,7 +8964,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sllv_epi64() { + const fn test_mm512_maskz_sllv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -8974,7 +8979,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sllv_epi64() { + const fn test_mm256_mask_sllv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 32, 1 << 63, 1 << 32); let count = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_mask_sllv_epi64(a, 0, a, count); @@ -8985,7 +8990,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sllv_epi64() { + const fn test_mm256_maskz_sllv_epi64() { let a = _mm256_set_epi64x(1 << 32, 1 << 32, 1 << 63, 1 << 32); let count = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_maskz_sllv_epi64(0, a, count); @@ -8996,7 +9001,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sllv_epi64() { + const fn test_mm_mask_sllv_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let count = _mm_set_epi64x(2, 3); let r = _mm_mask_sllv_epi64(a, 0, a, count); @@ -9007,7 +9012,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sllv_epi64() { + const fn test_mm_maskz_sllv_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let count = _mm_set_epi64x(2, 3); let r = _mm_maskz_sllv_epi64(0, a, count); @@ -9018,7 +9023,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srlv_epi64() { + const fn test_mm512_srlv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 0, 1 << 32, 1 << 32, @@ -9035,7 +9040,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srlv_epi64() { + const fn test_mm512_mask_srlv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 0, 1 << 32, 1 << 32, @@ -9054,7 +9059,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srlv_epi64() { + const fn test_mm512_maskz_srlv_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -9069,7 +9074,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srlv_epi64() { + const fn test_mm256_mask_srlv_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm256_set1_epi64x(1); let r = _mm256_mask_srlv_epi64(a, 0, a, count); @@ -9080,7 +9085,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srlv_epi64() { + const fn test_mm256_maskz_srlv_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm256_set1_epi64x(1); let r = _mm256_maskz_srlv_epi64(0, a, count); @@ -9091,7 +9096,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srlv_epi64() { + const fn test_mm_mask_srlv_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set1_epi64x(1); let r = _mm_mask_srlv_epi64(a, 0, a, count); @@ -9102,7 +9107,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srlv_epi64() { + const fn test_mm_maskz_srlv_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set1_epi64x(1); let r = _mm_maskz_srlv_epi64(0, a, count); @@ -9113,7 +9118,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sll_epi64() { + fn test_mm512_sll_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 63, 1 << 32, 1 << 32, 1 << 32, @@ -9133,7 +9138,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sll_epi64() { + fn test_mm512_mask_sll_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 63, 1 << 32, 1 << 32, 1 << 32, @@ -9152,7 +9157,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sll_epi64() { + fn test_mm512_maskz_sll_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -9167,7 +9172,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sll_epi64() { + fn test_mm256_mask_sll_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let count = _mm_set_epi64x(0, 1); let r = _mm256_mask_sll_epi64(a, 0, a, count); @@ -9178,7 +9183,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sll_epi64() { + fn test_mm256_maskz_sll_epi64() { let a = _mm256_set_epi64x(1 << 63, 1 << 32, 1 << 32, 1 << 32); let count = _mm_set_epi64x(0, 1); let r = _mm256_maskz_sll_epi64(0, a, count); @@ -9189,7 +9194,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sll_epi64() { + fn test_mm_mask_sll_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let count = _mm_set_epi64x(0, 1); let r = _mm_mask_sll_epi64(a, 0, a, count); @@ -9200,7 +9205,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sll_epi64() { + fn test_mm_maskz_sll_epi64() { let a = _mm_set_epi64x(1 << 63, 1 << 32); let count = _mm_set_epi64x(0, 1); let r = _mm_maskz_sll_epi64(0, a, count); @@ -9211,7 +9216,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srl_epi64() { + fn test_mm512_srl_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 0, 1 << 32, 1 << 32, 1 << 32, @@ -9228,7 +9233,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srl_epi64() { + fn test_mm512_mask_srl_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 0, 1 << 32, 1 << 32, 1 << 32, @@ -9247,7 +9252,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srl_epi64() { + fn test_mm512_maskz_srl_epi64() { #[rustfmt::skip] let a = _mm512_set_epi64( 1 << 32, 1 << 32, 1 << 32, 1 << 32, @@ -9262,7 +9267,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srl_epi64() { + fn test_mm256_mask_srl_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm_set_epi64x(0, 1); let r = _mm256_mask_srl_epi64(a, 0, a, count); @@ -9273,7 +9278,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srl_epi64() { + fn test_mm256_maskz_srl_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm_set_epi64x(0, 1); let r = _mm256_maskz_srl_epi64(0, a, count); @@ -9284,7 +9289,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srl_epi64() { + fn test_mm_mask_srl_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set_epi64x(0, 1); let r = _mm_mask_srl_epi64(a, 0, a, count); @@ -9295,7 +9300,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srl_epi64() { + fn test_mm_maskz_srl_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set_epi64x(0, 1); let r = _mm_maskz_srl_epi64(0, a, count); @@ -9306,7 +9311,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_sra_epi64() { + fn test_mm512_sra_epi64() { let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16); let count = _mm_set_epi64x(0, 2); let r = _mm512_sra_epi64(a, count); @@ -9315,7 +9320,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_sra_epi64() { + fn test_mm512_mask_sra_epi64() { let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16); let count = _mm_set_epi64x(0, 2); let r = _mm512_mask_sra_epi64(a, 0, a, count); @@ -9326,7 +9331,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_sra_epi64() { + fn test_mm512_maskz_sra_epi64() { let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16); let count = _mm_set_epi64x(0, 2); let r = _mm512_maskz_sra_epi64(0, a, count); @@ -9337,7 +9342,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_sra_epi64() { + fn test_mm256_sra_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm_set_epi64x(0, 1); let r = _mm256_sra_epi64(a, count); @@ -9346,7 +9351,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_sra_epi64() { + fn test_mm256_mask_sra_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm_set_epi64x(0, 1); let r = _mm256_mask_sra_epi64(a, 0, a, count); @@ -9357,7 +9362,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_sra_epi64() { + fn test_mm256_maskz_sra_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm_set_epi64x(0, 1); let r = _mm256_maskz_sra_epi64(0, a, count); @@ -9368,7 +9373,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_sra_epi64() { + fn test_mm_sra_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set_epi64x(0, 1); let r = _mm_sra_epi64(a, count); @@ -9377,7 +9382,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_sra_epi64() { + fn test_mm_mask_sra_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set_epi64x(0, 1); let r = _mm_mask_sra_epi64(a, 0, a, count); @@ -9388,7 +9393,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_sra_epi64() { + fn test_mm_maskz_sra_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set_epi64x(0, 1); let r = _mm_maskz_sra_epi64(0, a, count); @@ -9399,7 +9404,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srav_epi64() { + const fn test_mm512_srav_epi64() { let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16); let count = _mm512_set_epi64(2, 2, 0, 0, 0, 0, 2, 1); let r = _mm512_srav_epi64(a, count); @@ -9408,7 +9413,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srav_epi64() { + const fn test_mm512_mask_srav_epi64() { let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16); let count = _mm512_set_epi64(2, 2, 0, 0, 0, 0, 2, 1); let r = _mm512_mask_srav_epi64(a, 0, a, count); @@ -9419,7 +9424,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srav_epi64() { + const fn test_mm512_maskz_srav_epi64() { let a = _mm512_set_epi64(1, -8, 0, 0, 0, 0, 15, -16); let count = _mm512_set_epi64(2, 2, 0, 0, 0, 0, 2, 1); let r = _mm512_maskz_srav_epi64(0, a, count); @@ -9430,7 +9435,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_srav_epi64() { + const fn test_mm256_srav_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm256_set1_epi64x(1); let r = _mm256_srav_epi64(a, count); @@ -9439,7 +9444,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srav_epi64() { + const fn test_mm256_mask_srav_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm256_set1_epi64x(1); let r = _mm256_mask_srav_epi64(a, 0, a, count); @@ -9450,7 +9455,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srav_epi64() { + const fn test_mm256_maskz_srav_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let count = _mm256_set1_epi64x(1); let r = _mm256_maskz_srav_epi64(0, a, count); @@ -9461,7 +9466,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_srav_epi64() { + const fn test_mm_srav_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set1_epi64x(1); let r = _mm_srav_epi64(a, count); @@ -9470,7 +9475,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srav_epi64() { + const fn test_mm_mask_srav_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set1_epi64x(1); let r = _mm_mask_srav_epi64(a, 0, a, count); @@ -9481,7 +9486,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srav_epi64() { + const fn test_mm_maskz_srav_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let count = _mm_set1_epi64x(1); let r = _mm_maskz_srav_epi64(0, a, count); @@ -9492,7 +9497,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_srai_epi64() { + const fn test_mm512_srai_epi64() { let a = _mm512_set_epi64(1, -4, 15, 0, 0, 0, 0, -16); let r = _mm512_srai_epi64::<2>(a); let e = _mm512_set_epi64(0, -1, 3, 0, 0, 0, 0, -4); @@ -9500,7 +9505,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_srai_epi64() { + const fn test_mm512_mask_srai_epi64() { let a = _mm512_set_epi64(1, -4, 15, 0, 0, 0, 0, -16); let r = _mm512_mask_srai_epi64::<2>(a, 0, a); assert_eq_m512i(r, a); @@ -9510,7 +9515,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_srai_epi64() { + const fn test_mm512_maskz_srai_epi64() { let a = _mm512_set_epi64(1, -4, 15, 0, 0, 0, 0, -16); let r = _mm512_maskz_srai_epi64::<2>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -9520,7 +9525,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_srai_epi64() { + const fn test_mm256_srai_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let r = _mm256_srai_epi64::<1>(a); let e = _mm256_set_epi64x(1 << 4, 0, 0, 0); @@ -9528,7 +9533,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_srai_epi64() { + const fn test_mm256_mask_srai_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let r = _mm256_mask_srai_epi64::<1>(a, 0, a); assert_eq_m256i(r, a); @@ -9538,7 +9543,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_srai_epi64() { + const fn test_mm256_maskz_srai_epi64() { let a = _mm256_set_epi64x(1 << 5, 0, 0, 0); let r = _mm256_maskz_srai_epi64::<1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -9548,7 +9553,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_srai_epi64() { + const fn test_mm_srai_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let r = _mm_srai_epi64::<1>(a); let e = _mm_set_epi64x(1 << 4, 0); @@ -9556,7 +9561,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_srai_epi64() { + const fn test_mm_mask_srai_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let r = _mm_mask_srai_epi64::<1>(a, 0, a); assert_eq_m128i(r, a); @@ -9566,7 +9571,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_srai_epi64() { + const fn test_mm_maskz_srai_epi64() { let a = _mm_set_epi64x(1 << 5, 0); let r = _mm_maskz_srai_epi64::<1>(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -9576,7 +9581,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permute_pd() { + const fn test_mm512_permute_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_permute_pd::<0b11_11_11_11>(a); let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.); @@ -9584,7 +9589,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permute_pd() { + const fn test_mm512_mask_permute_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_mask_permute_pd::<0b11_11_11_11>(a, 0, a); assert_eq_m512d(r, a); @@ -9594,7 +9599,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permute_pd() { + const fn test_mm512_maskz_permute_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_maskz_permute_pd::<0b11_11_11_11>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -9604,7 +9609,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permute_pd() { + const fn test_mm256_mask_permute_pd() { let a = _mm256_set_pd(3., 2., 1., 0.); let r = _mm256_mask_permute_pd::<0b11_11>(a, 0, a); assert_eq_m256d(r, a); @@ -9614,7 +9619,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permute_pd() { + const fn test_mm256_maskz_permute_pd() { let a = _mm256_set_pd(3., 2., 1., 0.); let r = _mm256_maskz_permute_pd::<0b11_11>(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -9624,7 +9629,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permute_pd() { + const fn test_mm_mask_permute_pd() { let a = _mm_set_pd(1., 0.); let r = _mm_mask_permute_pd::<0b11>(a, 0, a); assert_eq_m128d(r, a); @@ -9634,7 +9639,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permute_pd() { + const fn test_mm_maskz_permute_pd() { let a = _mm_set_pd(1., 0.); let r = _mm_maskz_permute_pd::<0b11>(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -9644,7 +9649,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutex_epi64() { + const fn test_mm512_permutex_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_permutex_epi64::<0b11_11_11_11>(a); let e = _mm512_setr_epi64(3, 3, 3, 3, 7, 7, 7, 7); @@ -9652,7 +9657,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutex_epi64() { + const fn test_mm512_mask_permutex_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_mask_permutex_epi64::<0b11_11_11_11>(a, 0, a); assert_eq_m512i(r, a); @@ -9662,7 +9667,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutex_epi64() { + const fn test_mm512_maskz_permutex_epi64() { let a = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_maskz_permutex_epi64::<0b11_11_11_11>(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -9672,7 +9677,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutex_epi64() { + const fn test_mm256_permutex_epi64() { let a = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_permutex_epi64::<0b11_11_11_11>(a); let e = _mm256_set_epi64x(3, 3, 3, 3); @@ -9680,7 +9685,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutex_epi64() { + const fn test_mm256_mask_permutex_epi64() { let a = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_mask_permutex_epi64::<0b11_11_11_11>(a, 0, a); assert_eq_m256i(r, a); @@ -9690,7 +9695,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutex_epi64() { + const fn test_mm256_maskz_permutex_epi64() { let a = _mm256_set_epi64x(3, 2, 1, 0); let r = _mm256_maskz_permutex_epi64::<0b11_11_11_11>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -9700,7 +9705,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutex_pd() { + const fn test_mm512_permutex_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_permutex_pd::<0b11_11_11_11>(a); let e = _mm512_setr_pd(3., 3., 3., 3., 7., 7., 7., 7.); @@ -9708,7 +9713,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutex_pd() { + const fn test_mm512_mask_permutex_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_mask_permutex_pd::<0b11_11_11_11>(a, 0, a); assert_eq_m512d(r, a); @@ -9718,7 +9723,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutex_pd() { + const fn test_mm512_maskz_permutex_pd() { let a = _mm512_setr_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_maskz_permutex_pd::<0b11_11_11_11>(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -9728,7 +9733,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutex_pd() { + const fn test_mm256_permutex_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_permutex_pd::<0b11_11_11_11>(a); let e = _mm256_set_pd(0., 0., 0., 0.); @@ -9736,7 +9741,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutex_pd() { + const fn test_mm256_mask_permutex_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_mask_permutex_pd::<0b11_11_11_11>(a, 0, a); assert_eq_m256d(r, a); @@ -9746,7 +9751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutex_pd() { + const fn test_mm256_maskz_permutex_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_maskz_permutex_pd::<0b11_11_11_11>(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -9756,7 +9761,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutevar_pd() { + fn test_mm512_permutevar_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_set1_epi64(0b1); let r = _mm512_permutevar_pd(a, b); @@ -9765,7 +9770,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutevar_pd() { + fn test_mm512_mask_permutevar_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_set1_epi64(0b1); let r = _mm512_mask_permutevar_pd(a, 0, a, b); @@ -9776,7 +9781,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutevar_pd() { + fn test_mm512_maskz_permutevar_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let b = _mm512_set1_epi64(0b1); let r = _mm512_maskz_permutevar_pd(0, a, b); @@ -9787,7 +9792,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutevar_pd() { + fn test_mm256_mask_permutevar_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let b = _mm256_set1_epi64x(0b1); let r = _mm256_mask_permutevar_pd(a, 0, a, b); @@ -9798,7 +9803,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutevar_pd() { + fn test_mm256_maskz_permutevar_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let b = _mm256_set1_epi64x(0b1); let r = _mm256_maskz_permutevar_pd(0, a, b); @@ -9809,7 +9814,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permutevar_pd() { + fn test_mm_mask_permutevar_pd() { let a = _mm_set_pd(0., 1.); let b = _mm_set1_epi64x(0b1); let r = _mm_mask_permutevar_pd(a, 0, a, b); @@ -9820,7 +9825,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permutevar_pd() { + fn test_mm_maskz_permutevar_pd() { let a = _mm_set_pd(0., 1.); let b = _mm_set1_epi64x(0b1); let r = _mm_maskz_permutevar_pd(0, a, b); @@ -9831,7 +9836,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutexvar_epi64() { + fn test_mm512_permutexvar_epi64() { let idx = _mm512_set1_epi64(1); let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_permutexvar_epi64(idx, a); @@ -9840,7 +9845,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutexvar_epi64() { + fn test_mm512_mask_permutexvar_epi64() { let idx = _mm512_set1_epi64(1); let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_mask_permutexvar_epi64(a, 0, idx, a); @@ -9851,7 +9856,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutexvar_epi64() { + fn test_mm512_maskz_permutexvar_epi64() { let idx = _mm512_set1_epi64(1); let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_maskz_permutexvar_epi64(0, idx, a); @@ -9862,7 +9867,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutexvar_epi64() { + fn test_mm256_permutexvar_epi64() { let idx = _mm256_set1_epi64x(1); let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_permutexvar_epi64(idx, a); @@ -9871,7 +9876,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutexvar_epi64() { + fn test_mm256_mask_permutexvar_epi64() { let idx = _mm256_set1_epi64x(1); let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_mask_permutexvar_epi64(a, 0, idx, a); @@ -9882,7 +9887,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutexvar_epi64() { + fn test_mm256_maskz_permutexvar_epi64() { let idx = _mm256_set1_epi64x(1); let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_maskz_permutexvar_epi64(0, idx, a); @@ -9893,7 +9898,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutexvar_pd() { + fn test_mm512_permutexvar_pd() { let idx = _mm512_set1_epi64(1); let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_permutexvar_pd(idx, a); @@ -9902,7 +9907,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutexvar_pd() { + fn test_mm512_mask_permutexvar_pd() { let idx = _mm512_set1_epi64(1); let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_mask_permutexvar_pd(a, 0, idx, a); @@ -9913,7 +9918,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutexvar_pd() { + fn test_mm512_maskz_permutexvar_pd() { let idx = _mm512_set1_epi64(1); let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_maskz_permutexvar_pd(0, idx, a); @@ -9924,7 +9929,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutexvar_pd() { + fn test_mm256_permutexvar_pd() { let idx = _mm256_set1_epi64x(1); let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_permutexvar_pd(idx, a); @@ -9933,7 +9938,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutexvar_pd() { + fn test_mm256_mask_permutexvar_pd() { let idx = _mm256_set1_epi64x(1); let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_mask_permutexvar_pd(a, 0, idx, a); @@ -9944,7 +9949,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutexvar_pd() { + fn test_mm256_maskz_permutexvar_pd() { let idx = _mm256_set1_epi64x(1); let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_maskz_permutexvar_pd(0, idx, a); @@ -9955,7 +9960,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutex2var_epi64() { + fn test_mm512_permutex2var_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_epi64(100); @@ -9965,7 +9970,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutex2var_epi64() { + fn test_mm512_mask_permutex2var_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_epi64(100); @@ -9977,7 +9982,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutex2var_epi64() { + fn test_mm512_maskz_permutex2var_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_epi64(100); @@ -9989,7 +9994,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask2_permutex2var_epi64() { + fn test_mm512_mask2_permutex2var_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let idx = _mm512_set_epi64(1000, 1 << 3, 2000, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_epi64(100); @@ -10001,7 +10006,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutex2var_epi64() { + fn test_mm256_permutex2var_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_epi64x(100); @@ -10011,7 +10016,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutex2var_epi64() { + fn test_mm256_mask_permutex2var_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_epi64x(100); @@ -10023,7 +10028,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutex2var_epi64() { + fn test_mm256_maskz_permutex2var_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_epi64x(100); @@ -10035,7 +10040,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask2_permutex2var_epi64() { + fn test_mm256_mask2_permutex2var_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_epi64x(100); @@ -10047,7 +10052,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_permutex2var_epi64() { + fn test_mm_permutex2var_epi64() { let a = _mm_set_epi64x(0, 1); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_epi64x(100); @@ -10057,7 +10062,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permutex2var_epi64() { + fn test_mm_mask_permutex2var_epi64() { let a = _mm_set_epi64x(0, 1); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_epi64x(100); @@ -10069,7 +10074,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permutex2var_epi64() { + fn test_mm_maskz_permutex2var_epi64() { let a = _mm_set_epi64x(0, 1); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_epi64x(100); @@ -10081,7 +10086,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask2_permutex2var_epi64() { + fn test_mm_mask2_permutex2var_epi64() { let a = _mm_set_epi64x(0, 1); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_epi64x(100); @@ -10093,7 +10098,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_permutex2var_pd() { + fn test_mm512_permutex2var_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_pd(100.); @@ -10103,7 +10108,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_permutex2var_pd() { + fn test_mm512_mask_permutex2var_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_pd(100.); @@ -10115,7 +10120,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_permutex2var_pd() { + fn test_mm512_maskz_permutex2var_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_pd(100.); @@ -10127,7 +10132,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask2_permutex2var_pd() { + fn test_mm512_mask2_permutex2var_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let idx = _mm512_set_epi64(1, 1 << 3, 2, 1 << 3, 3, 1 << 3, 4, 1 << 3); let b = _mm512_set1_pd(100.); @@ -10139,7 +10144,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_permutex2var_pd() { + fn test_mm256_permutex2var_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_pd(100.); @@ -10149,7 +10154,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_permutex2var_pd() { + fn test_mm256_mask_permutex2var_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_pd(100.); @@ -10161,7 +10166,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_permutex2var_pd() { + fn test_mm256_maskz_permutex2var_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_pd(100.); @@ -10173,7 +10178,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask2_permutex2var_pd() { + fn test_mm256_mask2_permutex2var_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let idx = _mm256_set_epi64x(1, 1 << 2, 2, 1 << 2); let b = _mm256_set1_pd(100.); @@ -10185,7 +10190,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_permutex2var_pd() { + fn test_mm_permutex2var_pd() { let a = _mm_set_pd(0., 1.); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_pd(100.); @@ -10195,7 +10200,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_permutex2var_pd() { + fn test_mm_mask_permutex2var_pd() { let a = _mm_set_pd(0., 1.); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_pd(100.); @@ -10207,7 +10212,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_permutex2var_pd() { + fn test_mm_maskz_permutex2var_pd() { let a = _mm_set_pd(0., 1.); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_pd(100.); @@ -10219,7 +10224,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask2_permutex2var_pd() { + fn test_mm_mask2_permutex2var_pd() { let a = _mm_set_pd(0., 1.); let idx = _mm_set_epi64x(1, 1 << 1); let b = _mm_set1_pd(100.); @@ -10231,7 +10236,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_pd() { + const fn test_mm256_mask_shuffle_pd() { let a = _mm256_set_pd(1., 4., 5., 8.); let b = _mm256_set_pd(2., 3., 6., 7.); let r = _mm256_mask_shuffle_pd::<0b11_11_11_11>(a, 0, a, b); @@ -10242,7 +10247,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_pd() { + const fn test_mm256_maskz_shuffle_pd() { let a = _mm256_set_pd(1., 4., 5., 8.); let b = _mm256_set_pd(2., 3., 6., 7.); let r = _mm256_maskz_shuffle_pd::<0b11_11_11_11>(0, a, b); @@ -10253,7 +10258,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_shuffle_pd() { + const fn test_mm_mask_shuffle_pd() { let a = _mm_set_pd(1., 4.); let b = _mm_set_pd(2., 3.); let r = _mm_mask_shuffle_pd::<0b11_11_11_11>(a, 0, a, b); @@ -10264,7 +10269,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_shuffle_pd() { + const fn test_mm_maskz_shuffle_pd() { let a = _mm_set_pd(1., 4.); let b = _mm_set_pd(2., 3.); let r = _mm_maskz_shuffle_pd::<0b11_11_11_11>(0, a, b); @@ -10275,7 +10280,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_i64x2() { + const fn test_mm512_shuffle_i64x2() { let a = _mm512_setr_epi64(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm512_setr_epi64(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm512_shuffle_i64x2::<0b00_00_00_00>(a, b); @@ -10284,7 +10289,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_i64x2() { + const fn test_mm512_mask_shuffle_i64x2() { let a = _mm512_setr_epi64(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm512_setr_epi64(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm512_mask_shuffle_i64x2::<0b00_00_00_00>(a, 0, a, b); @@ -10295,7 +10300,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_i64x2() { + const fn test_mm512_maskz_shuffle_i64x2() { let a = _mm512_setr_epi64(1, 4, 5, 8, 9, 12, 13, 16); let b = _mm512_setr_epi64(2, 3, 6, 7, 10, 11, 14, 15); let r = _mm512_maskz_shuffle_i64x2::<0b00_00_00_00>(0, a, b); @@ -10306,7 +10311,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_shuffle_i64x2() { + const fn test_mm256_shuffle_i64x2() { let a = _mm256_set_epi64x(1, 4, 5, 8); let b = _mm256_set_epi64x(2, 3, 6, 7); let r = _mm256_shuffle_i64x2::<0b00>(a, b); @@ -10315,7 +10320,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_i64x2() { + const fn test_mm256_mask_shuffle_i64x2() { let a = _mm256_set_epi64x(1, 4, 5, 8); let b = _mm256_set_epi64x(2, 3, 6, 7); let r = _mm256_mask_shuffle_i64x2::<0b00>(a, 0, a, b); @@ -10326,7 +10331,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_i64x2() { + const fn test_mm256_maskz_shuffle_i64x2() { let a = _mm256_set_epi64x(1, 4, 5, 8); let b = _mm256_set_epi64x(2, 3, 6, 7); let r = _mm256_maskz_shuffle_i64x2::<0b00>(0, a, b); @@ -10337,7 +10342,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_shuffle_f64x2() { + const fn test_mm512_shuffle_f64x2() { let a = _mm512_setr_pd(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm512_setr_pd(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm512_shuffle_f64x2::<0b00_00_00_00>(a, b); @@ -10346,7 +10351,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_shuffle_f64x2() { + const fn test_mm512_mask_shuffle_f64x2() { let a = _mm512_setr_pd(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm512_setr_pd(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm512_mask_shuffle_f64x2::<0b00_00_00_00>(a, 0, a, b); @@ -10357,7 +10362,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_shuffle_f64x2() { + const fn test_mm512_maskz_shuffle_f64x2() { let a = _mm512_setr_pd(1., 4., 5., 8., 9., 12., 13., 16.); let b = _mm512_setr_pd(2., 3., 6., 7., 10., 11., 14., 15.); let r = _mm512_maskz_shuffle_f64x2::<0b00_00_00_00>(0, a, b); @@ -10368,7 +10373,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_shuffle_f64x2() { + const fn test_mm256_shuffle_f64x2() { let a = _mm256_set_pd(1., 4., 5., 8.); let b = _mm256_set_pd(2., 3., 6., 7.); let r = _mm256_shuffle_f64x2::<0b00>(a, b); @@ -10377,7 +10382,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_shuffle_f64x2() { + const fn test_mm256_mask_shuffle_f64x2() { let a = _mm256_set_pd(1., 4., 5., 8.); let b = _mm256_set_pd(2., 3., 6., 7.); let r = _mm256_mask_shuffle_f64x2::<0b00>(a, 0, a, b); @@ -10388,7 +10393,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_shuffle_f64x2() { + const fn test_mm256_maskz_shuffle_f64x2() { let a = _mm256_set_pd(1., 4., 5., 8.); let b = _mm256_set_pd(2., 3., 6., 7.); let r = _mm256_maskz_shuffle_f64x2::<0b00>(0, a, b); @@ -10399,7 +10404,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_movedup_pd() { + const fn test_mm512_movedup_pd() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_movedup_pd(a); let e = _mm512_setr_pd(1., 1., 3., 3., 5., 5., 7., 7.); @@ -10407,7 +10412,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_movedup_pd() { + const fn test_mm512_mask_movedup_pd() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_mask_movedup_pd(a, 0, a); assert_eq_m512d(r, a); @@ -10417,7 +10422,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_movedup_pd() { + const fn test_mm512_maskz_movedup_pd() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_movedup_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -10427,7 +10432,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_movedup_pd() { + const fn test_mm256_mask_movedup_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_mask_movedup_pd(a, 0, a); assert_eq_m256d(r, a); @@ -10437,7 +10442,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_movedup_pd() { + const fn test_mm256_maskz_movedup_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let r = _mm256_maskz_movedup_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -10447,7 +10452,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_movedup_pd() { + const fn test_mm_mask_movedup_pd() { let a = _mm_set_pd(1., 2.); let r = _mm_mask_movedup_pd(a, 0, a); assert_eq_m128d(r, a); @@ -10457,7 +10462,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_movedup_pd() { + const fn test_mm_maskz_movedup_pd() { let a = _mm_set_pd(1., 2.); let r = _mm_maskz_movedup_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -10467,7 +10472,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_inserti64x4() { + const fn test_mm512_inserti64x4() { let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_setr_epi64x(17, 18, 19, 20); let r = _mm512_inserti64x4::<1>(a, b); @@ -10476,7 +10481,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_inserti64x4() { + const fn test_mm512_mask_inserti64x4() { let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_setr_epi64x(17, 18, 19, 20); let r = _mm512_mask_inserti64x4::<1>(a, 0, a, b); @@ -10487,7 +10492,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_inserti64x4() { + const fn test_mm512_maskz_inserti64x4() { let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm256_setr_epi64x(17, 18, 19, 20); let r = _mm512_maskz_inserti64x4::<1>(0, a, b); @@ -10498,7 +10503,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_insertf64x4() { + const fn test_mm512_insertf64x4() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_pd(17., 18., 19., 20.); let r = _mm512_insertf64x4::<1>(a, b); @@ -10507,7 +10512,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_insertf64x4() { + const fn test_mm512_mask_insertf64x4() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_pd(17., 18., 19., 20.); let r = _mm512_mask_insertf64x4::<1>(a, 0, a, b); @@ -10518,7 +10523,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_insertf64x4() { + const fn test_mm512_maskz_insertf64x4() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm256_setr_pd(17., 18., 19., 20.); let r = _mm512_maskz_insertf64x4::<1>(0, a, b); @@ -10529,21 +10534,21 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castpd128_pd512() { + const fn test_mm512_castpd128_pd512() { let a = _mm_setr_pd(17., 18.); let r = _mm512_castpd128_pd512(a); assert_eq_m128d(_mm512_castpd512_pd128(r), a); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castpd256_pd512() { + const fn test_mm512_castpd256_pd512() { let a = _mm256_setr_pd(17., 18., 19., 20.); let r = _mm512_castpd256_pd512(a); assert_eq_m256d(_mm512_castpd512_pd256(r), a); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_zextpd128_pd512() { + const fn test_mm512_zextpd128_pd512() { let a = _mm_setr_pd(17., 18.); let r = _mm512_zextpd128_pd512(a); let e = _mm512_setr_pd(17., 18., 0., 0., 0., 0., 0., 0.); @@ -10551,7 +10556,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_zextpd256_pd512() { + const fn test_mm512_zextpd256_pd512() { let a = _mm256_setr_pd(17., 18., 19., 20.); let r = _mm512_zextpd256_pd512(a); let e = _mm512_setr_pd(17., 18., 19., 20., 0., 0., 0., 0.); @@ -10559,7 +10564,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castpd512_pd128() { + const fn test_mm512_castpd512_pd128() { let a = _mm512_setr_pd(17., 18., -1., -1., -1., -1., -1., -1.); let r = _mm512_castpd512_pd128(a); let e = _mm_setr_pd(17., 18.); @@ -10567,7 +10572,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castpd512_pd256() { + const fn test_mm512_castpd512_pd256() { let a = _mm512_setr_pd(17., 18., 19., 20., -1., -1., -1., -1.); let r = _mm512_castpd512_pd256(a); let e = _mm256_setr_pd(17., 18., 19., 20.); @@ -10575,7 +10580,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castpd_ps() { + const fn test_mm512_castpd_ps() { let a = _mm512_set1_pd(1.); let r = _mm512_castpd_ps(a); let e = _mm512_set_ps( @@ -10586,7 +10591,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castpd_si512() { + const fn test_mm512_castpd_si512() { let a = _mm512_set1_pd(1.); let r = _mm512_castpd_si512(a); let e = _mm512_set_epi32( @@ -10597,21 +10602,21 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castsi128_si512() { + const fn test_mm512_castsi128_si512() { let a = _mm_setr_epi64x(17, 18); let r = _mm512_castsi128_si512(a); assert_eq_m128i(_mm512_castsi512_si128(r), a); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castsi256_si512() { + const fn test_mm512_castsi256_si512() { let a = _mm256_setr_epi64x(17, 18, 19, 20); let r = _mm512_castsi256_si512(a); assert_eq_m256i(_mm512_castsi512_si256(r), a); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_zextsi128_si512() { + const fn test_mm512_zextsi128_si512() { let a = _mm_setr_epi64x(17, 18); let r = _mm512_zextsi128_si512(a); let e = _mm512_setr_epi64(17, 18, 0, 0, 0, 0, 0, 0); @@ -10619,7 +10624,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_zextsi256_si512() { + const fn test_mm512_zextsi256_si512() { let a = _mm256_setr_epi64x(17, 18, 19, 20); let r = _mm512_zextsi256_si512(a); let e = _mm512_setr_epi64(17, 18, 19, 20, 0, 0, 0, 0); @@ -10627,7 +10632,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castsi512_si128() { + const fn test_mm512_castsi512_si128() { let a = _mm512_setr_epi64(17, 18, -1, -1, -1, -1, -1, -1); let r = _mm512_castsi512_si128(a); let e = _mm_setr_epi64x(17, 18); @@ -10635,7 +10640,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castsi512_si256() { + const fn test_mm512_castsi512_si256() { let a = _mm512_setr_epi64(17, 18, 19, 20, -1, -1, -1, -1); let r = _mm512_castsi512_si256(a); let e = _mm256_setr_epi64x(17, 18, 19, 20); @@ -10643,7 +10648,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castsi512_ps() { + const fn test_mm512_castsi512_ps() { let a = _mm512_set1_epi64(1 << 62); let r = _mm512_castsi512_ps(a); let e = _mm512_set_ps( @@ -10653,7 +10658,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_castsi512_pd() { + const fn test_mm512_castsi512_pd() { let a = _mm512_set1_epi64(1 << 62); let r = _mm512_castsi512_pd(a); let e = _mm512_set_pd(2., 2., 2., 2., 2., 2., 2., 2.); @@ -10661,7 +10666,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcastq_epi64() { + const fn test_mm512_broadcastq_epi64() { let a = _mm_setr_epi64x(17, 18); let r = _mm512_broadcastq_epi64(a); let e = _mm512_set1_epi64(17); @@ -10669,7 +10674,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcastq_epi64() { + const fn test_mm512_mask_broadcastq_epi64() { let src = _mm512_set1_epi64(18); let a = _mm_setr_epi64x(17, 18); let r = _mm512_mask_broadcastq_epi64(src, 0, a); @@ -10680,7 +10685,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcastq_epi64() { + const fn test_mm512_maskz_broadcastq_epi64() { let a = _mm_setr_epi64x(17, 18); let r = _mm512_maskz_broadcastq_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -10690,7 +10695,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_broadcastq_epi64() { + const fn test_mm256_mask_broadcastq_epi64() { let src = _mm256_set1_epi64x(18); let a = _mm_set_epi64x(17, 18); let r = _mm256_mask_broadcastq_epi64(src, 0, a); @@ -10701,7 +10706,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_broadcastq_epi64() { + const fn test_mm256_maskz_broadcastq_epi64() { let a = _mm_set_epi64x(17, 18); let r = _mm256_maskz_broadcastq_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -10711,7 +10716,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_broadcastq_epi64() { + const fn test_mm_mask_broadcastq_epi64() { let src = _mm_set1_epi64x(18); let a = _mm_set_epi64x(17, 18); let r = _mm_mask_broadcastq_epi64(src, 0, a); @@ -10722,7 +10727,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_broadcastq_epi64() { + const fn test_mm_maskz_broadcastq_epi64() { let a = _mm_set_epi64x(17, 18); let r = _mm_maskz_broadcastq_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -10732,7 +10737,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcastsd_pd() { + const fn test_mm512_broadcastsd_pd() { let a = _mm_set_pd(17., 18.); let r = _mm512_broadcastsd_pd(a); let e = _mm512_set1_pd(18.); @@ -10740,7 +10745,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcastsd_pd() { + const fn test_mm512_mask_broadcastsd_pd() { let src = _mm512_set1_pd(18.); let a = _mm_set_pd(17., 18.); let r = _mm512_mask_broadcastsd_pd(src, 0, a); @@ -10751,7 +10756,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcastsd_pd() { + const fn test_mm512_maskz_broadcastsd_pd() { let a = _mm_set_pd(17., 18.); let r = _mm512_maskz_broadcastsd_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -10761,7 +10766,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_broadcastsd_pd() { + const fn test_mm256_mask_broadcastsd_pd() { let src = _mm256_set1_pd(18.); let a = _mm_set_pd(17., 18.); let r = _mm256_mask_broadcastsd_pd(src, 0, a); @@ -10772,7 +10777,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_broadcastsd_pd() { + const fn test_mm256_maskz_broadcastsd_pd() { let a = _mm_set_pd(17., 18.); let r = _mm256_maskz_broadcastsd_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -10782,7 +10787,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcast_i64x4() { + const fn test_mm512_broadcast_i64x4() { let a = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm512_broadcast_i64x4(a); let e = _mm512_set_epi64(17, 18, 19, 20, 17, 18, 19, 20); @@ -10790,7 +10795,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcast_i64x4() { + const fn test_mm512_mask_broadcast_i64x4() { let src = _mm512_set1_epi64(18); let a = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm512_mask_broadcast_i64x4(src, 0, a); @@ -10801,7 +10806,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcast_i64x4() { + const fn test_mm512_maskz_broadcast_i64x4() { let a = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm512_maskz_broadcast_i64x4(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -10811,7 +10816,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_broadcast_f64x4() { + const fn test_mm512_broadcast_f64x4() { let a = _mm256_set_pd(17., 18., 19., 20.); let r = _mm512_broadcast_f64x4(a); let e = _mm512_set_pd(17., 18., 19., 20., 17., 18., 19., 20.); @@ -10819,7 +10824,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_broadcast_f64x4() { + const fn test_mm512_mask_broadcast_f64x4() { let src = _mm512_set1_pd(18.); let a = _mm256_set_pd(17., 18., 19., 20.); let r = _mm512_mask_broadcast_f64x4(src, 0, a); @@ -10830,7 +10835,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_broadcast_f64x4() { + const fn test_mm512_maskz_broadcast_f64x4() { let a = _mm256_set_pd(17., 18., 19., 20.); let r = _mm512_maskz_broadcast_f64x4(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -10840,7 +10845,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_blend_epi64() { + const fn test_mm512_mask_blend_epi64() { let a = _mm512_set1_epi64(1); let b = _mm512_set1_epi64(2); let r = _mm512_mask_blend_epi64(0b11110000, a, b); @@ -10849,7 +10854,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_blend_epi64() { + const fn test_mm256_mask_blend_epi64() { let a = _mm256_set1_epi64x(1); let b = _mm256_set1_epi64x(2); let r = _mm256_mask_blend_epi64(0b00001111, a, b); @@ -10858,7 +10863,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_blend_epi64() { + const fn test_mm_mask_blend_epi64() { let a = _mm_set1_epi64x(1); let b = _mm_set1_epi64x(2); let r = _mm_mask_blend_epi64(0b00000011, a, b); @@ -10867,7 +10872,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_blend_pd() { + const fn test_mm512_mask_blend_pd() { let a = _mm512_set1_pd(1.); let b = _mm512_set1_pd(2.); let r = _mm512_mask_blend_pd(0b11110000, a, b); @@ -10876,7 +10881,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_blend_pd() { + const fn test_mm256_mask_blend_pd() { let a = _mm256_set1_pd(1.); let b = _mm256_set1_pd(2.); let r = _mm256_mask_blend_pd(0b00001111, a, b); @@ -10885,7 +10890,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_blend_pd() { + const fn test_mm_mask_blend_pd() { let a = _mm_set1_pd(1.); let b = _mm_set1_pd(2.); let r = _mm_mask_blend_pd(0b00000011, a, b); @@ -10894,7 +10899,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpackhi_epi64() { + const fn test_mm512_unpackhi_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_unpackhi_epi64(a, b); @@ -10903,7 +10908,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpackhi_epi64() { + const fn test_mm512_mask_unpackhi_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_mask_unpackhi_epi64(a, 0, a, b); @@ -10914,7 +10919,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpackhi_epi64() { + const fn test_mm512_maskz_unpackhi_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_maskz_unpackhi_epi64(0, a, b); @@ -10925,7 +10930,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpackhi_epi64() { + const fn test_mm256_mask_unpackhi_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm256_mask_unpackhi_epi64(a, 0, a, b); @@ -10936,7 +10941,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpackhi_epi64() { + const fn test_mm256_maskz_unpackhi_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm256_maskz_unpackhi_epi64(0, a, b); @@ -10947,7 +10952,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpackhi_epi64() { + const fn test_mm_mask_unpackhi_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(17, 18); let r = _mm_mask_unpackhi_epi64(a, 0, a, b); @@ -10958,7 +10963,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpackhi_epi64() { + const fn test_mm_maskz_unpackhi_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(17, 18); let r = _mm_maskz_unpackhi_epi64(0, a, b); @@ -10969,7 +10974,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpackhi_pd() { + const fn test_mm512_unpackhi_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_unpackhi_pd(a, b); @@ -10978,7 +10983,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpackhi_pd() { + const fn test_mm512_mask_unpackhi_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_mask_unpackhi_pd(a, 0, a, b); @@ -10989,7 +10994,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpackhi_pd() { + const fn test_mm512_maskz_unpackhi_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_maskz_unpackhi_pd(0, a, b); @@ -11000,7 +11005,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpackhi_pd() { + const fn test_mm256_mask_unpackhi_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(17., 18., 19., 20.); let r = _mm256_mask_unpackhi_pd(a, 0, a, b); @@ -11011,7 +11016,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpackhi_pd() { + const fn test_mm256_maskz_unpackhi_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(17., 18., 19., 20.); let r = _mm256_maskz_unpackhi_pd(0, a, b); @@ -11022,7 +11027,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpackhi_pd() { + const fn test_mm_mask_unpackhi_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(17., 18.); let r = _mm_mask_unpackhi_pd(a, 0, a, b); @@ -11033,7 +11038,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpackhi_pd() { + const fn test_mm_maskz_unpackhi_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(17., 18.); let r = _mm_maskz_unpackhi_pd(0, a, b); @@ -11044,7 +11049,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpacklo_epi64() { + const fn test_mm512_unpacklo_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_unpacklo_epi64(a, b); @@ -11053,7 +11058,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpacklo_epi64() { + const fn test_mm512_mask_unpacklo_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_mask_unpacklo_epi64(a, 0, a, b); @@ -11064,7 +11069,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpacklo_epi64() { + const fn test_mm512_maskz_unpacklo_epi64() { let a = _mm512_set_epi64(1, 2, 3, 4, 5, 6, 7, 8); let b = _mm512_set_epi64(17, 18, 19, 20, 21, 22, 23, 24); let r = _mm512_maskz_unpacklo_epi64(0, a, b); @@ -11075,7 +11080,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpacklo_epi64() { + const fn test_mm256_mask_unpacklo_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm256_mask_unpacklo_epi64(a, 0, a, b); @@ -11086,7 +11091,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpacklo_epi64() { + const fn test_mm256_maskz_unpacklo_epi64() { let a = _mm256_set_epi64x(1, 2, 3, 4); let b = _mm256_set_epi64x(17, 18, 19, 20); let r = _mm256_maskz_unpacklo_epi64(0, a, b); @@ -11097,7 +11102,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpacklo_epi64() { + const fn test_mm_mask_unpacklo_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(17, 18); let r = _mm_mask_unpacklo_epi64(a, 0, a, b); @@ -11108,7 +11113,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpacklo_epi64() { + const fn test_mm_maskz_unpacklo_epi64() { let a = _mm_set_epi64x(1, 2); let b = _mm_set_epi64x(17, 18); let r = _mm_maskz_unpacklo_epi64(0, a, b); @@ -11119,7 +11124,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_unpacklo_pd() { + const fn test_mm512_unpacklo_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_unpacklo_pd(a, b); @@ -11128,7 +11133,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_unpacklo_pd() { + const fn test_mm512_mask_unpacklo_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_mask_unpacklo_pd(a, 0, a, b); @@ -11139,7 +11144,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_unpacklo_pd() { + const fn test_mm512_maskz_unpacklo_pd() { let a = _mm512_set_pd(1., 2., 3., 4., 5., 6., 7., 8.); let b = _mm512_set_pd(17., 18., 19., 20., 21., 22., 23., 24.); let r = _mm512_maskz_unpacklo_pd(0, a, b); @@ -11150,7 +11155,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_unpacklo_pd() { + const fn test_mm256_mask_unpacklo_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(17., 18., 19., 20.); let r = _mm256_mask_unpacklo_pd(a, 0, a, b); @@ -11161,7 +11166,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_unpacklo_pd() { + const fn test_mm256_maskz_unpacklo_pd() { let a = _mm256_set_pd(1., 2., 3., 4.); let b = _mm256_set_pd(17., 18., 19., 20.); let r = _mm256_maskz_unpacklo_pd(0, a, b); @@ -11172,7 +11177,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_unpacklo_pd() { + const fn test_mm_mask_unpacklo_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(17., 18.); let r = _mm_mask_unpacklo_pd(a, 0, a, b); @@ -11183,7 +11188,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_unpacklo_pd() { + const fn test_mm_maskz_unpacklo_pd() { let a = _mm_set_pd(1., 2.); let b = _mm_set_pd(17., 18.); let r = _mm_maskz_unpacklo_pd(0, a, b); @@ -11194,7 +11199,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_alignr_epi64() { + const fn test_mm512_alignr_epi64() { let a = _mm512_set_epi64(8, 7, 6, 5, 4, 3, 2, 1); let b = _mm512_set_epi64(16, 15, 14, 13, 12, 11, 10, 9); let r = _mm512_alignr_epi64::<0>(a, b); @@ -11207,7 +11212,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_alignr_epi64() { + const fn test_mm512_mask_alignr_epi64() { let a = _mm512_set_epi64(8, 7, 6, 5, 4, 3, 2, 1); let b = _mm512_set_epi64(16, 15, 14, 13, 12, 11, 10, 9); let r = _mm512_mask_alignr_epi64::<1>(a, 0, a, b); @@ -11218,7 +11223,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_alignr_epi64() { + const fn test_mm512_maskz_alignr_epi64() { let a = _mm512_set_epi64(8, 7, 6, 5, 4, 3, 2, 1); let b = _mm512_set_epi64(16, 15, 14, 13, 12, 11, 10, 9); let r = _mm512_maskz_alignr_epi64::<1>(0, a, b); @@ -11229,7 +11234,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_alignr_epi64() { + const fn test_mm256_alignr_epi64() { let a = _mm256_set_epi64x(4, 3, 2, 1); let b = _mm256_set_epi64x(8, 7, 6, 5); let r = _mm256_alignr_epi64::<0>(a, b); @@ -11244,7 +11249,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_alignr_epi64() { + const fn test_mm256_mask_alignr_epi64() { let a = _mm256_set_epi64x(4, 3, 2, 1); let b = _mm256_set_epi64x(8, 7, 6, 5); let r = _mm256_mask_alignr_epi64::<1>(a, 0, a, b); @@ -11255,7 +11260,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_alignr_epi64() { + const fn test_mm256_maskz_alignr_epi64() { let a = _mm256_set_epi64x(4, 3, 2, 1); let b = _mm256_set_epi64x(8, 7, 6, 5); let r = _mm256_maskz_alignr_epi64::<1>(0, a, b); @@ -11266,7 +11271,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_alignr_epi64() { + const fn test_mm_alignr_epi64() { let a = _mm_set_epi64x(2, 1); let b = _mm_set_epi64x(4, 3); let r = _mm_alignr_epi64::<0>(a, b); @@ -11275,7 +11280,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_alignr_epi64() { + const fn test_mm_mask_alignr_epi64() { let a = _mm_set_epi64x(2, 1); let b = _mm_set_epi64x(4, 3); let r = _mm_mask_alignr_epi64::<1>(a, 0, a, b); @@ -11286,7 +11291,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_alignr_epi64() { + const fn test_mm_maskz_alignr_epi64() { let a = _mm_set_epi64x(2, 1); let b = _mm_set_epi64x(4, 3); let r = _mm_maskz_alignr_epi64::<1>(0, a, b); @@ -11297,7 +11302,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_and_epi64() { + const fn test_mm512_and_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_and_epi64(a, b); @@ -11306,7 +11311,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_and_epi64() { + const fn test_mm512_mask_and_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_mask_and_epi64(a, 0, a, b); @@ -11317,7 +11322,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_and_epi64() { + const fn test_mm512_maskz_and_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_maskz_and_epi64(0, a, b); @@ -11328,7 +11333,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_and_epi64() { + const fn test_mm256_mask_and_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 0); let r = _mm256_mask_and_epi64(a, 0, a, b); @@ -11339,7 +11344,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_and_epi64() { + const fn test_mm256_maskz_and_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 0); let r = _mm256_maskz_and_epi64(0, a, b); @@ -11350,7 +11355,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_and_epi64() { + const fn test_mm_mask_and_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 0); let r = _mm_mask_and_epi64(a, 0, a, b); @@ -11361,7 +11366,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_and_epi64() { + const fn test_mm_maskz_and_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 0); let r = _mm_maskz_and_epi64(0, a, b); @@ -11372,7 +11377,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_and_si512() { + const fn test_mm512_and_si512() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_and_epi64(a, b); @@ -11381,7 +11386,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_or_epi64() { + const fn test_mm512_or_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_or_epi64(a, b); @@ -11394,7 +11399,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_or_epi64() { + const fn test_mm512_mask_or_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_mask_or_epi64(a, 0, a, b); @@ -11409,7 +11414,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_or_epi64() { + const fn test_mm512_maskz_or_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_maskz_or_epi64(0, a, b); @@ -11420,7 +11425,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_or_epi64() { + const fn test_mm256_or_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 13); let r = _mm256_or_epi64(a, b); @@ -11429,7 +11434,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_or_epi64() { + const fn test_mm256_mask_or_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 13); let r = _mm256_mask_or_epi64(a, 0, a, b); @@ -11440,7 +11445,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_or_epi64() { + const fn test_mm256_maskz_or_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 13); let r = _mm256_maskz_or_epi64(0, a, b); @@ -11451,7 +11456,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_or_epi64() { + const fn test_mm_or_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 13); let r = _mm_or_epi64(a, b); @@ -11460,7 +11465,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_or_epi64() { + const fn test_mm_mask_or_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 13); let r = _mm_mask_or_epi64(a, 0, a, b); @@ -11471,7 +11476,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_or_epi64() { + const fn test_mm_maskz_or_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 13); let r = _mm_maskz_or_epi64(0, a, b); @@ -11482,7 +11487,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_or_si512() { + const fn test_mm512_or_si512() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_or_epi64(a, b); @@ -11495,7 +11500,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_xor_epi64() { + const fn test_mm512_xor_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_xor_epi64(a, b); @@ -11504,7 +11509,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_xor_epi64() { + const fn test_mm512_mask_xor_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_mask_xor_epi64(a, 0, a, b); @@ -11515,7 +11520,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_xor_epi64() { + const fn test_mm512_maskz_xor_epi64() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_maskz_xor_epi64(0, a, b); @@ -11526,7 +11531,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_xor_epi64() { + const fn test_mm256_xor_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 13); let r = _mm256_xor_epi64(a, b); @@ -11535,7 +11540,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_xor_epi64() { + const fn test_mm256_mask_xor_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 13); let r = _mm256_mask_xor_epi64(a, 0, a, b); @@ -11546,7 +11551,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_xor_epi64() { + const fn test_mm256_maskz_xor_epi64() { let a = _mm256_set1_epi64x(1 << 0 | 1 << 15); let b = _mm256_set1_epi64x(1 << 13); let r = _mm256_maskz_xor_epi64(0, a, b); @@ -11557,7 +11562,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_xor_epi64() { + const fn test_mm_xor_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 13); let r = _mm_xor_epi64(a, b); @@ -11566,7 +11571,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_xor_epi64() { + const fn test_mm_mask_xor_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 13); let r = _mm_mask_xor_epi64(a, 0, a, b); @@ -11577,7 +11582,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_xor_epi64() { + const fn test_mm_maskz_xor_epi64() { let a = _mm_set1_epi64x(1 << 0 | 1 << 15); let b = _mm_set1_epi64x(1 << 13); let r = _mm_maskz_xor_epi64(0, a, b); @@ -11588,7 +11593,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_xor_si512() { + const fn test_mm512_xor_si512() { let a = _mm512_set_epi64(1 << 0 | 1 << 15, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let b = _mm512_set_epi64(1 << 13, 0, 0, 0, 0, 0, 0, 1 << 1 | 1 << 2 | 1 << 3); let r = _mm512_xor_epi64(a, b); @@ -11597,7 +11602,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_andnot_epi64() { + const fn test_mm512_andnot_epi64() { let a = _mm512_set1_epi64(0); let b = _mm512_set1_epi64(1 << 3 | 1 << 4); let r = _mm512_andnot_epi64(a, b); @@ -11606,7 +11611,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_andnot_epi64() { + const fn test_mm512_mask_andnot_epi64() { let a = _mm512_set1_epi64(1 << 1 | 1 << 2); let b = _mm512_set1_epi64(1 << 3 | 1 << 4); let r = _mm512_mask_andnot_epi64(a, 0, a, b); @@ -11617,7 +11622,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_andnot_epi64() { + const fn test_mm512_maskz_andnot_epi64() { let a = _mm512_set1_epi64(1 << 1 | 1 << 2); let b = _mm512_set1_epi64(1 << 3 | 1 << 4); let r = _mm512_maskz_andnot_epi64(0, a, b); @@ -11632,7 +11637,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_andnot_epi64() { + const fn test_mm256_mask_andnot_epi64() { let a = _mm256_set1_epi64x(1 << 1 | 1 << 2); let b = _mm256_set1_epi64x(1 << 3 | 1 << 4); let r = _mm256_mask_andnot_epi64(a, 0, a, b); @@ -11643,7 +11648,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_andnot_epi64() { + const fn test_mm256_maskz_andnot_epi64() { let a = _mm256_set1_epi64x(1 << 1 | 1 << 2); let b = _mm256_set1_epi64x(1 << 3 | 1 << 4); let r = _mm256_maskz_andnot_epi64(0, a, b); @@ -11654,7 +11659,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_andnot_epi64() { + const fn test_mm_mask_andnot_epi64() { let a = _mm_set1_epi64x(1 << 1 | 1 << 2); let b = _mm_set1_epi64x(1 << 3 | 1 << 4); let r = _mm_mask_andnot_epi64(a, 0, a, b); @@ -11665,7 +11670,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_andnot_epi64() { + const fn test_mm_maskz_andnot_epi64() { let a = _mm_set1_epi64x(1 << 1 | 1 << 2); let b = _mm_set1_epi64x(1 << 3 | 1 << 4); let r = _mm_maskz_andnot_epi64(0, a, b); @@ -11676,7 +11681,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_andnot_si512() { + const fn test_mm512_andnot_si512() { let a = _mm512_set1_epi64(0); let b = _mm512_set1_epi64(1 << 3 | 1 << 4); let r = _mm512_andnot_si512(a, b); @@ -11685,175 +11690,175 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_add_epi64() { + const fn test_mm512_reduce_add_epi64() { let a = _mm512_set1_epi64(1); let e: i64 = _mm512_reduce_add_epi64(a); assert_eq!(8, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_add_epi64() { + const fn test_mm512_mask_reduce_add_epi64() { let a = _mm512_set1_epi64(1); let e: i64 = _mm512_mask_reduce_add_epi64(0b11110000, a); assert_eq!(4, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_add_pd() { + const fn test_mm512_reduce_add_pd() { let a = _mm512_set1_pd(1.); let e: f64 = _mm512_reduce_add_pd(a); assert_eq!(8., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_add_pd() { + const fn test_mm512_mask_reduce_add_pd() { let a = _mm512_set1_pd(1.); let e: f64 = _mm512_mask_reduce_add_pd(0b11110000, a); assert_eq!(4., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_mul_epi64() { + const fn test_mm512_reduce_mul_epi64() { let a = _mm512_set1_epi64(2); let e: i64 = _mm512_reduce_mul_epi64(a); assert_eq!(256, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_mul_epi64() { + const fn test_mm512_mask_reduce_mul_epi64() { let a = _mm512_set1_epi64(2); let e: i64 = _mm512_mask_reduce_mul_epi64(0b11110000, a); assert_eq!(16, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_mul_pd() { + const fn test_mm512_reduce_mul_pd() { let a = _mm512_set1_pd(2.); let e: f64 = _mm512_reduce_mul_pd(a); assert_eq!(256., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_mul_pd() { + const fn test_mm512_mask_reduce_mul_pd() { let a = _mm512_set1_pd(2.); let e: f64 = _mm512_mask_reduce_mul_pd(0b11110000, a); assert_eq!(16., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_max_epi64() { + const fn test_mm512_reduce_max_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: i64 = _mm512_reduce_max_epi64(a); assert_eq!(7, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_max_epi64() { + const fn test_mm512_mask_reduce_max_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: i64 = _mm512_mask_reduce_max_epi64(0b11110000, a); assert_eq!(3, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_max_epu64() { + const fn test_mm512_reduce_max_epu64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: u64 = _mm512_reduce_max_epu64(a); assert_eq!(7, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_max_epu64() { + const fn test_mm512_mask_reduce_max_epu64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: u64 = _mm512_mask_reduce_max_epu64(0b11110000, a); assert_eq!(3, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_max_pd() { + fn test_mm512_reduce_max_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let e: f64 = _mm512_reduce_max_pd(a); assert_eq!(7., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_max_pd() { + fn test_mm512_mask_reduce_max_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let e: f64 = _mm512_mask_reduce_max_pd(0b11110000, a); assert_eq!(3., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_min_epi64() { + const fn test_mm512_reduce_min_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: i64 = _mm512_reduce_min_epi64(a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_min_epi64() { + const fn test_mm512_mask_reduce_min_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: i64 = _mm512_mask_reduce_min_epi64(0b11110000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_min_epu64() { + const fn test_mm512_reduce_min_epu64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: u64 = _mm512_reduce_min_epu64(a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_min_epu64() { + const fn test_mm512_mask_reduce_min_epu64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let e: u64 = _mm512_mask_reduce_min_epu64(0b11110000, a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_min_pd() { + fn test_mm512_reduce_min_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let e: f64 = _mm512_reduce_min_pd(a); assert_eq!(0., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_min_pd() { + fn test_mm512_mask_reduce_min_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let e: f64 = _mm512_mask_reduce_min_pd(0b11110000, a); assert_eq!(0., e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_and_epi64() { + const fn test_mm512_reduce_and_epi64() { let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2); let e: i64 = _mm512_reduce_and_epi64(a); assert_eq!(0, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_and_epi64() { + const fn test_mm512_mask_reduce_and_epi64() { let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2); let e: i64 = _mm512_mask_reduce_and_epi64(0b11110000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_reduce_or_epi64() { + const fn test_mm512_reduce_or_epi64() { let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2); let e: i64 = _mm512_reduce_or_epi64(a); assert_eq!(3, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_reduce_or_epi64() { + const fn test_mm512_mask_reduce_or_epi64() { let a = _mm512_set_epi64(1, 1, 1, 1, 2, 2, 2, 2); let e: i64 = _mm512_mask_reduce_or_epi64(0b11110000, a); assert_eq!(1, e); } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_extractf64x4_pd() { + const fn test_mm512_extractf64x4_pd() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_extractf64x4_pd::<1>(a); let e = _mm256_setr_pd(5., 6., 7., 8.); @@ -11861,7 +11866,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_extractf64x4_pd() { + const fn test_mm512_mask_extractf64x4_pd() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let src = _mm256_set1_pd(100.); let r = _mm512_mask_extractf64x4_pd::<1>(src, 0, a); @@ -11872,7 +11877,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_extractf64x4_pd() { + const fn test_mm512_maskz_extractf64x4_pd() { let a = _mm512_setr_pd(1., 2., 3., 4., 5., 6., 7., 8.); let r = _mm512_maskz_extractf64x4_pd::<1>(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -11882,7 +11887,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_extracti64x4_epi64() { + const fn test_mm512_extracti64x4_epi64() { let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_extracti64x4_epi64::<0x1>(a); let e = _mm256_setr_epi64x(5, 6, 7, 8); @@ -11890,7 +11895,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_extracti64x4_epi64() { + const fn test_mm512_mask_extracti64x4_epi64() { let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let src = _mm256_set1_epi64x(100); let r = _mm512_mask_extracti64x4_epi64::<0x1>(src, 0, a); @@ -11901,7 +11906,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_extracti64x4_epi64() { + const fn test_mm512_maskz_extracti64x4_epi64() { let a = _mm512_setr_epi64(1, 2, 3, 4, 5, 6, 7, 8); let r = _mm512_maskz_extracti64x4_epi64::<0x1>(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -11911,7 +11916,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_compress_epi64() { + fn test_mm512_mask_compress_epi64() { let src = _mm512_set1_epi64(200); let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_mask_compress_epi64(src, 0, a); @@ -11922,7 +11927,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_compress_epi64() { + fn test_mm512_maskz_compress_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_maskz_compress_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -11932,7 +11937,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_compress_epi64() { + fn test_mm256_mask_compress_epi64() { let src = _mm256_set1_epi64x(200); let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_mask_compress_epi64(src, 0, a); @@ -11943,7 +11948,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_compress_epi64() { + fn test_mm256_maskz_compress_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_maskz_compress_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -11953,7 +11958,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_compress_epi64() { + fn test_mm_mask_compress_epi64() { let src = _mm_set1_epi64x(200); let a = _mm_set_epi64x(0, 1); let r = _mm_mask_compress_epi64(src, 0, a); @@ -11964,7 +11969,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_compress_epi64() { + fn test_mm_maskz_compress_epi64() { let a = _mm_set_epi64x(0, 1); let r = _mm_maskz_compress_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -11974,7 +11979,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_compress_pd() { + fn test_mm512_mask_compress_pd() { let src = _mm512_set1_pd(200.); let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_mask_compress_pd(src, 0, a); @@ -11985,7 +11990,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_compress_pd() { + fn test_mm512_maskz_compress_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_maskz_compress_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -11995,7 +12000,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_compress_pd() { + fn test_mm256_mask_compress_pd() { let src = _mm256_set1_pd(200.); let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_mask_compress_pd(src, 0, a); @@ -12006,7 +12011,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_compress_pd() { + fn test_mm256_maskz_compress_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_maskz_compress_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -12016,7 +12021,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_compress_pd() { + fn test_mm_mask_compress_pd() { let src = _mm_set1_pd(200.); let a = _mm_set_pd(0., 1.); let r = _mm_mask_compress_pd(src, 0, a); @@ -12027,7 +12032,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_compress_pd() { + fn test_mm_maskz_compress_pd() { let a = _mm_set_pd(0., 1.); let r = _mm_maskz_compress_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -12037,7 +12042,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_expand_epi64() { + fn test_mm512_mask_expand_epi64() { let src = _mm512_set1_epi64(200); let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_mask_expand_epi64(src, 0, a); @@ -12048,7 +12053,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_expand_epi64() { + fn test_mm512_maskz_expand_epi64() { let a = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); let r = _mm512_maskz_expand_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -12058,7 +12063,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_expand_epi64() { + fn test_mm256_mask_expand_epi64() { let src = _mm256_set1_epi64x(200); let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_mask_expand_epi64(src, 0, a); @@ -12069,7 +12074,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_expand_epi64() { + fn test_mm256_maskz_expand_epi64() { let a = _mm256_set_epi64x(0, 1, 2, 3); let r = _mm256_maskz_expand_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -12079,7 +12084,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_expand_epi64() { + fn test_mm_mask_expand_epi64() { let src = _mm_set1_epi64x(200); let a = _mm_set_epi64x(0, 1); let r = _mm_mask_expand_epi64(src, 0, a); @@ -12090,7 +12095,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_expand_epi64() { + fn test_mm_maskz_expand_epi64() { let a = _mm_set_epi64x(0, 1); let r = _mm_maskz_expand_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -12100,7 +12105,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_expand_pd() { + fn test_mm512_mask_expand_pd() { let src = _mm512_set1_pd(200.); let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_mask_expand_pd(src, 0, a); @@ -12111,7 +12116,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_expand_pd() { + fn test_mm512_maskz_expand_pd() { let a = _mm512_set_pd(0., 1., 2., 3., 4., 5., 6., 7.); let r = _mm512_maskz_expand_pd(0, a); assert_eq_m512d(r, _mm512_setzero_pd()); @@ -12121,7 +12126,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_expand_pd() { + fn test_mm256_mask_expand_pd() { let src = _mm256_set1_pd(200.); let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_mask_expand_pd(src, 0, a); @@ -12132,7 +12137,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_expand_pd() { + fn test_mm256_maskz_expand_pd() { let a = _mm256_set_pd(0., 1., 2., 3.); let r = _mm256_maskz_expand_pd(0, a); assert_eq_m256d(r, _mm256_setzero_pd()); @@ -12142,7 +12147,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_expand_pd() { + fn test_mm_mask_expand_pd() { let src = _mm_set1_pd(200.); let a = _mm_set_pd(0., 1.); let r = _mm_mask_expand_pd(src, 0, a); @@ -12153,7 +12158,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_expand_pd() { + fn test_mm_maskz_expand_pd() { let a = _mm_set_pd(0., 1.); let r = _mm_maskz_expand_pd(0, a); assert_eq_m128d(r, _mm_setzero_pd()); @@ -12163,7 +12168,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_loadu_epi64() { + const unsafe fn test_mm512_loadu_epi64() { let a = &[4, 3, 2, 5, -8, -9, -64, -50]; let p = a.as_ptr(); let r = _mm512_loadu_epi64(black_box(p)); @@ -12172,7 +12177,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_loadu_epi64() { + const unsafe fn test_mm256_loadu_epi64() { let a = &[4, 3, 2, 5]; let p = a.as_ptr(); let r = _mm256_loadu_epi64(black_box(p)); @@ -12181,7 +12186,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_loadu_epi64() { + const unsafe fn test_mm_loadu_epi64() { let a = &[4, 3]; let p = a.as_ptr(); let r = _mm_loadu_epi64(black_box(p)); @@ -12472,7 +12477,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_storeu_epi64() { + const unsafe fn test_mm512_storeu_epi64() { let a = _mm512_set1_epi64(9); let mut r = _mm512_set1_epi64(0); _mm512_storeu_epi64(&mut r as *mut _ as *mut i64, a); @@ -12480,7 +12485,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_storeu_epi64() { + const unsafe fn test_mm256_storeu_epi64() { let a = _mm256_set1_epi64x(9); let mut r = _mm256_set1_epi64x(0); _mm256_storeu_epi64(&mut r as *mut _ as *mut i64, a); @@ -12488,7 +12493,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_storeu_epi64() { + const unsafe fn test_mm_storeu_epi64() { let a = _mm_set1_epi64x(9); let mut r = _mm_set1_epi64x(0); _mm_storeu_epi64(&mut r as *mut _ as *mut i64, a); @@ -12496,7 +12501,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_load_epi64() { + const unsafe fn test_mm512_load_epi64() { #[repr(align(64))] struct Align { data: [i64; 8], // 64 bytes @@ -12511,7 +12516,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_load_epi64() { + const unsafe fn test_mm256_load_epi64() { #[repr(align(64))] struct Align { data: [i64; 4], @@ -12524,7 +12529,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_load_epi64() { + const unsafe fn test_mm_load_epi64() { #[repr(align(64))] struct Align { data: [i64; 2], @@ -12537,7 +12542,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_store_epi64() { + const unsafe fn test_mm512_store_epi64() { let a = _mm512_set1_epi64(9); let mut r = _mm512_set1_epi64(0); _mm512_store_epi64(&mut r as *mut _ as *mut i64, a); @@ -12545,7 +12550,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_store_epi64() { + const unsafe fn test_mm256_store_epi64() { let a = _mm256_set1_epi64x(9); let mut r = _mm256_set1_epi64x(0); _mm256_store_epi64(&mut r as *mut _ as *mut i64, a); @@ -12553,7 +12558,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_store_epi64() { + const unsafe fn test_mm_store_epi64() { let a = _mm_set1_epi64x(9); let mut r = _mm_set1_epi64x(0); _mm_store_epi64(&mut r as *mut _ as *mut i64, a); @@ -12561,7 +12566,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_load_pd() { + const unsafe fn test_mm512_load_pd() { #[repr(align(64))] struct Align { data: [f64; 8], // 64 bytes @@ -12576,7 +12581,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_store_pd() { + const unsafe fn test_mm512_store_pd() { let a = _mm512_set1_pd(9.); let mut r = _mm512_undefined_pd(); _mm512_store_pd(&mut r as *mut _ as *mut f64, a); @@ -12584,7 +12589,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_test_epi64_mask() { + const fn test_mm512_test_epi64_mask() { let a = _mm512_set1_epi64(1 << 0); let b = _mm512_set1_epi64(1 << 0 | 1 << 1); let r = _mm512_test_epi64_mask(a, b); @@ -12593,7 +12598,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_test_epi64_mask() { + const fn test_mm512_mask_test_epi64_mask() { let a = _mm512_set1_epi64(1 << 0); let b = _mm512_set1_epi64(1 << 0 | 1 << 1); let r = _mm512_mask_test_epi64_mask(0, a, b); @@ -12604,7 +12609,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_test_epi64_mask() { + const fn test_mm256_test_epi64_mask() { let a = _mm256_set1_epi64x(1 << 0); let b = _mm256_set1_epi64x(1 << 0 | 1 << 1); let r = _mm256_test_epi64_mask(a, b); @@ -12613,7 +12618,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_test_epi64_mask() { + const fn test_mm256_mask_test_epi64_mask() { let a = _mm256_set1_epi64x(1 << 0); let b = _mm256_set1_epi64x(1 << 0 | 1 << 1); let r = _mm256_mask_test_epi64_mask(0, a, b); @@ -12624,7 +12629,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_test_epi64_mask() { + const fn test_mm_test_epi64_mask() { let a = _mm_set1_epi64x(1 << 0); let b = _mm_set1_epi64x(1 << 0 | 1 << 1); let r = _mm_test_epi64_mask(a, b); @@ -12633,7 +12638,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_test_epi64_mask() { + const fn test_mm_mask_test_epi64_mask() { let a = _mm_set1_epi64x(1 << 0); let b = _mm_set1_epi64x(1 << 0 | 1 << 1); let r = _mm_mask_test_epi64_mask(0, a, b); @@ -12644,7 +12649,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_testn_epi64_mask() { + const fn test_mm512_testn_epi64_mask() { let a = _mm512_set1_epi64(1 << 0); let b = _mm512_set1_epi64(1 << 0 | 1 << 1); let r = _mm512_testn_epi64_mask(a, b); @@ -12653,7 +12658,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_testn_epi64_mask() { + const fn test_mm512_mask_testn_epi64_mask() { let a = _mm512_set1_epi64(1 << 0); let b = _mm512_set1_epi64(1 << 1); let r = _mm512_mask_testn_epi64_mask(0, a, b); @@ -12664,7 +12669,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_testn_epi64_mask() { + const fn test_mm256_testn_epi64_mask() { let a = _mm256_set1_epi64x(1 << 0); let b = _mm256_set1_epi64x(1 << 1); let r = _mm256_testn_epi64_mask(a, b); @@ -12673,7 +12678,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_testn_epi64_mask() { + const fn test_mm256_mask_testn_epi64_mask() { let a = _mm256_set1_epi64x(1 << 0); let b = _mm256_set1_epi64x(1 << 1); let r = _mm256_mask_testn_epi64_mask(0, a, b); @@ -12684,7 +12689,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_testn_epi64_mask() { + const fn test_mm_testn_epi64_mask() { let a = _mm_set1_epi64x(1 << 0); let b = _mm_set1_epi64x(1 << 1); let r = _mm_testn_epi64_mask(a, b); @@ -12693,7 +12698,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_testn_epi64_mask() { + const fn test_mm_mask_testn_epi64_mask() { let a = _mm_set1_epi64x(1 << 0); let b = _mm_set1_epi64x(1 << 1); let r = _mm_mask_testn_epi64_mask(0, a, b); @@ -12704,7 +12709,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_mask_set1_epi64() { + const fn test_mm512_mask_set1_epi64() { let src = _mm512_set1_epi64(2); let a: i64 = 11; let r = _mm512_mask_set1_epi64(src, 0, a); @@ -12715,7 +12720,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm512_maskz_set1_epi64() { + const fn test_mm512_maskz_set1_epi64() { let a: i64 = 11; let r = _mm512_maskz_set1_epi64(0, a); assert_eq_m512i(r, _mm512_setzero_si512()); @@ -12725,7 +12730,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_mask_set1_epi64() { + const fn test_mm256_mask_set1_epi64() { let src = _mm256_set1_epi64x(2); let a: i64 = 11; let r = _mm256_mask_set1_epi64(src, 0, a); @@ -12736,7 +12741,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm256_maskz_set1_epi64() { + const fn test_mm256_maskz_set1_epi64() { let a: i64 = 11; let r = _mm256_maskz_set1_epi64(0, a); assert_eq_m256i(r, _mm256_setzero_si256()); @@ -12746,7 +12751,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_mask_set1_epi64() { + const fn test_mm_mask_set1_epi64() { let src = _mm_set1_epi64x(2); let a: i64 = 11; let r = _mm_mask_set1_epi64(src, 0, a); @@ -12757,7 +12762,7 @@ mod tests { } #[simd_test(enable = "avx512f,avx512vl")] - unsafe fn test_mm_maskz_set1_epi64() { + const fn test_mm_maskz_set1_epi64() { let a: i64 = 11; let r = _mm_maskz_set1_epi64(0, a); assert_eq_m128i(r, _mm_setzero_si128()); @@ -12767,7 +12772,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtsd_i64() { + fn test_mm_cvtsd_i64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtsd_i64(a); let e: i64 = -2; @@ -12775,7 +12780,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtss_i64() { + fn test_mm_cvtss_i64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtss_i64(a); let e: i64 = -2; @@ -12783,7 +12788,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundi64_ss() { + fn test_mm_cvt_roundi64_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: i64 = 9; let r = _mm_cvt_roundi64_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -12792,7 +12797,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsi64_ss() { + fn test_mm_cvt_roundsi64_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: i64 = 9; let r = _mm_cvt_roundsi64_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -12801,7 +12806,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvti64_ss() { + const fn test_mm_cvti64_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: i64 = 9; let r = _mm_cvti64_ss(a, b); @@ -12810,7 +12815,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvti64_sd() { + const fn test_mm_cvti64_sd() { let a = _mm_set_pd(1., -1.5); let b: i64 = 9; let r = _mm_cvti64_sd(a, b); @@ -12819,7 +12824,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_si64() { + fn test_mm_cvt_roundsd_si64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvt_roundsd_si64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i64 = -1; @@ -12827,7 +12832,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_i64() { + fn test_mm_cvt_roundsd_i64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvt_roundsd_i64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i64 = -1; @@ -12835,7 +12840,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsd_u64() { + fn test_mm_cvt_roundsd_u64() { let a = _mm_set_pd(1., f64::MAX); let r = _mm_cvt_roundsd_u64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: u64 = u64::MAX; @@ -12843,7 +12848,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtsd_u64() { + fn test_mm_cvtsd_u64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtsd_u64(a); let e: u64 = u64::MAX; @@ -12851,7 +12856,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_i64() { + fn test_mm_cvt_roundss_i64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_i64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i64 = -1; @@ -12859,7 +12864,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_si64() { + fn test_mm_cvt_roundss_si64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_si64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: i64 = -1; @@ -12867,7 +12872,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundss_u64() { + fn test_mm_cvt_roundss_u64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvt_roundss_u64::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a); let e: u64 = u64::MAX; @@ -12875,7 +12880,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtss_u64() { + fn test_mm_cvtss_u64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtss_u64(a); let e: u64 = u64::MAX; @@ -12883,7 +12888,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttsd_i64() { + fn test_mm_cvttsd_i64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvttsd_i64(a); let e: i64 = -1; @@ -12891,7 +12896,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundsd_i64() { + fn test_mm_cvtt_roundsd_i64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtt_roundsd_i64::<_MM_FROUND_NO_EXC>(a); let e: i64 = -1; @@ -12899,7 +12904,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundsd_si64() { + fn test_mm_cvtt_roundsd_si64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtt_roundsd_si64::<_MM_FROUND_NO_EXC>(a); let e: i64 = -1; @@ -12907,7 +12912,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundsd_u64() { + fn test_mm_cvtt_roundsd_u64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvtt_roundsd_u64::<_MM_FROUND_NO_EXC>(a); let e: u64 = u64::MAX; @@ -12915,7 +12920,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttsd_u64() { + fn test_mm_cvttsd_u64() { let a = _mm_set_pd(1., -1.5); let r = _mm_cvttsd_u64(a); let e: u64 = u64::MAX; @@ -12923,7 +12928,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttss_i64() { + fn test_mm_cvttss_i64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvttss_i64(a); let e: i64 = -1; @@ -12931,7 +12936,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundss_i64() { + fn test_mm_cvtt_roundss_i64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtt_roundss_i64::<_MM_FROUND_NO_EXC>(a); let e: i64 = -1; @@ -12939,7 +12944,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundss_si64() { + fn test_mm_cvtt_roundss_si64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtt_roundss_si64::<_MM_FROUND_NO_EXC>(a); let e: i64 = -1; @@ -12947,7 +12952,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtt_roundss_u64() { + fn test_mm_cvtt_roundss_u64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvtt_roundss_u64::<_MM_FROUND_NO_EXC>(a); let e: u64 = u64::MAX; @@ -12955,7 +12960,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvttss_u64() { + fn test_mm_cvttss_u64() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let r = _mm_cvttss_u64(a); let e: u64 = u64::MAX; @@ -12963,7 +12968,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtu64_ss() { + const fn test_mm_cvtu64_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: u64 = 9; let r = _mm_cvtu64_ss(a, b); @@ -12972,7 +12977,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvtu64_sd() { + const fn test_mm_cvtu64_sd() { let a = _mm_set_pd(1., -1.5); let b: u64 = 9; let r = _mm_cvtu64_sd(a, b); @@ -12981,7 +12986,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundu64_ss() { + fn test_mm_cvt_roundu64_ss() { let a = _mm_set_ps(0., -0.5, 1., -1.5); let b: u64 = 9; let r = _mm_cvt_roundu64_ss::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -12990,7 +12995,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundu64_sd() { + fn test_mm_cvt_roundu64_sd() { let a = _mm_set_pd(1., -1.5); let b: u64 = 9; let r = _mm_cvt_roundu64_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -12999,7 +13004,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundi64_sd() { + fn test_mm_cvt_roundi64_sd() { let a = _mm_set_pd(1., -1.5); let b: i64 = 9; let r = _mm_cvt_roundi64_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); @@ -13008,7 +13013,7 @@ mod tests { } #[simd_test(enable = "avx512f")] - unsafe fn test_mm_cvt_roundsi64_sd() { + fn test_mm_cvt_roundsi64_sd() { let a = _mm_set_pd(1., -1.5); let b: i64 = 9; let r = _mm_cvt_roundsi64_sd::<{ _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC }>(a, b); diff --git a/library/stdarch/crates/core_arch/src/x86_64/avx512fp16.rs b/library/stdarch/crates/core_arch/src/x86_64/avx512fp16.rs index 955c6ccc7526..87e3651ba744 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/avx512fp16.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/avx512fp16.rs @@ -10,7 +10,7 @@ use stdarch_test::assert_instr; #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsi2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvti64_sh(a: __m128h, b: i64) -> __m128h { unsafe { vcvtsi642sh(a, b, _MM_FROUND_CUR_DIRECTION) } } @@ -32,7 +32,7 @@ pub fn _mm_cvti64_sh(a: __m128h, b: i64) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsi2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundi64_sh(a: __m128h, b: i64) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -48,7 +48,7 @@ pub fn _mm_cvt_roundi64_sh(a: __m128h, b: i64) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtusi2sh))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtu64_sh(a: __m128h, b: u64) -> __m128h { unsafe { vcvtusi642sh(a, b, _MM_FROUND_CUR_DIRECTION) } } @@ -70,7 +70,7 @@ pub fn _mm_cvtu64_sh(a: __m128h, b: u64) -> __m128h { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtusi2sh, ROUNDING = 8))] #[rustc_legacy_const_generics(2)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundu64_sh(a: __m128h, b: u64) -> __m128h { unsafe { static_assert_rounding!(ROUNDING); @@ -85,7 +85,7 @@ pub fn _mm_cvt_roundu64_sh(a: __m128h, b: u64) -> __m128h { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2si))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsh_i64(a: __m128h) -> i64 { unsafe { vcvtsh2si64(a, _MM_FROUND_CUR_DIRECTION) } } @@ -106,7 +106,7 @@ pub fn _mm_cvtsh_i64(a: __m128h) -> i64 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2si, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsh_i64(a: __m128h) -> i64 { unsafe { static_assert_rounding!(ROUNDING); @@ -121,7 +121,7 @@ pub fn _mm_cvt_roundsh_i64(a: __m128h) -> i64 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2usi))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtsh_u64(a: __m128h) -> u64 { unsafe { vcvtsh2usi64(a, _MM_FROUND_CUR_DIRECTION) } } @@ -142,7 +142,7 @@ pub fn _mm_cvtsh_u64(a: __m128h) -> u64 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvtsh2usi, ROUNDING = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvt_roundsh_u64(a: __m128h) -> u64 { unsafe { static_assert_rounding!(ROUNDING); @@ -157,7 +157,7 @@ pub fn _mm_cvt_roundsh_u64(a: __m128h) -> u64 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2si))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttsh_i64(a: __m128h) -> i64 { unsafe { vcvttsh2si64(a, _MM_FROUND_CUR_DIRECTION) } } @@ -172,7 +172,7 @@ pub fn _mm_cvttsh_i64(a: __m128h) -> i64 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2si, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtt_roundsh_i64(a: __m128h) -> i64 { unsafe { static_assert_sae!(SAE); @@ -187,7 +187,7 @@ pub fn _mm_cvtt_roundsh_i64(a: __m128h) -> i64 { #[inline] #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2usi))] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvttsh_u64(a: __m128h) -> u64 { unsafe { vcvttsh2usi64(a, _MM_FROUND_CUR_DIRECTION) } } @@ -202,7 +202,7 @@ pub fn _mm_cvttsh_u64(a: __m128h) -> u64 { #[target_feature(enable = "avx512fp16")] #[cfg_attr(test, assert_instr(vcvttsh2usi, SAE = 8))] #[rustc_legacy_const_generics(1)] -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub fn _mm_cvtt_roundsh_u64(a: __m128h) -> u64 { unsafe { static_assert_sae!(SAE); @@ -232,7 +232,7 @@ mod tests { use stdarch_test::simd_test; #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvti64_sh() { + fn test_mm_cvti64_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvti64_sh(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -240,7 +240,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvt_roundi64_sh() { + fn test_mm_cvt_roundi64_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundi64_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -248,7 +248,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvtu64_sh() { + fn test_mm_cvtu64_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtu64_sh(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -256,7 +256,7 @@ mod tests { } #[simd_test(enable = "avx512fp16,avx512vl")] - unsafe fn test_mm_cvt_roundu64_sh() { + fn test_mm_cvt_roundu64_sh() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundu64_sh::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a, 10); let e = _mm_setr_ph(10.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); @@ -264,56 +264,56 @@ mod tests { } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_i64() { + fn test_mm_cvtsh_i64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtsh_i64(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvt_roundsh_i64() { + fn test_mm_cvt_roundsh_i64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundsh_i64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtsh_u64() { + fn test_mm_cvtsh_u64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtsh_u64(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvt_roundsh_u64() { + fn test_mm_cvt_roundsh_u64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvt_roundsh_u64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvttsh_i64() { + fn test_mm_cvttsh_i64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttsh_i64(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtt_roundsh_i64() { + fn test_mm_cvtt_roundsh_i64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtt_roundsh_i64::<{ _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC }>(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvttsh_u64() { + fn test_mm_cvttsh_u64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvttsh_u64(a); assert_eq!(r, 1); } #[simd_test(enable = "avx512fp16")] - unsafe fn test_mm_cvtt_roundsh_u64() { + fn test_mm_cvtt_roundsh_u64() { let a = _mm_setr_ph(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); let r = _mm_cvtt_roundsh_u64::<_MM_FROUND_NO_EXC>(a); assert_eq!(r, 1); diff --git a/library/stdarch/crates/core_arch/src/x86_64/bmi.rs b/library/stdarch/crates/core_arch/src/x86_64/bmi.rs index 5d204d51ae6d..8d2b22089ac1 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/bmi.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/bmi.rs @@ -6,7 +6,7 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions //! available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf //! [wikipedia_bmi]: https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 #[cfg(test)] @@ -48,7 +48,8 @@ pub fn _bextr2_u64(a: u64, control: u64) -> u64 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(andn))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _andn_u64(a: u64, b: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _andn_u64(a: u64, b: u64) -> u64 { !a & b } @@ -60,7 +61,8 @@ pub fn _andn_u64(a: u64, b: u64) -> u64 { #[cfg_attr(test, assert_instr(blsi))] #[cfg(not(target_arch = "x86"))] // generates lots of instructions #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsi_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsi_u64(x: u64) -> u64 { x & x.wrapping_neg() } @@ -72,7 +74,8 @@ pub fn _blsi_u64(x: u64) -> u64 { #[cfg_attr(test, assert_instr(blsmsk))] #[cfg(not(target_arch = "x86"))] // generates lots of instructions #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsmsk_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsmsk_u64(x: u64) -> u64 { x ^ (x.wrapping_sub(1_u64)) } @@ -86,7 +89,8 @@ pub fn _blsmsk_u64(x: u64) -> u64 { #[cfg_attr(test, assert_instr(blsr))] #[cfg(not(target_arch = "x86"))] // generates lots of instructions #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsr_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsr_u64(x: u64) -> u64 { x & (x.wrapping_sub(1)) } @@ -99,7 +103,8 @@ pub fn _blsr_u64(x: u64) -> u64 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(tzcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _tzcnt_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _tzcnt_u64(x: u64) -> u64 { x.trailing_zeros() as u64 } @@ -112,7 +117,8 @@ pub fn _tzcnt_u64(x: u64) -> u64 { #[target_feature(enable = "bmi1")] #[cfg_attr(test, assert_instr(tzcnt))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_tzcnt_64(x: u64) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_tzcnt_64(x: u64) -> i64 { x.trailing_zeros() as i64 } @@ -123,18 +129,19 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::{x86::*, x86_64::*}; #[simd_test(enable = "bmi1")] - unsafe fn test_bextr_u64() { + fn test_bextr_u64() { let r = _bextr_u64(0b0101_0000u64, 4, 4); assert_eq!(r, 0b0000_0101u64); } #[simd_test(enable = "bmi1")] - unsafe fn test_andn_u64() { + const fn test_andn_u64() { assert_eq!(_andn_u64(0, 0), 0); assert_eq!(_andn_u64(0, 1), 1); assert_eq!(_andn_u64(1, 0), 0); @@ -157,25 +164,25 @@ mod tests { } #[simd_test(enable = "bmi1")] - unsafe fn test_blsi_u64() { + const fn test_blsi_u64() { assert_eq!(_blsi_u64(0b1101_0000u64), 0b0001_0000u64); } #[simd_test(enable = "bmi1")] - unsafe fn test_blsmsk_u64() { + const fn test_blsmsk_u64() { let r = _blsmsk_u64(0b0011_0000u64); assert_eq!(r, 0b0001_1111u64); } #[simd_test(enable = "bmi1")] - unsafe fn test_blsr_u64() { + const fn test_blsr_u64() { // TODO: test the behavior when the input is `0`. let r = _blsr_u64(0b0011_0000u64); assert_eq!(r, 0b0010_0000u64); } #[simd_test(enable = "bmi1")] - unsafe fn test_tzcnt_u64() { + const fn test_tzcnt_u64() { assert_eq!(_tzcnt_u64(0b0000_0001u64), 0u64); assert_eq!(_tzcnt_u64(0b0000_0000u64), 64u64); assert_eq!(_tzcnt_u64(0b1001_0000u64), 4u64); diff --git a/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs b/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs index ea9daf88574f..6151eee8bdbb 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/bmi2.rs @@ -6,7 +6,7 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions //! available. //! -//! [intel64_ref]: http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf +//! [intel64_ref]: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf //! [wikipedia_bmi]: //! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 @@ -24,7 +24,8 @@ use stdarch_test::assert_instr; #[target_feature(enable = "bmi2")] #[cfg(not(target_arch = "x86"))] // calls an intrinsic #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mulx_u64(a: u64, b: u64, hi: &mut u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mulx_u64(a: u64, b: u64, hi: &mut u64) -> u64 { let result: u128 = (a as u128) * (b as u128); *hi = (result >> 64) as u64; result as u64 @@ -79,12 +80,13 @@ unsafe extern "C" { #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86_64::*; #[simd_test(enable = "bmi2")] - unsafe fn test_pext_u64() { + fn test_pext_u64() { let n = 0b1011_1110_1001_0011u64; let m0 = 0b0110_0011_1000_0101u64; @@ -98,7 +100,7 @@ mod tests { } #[simd_test(enable = "bmi2")] - unsafe fn test_pdep_u64() { + fn test_pdep_u64() { let n = 0b1011_1110_1001_0011u64; let m0 = 0b0110_0011_1000_0101u64; @@ -112,7 +114,7 @@ mod tests { } #[simd_test(enable = "bmi2")] - unsafe fn test_bzhi_u64() { + fn test_bzhi_u64() { let n = 0b1111_0010u64; let s = 0b0001_0010u64; assert_eq!(_bzhi_u64(n, 5), s); @@ -120,7 +122,7 @@ mod tests { #[simd_test(enable = "bmi2")] #[rustfmt::skip] - unsafe fn test_mulx_u64() { + const fn test_mulx_u64() { let a: u64 = 9_223_372_036_854_775_800; let b: u64 = 100; let mut hi = 0; diff --git a/library/stdarch/crates/core_arch/src/x86_64/bswap.rs b/library/stdarch/crates/core_arch/src/x86_64/bswap.rs index 4e2d8b96eade..1b1d739a62c8 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/bswap.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/bswap.rs @@ -11,16 +11,20 @@ use stdarch_test::assert_instr; #[inline] #[cfg_attr(test, assert_instr(bswap))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _bswap64(x: i64) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _bswap64(x: i64) -> i64 { x.swap_bytes() } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; + use stdarch_test::simd_test; + use super::*; - #[test] - fn test_bswap64() { + #[simd_test] + const fn test_bswap64() { assert_eq!(_bswap64(0x0EADBEEFFADECA0E), 0x0ECADEFAEFBEAD0E); assert_eq!(_bswap64(0x0000000000000000), 0x0000000000000000); } diff --git a/library/stdarch/crates/core_arch/src/x86_64/mod.rs b/library/stdarch/crates/core_arch/src/x86_64/mod.rs index 7d681882bef0..c6dc7a85e785 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/mod.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/mod.rs @@ -75,7 +75,7 @@ mod bt; pub use self::bt::*; mod avx512fp16; -#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")] +#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")] pub use self::avx512fp16::*; mod amx; diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse.rs b/library/stdarch/crates/core_arch/src/x86_64/sse.rs index 6bd7ec83ec99..81e1070b5569 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/sse.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/sse.rs @@ -62,17 +62,19 @@ pub fn _mm_cvttss_si64(a: __m128) -> i64 { #[target_feature(enable = "sse")] #[cfg_attr(test, assert_instr(cvtsi2ss))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi64_ss(a: __m128, b: i64) -> __m128 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi64_ss(a: __m128, b: i64) -> __m128 { unsafe { simd_insert!(a, 0, b as f32) } } #[cfg(test)] mod tests { use crate::core_arch::arch::x86_64::*; + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; #[simd_test(enable = "sse")] - unsafe fn test_mm_cvtss_si64() { + fn test_mm_cvtss_si64() { let inputs = &[ (42.0f32, 42i64), (-31.4, -31), @@ -96,7 +98,7 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_cvttss_si64() { + fn test_mm_cvttss_si64() { let inputs = &[ (42.0f32, 42i64), (-31.4, -31), @@ -123,21 +125,31 @@ mod tests { } #[simd_test(enable = "sse")] - unsafe fn test_mm_cvtsi64_ss() { - let inputs = &[ - (4555i64, 4555.0f32), - (322223333, 322223330.0), - (-432, -432.0), - (-322223333, -322223330.0), - (9223372036854775807, 9.223372e18), - (-9223372036854775808, -9.223372e18), - ]; + const fn test_mm_cvtsi64_ss() { + let a = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); - for &(x, f) in inputs { - let a = _mm_setr_ps(5.0, 6.0, 7.0, 8.0); - let r = _mm_cvtsi64_ss(a, x); - let e = _mm_setr_ps(f, 6.0, 7.0, 8.0); - assert_eq_m128(e, r); - } + let r = _mm_cvtsi64_ss(a, 4555); + let e = _mm_setr_ps(4555.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi64_ss(a, 322223333); + let e = _mm_setr_ps(322223333.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi64_ss(a, -432); + let e = _mm_setr_ps(-432.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi64_ss(a, -322223333); + let e = _mm_setr_ps(-322223333.0, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi64_ss(a, 9223372036854775807); + let e = _mm_setr_ps(9.223372e18, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); + + let r = _mm_cvtsi64_ss(a, -9223372036854775808); + let e = _mm_setr_ps(-9.223372e18, 6.0, 7.0, 8.0); + assert_eq_m128(e, r); } } diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse2.rs b/library/stdarch/crates/core_arch/src/x86_64/sse2.rs index 0894aa9810de..b156af078a32 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/sse2.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/sse2.rs @@ -95,7 +95,8 @@ pub unsafe fn _mm_stream_si64(mem_addr: *mut i64, a: i64) { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi64_si128(a: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi64_si128(a: i64) -> __m128i { _mm_set_epi64x(0, a) } @@ -107,7 +108,8 @@ pub fn _mm_cvtsi64_si128(a: i64) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi64x_si128(a: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi64x_si128(a: i64) -> __m128i { _mm_cvtsi64_si128(a) } @@ -118,7 +120,8 @@ pub fn _mm_cvtsi64x_si128(a: i64) -> __m128i { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi128_si64(a: __m128i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi128_si64(a: __m128i) -> i64 { unsafe { simd_extract!(a.as_i64x2(), 0) } } @@ -129,7 +132,8 @@ pub fn _mm_cvtsi128_si64(a: __m128i) -> i64 { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(movq))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi128_si64x(a: __m128i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi128_si64x(a: __m128i) -> i64 { _mm_cvtsi128_si64(a) } @@ -141,7 +145,8 @@ pub fn _mm_cvtsi128_si64x(a: __m128i) -> i64 { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtsi2sd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi64_sd(a: __m128d, b: i64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi64_sd(a: __m128d, b: i64) -> __m128d { unsafe { simd_insert!(a, 0, b as f64) } } @@ -153,19 +158,21 @@ pub fn _mm_cvtsi64_sd(a: __m128d, b: i64) -> __m128d { #[target_feature(enable = "sse2")] #[cfg_attr(test, assert_instr(cvtsi2sd))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_cvtsi64x_sd(a: __m128d, b: i64) -> __m128d { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_cvtsi64x_sd(a: __m128d, b: i64) -> __m128d { _mm_cvtsi64_sd(a, b) } #[cfg(test)] mod tests { use crate::core_arch::arch::x86_64::*; + use crate::core_arch::assert_eq_const as assert_eq; use std::boxed; use std::ptr; use stdarch_test::simd_test; #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsd_si64() { + fn test_mm_cvtsd_si64() { let r = _mm_cvtsd_si64(_mm_setr_pd(-2.0, 5.0)); assert_eq!(r, -2_i64); @@ -174,20 +181,20 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsd_si64x() { + fn test_mm_cvtsd_si64x() { let r = _mm_cvtsd_si64x(_mm_setr_pd(f64::NAN, f64::NAN)); assert_eq!(r, i64::MIN); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvttsd_si64() { + fn test_mm_cvttsd_si64() { let a = _mm_setr_pd(-1.1, 2.2); let r = _mm_cvttsd_si64(a); assert_eq!(r, -1_i64); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvttsd_si64x() { + fn test_mm_cvttsd_si64x() { let a = _mm_setr_pd(f64::NEG_INFINITY, f64::NAN); let r = _mm_cvttsd_si64x(a); assert_eq!(r, i64::MIN); @@ -206,19 +213,19 @@ mod tests { } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsi64_si128() { + const fn test_mm_cvtsi64_si128() { let r = _mm_cvtsi64_si128(5); assert_eq_m128i(r, _mm_setr_epi64x(5, 0)); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsi128_si64() { + const fn test_mm_cvtsi128_si64() { let r = _mm_cvtsi128_si64(_mm_setr_epi64x(5, 0)); assert_eq!(r, 5); } #[simd_test(enable = "sse2")] - unsafe fn test_mm_cvtsi64_sd() { + const fn test_mm_cvtsi64_sd() { let a = _mm_set1_pd(3.5); let r = _mm_cvtsi64_sd(a, 5); assert_eq_m128d(r, _mm_setr_pd(5.0, 3.5)); diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse41.rs b/library/stdarch/crates/core_arch/src/x86_64/sse41.rs index 4b7d25f2144b..7732264e207d 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/sse41.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/sse41.rs @@ -13,7 +13,8 @@ use stdarch_test::assert_instr; #[cfg_attr(test, assert_instr(pextrq, IMM1 = 1))] #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_extract_epi64(a: __m128i) -> i64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_extract_epi64(a: __m128i) -> i64 { static_assert_uimm_bits!(IMM1, 1); unsafe { simd_extract!(a.as_i64x2(), IMM1 as u32) } } @@ -27,7 +28,8 @@ pub fn _mm_extract_epi64(a: __m128i) -> i64 { #[cfg_attr(test, assert_instr(pinsrq, IMM1 = 0))] #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _mm_insert_epi64(a: __m128i, i: i64) -> __m128i { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _mm_insert_epi64(a: __m128i, i: i64) -> __m128i { static_assert_uimm_bits!(IMM1, 1); unsafe { transmute(simd_insert!(a.as_i64x2(), IMM1 as u32, i)) } } @@ -35,10 +37,11 @@ pub fn _mm_insert_epi64(a: __m128i, i: i64) -> __m128i { #[cfg(test)] mod tests { use crate::core_arch::arch::x86_64::*; + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_extract_epi64() { + const fn test_mm_extract_epi64() { let a = _mm_setr_epi64x(0, 1); let r = _mm_extract_epi64::<1>(a); assert_eq!(r, 1); @@ -47,7 +50,7 @@ mod tests { } #[simd_test(enable = "sse4.1")] - unsafe fn test_mm_insert_epi64() { + const fn test_mm_insert_epi64() { let a = _mm_set1_epi64x(0); let e = _mm_setr_epi64x(0, 32); let r = _mm_insert_epi64::<1>(a, 32); diff --git a/library/stdarch/crates/core_arch/src/x86_64/sse42.rs b/library/stdarch/crates/core_arch/src/x86_64/sse42.rs index 64a23b2b1921..cd32c149aff5 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/sse42.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/sse42.rs @@ -28,7 +28,7 @@ mod tests { use stdarch_test::simd_test; #[simd_test(enable = "sse4.2")] - unsafe fn test_mm_crc32_u64() { + fn test_mm_crc32_u64() { let crc = 0x7819dccd3e824; let v = 0x2a22b845fed; let i = _mm_crc32_u64(crc, v); diff --git a/library/stdarch/crates/core_arch/src/x86_64/tbm.rs b/library/stdarch/crates/core_arch/src/x86_64/tbm.rs index f4bba709f681..fe12538b07a0 100644 --- a/library/stdarch/crates/core_arch/src/x86_64/tbm.rs +++ b/library/stdarch/crates/core_arch/src/x86_64/tbm.rs @@ -6,7 +6,7 @@ //! [Wikipedia][wikipedia_bmi] provides a quick overview of the available //! instructions. //! -//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf +//! [amd64_ref]: https://docs.amd.com/v/u/en-US/24594_3.37 //! [wikipedia_bmi]: //! https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_.28Advanced_Bit_Manipulation.29 @@ -42,7 +42,8 @@ pub fn _bextri_u64(a: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcfill))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcfill_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcfill_u64(x: u64) -> u64 { x & x.wrapping_add(1) } @@ -53,7 +54,8 @@ pub fn _blcfill_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blci))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blci_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blci_u64(x: u64) -> u64 { x | !x.wrapping_add(1) } @@ -64,7 +66,8 @@ pub fn _blci_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcic))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcic_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcic_u64(x: u64) -> u64 { !x & x.wrapping_add(1) } @@ -76,7 +79,8 @@ pub fn _blcic_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcmsk))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcmsk_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcmsk_u64(x: u64) -> u64 { x ^ x.wrapping_add(1) } @@ -87,7 +91,8 @@ pub fn _blcmsk_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blcs))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blcs_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blcs_u64(x: u64) -> u64 { x | x.wrapping_add(1) } @@ -98,7 +103,8 @@ pub fn _blcs_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blsfill))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsfill_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsfill_u64(x: u64) -> u64 { x | x.wrapping_sub(1) } @@ -109,7 +115,8 @@ pub fn _blsfill_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(blsic))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _blsic_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _blsic_u64(x: u64) -> u64 { !x | x.wrapping_sub(1) } @@ -121,7 +128,8 @@ pub fn _blsic_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(t1mskc))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _t1mskc_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _t1mskc_u64(x: u64) -> u64 { !x | x.wrapping_add(1) } @@ -133,29 +141,31 @@ pub fn _t1mskc_u64(x: u64) -> u64 { #[target_feature(enable = "tbm")] #[cfg_attr(test, assert_instr(tzmsk))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub fn _tzmsk_u64(x: u64) -> u64 { +#[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] +pub const fn _tzmsk_u64(x: u64) -> u64 { !x & x.wrapping_sub(1) } #[cfg(test)] mod tests { + use crate::core_arch::assert_eq_const as assert_eq; use stdarch_test::simd_test; use crate::core_arch::x86_64::*; #[simd_test(enable = "tbm")] - unsafe fn test_bextri_u64() { + fn test_bextri_u64() { assert_eq!(_bextri_u64::<0x0404>(0b0101_0000u64), 0b0000_0101u64); } #[simd_test(enable = "tbm")] - unsafe fn test_blcfill_u64() { + const fn test_blcfill_u64() { assert_eq!(_blcfill_u64(0b0101_0111u64), 0b0101_0000u64); assert_eq!(_blcfill_u64(0b1111_1111u64), 0u64); } #[simd_test(enable = "tbm")] - unsafe fn test_blci_u64() { + const fn test_blci_u64() { assert_eq!( _blci_u64(0b0101_0000u64), 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1110u64 @@ -167,25 +177,25 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_blcic_u64() { + const fn test_blcic_u64() { assert_eq!(_blcic_u64(0b0101_0001u64), 0b0000_0010u64); assert_eq!(_blcic_u64(0b1111_1111u64), 0b1_0000_0000u64); } #[simd_test(enable = "tbm")] - unsafe fn test_blcmsk_u64() { + const fn test_blcmsk_u64() { assert_eq!(_blcmsk_u64(0b0101_0001u64), 0b0000_0011u64); assert_eq!(_blcmsk_u64(0b1111_1111u64), 0b1_1111_1111u64); } #[simd_test(enable = "tbm")] - unsafe fn test_blcs_u64() { + const fn test_blcs_u64() { assert_eq!(_blcs_u64(0b0101_0001u64), 0b0101_0011u64); assert_eq!(_blcs_u64(0b1111_1111u64), 0b1_1111_1111u64); } #[simd_test(enable = "tbm")] - unsafe fn test_blsfill_u64() { + const fn test_blsfill_u64() { assert_eq!(_blsfill_u64(0b0101_0100u64), 0b0101_0111u64); assert_eq!( _blsfill_u64(0u64), @@ -194,7 +204,7 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_blsic_u64() { + const fn test_blsic_u64() { assert_eq!( _blsic_u64(0b0101_0100u64), 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1011u64 @@ -206,7 +216,7 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_t1mskc_u64() { + const fn test_t1mskc_u64() { assert_eq!( _t1mskc_u64(0b0101_0111u64), 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1000u64 @@ -218,7 +228,7 @@ mod tests { } #[simd_test(enable = "tbm")] - unsafe fn test_tzmsk_u64() { + const fn test_tzmsk_u64() { assert_eq!(_tzmsk_u64(0b0101_1000u64), 0b0000_0111u64); assert_eq!(_tzmsk_u64(0b0101_1001u64), 0b0000_0000u64); } diff --git a/library/stdarch/crates/intrinsic-test/missing_aarch64_be.txt b/library/stdarch/crates/intrinsic-test/missing_aarch64_be.txt new file mode 100644 index 000000000000..28e1d9203ee5 --- /dev/null +++ b/library/stdarch/crates/intrinsic-test/missing_aarch64_be.txt @@ -0,0 +1,105 @@ +# Bad LLVM codegen for BE in O2 in clang, and release in rust (https://github.com/llvm/llvm-project/issues/166190) +vcmla_lane_f16 +vcmla_laneq_f16 +vcmla_rot180_lane_f16 +vcmla_rot180_laneq_f16 +vcmla_rot270_lane_f16 +vcmla_rot270_laneq_f16 +vcmla_rot90_lane_f16 +vcmla_rot90_laneq_f16 +vcmlaq_lane_f16 +vcmlaq_laneq_f16 +vcmlaq_laneq_f32 +vcmlaq_rot180_lane_f16 +vcmlaq_rot180_laneq_f16 +vcmlaq_rot180_laneq_f32 +vcmlaq_rot270_lane_f16 +vcmlaq_rot270_laneq_f16 +vcmlaq_rot270_laneq_f32 +vcmlaq_rot90_lane_f16 +vcmlaq_rot90_laneq_f16 +vcmlaq_rot90_laneq_f32 +# Bad codegen for BE in O2 in clang, correct in rust. Same cause as above issue. +vdot_lane_s32 +vdot_lane_u32 +vdot_laneq_s32 +vdot_laneq_u32 +vdotq_lane_s32 +vdotq_lane_u32 +vdotq_laneq_s32 +vdotq_laneq_u32 +vsudot_lane_s32 +vsudot_laneq_s32 +vsudotq_lane_s32 +vsudotq_laneq_s32 +vusdot_lane_s32 +vusdot_laneq_s32 +vusdotq_lane_s32 +vusdotq_laneq_s32 + +# Below are in common to missing_aarch64.txt + +# Not implemented in stdarch yet +vbfdot_f32 +vbfdot_lane_f32 +vbfdot_laneq_f32 +vbfdotq_f32 +vbfdotq_lane_f32 +vbfdotq_laneq_f32 +vbfmlalbq_f32 +vbfmlalbq_lane_f32 +vbfmlalbq_laneq_f32 +vbfmlaltq_f32 +vbfmlaltq_lane_f32 +vbfmlaltq_laneq_f32 +vbfmmlaq_f32 + + +# Implemented in stdarch, but missing in Clang. +vrnd32xq_f64 +vrnd32zq_f64 +vrnd64xq_f64 +vrnd64zq_f64 +vamin_f32 +vaminq_f32 +vaminq_f64 +vamax_f32 +vamaxq_f32 +vamaxq_f64 +# LLVM select error, and missing in Clang. +vrnd32x_f64 +vrnd32z_f64 +vrnd64x_f64 +vrnd64z_f64 +vluti2_lane_p16 +vluti2_lane_p8 +vluti2_lane_s16 +vluti2_lane_s8 +vluti2_lane_u16 +vluti2_lane_u8 +vluti2q_lane_p16 +vluti2q_lane_p8 +vluti2q_lane_s16 +vluti2q_lane_s8 +vluti2q_lane_u16 +vluti2q_lane_u8 +vluti4q_lane_f16_x2 +vluti4q_lane_p16_x2 +vluti4q_lane_p8 +vluti4q_lane_s16_x2 +vluti4q_lane_s8 +vluti4q_lane_u16_x2 +vluti4q_lane_u8 +vluti4q_laneq_f16_x2 +vluti4q_laneq_p16_x2 +vluti4q_laneq_p8 +vluti4q_laneq_s16_x2 +vluti4q_laneq_s8 +vluti4q_laneq_u16_x2 +vluti4q_laneq_u8 + +# Broken in Clang +vcvth_s16_f16 +# FIXME: Broken output due to missing f16 printing support in Rust +vmulh_lane_f16 +vmulh_laneq_f16 diff --git a/library/stdarch/crates/intrinsic-test/missing_x86.txt b/library/stdarch/crates/intrinsic-test/missing_x86.txt index 58e37b92a1db..f88a125bfdff 100644 --- a/library/stdarch/crates/intrinsic-test/missing_x86.txt +++ b/library/stdarch/crates/intrinsic-test/missing_x86.txt @@ -3,17 +3,9 @@ #__bswap_64 _bswap64 -# Provides pointer to allocated memory, which is difficult to test -_mm_malloc - -# requires target feature 'waitpkg', but would be inlined into function that is compiled without support for 'waitpkg' -_tpause -_umwait - -# `use of undeclared identifier` error in Clang +# not present in Clang and Rust _bit_scan_forward _bit_scan_reverse -_bswap _castf32_u32 _castf64_u64 _castu32_f32 @@ -22,569 +14,6 @@ _lrotl _lrotr _may_i_use_cpu_feature _may_i_use_cpu_feature_ext -_mm256_acos_pd -_mm256_acos_ph -_mm256_acos_ps -_mm256_acosh_pd -_mm256_acosh_ph -_mm256_acosh_ps -_mm256_asin_pd -_mm256_asin_ph -_mm256_asin_ps -_mm256_asinh_pd -_mm256_asinh_ph -_mm256_asinh_ps -_mm256_atan_pd -_mm256_atan_ps -_mm256_atan_ph -_mm256_atan2_pd -_mm256_atan2_ph -_mm256_atan2_ps -_mm256_atanh_pd -_mm256_atanh_ph -_mm256_atanh_ps -_mm256_cbrt_pd -_mm256_cbrt_ph -_mm256_cbrt_ps -_mm256_cdfnorm_pd -_mm256_cdfnorm_ph -_mm256_cdfnorm_ps -_mm256_cdfnorminv_pd -_mm256_cdfnorminv_ph -_mm256_cdfnorminv_ps -_mm256_cexp_ps -_mm256_cos_pd -_mm256_cos_ph -_mm256_cos_ps -_mm256_cosd_pd -_mm256_cosd_ph -_mm256_cosd_ps -_mm256_cosh_pd -_mm256_cosh_ph -_mm256_cosh_ps -_mm256_csqrt_ps -_mm256_div_epi16 -_mm256_div_epi32 -_mm256_div_epi64 -_mm256_div_epi8 -_mm256_div_epu16 -_mm256_div_epu32 -_mm256_div_epu64 -_mm256_div_epu8 -_mm256_dpbssd_epi32 -_mm256_dpbssds_epi32 -_mm256_dpbsud_epi32 -_mm256_dpbsuds_epi32 -_mm256_dpbuud_epi32 -_mm256_dpbuuds_epi32 -_mm256_dpwsud_epi32 -_mm256_dpwsuds_epi32 -_mm256_dpwusd_epi32 -_mm256_dpwusds_epi32 -_mm256_dpwuud_epi32 -_mm256_dpwuuds_epi32 -_mm256_erf_pd -_mm256_erf_ps -_mm256_erfc_pd -_mm256_erfc_ph -_mm256_erfc_ps -_mm256_erfcinv_pd -_mm256_erfcinv_ph -_mm256_erfcinv_ps -_mm256_erfinv_pd -_mm256_erfinv_ph -_mm256_erfinv_ps -_mm256_exp10_pd -_mm256_exp10_ph -_mm256_exp10_ps -_mm256_exp2_pd -_mm256_exp2_ph -_mm256_exp2_ps -_mm256_exp_pd -_mm256_exp_ph -_mm256_exp_ps -_mm256_expm1_pd -_mm256_expm1_ph -_mm256_expm1_ps -_mm256_hypot_pd -_mm256_hypot_ph -_mm256_hypot_ps -_mm256_idiv_epi32 -_mm256_invcbrt_pd -_mm256_invcbrt_ph -_mm256_invcbrt_ps -_mm256_invsqrt_pd -_mm256_invsqrt_ph -_mm256_invsqrt_ps -_mm256_irem_epi32 -_mm256_log10_pd -_mm256_log10_ph -_mm256_log10_ps -_mm256_log1p_pd -_mm256_log1p_ph -_mm256_log1p_ps -_mm256_log2_pd -_mm256_log2_ph -_mm256_log2_ps -_mm256_log_pd -_mm256_log_ph -_mm256_log_ps -_mm256_logb_pd -_mm256_logb_ph -_mm256_logb_ps -_mm256_clog_ps -_mm256_madd52hi_avx_epu64 -_mm256_madd52lo_avx_epu64 -_mm256_erf_ph -_mm256_mask_reduce_add_epi16 -_mm256_mask_reduce_add_epi8 -_mm256_mask_reduce_and_epi16 -_mm256_mask_reduce_and_epi8 -_mm256_mask_reduce_max_epi16 -_mm256_mask_reduce_max_epi8 -_mm256_mask_reduce_max_epu16 -_mm256_mask_reduce_max_epu8 -_mm256_mask_reduce_min_epi16 -_mm256_mask_reduce_min_epi8 -_mm256_mask_reduce_min_epu16 -_mm256_mask_reduce_min_epu8 -_mm256_mask_reduce_mul_epi16 -_mm256_mask_reduce_mul_epi8 -_mm256_mask_reduce_or_epi16 -_mm256_mask_reduce_or_epi8 -_mm512_cosd_ph -_mm512_cosd_ps -_mm512_cosh_pd -_mm512_cosh_ph -_mm512_cosh_ps -_mm512_div_epi16 -_mm512_div_epi32 -_mm512_div_epi64 -_mm512_div_epi8 -_mm512_div_epu16 -_mm512_div_epu32 -_mm512_div_epu64 -_mm512_div_epu8 -_mm512_erf_pd -_mm512_erf_ph -_mm512_erf_ps -_mm512_erfc_pd -_mm512_erfc_ph -_mm512_erfc_ps -_mm512_erfcinv_pd -_mm512_erfcinv_ph -_mm512_erfcinv_ps -_mm512_erfinv_pd -_mm512_erfinv_ph -_mm512_erfinv_ps -_mm512_exp10_pd -_mm512_exp10_ph -_mm512_exp10_ps -_mm512_exp2_pd -_mm512_exp2_ph -_mm512_exp2_ps -_mm512_exp_pd -_mm512_exp_ph -_mm512_exp_ps -_mm512_expm1_pd -_mm512_expm1_ph -_mm512_expm1_ps -_mm512_floor_ph -_mm512_hypot_pd -_mm512_hypot_ph -_mm512_hypot_ps -_mm512_invsqrt_pd -_mm512_invsqrt_ph -_mm512_invsqrt_ps -_mm512_log10_pd -_mm512_log10_ph -_mm512_log10_ps -_mm512_log1p_pd -_mm512_log1p_ph -_mm512_log1p_ps -_mm512_log2_pd -_mm512_log2_ph -_mm512_log2_ps -_mm512_log_pd -_mm512_log_ph -_mm512_log_ps -_mm512_logb_pd -_mm512_logb_ph -_mm512_logb_ps -_mm512_mask_acos_pd -_mm512_mask_acos_ph -_mm512_mask_acos_ps -_mm512_mask_acosh_pd -_mm512_mask_acosh_ph -_mm512_mask_acosh_ps -_mm512_mask_asin_pd -_mm512_mask_asin_ph -_mm512_mask_asin_ps -_mm512_mask_asinh_pd -_mm512_mask_asinh_ph -_mm512_mask_asinh_ps -_mm512_mask_atan2_pd -_mm512_mask_atan2_ps -_mm512_mask_atan_pd -_mm512_mask_atan_ph -_mm512_mask_atan_ph -_mm512_mask_atanh_pd -_mm512_mask_atanh_ph -_mm512_mask_atanh_ps -_mm512_mask_cbrt_pd -_mm512_mask_cbrt_ph -_mm512_mask_cbrt_ps -_mm512_mask_cdfnorm_pd -_mm512_mask_cdfnorm_ph -_mm512_mask_cdfnorm_ps -_mm512_mask_cdfnorminv_pd -_mm512_mask_cdfnorminv_ph -_mm512_mask_cdfnorminv_ps -_mm512_mask_ceil_ph -_mm512_mask_cos_pd -_mm512_mask_cos_ph -_mm512_mask_cos_ps -_mm512_mask_cosd_pd -_mm512_mask_cosd_ph -_mm512_mask_cosd_ps -_mm512_mask_cosh_pd -_mm512_mask_cosh_ph -_mm512_mask_cosh_ps -_mm512_mask_atan_ps -_mm512_cosd_pd -_mm512_cos_ps -_mm512_cos_ph -_mm512_cos_pd -_mm512_mask_div_epi32 -_mm512_mask_div_epu32 -_mm512_mask_erf_pd -_mm512_mask_erf_ph -_mm512_mask_erf_ps -_mm512_mask_erfc_pd -_mm512_mask_erfc_ph -_mm512_mask_erfc_ps -_mm512_mask_erfcinv_pd -_mm512_mask_erfcinv_ph -_mm512_mask_erfcinv_ps -_mm512_mask_erfinv_pd -_mm512_mask_erfinv_ph -_mm512_mask_erfinv_ps -_mm512_mask_exp10_pd -_mm512_mask_exp10_ph -_mm512_mask_exp10_ps -_mm512_mask_exp2_pd -_mm512_mask_exp2_ph -_mm512_mask_exp2_ps -_mm512_mask_exp_pd -_mm512_mask_exp_ph -_mm512_mask_exp_ps -_mm512_mask_expm1_pd -_mm512_mask_expm1_ph -_mm512_mask_expm1_ps -_mm512_mask_floor_ph -_mm512_mask_hypot_pd -_mm512_mask_hypot_ps -_mm512_mask_invsqrt_pd -_mm512_mask_invsqrt_ph -_mm512_mask_invsqrt_ps -_mm512_mask_log10_pd -_mm512_mask_log10_ph -_mm512_mask_log10_ps -_mm512_mask_log1p_pd -_mm512_mask_log1p_ph -_mm512_mask_log1p_ps -_mm512_mask_log2_pd -_mm512_mask_log2_ph -_mm512_mask_log2_ps -_mm512_mask_log_pd -_mm512_mask_log_ph -_mm512_mask_log_ps -_mm512_mask_logb_pd -_mm512_mask_logb_ph -_mm512_mask_logb_ps -_mm512_mask_nearbyint_pd -_mm512_mask_nearbyint_ph -_mm512_mask_nearbyint_ps -_mm512_mask_pow_pd -_mm512_mask_pow_ps -_mm512_mask_recip_pd -_mm512_mask_recip_ph -_mm512_mask_recip_ps -_mm512_mask_rem_epi32 -_mm512_mask_rem_epu32 -_mm512_mask_rint_pd -_mm512_mask_rint_ph -_mm512_mask_rint_ps -_mm512_mask_sin_pd -_mm512_mask_sin_ph -_mm512_mask_sin_ps -_mm512_mask_sind_pd -_mm512_mask_sind_ph -_mm512_mask_sind_ps -_mm512_mask_sinh_pd -_mm512_mask_sinh_ph -_mm512_mask_sinh_ps -_mm512_mask_svml_round_pd -_mm512_mask_svml_round_ph -_mm512_mask_tan_pd -_mm512_mask_tan_ph -_mm512_mask_tan_ps -_mm512_mask_tand_pd -_mm512_mask_tand_ph -_mm512_mask_tand_ps -_mm512_mask_tanh_pd -_mm512_mask_tanh_ph -_mm512_mask_tanh_ps -_mm512_mask_trunc_pd -_mm512_mask_trunc_ph -_mm512_mask_trunc_ps -_mm512_nearbyint_pd -_mm512_nearbyint_ph -_mm512_nearbyint_ps -_mm512_pow_pd -_mm512_pow_ph -_mm512_pow_ps -_mm512_recip_pd -_mm512_recip_ph -_mm512_recip_ps -_mm512_rem_epi16 -_mm512_rem_epi32 -_mm512_rem_epi64 -_mm512_rem_epi8 -_mm512_rem_epu16 -_mm512_rem_epu32 -_mm512_rem_epu64 -_mm512_rem_epu8 -_mm512_rint_pd -_mm512_rint_ph -_mm512_rint_ps -_mm512_sin_pd -_mm512_sin_ph -_mm512_sin_ps -_mm512_sind_pd -_mm512_sind_ph -_mm512_sind_ps -_mm512_sinh_pd -_mm512_sinh_ph -_mm512_sinh_ps -_mm512_svml_round_pd -_mm512_svml_round_ph -_mm512_tan_pd -_mm512_tan_ph -_mm512_tan_ps -_mm512_tand_pd -_mm512_tand_ph -_mm512_tand_ps -_mm512_tanh_pd -_mm512_tanh_ph -_mm512_tanh_ps -_mm512_trunc_pd -_mm512_trunc_ph -_mm512_trunc_ps -_mm_acos_pd -_mm_acos_ph -_mm_acos_ps -_mm_acosh_pd -_mm_acosh_ph -_mm_acosh_ps -_mm_asin_pd -_mm_asin_ph -_mm_asin_ps -_mm_asinh_pd -_mm_asinh_ph -_mm_asinh_ps -_mm_atan2_pd -_mm_atan2_ph -_mm_atan2_ps -_mm_atan_pd -_mm_atan_ph -_mm_atan_ps -_mm_atanh_pd -_mm_atanh_ph -_mm_atanh_ps -_mm_cbrt_pd -_mm_cbrt_ph -_mm_cbrt_ps -_mm_cdfnorm_pd -_mm_cdfnorm_ph -_mm_cdfnorm_ps -_mm_cdfnorminv_pd -_mm_cdfnorminv_ph -_mm_cdfnorminv_ps -_mm_cexp_ps -_mm_clog_ps -_mm_cos_pd -_mm_cos_ph -_mm_cos_ps -_mm_cosd_pd -_mm_cosd_ph -_mm_cosd_ps -_mm_cosh_pd -_mm_cosh_ph -_mm_cosh_ps -_mm_csqrt_ps -_mm_cvtsd_si64x -_mm_cvtsi128_si64x -_mm_cvtsi64x_sd -_mm_cvtsi64x_si128 -_mm_cvttsd_si64x -_mm_div_epi16 -_mm_div_epi32 -_mm_div_epi64 -_mm_div_epi8 -_mm_div_epu16 -_mm_div_epu32 -_mm_div_epu64 -_mm_div_epu8 -_mm_dpbssd_epi32 -_mm_dpbssds_epi32 -_mm_dpbsud_epi32 -_mm_dpbsuds_epi32 -_mm_dpbuud_epi32 -_mm_dpbuuds_epi32 -_mm_dpwsud_epi32 -_mm_dpwsuds_epi32 -_mm_dpwusd_epi32 -_mm_dpwusds_epi32 -_mm_dpwuud_epi32 -_mm_dpwuuds_epi32 -_mm_erf_pd -_mm_erf_ph -_mm_erf_ps -_mm_erfc_pd -_mm_erfc_ph -_mm_erfc_ps -_mm_erfcinv_pd -_mm_erfcinv_ph -_mm_erfcinv_ps -_mm_erfinv_pd -_mm_erfinv_ph -_mm_erfinv_ps -_mm_exp10_pd -_mm_exp10_ph -_mm_exp10_ps -_mm_exp2_pd -_mm_exp2_ph -_mm_exp2_ps -_mm_exp_pd -_mm_exp_ph -_mm_exp_ps -_mm_expm1_pd -_mm_expm1_ph -_mm_expm1_ps -_mm_hypot_pd -_mm_hypot_ph -_mm_hypot_ps -_mm_idiv_epi32 -_mm_invcbrt_pd -_mm_invcbrt_ph -_mm_invcbrt_ps -_mm_invsqrt_pd -_mm_invsqrt_ph -_mm_invsqrt_ps -_mm_irem_epi32 -_mm_log10_pd -_mm_log10_ph -_mm_log10_ps -_mm_log1p_pd -_mm_log1p_ph -_mm_log1p_ps -_mm_log2_pd -_mm_log2_ph -_mm_log2_ps -_mm_log_pd -_mm_log_ph -_mm_log_ps -_mm_logb_pd -_mm_logb_ph -_mm_logb_ps -_mm_madd52hi_avx_epu64 -_mm_madd52lo_avx_epu64 -_mm_mask_reduce_add_epi16 -_mm_mask_reduce_add_epi8 -_mm_mask_reduce_and_epi16 -_mm_mask_reduce_and_epi8 -_mm_mask_reduce_max_epi16 -_mm_mask_reduce_max_epi8 -_mm_mask_reduce_max_epu16 -_mm_mask_reduce_max_epu8 -_mm_mask_reduce_min_epi16 -_mm_mask_reduce_min_epi8 -_mm_mask_reduce_min_epu16 -_mm_mask_reduce_min_epu8 -_mm_mask_reduce_mul_epi16 -_mm_mask_reduce_mul_epi8 -_mm_mask_reduce_or_epi16 -_mm_mask_reduce_or_epi8 -_mm_pow_pd -_mm_pow_ph -_mm_pow_ps -_mm_reduce_add_epi16 -_mm_reduce_add_epi8 -_mm_reduce_and_epi16 -_mm_reduce_and_epi8 -_mm_reduce_max_epi16 -_mm_reduce_max_epi8 -_mm_reduce_max_epu16 -_mm_reduce_max_epu8 -_mm_reduce_min_epi16 -_mm_reduce_min_epi8 -_mm_reduce_min_epu16 -_mm_reduce_min_epu8 -_mm_reduce_mul_epi16 -_mm_reduce_mul_epi8 -_mm_reduce_or_epi16 -_mm_reduce_or_epi8 -_mm_rem_epi16 -_mm_rem_epi32 -_mm_rem_epi64 -_mm_rem_epi8 -_mm_rem_epu16 -_mm_rem_epu32 -_mm_rem_epu64 -_mm_rem_epu8 -_mm_sin_pd -_mm_sin_ph -_mm_sin_ps -_mm_sind_pd -_mm_sind_ph -_mm_sind_ps -_mm_sinh_pd -_mm_sinh_ph -_mm_sinh_ps -_mm_sm3msg1_epi32 -_mm_sm3msg2_epi32 -_mm_sm3rnds2_epi32 -_mm_sm4key4_epi32 -_mm_sm4rnds4_epi32 -_mm_svml_ceil_pd -_mm_svml_ceil_ph -_mm_svml_ceil_ps -_mm_svml_floor_pd -_mm_svml_floor_ph -_mm_svml_floor_ps -_mm_svml_round_pd -_mm_svml_round_ph -_mm_svml_round_ps -_mm_svml_sqrt_pd -_mm_svml_sqrt_ph -_mm_svml_sqrt_ps -_mm_tan_pd -_mm_tan_ph -_mm_tan_ps -_mm_tand_pd -_mm_tand_ph -_mm_tand_ps -_mm_tanh_pd -_mm_tanh_ph -_mm_tanh_ps -_mm_trunc_pd -_mm_trunc_ph -_mm_trunc_ps -_mm_udiv_epi32 -_mm_urem_epi32 -_popcnt32 -_popcnt64 _rdpmc _rotl _rotl64 @@ -594,311 +23,45 @@ _rotwl _rotwr _urdmsr -# Cannot find value in this scope (in Rust testfiles) -_mm512_set1_pch -_mm_abs_pi16 -_mm_abs_pi32 -_mm_abs_pi8 -_mm_add_pi16 -_mm_add_pi32 -_mm_add_pi8 -_mm_add_si64 -_mm_adds_pi16 -_mm_adds_pi8 -_mm_adds_pu16 -_mm_adds_pu8 -_mm_alignr_pi8 -_mm_and_si64 -_mm_andnot_si64 -_mm_avg_pu16 -_mm_avg_pu8 -_mm_cmpeq_pi16 -_mm_cmpeq_pi32 -_mm_cmpeq_pi8 -_mm_cmpgt_pi16 -_mm_cmpgt_pi32 -_mm_cmpgt_pi8 -_mm_cvt_pi2ps -_mm_cvt_ps2pi -_mm_cvtm64_si64 -_mm_cvtpd_pi32 -_mm_cvtpi16_ps -_mm_cvtpi32_pd -_mm_cvtpi32_ps -_mm_cvtpi32x2_ps -_mm_cvtpi8_ps -_mm_cvtps_pi16 -_mm_cvtps_pi32 -_mm_cvtps_pi8 -_mm_cvtpu16_ps -_mm_cvtpu8_ps -_mm_cvtsi32_si64 -_mm_cvtsi64_m64 -_mm_cvtsi64_si32 -_mm_cvtt_ps2pi -_mm_cvttpd_pi32 -_mm512_cbrt_pd -_mm512_cbrt_ph -_mm512_cbrt_ps -_mm512_cdfnorm_pd -_mm512_cdfnorm_ph -_mm512_cdfnorm_ps -_mm512_cdfnorminv_pd -_mm512_cdfnorminv_ph -_mm512_cdfnorminv_ps -_mm512_ceil_pd -_mm512_ceil_ph -_mm512_ceil_ps -_mm512_floor_pd -_mm512_floor_ps -_mm512_mask_ceil_pd -_mm512_mask_ceil_ps -_mm_max_pi16 -_mm_max_pu8 -_mm_min_pi16 -_mm_min_pu8 -_mm_movemask_pi8 -_mm_movepi64_pi64 -_mm_movpi64_epi64 -_mm_mul_su32 -_mm_mulhi_pi16 -_mm_mulhi_pu16 -_mm_mulhrs_pi16 -_mm_mullo_pi16 -_mm_or_si64 -_mm_packs_pi16 -_mm_packs_pi32 -_mm_packs_pu16 -_mm_popcnt_u32 -_mm_popcnt_u64 -_mm_sad_pu8 -_mm_set1_epi64 -_mm_set1_pch -_mm_set1_pi16 -_mm_set1_pi32 -_mm_set1_pi8 -_mm_set_epi64 -_mm_set_pi16 -_mm_set_pi32 -_mm_set_pi8 -_mm_setr_epi64 -_mm_setr_pi16 -_mm_setr_pi32 -_mm_setr_pi8 -_mm_shuffle_pi16 -_mm_shuffle_pi8 -_mm_sign_pi16 -_mm_sign_pi32 -_mm_sign_pi8 -_mm_sll_pi16 -_mm_sll_pi32 -_mm_sll_si64 -_mm_slli_pi16 -_mm_slli_pi32 -_mm_slli_si64 -_mm_sra_pi16 -_mm_sra_pi32 -_mm_srai_pi16 -_mm_srai_pi32 -_mm_srl_pi16 -_mm_srl_pi32 -_mm_srl_si64 -_mm_srli_pi16 -_mm_srli_pi32 -_mm_srli_si64 -_mm_sub_pi16 -_mm_sub_pi32 -_mm_sub_pi8 -_mm_sub_si64 -_mm_subs_pi16 -_mm_subs_pi8 -_mm_subs_pu16 -_mm_subs_pu8 -_mm_unpackhi_pi16 -_mm_unpackhi_pi32 -_mm_unpackhi_pi8 -_mm_unpacklo_pi16 -_mm_unpacklo_pi32 -_mm_unpacklo_pi8 -_mm_xor_si64 -_mm256_pow_pd -_mm256_pow_ph -_mm256_pow_ps -_mm256_rem_epi16 -_mm256_rem_epi32 -_mm256_rem_epi64 -_mm256_rem_epi8 -_mm256_rem_epu16 -_mm256_rem_epu32 -_mm256_rem_epu64 -_mm256_rem_epu8 -_mm256_set1_pch -_mm256_sin_pd -_mm256_sin_ph -_mm256_sin_ps -_mm256_sind_pd -_mm256_sind_ph -_mm256_sind_ps -_mm256_sinh_pd -_mm256_sinh_ph -_mm256_sinh_ps -_mm256_svml_ceil_pd -_mm256_svml_ceil_ph -_mm256_svml_ceil_ps -_mm256_svml_floor_pd -_mm256_svml_floor_ph -_mm256_svml_floor_ps -_mm256_svml_round_pd -_mm256_svml_round_ph -_mm256_svml_round_ps -_mm256_svml_sqrt_pd -_mm256_svml_sqrt_ph -_mm256_svml_sqrt_ps -_mm256_tan_pd -_mm256_tan_ph -_mm256_tan_ps -_mm256_tand_pd -_mm256_tand_ph -_mm256_tand_ps -_mm256_tanh_pd -_mm256_tanh_ph -_mm256_tanh_ps -_mm256_trunc_pd -_mm256_trunc_ph -_mm256_trunc_ps -_mm256_udiv_epi32 -_mm256_urem_epi32 -_mm512_acos_pd -_mm512_acos_ph -_mm512_acos_ps -_mm512_acosh_pd -_mm512_acosh_ph -_mm512_acosh_ps -_mm_cvttps_pi32 -_mm_extract_pi16 -_mm_hadd_pi16 -_mm_hadd_pi32 -_mm_hadds_pi16 -_mm_hsub_pi16 -_mm_hsub_pi32 -_mm_hsubs_pi16 -_mm_insert_pi16 -_mm_madd_pi16 -_mm_maddubs_pi16 -_mm512_asin_pd -_mm512_asin_ph -_mm512_asin_ps -_mm512_asinh_pd -_mm512_asinh_ph -_mm512_asinh_ps -_mm512_atan2_pd -_mm512_atan2_ph -_mm512_atan2_ps -_mm512_atan_pd -_mm512_atan_ph -_mm512_atan_ps -_mm512_atanh_pd -_mm512_atanh_ph -_mm512_atanh_ps +# not present in Clang +_bswap +_mm_cvtsd_si64x +_mm_cvtsi128_si64x +_mm_cvtsi64x_sd +_mm_cvtsi64x_si128 +_mm_cvttsd_si64x +_popcnt32 +_popcnt64 + +# not present in Rust _cvtsh_ss _cvtss_sh -_m_from_int -_m_from_int64 -_m_packssdw -_m_packsswb -_m_packuswb -_m_paddb -_m_paddd -_m_paddsb -_m_paddsw -_m_paddusb -_m_paddusw -_m_paddw -_m_pand -_m_pandn -_m_pavgb -_m_pavgw -_m_pcmpeqb -_m_pcmpeqd -_m_pcmpeqw -_m_pcmpgtb -_m_pcmpgtd -_m_pcmpgtw -_m_pextrw -_m_pinsrw -_m_pmaddwd -_m_pmaxsw -_m_pmaxub -_m_pminsw -_m_pminub -_m_pmovmskb -_m_pmulhuw -_m_pmulhw -_m_pmullw -_m_por -_m_psadbw -_m_pshufw -_m_pslld -_m_pslldi -_m_psllq -_m_psllqi -_m_psllw -_m_psllwi -_m_psrad -_m_psradi -_m_psraw -_m_psrawi -_m_psrld -_m_psrldi -_m_psrlq -_m_psrlqi -_m_psrlw -_m_psrlwi -_m_psubb -_m_psubd -_m_psubsb -_m_psubsw -_m_psubusb -_m_psubusw -_m_psubw -_m_punpckhbw -_m_punpckhdq -_m_punpckhwd -_m_punpcklbw -_m_punpckldq -_m_punpcklwd -_m_pxor -_m_to_int -_m_to_int64 -_mm512_mask_floor_pd -_mm512_mask_floor_ps +_mm256_set1_pch +_mm512_set1_pch +_mm_malloc +_mm_popcnt_u32 +_mm_popcnt_u64 +_mm_set1_pch +_tpause +_umwait + +# IMM8 must be an even number in the range `0..=62` +_mm_sm3rnds2_epi32 # SDE ERROR: Cannot execute XGETBV with ECX != 0 _xgetbv -# Miscellaneous issues that can be fixed first -_kshiftli_mask16 -_kshiftli_mask32 -_kshiftli_mask64 -_kshiftli_mask8 -_kshiftri_mask16 -_kshiftri_mask32 -_kshiftri_mask64 -_kshiftri_mask8 +# top bits are undefined, unclear how to test these _mm256_castsi128_si256 -_mm256_extract_epi16 -_mm256_extract_epi8 _mm512_castsi128_si512 _mm512_castsi256_si512 -# _mm512_conj_pch + +# Clang bug +_mm256_extract_epi16 +_mm256_extract_epi8 _mm512_mask_reduce_max_pd _mm512_mask_reduce_max_ps _mm512_mask_reduce_min_pd _mm512_mask_reduce_min_ps -_mm_comineq_sh _mm_extract_epi16 _mm_extract_epi8 -_mm_mask_cvtepi16_epi8 -_mm_mask_cvtpd_epi32 -_mm_mask_cvtpd_ps -_mm_ucomineq_sh \ No newline at end of file diff --git a/library/stdarch/crates/intrinsic-test/src/arm/config.rs b/library/stdarch/crates/intrinsic-test/src/arm/config.rs index a63464596915..85cb21c2d6c4 100644 --- a/library/stdarch/crates/intrinsic-test/src/arm/config.rs +++ b/library/stdarch/crates/intrinsic-test/src/arm/config.rs @@ -38,11 +38,7 @@ std::ostream& operator<<(std::ostream& os, poly128_t value) { #endif std::ostream& operator<<(std::ostream& os, float16_t value) { - uint16_t temp = 0; - memcpy(&temp, &value, sizeof(float16_t)); - std::stringstream ss; - ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << temp; - os << ss.str(); + os << static_cast(value); return os; } @@ -52,92 +48,7 @@ std::ostream& operator<<(std::ostream& os, uint8_t value) { } "#; -// Format f16 values (and vectors containing them) in a way that is consistent with C. -pub const PLATFORM_RUST_DEFINITIONS: &str = r#" -/// Used to continue `Debug`ging SIMD types as `MySimd(1, 2, 3, 4)`, as they -/// were before moving to array-based simd. -#[inline] -fn debug_simd_finish( - formatter: &mut core::fmt::Formatter<'_>, - type_name: &str, - array: &[T; N], -) -> core::fmt::Result { - core::fmt::Formatter::debug_tuple_fields_finish( - formatter, - type_name, - &core::array::from_fn::<&dyn core::fmt::Debug, N, _>(|i| &array[i]), - ) -} - -#[repr(transparent)] -struct Hex(T); - -impl core::fmt::Debug for Hex { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - ::fmt(&self.0, f) - } -} - -fn debug_f16(x: T) -> impl core::fmt::Debug { - Hex(x) -} - -trait DebugHexF16 { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result; -} - -impl DebugHexF16 for f16 { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(f, "{:#06x?}", self.to_bits()) - } -} - -impl DebugHexF16 for float16x4_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 4]>(*self) }; - debug_simd_finish(f, "float16x4_t", &array) - } -} - -impl DebugHexF16 for float16x8_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 8]>(*self) }; - debug_simd_finish(f, "float16x8_t", &array) - } -} - -impl DebugHexF16 for float16x4x2_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - debug_simd_finish(f, "float16x4x2_t", &[Hex(self.0), Hex(self.1)]) - } -} -impl DebugHexF16 for float16x4x3_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - debug_simd_finish(f, "float16x4x3_t", &[Hex(self.0), Hex(self.1), Hex(self.2)]) - } -} -impl DebugHexF16 for float16x4x4_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - debug_simd_finish(f, "float16x4x4_t", &[Hex(self.0), Hex(self.1), Hex(self.2), Hex(self.3)]) - } -} - -impl DebugHexF16 for float16x8x2_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - debug_simd_finish(f, "float16x8x2_t", &[Hex(self.0), Hex(self.1)]) - } -} -impl DebugHexF16 for float16x8x3_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - debug_simd_finish(f, "float16x8x3_t", &[Hex(self.0), Hex(self.1), Hex(self.2)]) - } -} -impl DebugHexF16 for float16x8x4_t { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - debug_simd_finish(f, "float16x8x4_t", &[Hex(self.0), Hex(self.1), Hex(self.2), Hex(self.3)]) - } -} - "#; +pub const PLATFORM_RUST_DEFINITIONS: &str = ""; pub const PLATFORM_RUST_CFGS: &str = r#" #![cfg_attr(target_arch = "arm", feature(stdarch_arm_neon_intrinsics))] diff --git a/library/stdarch/crates/intrinsic-test/src/common/cli.rs b/library/stdarch/crates/intrinsic-test/src/common/cli.rs index 461ab542ea89..bed8259de8b6 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/cli.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/cli.rs @@ -7,12 +7,6 @@ pub enum Language { C, } -pub enum FailureReason { - RunC(String), - RunRust(String), - Difference(String, String, String), -} - /// Intrinsic test tool #[derive(clap::Parser)] #[command( @@ -47,6 +41,10 @@ pub struct Cli { #[arg(long, default_value_t = String::from("armv7-unknown-linux-gnueabihf"))] pub target: String, + /// Pass a profile (release, dev) + #[arg(long, default_value_t = String::from("release"))] + pub profile: String, + /// Set the linker #[arg(long)] pub linker: Option, @@ -65,6 +63,7 @@ pub struct ProcessedCli { pub cpp_compiler: Option, pub runner: String, pub target: String, + pub profile: String, pub linker: Option, pub cxx_toolchain_dir: Option, pub skip: Vec, @@ -76,6 +75,7 @@ impl ProcessedCli { let filename = cli_options.input; let runner = cli_options.runner.unwrap_or_default(); let target = cli_options.target; + let profile = cli_options.profile; let linker = cli_options.linker; let cxx_toolchain_dir = cli_options.cxx_toolchain_dir; let sample_percentage = cli_options.sample_percentage; @@ -109,6 +109,7 @@ impl ProcessedCli { cpp_compiler, runner, target, + profile, linker, cxx_toolchain_dir, skip, diff --git a/library/stdarch/crates/intrinsic-test/src/common/compare.rs b/library/stdarch/crates/intrinsic-test/src/common/compare.rs index c0459b743a7f..521434917159 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/compare.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/compare.rs @@ -1,7 +1,8 @@ -use super::cli::FailureReason; +use itertools::Itertools; use rayon::prelude::*; -use std::process::Command; +use std::{collections::HashMap, process::Command}; +pub const INTRINSIC_DELIMITER: &str = "############"; fn runner_command(runner: &str) -> Command { let mut it = runner.split_whitespace(); let mut cmd = Command::new(it.next().unwrap()); @@ -10,86 +11,119 @@ fn runner_command(runner: &str) -> Command { cmd } -pub fn compare_outputs(intrinsic_name_list: &Vec, runner: &str, target: &str) -> bool { - let intrinsics = intrinsic_name_list - .par_iter() - .filter_map(|intrinsic_name| { - let c = runner_command(runner) +pub fn compare_outputs( + intrinsic_name_list: &Vec, + runner: &str, + target: &str, + profile: &str, +) -> bool { + let profile_dir = match profile { + "dev" => "debug", + _ => "release", + }; + + let (c, rust) = rayon::join( + || { + runner_command(runner) .arg("./intrinsic-test-programs") - .arg(intrinsic_name) .current_dir("c_programs") - .output(); - - let rust = runner_command(runner) - .arg(format!("./target/{target}/release/intrinsic-test-programs")) - .arg(intrinsic_name) + .output() + }, + || { + runner_command(runner) + .arg(format!( + "./target/{target}/{profile_dir}/intrinsic-test-programs" + )) .current_dir("rust_programs") - .output(); + .output() + }, + ); + let (c, rust) = match (c, rust) { + (Ok(c), Ok(rust)) => (c, rust), + failure => panic!("Failed to run: {failure:#?}"), + }; - let (c, rust) = match (c, rust) { - (Ok(c), Ok(rust)) => (c, rust), - a => panic!("{a:#?}"), - }; + if !c.status.success() { + error!( + "Failed to run C program.\nstdout: {stdout}\nstderr: {stderr}", + stdout = std::str::from_utf8(&c.stdout).unwrap_or(""), + stderr = std::str::from_utf8(&c.stderr).unwrap_or(""), + ); + } - if !c.status.success() { - error!( - "Failed to run C program for intrinsic `{intrinsic_name}`\nstdout: {stdout}\nstderr: {stderr}", - stdout = std::str::from_utf8(&c.stdout).unwrap_or(""), - stderr = std::str::from_utf8(&c.stderr).unwrap_or(""), - ); - return Some(FailureReason::RunC(intrinsic_name.clone())); - } + if !rust.status.success() { + error!( + "Failed to run Rust program.\nstdout: {stdout}\nstderr: {stderr}", + stdout = std::str::from_utf8(&rust.stdout).unwrap_or(""), + stderr = std::str::from_utf8(&rust.stderr).unwrap_or(""), + ); + } - if !rust.status.success() { - error!( - "Failed to run Rust program for intrinsic `{intrinsic_name}`\nstdout: {stdout}\nstderr: {stderr}", - stdout = std::str::from_utf8(&rust.stdout).unwrap_or(""), - stderr = std::str::from_utf8(&rust.stderr).unwrap_or(""), - ); - return Some(FailureReason::RunRust(intrinsic_name.clone())); - } + info!("Completed running C++ and Rust test binaries"); + let c = std::str::from_utf8(&c.stdout) + .unwrap() + .to_lowercase() + .replace("-nan", "nan"); + let rust = std::str::from_utf8(&rust.stdout) + .unwrap() + .to_lowercase() + .replace("-nan", "nan"); - info!("Comparing intrinsic: {intrinsic_name}"); + let c_output_map = c + .split(INTRINSIC_DELIMITER) + .filter_map(|output| output.trim().split_once("\n")) + .collect::>(); + let rust_output_map = rust + .split(INTRINSIC_DELIMITER) + .filter_map(|output| output.trim().split_once("\n")) + .collect::>(); - let c = std::str::from_utf8(&c.stdout) - .unwrap() - .to_lowercase() - .replace("-nan", "nan"); - let rust = std::str::from_utf8(&rust.stdout) - .unwrap() - .to_lowercase() - .replace("-nan", "nan"); + let intrinsics = c_output_map + .keys() + .chain(rust_output_map.keys()) + .unique() + .collect_vec(); - if c == rust { + info!("Comparing outputs"); + let intrinsics_diff_count = intrinsics + .par_iter() + .filter_map(|&&intrinsic| { + let c_output = c_output_map.get(intrinsic).unwrap(); + let rust_output = rust_output_map.get(intrinsic).unwrap(); + if rust_output.eq(c_output) { None } else { - Some(FailureReason::Difference(intrinsic_name.clone(), c, rust)) + let diff = diff::lines(c_output, rust_output); + let diffs = diff + .into_iter() + .filter_map(|diff| match diff { + diff::Result::Left(_) | diff::Result::Right(_) => Some(diff), + diff::Result::Both(_, _) => None, + }) + .collect_vec(); + if diffs.len() > 0 { + Some((intrinsic, diffs)) + } else { + None + } } }) - .collect::>(); - - intrinsics.iter().for_each(|reason| match reason { - FailureReason::Difference(intrinsic, c, rust) => { + .inspect(|(intrinsic, diffs)| { println!("Difference for intrinsic: {intrinsic}"); - let diff = diff::lines(c, rust); - diff.iter().for_each(|diff| match diff { + diffs.into_iter().for_each(|diff| match diff { diff::Result::Left(c) => println!("C: {c}"), diff::Result::Right(rust) => println!("Rust: {rust}"), - diff::Result::Both(_, _) => (), + _ => (), }); println!("****************************************************************"); - } - FailureReason::RunC(intrinsic) => { - println!("Failed to run C program for intrinsic {intrinsic}") - } - FailureReason::RunRust(intrinsic) => { - println!("Failed to run rust program for intrinsic {intrinsic}") - } - }); + }) + .count(); + println!( "{} differences found (tested {} intrinsics)", - intrinsics.len(), + intrinsics_diff_count, intrinsic_name_list.len() ); - intrinsics.is_empty() + + intrinsics_diff_count == 0 } diff --git a/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs b/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs index 04741e4f8075..a95b4c36b7bf 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/gen_c.rs @@ -1,6 +1,7 @@ use crate::common::intrinsic::Intrinsic; use super::argument::Argument; +use super::compare::INTRINSIC_DELIMITER; use super::indentation::Indentation; use super::intrinsic_helpers::IntrinsicTypeDefinition; @@ -147,22 +148,17 @@ pub fn write_main_cpp<'a>( } writeln!(w, "int main(int argc, char **argv) {{")?; - writeln!(w, " std::string intrinsic_name = argv[1];")?; - - writeln!(w, " if (false) {{")?; for intrinsic in intrinsics { - writeln!(w, " }} else if (intrinsic_name == \"{intrinsic}\") {{")?; - writeln!(w, " return run_{intrinsic}();")?; + writeln!( + w, + " std::cout << \"{INTRINSIC_DELIMITER}\" << std::endl;" + )?; + writeln!(w, " std::cout << \"{intrinsic}\" << std::endl;")?; + writeln!(w, " run_{intrinsic}();\n")?; } - writeln!(w, " }} else {{")?; - writeln!( - w, - " std::cerr << \"Unknown command: \" << intrinsic_name << \"\\n\";" - )?; - writeln!(w, " return -1;")?; - writeln!(w, " }}")?; + writeln!(w, " return 0;")?; writeln!(w, "}}")?; diff --git a/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs b/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs index c8d815e46eae..82b97701bb14 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/gen_rust.rs @@ -1,11 +1,11 @@ use itertools::Itertools; use std::process::Command; -use crate::common::argument::ArgumentList; -use crate::common::intrinsic::Intrinsic; - +use super::compare::INTRINSIC_DELIMITER; use super::indentation::Indentation; use super::intrinsic_helpers::IntrinsicTypeDefinition; +use crate::common::argument::ArgumentList; +use crate::common::intrinsic::Intrinsic; // The number of times each intrinsic will be called. pub(crate) const PASSES: u32 = 20; @@ -86,18 +86,12 @@ pub fn write_main_rs<'a>( writeln!(w, "fn main() {{")?; - writeln!(w, " match std::env::args().nth(1).unwrap().as_str() {{")?; - for binary in intrinsics { - writeln!(w, " \"{binary}\" => run_{binary}(),")?; + writeln!(w, " println!(\"{INTRINSIC_DELIMITER}\");")?; + writeln!(w, " println!(\"{binary}\");")?; + writeln!(w, " run_{binary}();\n")?; } - writeln!( - w, - " other => panic!(\"unknown intrinsic `{{}}`\", other)," - )?; - - writeln!(w, " }}")?; writeln!(w, "}}")?; Ok(()) @@ -146,7 +140,12 @@ pub fn write_lib_rs( Ok(()) } -pub fn compile_rust_programs(toolchain: Option<&str>, target: &str, linker: Option<&str>) -> bool { +pub fn compile_rust_programs( + toolchain: Option<&str>, + target: &str, + profile: &str, + linker: Option<&str>, +) -> bool { /* If there has been a linker explicitly set from the command line then * we want to set it via setting it in the RUSTFLAGS*/ @@ -167,7 +166,7 @@ pub fn compile_rust_programs(toolchain: Option<&str>, target: &str, linker: Opti if toolchain.is_some_and(|val| !val.is_empty()) { cargo_command.arg(toolchain.unwrap()); } - cargo_command.args(["build", "--target", target, "--release"]); + cargo_command.args(["build", "--target", target, "--profile", profile]); let mut rust_flags = "-Cdebuginfo=0".to_string(); if let Some(linker) = linker { diff --git a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs index c2d66868ceb4..a14d7ef05f53 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/intrinsic_helpers.rs @@ -42,7 +42,7 @@ impl FromStr for TypeKind { "uint" | "unsigned" | "UI8" | "UI16" | "UI32" | "UI64" => Ok(Self::Int(Sign::Unsigned)), "void" => Ok(Self::Void), "MASK" => Ok(Self::Mask), - "M64" | "M128" | "M256" | "M512" => Ok(Self::Vector), + "M128" | "M256" | "M512" => Ok(Self::Vector), _ => Err(format!("Impossible to parse argument kind {s}")), } } @@ -368,19 +368,8 @@ pub trait IntrinsicTypeDefinition: Deref { /// Generates a std::cout for the intrinsics results that will match the /// rust debug output format for the return type. The generated line assumes /// there is an int i in scope which is the current pass number. - /// - /// The `intrinsic-test` crate compares the output of C and Rust intrinsics. Currently, It uses - /// a string representation of the output value to compare. In C, f16 values are currently printed - /// as hexadecimal integers. Since https://github.com/rust-lang/rust/pull/127013, rust does print - /// them as decimal floating point values. To keep the intrinsics tests working, for now, format - /// vectors containing f16 values like C prints them. fn print_result_rust(&self) -> String { - let return_value = match self.kind() { - TypeKind::Float if self.inner_size() == 16 => "debug_f16(__return_value)", - _ => "format_args!(\"{__return_value:.150?}\")", - }; - - String::from(return_value) + String::from("format_args!(\"{__return_value:.150?}\")") } /// To enable architecture-specific logic diff --git a/library/stdarch/crates/intrinsic-test/src/common/mod.rs b/library/stdarch/crates/intrinsic-test/src/common/mod.rs index 8b6bd943a742..a1062b3a87db 100644 --- a/library/stdarch/crates/intrinsic-test/src/common/mod.rs +++ b/library/stdarch/crates/intrinsic-test/src/common/mod.rs @@ -146,6 +146,7 @@ pub trait SupportedArchitectureTest { .unwrap(); let target = &self.cli_options().target; + let profile = &self.cli_options().profile; let toolchain = self.cli_options().toolchain.as_deref(); let linker = self.cli_options().linker.as_deref(); @@ -178,7 +179,7 @@ pub trait SupportedArchitectureTest { .collect::>() .unwrap(); - compile_rust_programs(toolchain, target, linker) + compile_rust_programs(toolchain, target, profile, linker) } fn compare_outputs(&self) -> bool { @@ -193,6 +194,7 @@ pub trait SupportedArchitectureTest { &intrinsics_name_list, &self.cli_options().runner, &self.cli_options().target, + &self.cli_options().profile, ) } else { true diff --git a/library/stdarch/crates/intrinsic-test/src/main.rs b/library/stdarch/crates/intrinsic-test/src/main.rs index 3580d80bd112..e5c846877ce6 100644 --- a/library/stdarch/crates/intrinsic-test/src/main.rs +++ b/library/stdarch/crates/intrinsic-test/src/main.rs @@ -34,7 +34,7 @@ fn run(test_environment: impl SupportedArchitectureTest) { if !test_environment.build_rust_file() { std::process::exit(3); } - info!("comparing outputs"); + info!("Running binaries"); if !test_environment.compare_outputs() { std::process::exit(1); } diff --git a/library/stdarch/crates/intrinsic-test/src/x86/compile.rs b/library/stdarch/crates/intrinsic-test/src/x86/compile.rs index 60997a1278a4..65cd291b1b37 100644 --- a/library/stdarch/crates/intrinsic-test/src/x86/compile.rs +++ b/library/stdarch/crates/intrinsic-test/src/x86/compile.rs @@ -25,14 +25,26 @@ pub fn build_cpp_compilation(config: &ProcessedCli) -> Option { "-mavx512cd", "-mavx512fp16", "-msha512", + "-msm3", "-msm4", "-mavxvnni", + "-mavxvnniint8", + "-mavxneconvert", + "-mavxifma", + "-mavxvnniint16", + "-mavx512bf16", "-mavx512bitalg", "-mavx512ifma", "-mavx512vbmi", "-mavx512vbmi2", "-mavx512vnni", "-mavx512vpopcntdq", + "-mavx512vp2intersect", + "-mbmi", + "-mbmi2", + "-mgfni", + "-mvaes", + "-mvpclmulqdq", "-ferror-limit=1000", "-std=c++23", ]); diff --git a/library/stdarch/crates/intrinsic-test/src/x86/config.rs b/library/stdarch/crates/intrinsic-test/src/x86/config.rs index 7c349e448206..491dbb5147bb 100644 --- a/library/stdarch/crates/intrinsic-test/src/x86/config.rs +++ b/library/stdarch/crates/intrinsic-test/src/x86/config.rs @@ -5,7 +5,7 @@ pub const NOTICE: &str = "\ // Format f16 values (and vectors containing them) in a way that is consistent with C. pub const PLATFORM_RUST_DEFINITIONS: &str = r#" -use std::arch::x86_64::*; +use core_arch::arch::x86_64::*; #[inline] unsafe fn _mm_loadu_ph_to___m128i(mem_addr: *const f16) -> __m128i { @@ -142,71 +142,6 @@ fn debug_simd_finish( ) } -#[repr(transparent)] -struct Hex(T); - -impl core::fmt::Debug for Hex { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - ::fmt(&self.0, f) - } -} - -fn debug_f16(x: T) -> impl core::fmt::Debug { - Hex(x) -} - -trait DebugHexF16 { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result; -} - -impl DebugHexF16 for f16 { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(f, "{:#06x?}", self.to_bits()) - } -} - -impl DebugHexF16 for __m128h { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 8]>(*self) }; - debug_simd_finish(f, "__m128h", &array) - } -} - -impl DebugHexF16 for __m128i { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 8]>(*self) }; - debug_simd_finish(f, "__m128i", &array) - } -} - -impl DebugHexF16 for __m256h { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 16]>(*self) }; - debug_simd_finish(f, "__m256h", &array) - } -} - -impl DebugHexF16 for __m256i { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 16]>(*self) }; - debug_simd_finish(f, "__m256i", &array) - } -} - -impl DebugHexF16 for __m512h { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 32]>(*self) }; - debug_simd_finish(f, "__m512h", &array) - } -} - -impl DebugHexF16 for __m512i { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let array = unsafe { core::mem::transmute::<_, [Hex; 32]>(*self) }; - debug_simd_finish(f, "__m512i", &array) - } -} - trait DebugAs { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result; } @@ -232,7 +167,7 @@ macro_rules! impl_debug_as { }; } -impl_debug_as!(__m128i, "__m128i", 128, [u8, i8, u16, i16, u32, i32, u64, i64]); +impl_debug_as!(__m128i, "__m128i", 128, [u8, i8, u16, i16, u32, i32, u64, i64, f16]); impl_debug_as!(__m256i, "__m256i", 256, [u8, i8, u16, i16, u32, i32, u64, i64]); impl_debug_as!(__m512i, "__m512i", 512, [u8, i8, u16, i16, u32, i32, u64, i64]); impl_debug_as!(__m128h, "__m128h", 128, [f32]); @@ -280,12 +215,6 @@ pub const PLATFORM_C_FORWARD_DECLARATIONS: &str = r#" #define _mm512_extract_intrinsic_test_epi64(m, lane) \ _mm_extract_epi64(_mm512_extracti64x2_epi64((m), (lane) / 2), (lane) % 2) - - #define _mm64_extract_intrinsic_test_epi8(m, lane) \ - ((_mm_extract_pi16((m), (lane) / 2) >> (((lane) % 2) * 8)) & 0xFF) - - #define _mm64_extract_intrinsic_test_epi32(m, lane) \ - _mm_cvtsi64_si32(_mm_srli_si64(m, (lane) * 32)) // Load f16 (__m128h) and cast to integer (__m128i) #define _mm_loadu_ph_to___m128i(mem_addr) _mm_castph_si128(_mm_loadu_ph(mem_addr)) @@ -342,11 +271,7 @@ pub const PLATFORM_C_FORWARD_DECLARATIONS: &str = r#" pub const PLATFORM_C_DEFINITIONS: &str = r#" std::ostream& operator<<(std::ostream& os, _Float16 value) { - uint16_t temp = 0; - memcpy(&temp, &value, sizeof(_Float16)); - std::stringstream ss; - ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << temp; - os << ss.str(); + os << static_cast(value); return os; } diff --git a/library/stdarch/crates/intrinsic-test/src/x86/types.rs b/library/stdarch/crates/intrinsic-test/src/x86/types.rs index 87932fcb3ec7..2391ee9c2df4 100644 --- a/library/stdarch/crates/intrinsic-test/src/x86/types.rs +++ b/library/stdarch/crates/intrinsic-test/src/x86/types.rs @@ -115,9 +115,6 @@ impl IntrinsicTypeDefinition for X86IntrinsicType { // if "type" starts with __m{h/i/}, // then use either _mm_set1_epi64, // _mm256_set1_epi64 or _mm512_set1_epi64 - if type_value.contains("__m64") { - return String::from("*(__m64*)"); - } let type_val_filtered = type_value .chars() @@ -175,29 +172,7 @@ impl IntrinsicTypeDefinition for X86IntrinsicType { /// rust debug output format for the return type. The generated line assumes /// there is an int i in scope which is the current pass number. fn print_result_c(&self, indentation: Indentation, additional: &str) -> String { - let lanes = if self.num_vectors() > 1 { - (0..self.num_vectors()) - .map(|vector| { - format!( - r#""{ty}(" << {lanes} << ")""#, - ty = self.c_single_vector_type(), - lanes = (0..self.num_lanes()) - .map(move |idx| -> std::string::String { - format!( - "{cast}{lane_fn}(__return_value.val[{vector}], {lane})", - cast = self.generate_final_type_cast(), - lane_fn = self.get_lane_function(), - lane = idx, - vector = vector, - ) - }) - .collect::>() - .join(r#" << ", " << "#) - ) - }) - .collect::>() - .join(r#" << ", " << "#) - } else if self.num_lanes() > 1 { + let lanes = if self.num_lanes() > 1 { (0..self.num_lanes()) .map(|idx| -> std::string::String { let cast_type = self.c_promotion(); @@ -262,9 +237,6 @@ impl IntrinsicTypeDefinition for X86IntrinsicType { (Some(16), Some(512)) => String::from("(uint16_t)_mm512_extract_intrinsic_test_epi16"), (Some(32), Some(512)) => String::from("(uint32_t)_mm512_extract_intrinsic_test_epi32"), (Some(64), Some(512)) => String::from("(uint64_t)_mm512_extract_intrinsic_test_epi64"), - (Some(8), Some(64)) => String::from("(uint8_t)_mm64_extract_intrinsic_test_epi8"), - (Some(16), Some(64)) => String::from("(uint16_t)_mm_extract_pi16"), - (Some(32), Some(64)) => String::from("(uint32_t)_mm64_extract_intrinsic_test_epi32"), _ => unreachable!( "invalid length for vector argument: {:?}, {:?}", self.bit_len, self.simd_len @@ -289,12 +261,9 @@ impl IntrinsicTypeDefinition for X86IntrinsicType { fn print_result_rust(&self) -> String { let return_value = match self.kind() { - TypeKind::Float if self.inner_size() == 16 => "debug_f16(__return_value)".to_string(), - TypeKind::Float - if self.inner_size() == 32 - && ["__m512h"].contains(&self.param.type_data.as_str()) => - { - "debug_as::<_, f32>(__return_value)".to_string() + // `_mm{256}_cvtps_ph` has return type __m128i but contains f16 values + TypeKind::Float if self.param.type_data == "__m128i" => { + "format_args!(\"{:.150?}\", debug_as::<_, f16>(__return_value))".to_string() } TypeKind::Int(_) if ["__m128i", "__m256i", "__m512i"].contains(&self.param.type_data.as_str()) => @@ -469,6 +438,17 @@ impl X86IntrinsicType { } } + // a few intrinsics have wrong `etype` field in the XML + // - _mm512_reduce_add_ph + // - _mm512_reduce_mul_ph + // - _mm512_reduce_min_ph + // - _mm512_reduce_max_ph + // - _mm512_conj_pch + if param.type_data == "__m512h" && param.etype == "FP32" { + data.bit_len = Some(16); + data.simd_len = Some(32); + } + let mut result = X86IntrinsicType { data, param: param.clone(), diff --git a/library/stdarch/crates/intrinsic-test/src/x86/xml_parser.rs b/library/stdarch/crates/intrinsic-test/src/x86/xml_parser.rs index af85118b8aac..681b1a3c5274 100644 --- a/library/stdarch/crates/intrinsic-test/src/x86/xml_parser.rs +++ b/library/stdarch/crates/intrinsic-test/src/x86/xml_parser.rs @@ -30,8 +30,8 @@ struct XMLIntrinsic { pub return_data: Parameter, #[serde(rename = "@name")] pub name: String, - // #[serde(rename = "@tech")] - // tech: String, + #[serde(rename = "@tech")] + tech: String, #[serde(rename = "CPUID", default)] cpuid: Vec, #[serde(rename = "parameter", default)] @@ -65,6 +65,16 @@ pub fn get_xml_intrinsics( let parsed_intrinsics: Vec> = data .intrinsics .into_iter() + .filter(|intrinsic| { + intrinsic.tech != "SVML" + && intrinsic.tech != "MMX" + && !intrinsic.cpuid.contains(&"MPX".to_string()) + && intrinsic.return_data.type_data != "__m64" + && !intrinsic + .parameters + .iter() + .any(|param| param.type_data.contains("__m64")) + }) .filter_map(|intr| { // Some(xml_to_intrinsic(intr, target).expect("Couldn't parse XML properly!")) xml_to_intrinsic(intr).ok() diff --git a/library/stdarch/crates/simd-test-macro/src/lib.rs b/library/stdarch/crates/simd-test-macro/src/lib.rs index b18e2d6b63e5..b8bb874480a0 100644 --- a/library/stdarch/crates/simd-test-macro/src/lib.rs +++ b/library/stdarch/crates/simd-test-macro/src/lib.rs @@ -7,43 +7,41 @@ #[macro_use] extern crate quote; -use proc_macro2::{Ident, Literal, Span, TokenStream, TokenTree}; +use proc_macro2::{Ident, Span, TokenStream, TokenTree}; use quote::ToTokens; use std::env; -fn string(s: &str) -> TokenTree { - Literal::string(s).into() -} - #[proc_macro_attribute] pub fn simd_test( attr: proc_macro::TokenStream, item: proc_macro::TokenStream, ) -> proc_macro::TokenStream { let tokens = TokenStream::from(attr).into_iter().collect::>(); - if tokens.len() != 3 { - panic!("expected #[simd_test(enable = \"feature\")]"); - } - match &tokens[0] { - TokenTree::Ident(tt) if *tt == "enable" => {} - _ => panic!("expected #[simd_test(enable = \"feature\")]"), - } - match &tokens[1] { - TokenTree::Punct(tt) if tt.as_char() == '=' => {} - _ => panic!("expected #[simd_test(enable = \"feature\")]"), - } - let enable_feature = match &tokens[2] { - TokenTree::Literal(tt) => tt.to_string(), - _ => panic!("expected #[simd_test(enable = \"feature\")]"), - }; - let enable_feature = enable_feature.trim_start_matches('"').trim_end_matches('"'); - let target_features: Vec = enable_feature - .replace('+', "") - .split(',') - .map(String::from) - .collect(); + let (target_features, target_feature_attr) = match &tokens[..] { + [] => (Vec::new(), TokenStream::new()), + [ + TokenTree::Ident(enable), + TokenTree::Punct(equals), + TokenTree::Literal(literal), + ] if enable == "enable" && equals.as_char() == '=' => { + let enable_feature = literal.to_string(); + let enable_feature = enable_feature.trim_start_matches('"').trim_end_matches('"'); + let target_features: Vec<_> = enable_feature + .replace('+', "") + .split(',') + .map(String::from) + .collect(); + + ( + target_features, + quote! { + #[target_feature(enable = #enable_feature)] + }, + ) + } + _ => panic!("expected #[simd_test(enable = \"feature\")] or #[simd_test]"), + }; - let enable_feature = string(enable_feature); let mut item = syn::parse_macro_input!(item as syn::ItemFn); let item_attrs = std::mem::take(&mut item.attrs); let name = &item.sig.ident; @@ -102,6 +100,19 @@ pub fn simd_test( TokenStream::new() }; + let (const_test, const_stability) = if item.sig.constness.is_some() { + ( + quote! { + const _: () = unsafe { #name() }; + }, + quote! { + #[rustc_const_unstable(feature = "stdarch_const_helpers", issue = "none")] + }, + ) + } else { + (TokenStream::new(), TokenStream::new()) + }; + let ret: TokenStream = quote_spanned! { proc_macro2::Span::call_site() => #[allow(non_snake_case)] @@ -109,6 +120,8 @@ pub fn simd_test( #maybe_ignore #(#item_attrs)* fn #name() { + #const_test + let mut missing_features = ::std::vec::Vec::new(); #detect_missing_features if missing_features.is_empty() { @@ -118,7 +131,8 @@ pub fn simd_test( ::stdarch_test::assert_skip_test_ok(stringify!(#name), &missing_features); } - #[target_feature(enable = #enable_feature)] + #target_feature_attr + #const_stability #item } }; diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml index fe64f9d7869e..8f36c525fae9 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml @@ -13,6 +13,10 @@ auto_llvm_sign_conversion: false neon-stable: &neon-stable FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] +# #[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] +neon-stable-fp16: &neon-stable-fp16 + FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "CURRENT_RUSTC_VERSION"']] + # #[cfg(not(target_arch = "arm64ec"))] target-not-arm64ec: &target-not-arm64ec FnCall: [cfg, [{ FnCall: [not, ['target_arch = "arm64ec"']]}]] @@ -1506,8 +1510,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtn2]]}]] - - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -1524,8 +1527,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtl2]]}]] - - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -1809,7 +1811,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtas]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -1979,7 +1981,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtns]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -2000,7 +2002,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtnu]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -2114,7 +2116,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtms]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -2135,7 +2137,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtmu]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -2330,7 +2332,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtps]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -2351,7 +2353,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtpu]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -3034,7 +3036,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [frintx] safety: safe @@ -3083,7 +3085,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [frinta] safety: safe @@ -3183,7 +3185,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [frintm] safety: safe @@ -3233,7 +3235,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [frintp] safety: safe @@ -3279,7 +3281,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [frintz] safety: safe @@ -3332,7 +3334,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [frinti] safety: safe @@ -5091,13 +5093,13 @@ intrinsics: static_defs: ["const LANE: i32"] safety: safe types: - - [int32x2_t, uint8x8_t, int8x16_t, '[LANE as u32, LANE as u32]'] - - [int32x4_t, uint8x16_t, int8x16_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] + - [int32x2_t, uint8x8_t, int8x16_t, '[LANE as u32, LANE as u32]',''] + - [int32x4_t, uint8x16_t, int8x16_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]','q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '2']] - - Let: [c, int32x4_t, {FnCall: [transmute, [c]]}] + - Let: [c, int32x4_t, {FnCall: ['vreinterpretq_s32_s8', [c]]}] - Let: [c, "{neon_type[0]}", {FnCall: [simd_shuffle!, [c, c, "{type[3]}"]]}] - - FnCall: ["vusdot{neon_type[0].no}", [a, b, {FnCall: [transmute, [c]]}]] + - FnCall: ["vusdot{neon_type[0].no}", [a, b, {FnCall: ['vreinterpret{type[4]}_s8_s32', [c]]}]] - name: "vsudot{neon_type[0].laneq_nox}" doc: "Dot product index form with signed and unsigned integers" @@ -5123,7 +5125,11 @@ intrinsics: - c - "{type[4]}" - FnCall: [simd_shuffle!, [c, c, "{type[3]}"]] - - FnCall: ["vusdot{neon_type[0].no}", [a, {FnCall: [transmute, [c]]}, b]] + - FnCall: + - "vusdot{neon_type[0].no}" + - - a + - FnCall: [transmute, [c]] + - b - name: "vmul{neon_type.no}" doc: Multiply @@ -5266,7 +5272,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmulx] safety: safe @@ -5448,7 +5454,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fmulx, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -5649,7 +5655,7 @@ intrinsics: return_type: "{neon_type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fdiv] safety: safe @@ -5667,7 +5673,7 @@ intrinsics: - *neon-fp16 - *neon-unstable-f16 - *target-not-arm64ec - assert_instr: [nop] + assert_instr: [fdiv] safety: safe types: - [f16, 'h'] @@ -5692,7 +5698,7 @@ intrinsics: arguments: ["a: {type[1]}", "b: {type[1]}"] return_type: "{type[1]}" attr: [*neon-stable] - assert_instr: [nop] + assert_instr: [sub] safety: safe types: - ['d_s64', 'i64'] @@ -5708,7 +5714,7 @@ intrinsics: - *neon-fp16 - *neon-unstable-f16 - *target-not-arm64ec - assert_instr: [nop] + assert_instr: [fsub] safety: safe types: - ['h_f16', 'f16'] @@ -5998,7 +6004,7 @@ intrinsics: attr: - *neon-fp16 - *enable-fcma - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec assert_instr: [fcadd] safety: safe @@ -6019,7 +6025,7 @@ intrinsics: attr: - *neon-fp16 - *enable-fcma - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec assert_instr: [fcadd] safety: safe @@ -6060,7 +6066,7 @@ intrinsics: attr: - FnCall: [target_feature, ['enable = "neon,fcma"']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec assert_instr: [fcmla] safety: safe @@ -6101,7 +6107,7 @@ intrinsics: attr: - FnCall: [target_feature, ['enable = "neon,fcma"']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec assert_instr: [fcmla] safety: safe @@ -6143,7 +6149,7 @@ intrinsics: attr: - FnCall: [target_feature, ['enable = "neon,fcma"']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec assert_instr: [fcmla] safety: safe @@ -6188,7 +6194,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6234,7 +6240,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6280,7 +6286,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6323,7 +6329,7 @@ intrinsics: attr: - FnCall: [target_feature, ['enable = "neon,fcma"']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec assert_instr: [fcmla] safety: safe @@ -6369,7 +6375,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6417,7 +6423,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6465,7 +6471,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6512,7 +6518,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6556,7 +6562,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-unstable-fcma - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6580,14 +6586,14 @@ intrinsics: - FnCall: [unstable, ['feature = "stdarch_neon_dotprod"', 'issue = "117224"']] safety: safe types: - - [int32x2_t, int8x8_t, int8x16_t, int32x4_t, '[LANE as u32, LANE as u32]'] - - [int32x4_t, int8x16_t, int8x16_t, int32x4_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] + - [int32x2_t, int8x8_t, int8x16_t, int32x4_t, '[LANE as u32, LANE as u32]', ''] + - [int32x4_t, int8x16_t, int8x16_t, int32x4_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]','q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '2']] - Let: - c - "{neon_type[3]}" - - FnCall: [transmute, [c]] + - FnCall: ['vreinterpretq_{neon_type[0]}_{neon_type[1]}', [c]] - Let: - c - "{neon_type[0]}" @@ -6596,7 +6602,7 @@ intrinsics: - "vdot{neon_type[0].no}" - - a - b - - FnCall: [transmute, [c]] + - FnCall: ['vreinterpret{type[5]}_{neon_type[1]}_{neon_type[0]}', [c]] - name: "vdot{neon_type[0].laneq_nox}" doc: Dot product arithmetic (indexed) @@ -6610,14 +6616,14 @@ intrinsics: - FnCall: [unstable, ['feature = "stdarch_neon_dotprod"', 'issue = "117224"']] safety: safe types: - - [uint32x2_t, uint8x8_t, uint8x16_t, uint32x4_t, '[LANE as u32, LANE as u32]'] - - [uint32x4_t, uint8x16_t, uint8x16_t, uint32x4_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] + - [uint32x2_t, uint8x8_t, uint8x16_t, uint32x4_t, '[LANE as u32, LANE as u32]',''] + - [uint32x4_t, uint8x16_t, uint8x16_t, uint32x4_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]','q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '2']] - Let: - c - "{neon_type[3]}" - - FnCall: [transmute, [c]] + - FnCall: ['vreinterpretq_{neon_type[0]}_{neon_type[1]}', [c]] - Let: - c - "{neon_type[0]}" @@ -6626,7 +6632,7 @@ intrinsics: - "vdot{neon_type[0].no}" - - a - b - - FnCall: [transmute, [c]] + - FnCall: ['vreinterpret{type[5]}_{neon_type[1]}_{neon_type[0]}', [c]] - name: "vmax{neon_type.no}" doc: Maximum (vector) @@ -6967,7 +6973,7 @@ intrinsics: return_type: "{type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [faddp] safety: safe @@ -6987,7 +6993,7 @@ intrinsics: return_type: "{type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmaxp] safety: safe @@ -7008,7 +7014,7 @@ intrinsics: return_type: "{type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmaxnmp] safety: safe @@ -7029,7 +7035,7 @@ intrinsics: return_type: "{type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fminp] safety: safe @@ -7050,7 +7056,7 @@ intrinsics: return_type: "{type}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fminnmp] safety: safe @@ -8476,7 +8482,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fsqrt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -8789,8 +8795,7 @@ intrinsics: arguments: ["a: {type[0]}"] return_type: "{type[1]}" attr: - - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [nop] safety: safe @@ -9690,7 +9695,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [trn1]]}]] safety: safe @@ -9752,7 +9757,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [trn2]]}]] safety: safe @@ -9821,7 +9826,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [zip2]]}]] safety: safe @@ -9872,7 +9877,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [zip1]]}]] safety: safe @@ -9934,7 +9939,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [uzp1]]}]] safety: safe @@ -10000,7 +10005,7 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec - FnCall: [cfg_attr, [{FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]]}, {FnCall: [assert_instr, [uzp2]]}]] safety: safe @@ -10290,7 +10295,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fmla, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe @@ -10317,7 +10322,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fmls, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['3']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe @@ -10657,7 +10662,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcmeq]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -11247,7 +11252,7 @@ intrinsics: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fmul, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe @@ -11270,7 +11275,7 @@ intrinsics: - *neon-fp16 - *neon-unstable-f16 - *target-not-arm64ec - assert_instr: [nop] + assert_instr: [fmul] safety: safe types: - [f16, 'h'] @@ -11861,7 +11866,7 @@ intrinsics: attr: - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [fcvtau]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec safety: safe types: @@ -13257,7 +13262,7 @@ intrinsics: types: - [int64x2_t, i64] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vpaddd_u64" doc: "Add pairwise" @@ -13270,7 +13275,7 @@ intrinsics: types: - [uint64x2_t, u64] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13287,7 +13292,7 @@ intrinsics: - [int16x8_t, i16] - [int32x4_t, i32] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13300,7 +13305,7 @@ intrinsics: types: - [int32x2_t, i32] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13313,7 +13318,7 @@ intrinsics: types: - [int64x2_t, i64] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13330,7 +13335,7 @@ intrinsics: - [uint16x8_t, u16] - [uint32x4_t, u32] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13343,7 +13348,7 @@ intrinsics: types: - [uint32x2_t, u32, i32] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddv{neon_type[0].no}" doc: "Add across vector" @@ -13356,7 +13361,7 @@ intrinsics: types: - [uint64x2_t, u64, i64] compose: - - FnCall: [simd_reduce_add_unordered, [a]] + - FnCall: [simd_reduce_add_ordered, [a, 0]] - name: "vaddlv{neon_type[0].no}" doc: "Signed Add Long across Vector" @@ -13769,7 +13774,7 @@ intrinsics: attr: - *neon-fp16 - *enable-fhm - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmlal2] safety: safe @@ -13793,7 +13798,7 @@ intrinsics: - *neon-fp16 - *enable-fhm - FnCall: [rustc_legacy_const_generics, ['3']] - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe @@ -13818,7 +13823,7 @@ intrinsics: attr: - *neon-fp16 - *enable-fhm - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmlal] safety: safe @@ -13842,7 +13847,7 @@ intrinsics: - *neon-fp16 - *enable-fhm - FnCall: [rustc_legacy_const_generics, ['3']] - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe @@ -13867,7 +13872,7 @@ intrinsics: attr: - *neon-fp16 - *enable-fhm - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmlsl2] safety: safe @@ -13890,7 +13895,7 @@ intrinsics: - *neon-fp16 - *enable-fhm - FnCall: [rustc_legacy_const_generics, ['3']] - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe @@ -13915,7 +13920,7 @@ intrinsics: attr: - *neon-fp16 - *enable-fhm - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec assert_instr: [fmlsl] safety: safe @@ -13938,7 +13943,7 @@ intrinsics: - *neon-fp16 - *enable-fhm - FnCall: [rustc_legacy_const_generics, ['3']] - - *neon-unstable-f16 + - *neon-stable-fp16 - *target-not-arm64ec static_defs: ['const LANE: i32'] safety: safe diff --git a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml index 43dd3b903150..c7a333d7f75e 100644 --- a/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml +++ b/library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml @@ -10,6 +10,10 @@ auto_big_endian: true neon-stable: &neon-stable FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']] +# #[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")] +neon-stable-fp16: &neon-stable-fp16 + FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "CURRENT_RUSTC_VERSION"']] + # #[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800"))] neon-cfg-arm-unstable: &neon-cfg-arm-unstable FnCall: ['cfg_attr', ['target_arch = "arm"', {FnCall: ['unstable', ['feature = "stdarch_arm_neon_intrinsics"', 'issue = "111800"']]}]] @@ -51,6 +55,10 @@ neon-target-aarch64-arm64ec: &neon-target-aarch64-arm64ec neon-not-arm-stable: &neon-not-arm-stable FnCall: [cfg_attr, [{ FnCall: [not, ['target_arch = "arm"']]}, {FnCall: [stable, ['feature = "neon_intrinsics"', 'since = "1.59.0"']]}]] +# #[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION"))] +neon-not-arm-stable-fp16: &neon-not-arm-stable-fp16 + FnCall: [cfg_attr, [{ FnCall: [not, ['target_arch = "arm"']]}, {FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "CURRENT_RUSTC_VERSION"']]}]] + # #[cfg_attr(all(test, not(target_env = "msvc"))] msvc-disabled: &msvc-disabled FnCall: [all, [test, {FnCall: [not, ['target_env = "msvc"']]}]] @@ -71,6 +79,10 @@ neon-i8mm: &neon-i8mm neon-fp16: &neon-fp16 FnCall: [target_feature, ['enable = "neon,fp16"']] +# #[cfg_attr[target_arch = "arm", target_feature(enable = "neon,fp16")] +arm-fp16: &arm-fp16 + FnCall: [cfg_attr, ['target_arch = "arm"', {FnCall: [target_feature, ['enable = "fp16"']]}]] + enable-fcma: &enable-fcma FnCall: [cfg_attr, [{ FnCall: [not, ['target_arch = "arm"']]}, { FnCall: [target_feature, ['enable = "fcma"']] }]] @@ -281,7 +293,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vabd.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fabd]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -400,7 +413,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vceq.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmeq]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -462,7 +476,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vabs]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fabs]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -562,7 +577,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcgt.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmgt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -581,7 +597,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcgt.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmgt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -660,7 +677,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcge.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmge]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -678,7 +696,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcle.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmle]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -860,7 +879,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vacgt.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [facgt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -907,7 +927,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vacge.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [facge]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -948,7 +969,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vacgt.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [facgt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -984,7 +1006,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vacge.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [facge]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -1019,7 +1042,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [scvtf]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -1054,7 +1078,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ucvtf]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -1126,7 +1151,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ucvtf, 'N = 1']]}]] - FnCall: [rustc_legacy_const_generics, ['1']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1158,7 +1184,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcvtzs, 'N = 1']]}]] - FnCall: [rustc_legacy_const_generics, ['1']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1190,7 +1217,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcvtzu, 'N = 1']]}]] - FnCall: [rustc_legacy_const_generics, ['1']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1249,7 +1277,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [scvtf, 'N = 1']]}]] - FnCall: [rustc_legacy_const_generics, ['1']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1502,8 +1531,9 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vdup.16"', 'N = 4']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [dup, 'N = 4']]}]] - FnCall: [rustc_legacy_const_generics, ['1']] - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1522,7 +1552,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vdup.16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [dup]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: safe @@ -1541,8 +1571,9 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vdup.16"', 'N = 2']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [dup, 'N = 2']]}]] - FnCall: [rustc_legacy_const_generics, ['1']] - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1764,7 +1795,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ext, 'N = 3']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -1783,7 +1815,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ext, 'N = 7']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ['const N: i32'] safety: safe @@ -2233,7 +2266,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vneg.{type[1]}"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fneg]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -2497,7 +2531,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vrintn]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [frintn]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -2754,7 +2789,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld1]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld1]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -2785,7 +2820,7 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld1, 'LANE = 0']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld1, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["2"]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -2806,7 +2841,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ["vld1"]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld1r]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3399,7 +3434,7 @@ intrinsics: - *neon-v7 - *target-is-arm - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld2]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3428,7 +3463,7 @@ intrinsics: attr: - *target-not-arm - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld2]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3455,7 +3490,7 @@ intrinsics: attr: - *neon-v7 - *target-is-arm - - *neon-fp16 + - *arm-fp16 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld2]]}]] - *neon-unstable-f16 - *target-not-arm64ec @@ -3486,7 +3521,7 @@ intrinsics: attr: - *target-not-arm - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld2r]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3516,7 +3551,7 @@ intrinsics: - *target-is-arm - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['vld2', 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["2"]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: @@ -3559,7 +3594,7 @@ intrinsics: - *target-not-arm - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld2, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["2"]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: @@ -3600,7 +3635,7 @@ intrinsics: - *neon-v7 - *target-is-arm - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld3]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3629,7 +3664,7 @@ intrinsics: attr: - *target-not-arm - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld3]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3657,7 +3692,7 @@ intrinsics: - *neon-v7 - *target-is-arm - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld3]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3687,7 +3722,7 @@ intrinsics: attr: - *target-not-arm - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld3r]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: @@ -3717,7 +3752,7 @@ intrinsics: - *target-is-arm - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['vld3', 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["2"]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: @@ -3762,7 +3797,7 @@ intrinsics: - *target-not-arm - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [ld3, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["2"]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: @@ -4744,7 +4779,7 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop, 'LANE = 0']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [nop, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["2"]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec types: @@ -4982,7 +5017,7 @@ intrinsics: attr: - *target-is-arm - *neon-v7 - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [vst1] @@ -5126,7 +5161,7 @@ intrinsics: arguments: ["a: *mut {type[0]}", "b: {neon_type[1]}"] attr: - *target-not-arm - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [st2] @@ -5217,7 +5252,7 @@ intrinsics: - *target-not-arm - FnCall: [rustc_legacy_const_generics, ['2']] - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [st2, 'LANE = 0']]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -5309,7 +5344,7 @@ intrinsics: attr: - *target-is-arm - *neon-v7 - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [vst2] @@ -5376,7 +5411,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [vst2, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -5587,7 +5622,7 @@ intrinsics: attr: - *target-is-arm - *neon-v7 - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [vst3] @@ -5656,7 +5691,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [vst3, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -5717,7 +5752,7 @@ intrinsics: arguments: ["a: *mut {type[0]}", "b: {neon_type[1]}"] attr: - *target-not-arm - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [st3] @@ -5782,7 +5817,7 @@ intrinsics: - *target-not-arm - FnCall: [rustc_legacy_const_generics, ['2']] - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [st3, 'LANE = 0']]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -5996,7 +6031,7 @@ intrinsics: attr: - *target-is-arm - *neon-v7 - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [vst4] @@ -6066,7 +6101,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [vst4, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -6129,7 +6164,7 @@ intrinsics: arguments: ["a: *mut {type[0]}", "b: {neon_type[1]}"] attr: - *target-not-arm - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec assert_instr: [st4] @@ -6196,7 +6231,7 @@ intrinsics: - *target-not-arm - FnCall: [rustc_legacy_const_generics, ['2']] - FnCall: [cfg_attr, [test, {FnCall: [assert_instr, [st4, 'LANE = 0']]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -6259,21 +6294,22 @@ intrinsics: - *neon-unstable-i8mm - *neon-cfg-arm-unstable static_defs: ["const LANE: i32"] + big_endian_inverse: true # TODO: Remove this attribute, and replace transmute with vreinterpret when https://github.com/llvm/llvm-project/pull/169337 is merged, LLVM inlining issue causing assertion failure. safety: safe types: - - ['_lane_s32', int32x2_t, uint8x8_t, '[LANE as u32, LANE as u32]'] - - ['q_lane_s32', int32x4_t, uint8x16_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] + - ['_lane_s32', int32x2_t, uint8x8_t, '[LANE as u32, LANE as u32]',''] + - ['q_lane_s32', int32x4_t, uint8x16_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]','q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '1']] - Let: - c - int32x2_t - - FnCall: [transmute, [c]] + - FnCall: [transmute, [c]] #- FnCall: ['vreinterpret_s32_s8', [c]] - Let: - c - "{type[1]}" - FnCall: [simd_shuffle!, [c, c, "{type[3]}"]] - - FnCall: ["vusdot{neon_type[1].no}", [a, b, {FnCall: [transmute, [c]]}]] + - FnCall: ["vusdot{neon_type[1].no}", [a, b, {FnCall: [transmute, [c]]}]] #'vreinterpret{type[4]}_s8_s32' - name: "vsudot{neon_type[0].lane_nox}" doc: "Dot product index form with signed and unsigned integers" @@ -6288,21 +6324,26 @@ intrinsics: - *neon-unstable-i8mm - *neon-cfg-arm-unstable static_defs: ["const LANE: i32"] + big_endian_inverse: true # TODO: Remove this attribute, and replace transmute with vreinterpret when https://github.com/llvm/llvm-project/pull/169337 is merged, LLVM inlining issue causing assertion failure. safety: safe types: - - [int32x2_t, int8x8_t, uint8x8_t, '[LANE as u32, LANE as u32]', uint32x2_t] - - [int32x4_t, int8x16_t, uint8x8_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]', uint32x4_t] + - [int32x2_t, int8x8_t, uint8x8_t, '[LANE as u32, LANE as u32]', uint32x2_t,''] + - [int32x4_t, int8x16_t, uint8x8_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]', uint32x4_t,'q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '1']] - Let: - c - uint32x2_t - - FnCall: [transmute, [c]] + - FnCall: [transmute, [c]] #- FnCall: ['vreinterpret_u32_u8', [c]] - Let: - c - "{type[4]}" - FnCall: [simd_shuffle!, [c, c, "{type[3]}"]] - - FnCall: ["vusdot{neon_type[0].no}", [a, {FnCall: [transmute, [c]]}, b]] + - FnCall: + - "vusdot{neon_type[0].no}" + - - a + - FnCall: [transmute, [c]] #- FnCall: ['vreinterpret{type[5]}_u8_u32', [c]] + - b - name: "vmul{neon_type[1].no}" doc: Multiply @@ -6358,7 +6399,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vmul.{type[0]}"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmul]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -6408,7 +6450,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmul, 'LANE = 1']]}]] - FnCall: [rustc_legacy_const_generics, ['2']] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec static_defs: ["const LANE: i32"] safety: safe @@ -6612,7 +6655,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vfma]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmla]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -6722,7 +6766,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vsub.{type[0]}"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fsub]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -6741,7 +6786,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vadd.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fadd]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -7111,10 +7157,11 @@ intrinsics: - FnCall: [rustc_legacy_const_generics, ['3']] - FnCall: [cfg_attr, [{FnCall: [not, ['target_arch = "arm"']]}, {FnCall: [unstable, ['feature = "stdarch_neon_dotprod"', 'issue = "117224"']]}]] - *neon-cfg-arm-unstable + big_endian_inverse: true # TODO: Remove this attribute, and replace transmute with vreinterpret when https://github.com/llvm/llvm-project/pull/169337 is merged, LLVM inlining issue causing assertion failure. safety: safe types: - - [int32x2_t, int8x8_t, int8x8_t, int32x2_t, '[LANE as u32, LANE as u32]'] - - [int32x4_t, int8x16_t, int8x8_t, int32x2_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] + - [int32x2_t, int8x8_t, int8x8_t, int32x2_t, '[LANE as u32, LANE as u32]',''] + - [int32x4_t, int8x16_t, int8x8_t, int32x2_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]','q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '1']] - Let: @@ -7145,15 +7192,16 @@ intrinsics: - FnCall: [cfg_attr, [{FnCall: [not, ['target_arch = "arm"']]}, {FnCall: [unstable, ['feature = "stdarch_neon_dotprod"', 'issue = "117224"']]}]] - *neon-cfg-arm-unstable safety: safe + big_endian_inverse: true # TODO: Remove this attribute, and replace transmute with vreinterpret when https://github.com/llvm/llvm-project/pull/169337 is merged, LLVM inlining issue causing assertion failure. types: - - [uint32x2_t, uint8x8_t, uint8x8_t, uint32x2_t, '[LANE as u32, LANE as u32]'] - - [uint32x4_t, uint8x16_t, uint8x8_t, uint32x2_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] + - [uint32x2_t, uint8x8_t, uint8x8_t, uint32x2_t, '[LANE as u32, LANE as u32]',''] + - [uint32x4_t, uint8x16_t, uint8x8_t, uint32x2_t, '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]','q'] compose: - FnCall: [static_assert_uimm_bits!, [LANE, '1']] - Let: - c - "{neon_type[3]}" - - FnCall: [transmute, [c]] + - FnCall: [transmute, [c]] #- FnCall: ['vreinterpret_{neon_type[0]}_{neon_type[1]}', [c]] - Let: - c - "{neon_type[0]}" @@ -7162,7 +7210,7 @@ intrinsics: - "vdot{neon_type[0].no}" - - a - b - - FnCall: [transmute, [c]] + - FnCall: [transmute, [c]] #- FnCall: ['vreinterpret{type[5]}_{neon_type[1]}_{neon_type[0]}', [c]] - name: "vmax{neon_type.no}" doc: Maximum (vector) @@ -7241,7 +7289,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vmax]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmax]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -7284,7 +7333,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vmaxnm]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmaxnm]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -7303,7 +7353,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vminnm]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fminnm]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -7390,7 +7441,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vmin]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmin]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -7455,7 +7507,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vpadd]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [faddp]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -8299,7 +8352,8 @@ intrinsics: - *neon-fp16 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vrsqrts]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [frsqrts]]}]] - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -8348,7 +8402,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vrecpe]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [frecpe]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -8397,7 +8452,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vrecps]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [frecps]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -8730,7 +8786,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [nop]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -8793,7 +8850,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [nop]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -8816,7 +8874,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vrev64]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [rev64]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -9131,8 +9190,9 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [nop]]}]] - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -9638,7 +9698,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn1]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [trn2]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -9794,7 +9855,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip1]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [zip2]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -9865,7 +9927,8 @@ intrinsics: - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp1]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [uzp2]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -10444,7 +10507,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcge.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmge]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -10463,7 +10527,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcge.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmge]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -10703,7 +10768,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcvtzu]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -10720,10 +10786,11 @@ intrinsics: return_type: "{neon_type[1]}" attr: - *neon-v7 - - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt.f16.f32]]}]] + - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcvtn]]}]] - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -10739,8 +10806,9 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcvtl]]}]] - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -11215,7 +11283,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vcgt.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmgt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -11234,7 +11303,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vclt.f16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcmlt]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -11347,7 +11417,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fmls]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -11463,7 +11534,8 @@ intrinsics: - *neon-fp16 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vrsqrte]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [frsqrte]]}]] - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -11577,7 +11649,8 @@ intrinsics: - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vcvt]]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [fcvtzs]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: @@ -11787,39 +11860,39 @@ intrinsics: - name: "vld1{type[0]}" visibility: private - doc: "Load multiple single-element structures to one, two, three, or four registers" - arguments: ["a: {type[1]}", "b: {type[2]}"] - return_type: "{neon_type[3]}" + arguments: ["a: {type[1]}"] + static_defs: ["const ALIGN: i32"] + return_type: "{neon_type[2]}" attr: + - FnCall: [rustc_legacy_const_generics, ['1']] - *target-is-arm - *enable-v7 - # - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [vld1]]}]] + - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vld1.8"', "ALIGN = 0"]]}]] - *neon-arm-unstable safety: unsafe: [neon] types: - - ["_v8i8", "*const i8", "i32", "int8x8_t"] - - ["q_v16i8", "*const i8", "i32", "int8x16_t"] - - ["_v4i16", "*const i8", "i32", "int16x4_t"] - - ["q_v8i16", "*const i8", "i32", "int16x8_t"] - - ["_v2i32", "*const i8", "i32", "int32x2_t"] - - ["q_v4i32", "*const i8", "i32", "int32x4_t"] - - ["_v1i64", "*const i8", "i32", "int64x1_t"] - - ["q_v2i64", "*const i8", "i32", "int64x2_t"] - - ["_v2f32", "*const i8", "i32", "float32x2_t"] - - ["q_v4f32", "*const i8", "i32", "float32x4_t"] + - ["_v8i8", "*const i8", "int8x8_t" ] + - ["q_v16i8", "*const i8", "int8x16_t" ] + - ["_v4i16", "*const i8", "int16x4_t" ] + - ["q_v8i16", "*const i8", "int16x8_t" ] + - ["_v2i32", "*const i8", "int32x2_t" ] + - ["q_v4i32", "*const i8", "int32x4_t" ] + - ["_v1i64", "*const i8", "int64x1_t" ] + - ["q_v2i64", "*const i8", "int64x2_t" ] + - ["_v2f32", "*const i8", "float32x2_t"] + - ["q_v4f32", "*const i8", "float32x4_t"] compose: - LLVMLink: name: "vld1.{type[0]}" + arguments: ["a: {type[1]}", "b: i32"] links: - - link: "llvm.arm.neon.vld1.{neon_type[3]}" + - link: "llvm.arm.neon.vld1.{neon_type[2]}" arch: arm - - FnCall: ["_vld1{type[0]}", [a, b]] - + - FnCall: ["_vld1{type[0]}", [a, ALIGN]] - name: "vld1{type[0]}" visibility: private - doc: "Load multiple single-element structures to one, two, three, or four registers" arguments: ["a: {type[1]}", "b: {type[2]}"] return_type: "{neon_type[3]}" attr: @@ -11827,7 +11900,7 @@ intrinsics: - *enable-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop]]}]] - *neon-fp16 - - *neon-unstable-f16 + - *neon-arm-unstable - *target-not-arm64ec safety: unsafe: [neon] @@ -11855,19 +11928,23 @@ intrinsics: - *neon-arm-unstable - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['{type[2]}']]}]] types: - - ['*const i8', int8x8_t, '"vld1.8"', 'crate::mem::align_of::() as i32', '_v8i8'] - - ['*const i8', int8x16_t, '"vld1.8"', 'crate::mem::align_of::() as i32', 'q_v16i8'] - - ['*const i16', int16x4_t, '"vld1.16"', 'crate::mem::align_of::() as i32', '_v4i16'] - - ['*const i16', int16x8_t, '"vld1.16"', 'crate::mem::align_of::() as i32', 'q_v8i16'] - - ['*const i32', int32x2_t, 'vldr', 'crate::mem::align_of::() as i32', '_v2i32'] - - ['*const i32', int32x4_t, '"vld1.32"', 'crate::mem::align_of::() as i32', 'q_v4i32'] - - ['*const i64', int64x1_t, 'vldr', 'crate::mem::align_of::() as i32', '_v1i64'] - - ['*const i64', int64x2_t, '"vld1.64"', 'crate::mem::align_of::() as i32', 'q_v2i64'] + - ['*const i8', int8x8_t, '"vld1.8"', 'crate::mem::align_of::()', '_v8i8' ] + - ['*const i8', int8x16_t, '"vld1.8"', 'crate::mem::align_of::()', 'q_v16i8'] + - ['*const i16', int16x4_t, '"vld1.16"', 'crate::mem::align_of::()', '_v4i16' ] + - ['*const i16', int16x8_t, '"vld1.16"', 'crate::mem::align_of::()', 'q_v8i16'] + - ['*const i32', int32x2_t, 'vldr', 'crate::mem::align_of::()', '_v2i32' ] + - ['*const i32', int32x4_t, '"vld1.32"', 'crate::mem::align_of::()', 'q_v4i32'] + - ['*const i64', int64x1_t, 'vldr', 'crate::mem::align_of::()', '_v1i64' ] + - ['*const i64', int64x2_t, '"vld1.64"', 'crate::mem::align_of::()', 'q_v2i64'] compose: + - Const: + - ALIGN + - "i32" + - "{type[3]} as i32" - FnCall: - "vld1{type[4]}" - - - 'ptr as *const i8' - - '{type[3]}' + - ['ptr as *const i8'] + - ['ALIGN'] - name: "vld1{neon_type[1].no}" doc: "Load multiple single-element structures to one, two, three, or four registers." @@ -11881,28 +11958,32 @@ intrinsics: - *neon-arm-unstable - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['{type[2]}']]}]] types: - - ['*const u8', uint8x8_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::() as i32', '_v8i8'] - - ['*const u8', uint8x16_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v16i8'] - - ['*const u16', uint16x4_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::() as i32', '_v4i16'] - - ['*const u16', uint16x8_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v8i16'] - - ['*const u32', uint32x2_t, 'vldr', 'neon,v7', 'crate::mem::align_of::() as i32', '_v2i32'] - - ['*const u32', uint32x4_t, '"vld1.32"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v4i32'] - - ['*const u64', uint64x1_t, 'vldr', 'neon,v7', 'crate::mem::align_of::() as i32', '_v1i64'] - - ['*const u64', uint64x2_t, '"vld1.64"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v2i64'] - - ['*const p8', poly8x8_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::() as i32', '_v8i8'] - - ['*const p8', poly8x16_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v16i8'] - - ['*const p16', poly16x4_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::() as i32', '_v4i16'] - - ['*const p16', poly16x8_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v8i16'] - - ['*const p64', poly64x2_t, '"vld1.64"', 'neon,aes', 'crate::mem::align_of::() as i32', 'q_v2i64'] - - ['*const f32', float32x2_t, 'vldr', 'neon,v7', 'crate::mem::align_of::() as i32', '_v2f32'] - - ['*const f32', float32x4_t, '"vld1.32"', 'neon,v7', 'crate::mem::align_of::() as i32', 'q_v4f32'] + - ['*const u8', uint8x8_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::()', '_v8i8' ] + - ['*const u8', uint8x16_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::()', 'q_v16i8'] + - ['*const u16', uint16x4_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::()', '_v4i16' ] + - ['*const u16', uint16x8_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::()', 'q_v8i16'] + - ['*const u32', uint32x2_t, 'vldr', 'neon,v7', 'crate::mem::align_of::()', '_v2i32' ] + - ['*const u32', uint32x4_t, '"vld1.32"', 'neon,v7', 'crate::mem::align_of::()', 'q_v4i32'] + - ['*const u64', uint64x1_t, 'vldr', 'neon,v7', 'crate::mem::align_of::()', '_v1i64' ] + - ['*const u64', uint64x2_t, '"vld1.64"', 'neon,v7', 'crate::mem::align_of::()', 'q_v2i64'] + - ['*const p8', poly8x8_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::()', '_v8i8' ] + - ['*const p8', poly8x16_t, '"vld1.8"', 'neon,v7', 'crate::mem::align_of::()', 'q_v16i8'] + - ['*const p16', poly16x4_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::()', '_v4i16' ] + - ['*const p16', poly16x8_t, '"vld1.16"', 'neon,v7', 'crate::mem::align_of::()', 'q_v8i16'] + - ['*const p64', poly64x2_t, '"vld1.64"', 'neon,aes', 'crate::mem::align_of::()', 'q_v2i64'] + - ['*const f32', float32x2_t, 'vldr', 'neon,v7', 'crate::mem::align_of::()', '_v2f32' ] + - ['*const f32', float32x4_t, '"vld1.32"', 'neon,v7', 'crate::mem::align_of::()', 'q_v4f32'] compose: + - Const: + - ALIGN + - "i32" + - "{type[4]} as i32" - FnCall: - transmute - - FnCall: - "vld1{type[5]}" - - - 'ptr as *const i8' - - '{type[4]}' + - ['ptr as *const i8'] + - ['ALIGN'] - name: "vld1{neon_type[1].no}" doc: "Load multiple single-element structures to one, two, three, or four registers." @@ -13724,32 +13805,35 @@ intrinsics: - name: "vst1{type[0]}" visibility: private - doc: "Store multiple single-element structures from one, two, three, or four registers." - arguments: ["addr: {type[1]}", "val: {neon_type[2]}", "align: {type[3]}"] + arguments: ["addr: {type[1]}", "val: {neon_type[2]}"] + static_defs: ["const ALIGN: i32"] safety: unsafe: [neon] attr: - *target-is-arm - *neon-v7 - *neon-arm-unstable - - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vst1.{type[4]}"']]}]] + - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vst1.{type[3]}"', "ALIGN = 0"]]}]] + - FnCall: ["rustc_legacy_const_generics", ['2']] types: - - ['_v8i8', '* const i8', int8x8_t, i32, '8'] - - ['q_v16i8', '* const i8', int8x16_t, i32, '8'] - - ['_v4i16', '* const i8', int16x4_t, i32, '16'] - - ['q_v8i16', '* const i8', int16x8_t, i32, '16'] - - ['_v2i32', '* const i8', int32x2_t, i32, '32'] - - ['q_v4i32', '* const i8', int32x4_t, i32, '32'] - - ['_v1i64', '* const i8', int64x1_t, i32, '64'] - - ['q_v2i64', '* const i8', int64x2_t, i32, '64'] - - ['_v2f32', '* const i8', float32x2_t, i32, '32'] - - ['q_v4f32', '* const i8', float32x4_t, i32, '32'] + - ['_v8i8', '* const i8', int8x8_t, '8' ] + - ['q_v16i8', '* const i8', int8x16_t, '8' ] + - ['_v4i16', '* const i8', int16x4_t, '16'] + - ['q_v8i16', '* const i8', int16x8_t, '16'] + - ['_v2i32', '* const i8', int32x2_t, '32'] + - ['q_v4i32', '* const i8', int32x4_t, '32'] + - ['_v1i64', '* const i8', int64x1_t, '64'] + - ['q_v2i64', '* const i8', int64x2_t, '64'] + - ['_v2f32', '* const i8', float32x2_t, '32'] + - ['q_v4f32', '* const i8', float32x4_t, '32'] compose: - LLVMLink: name: "_vst1{type[0]}" + arguments: ["addr: {type[1]}", "val: {neon_type[2]}", "align: i32"] links: - link: "llvm.arm.neon.vst1.{neon_type[2]}.p0" arch: arm + - FnCall: ["_vst1{type[0]}",[addr, val, ALIGN]] - name: "vst1{type[0]}" visibility: private @@ -13761,7 +13845,7 @@ intrinsics: - *target-is-arm - *neon-v7 - *neon-fp16 - - *neon-unstable-f16 + - *neon-arm-unstable - *target-not-arm64ec - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vst1.{type[4]}"']]}]] types: @@ -13785,37 +13869,39 @@ intrinsics: - *neon-arm-unstable - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vst1.{type[2]}"']]}]] types: - - ['*mut i8', int8x8_t, '8', 'a', 'crate::mem::align_of::() as i32', '_v8i8'] - - ['*mut i8', int8x16_t, '8', 'a', 'crate::mem::align_of::() as i32', 'q_v16i8'] - - ['*mut i16', int16x4_t, '16', 'a', 'crate::mem::align_of::() as i32', '_v4i16'] - - ['*mut i16', int16x8_t, '16', 'a', 'crate::mem::align_of::() as i32', 'q_v8i16'] - - ['*mut i32', int32x2_t, '32', 'a', 'crate::mem::align_of::() as i32', '_v2i32'] - - ['*mut i32', int32x4_t, '32', 'a', 'crate::mem::align_of::() as i32', 'q_v4i32'] - - ['*mut i64', int64x1_t, '64', 'a', 'crate::mem::align_of::() as i32', '_v1i64'] - - ['*mut i64', int64x2_t, '64', 'a', 'crate::mem::align_of::() as i32', 'q_v2i64'] - - ['*mut u8', uint8x8_t, '8', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v8i8'] - - ['*mut u8', uint8x16_t, '8', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v16i8'] - - ['*mut u16', uint16x4_t, '16', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v4i16'] - - ['*mut u16', uint16x8_t, '16', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v8i16'] - - ['*mut u32', uint32x2_t, '32', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v2i32'] - - ['*mut u32', uint32x4_t, '32', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v4i32'] - - ['*mut u64', uint64x1_t, '64', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v1i64'] - - ['*mut u64', uint64x2_t, '64', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v2i64'] - - ['*mut p8', poly8x8_t, '8', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v8i8'] - - ['*mut p8', poly8x16_t, '8', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v16i8'] - - ['*mut p16', poly16x4_t, '16', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v4i16'] - - ['*mut p16', poly16x8_t, '16', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v8i16'] - - ['*mut p64', poly64x1_t, '64', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v1i64'] - - ['*mut p64', poly64x2_t, '64', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v2i64'] - - ['*mut f32', float32x2_t, '32', 'transmute(a)', 'crate::mem::align_of::() as i32', '_v2f32'] - - ['*mut f32', float32x4_t, '32', 'transmute(a)', 'crate::mem::align_of::() as i32', 'q_v4f32'] + - ['*mut i8', int8x8_t, '8', 'a', 'crate::mem::align_of::()', '_v8i8' ] + - ['*mut i8', int8x16_t, '8', 'a', 'crate::mem::align_of::()', 'q_v16i8'] + - ['*mut i16', int16x4_t, '16', 'a', 'crate::mem::align_of::()', '_v4i16' ] + - ['*mut i16', int16x8_t, '16', 'a', 'crate::mem::align_of::()', 'q_v8i16'] + - ['*mut i32', int32x2_t, '32', 'a', 'crate::mem::align_of::()', '_v2i32' ] + - ['*mut i32', int32x4_t, '32', 'a', 'crate::mem::align_of::()', 'q_v4i32'] + - ['*mut i64', int64x1_t, '64', 'a', 'crate::mem::align_of::()', '_v1i64' ] + - ['*mut i64', int64x2_t, '64', 'a', 'crate::mem::align_of::()', 'q_v2i64'] + - ['*mut u8', uint8x8_t, '8', 'transmute(a)', 'crate::mem::align_of::()', '_v8i8' ] + - ['*mut u8', uint8x16_t, '8', 'transmute(a)', 'crate::mem::align_of::()', 'q_v16i8'] + - ['*mut u16', uint16x4_t, '16', 'transmute(a)', 'crate::mem::align_of::()', '_v4i16' ] + - ['*mut u16', uint16x8_t, '16', 'transmute(a)', 'crate::mem::align_of::()', 'q_v8i16'] + - ['*mut u32', uint32x2_t, '32', 'transmute(a)', 'crate::mem::align_of::()', '_v2i32' ] + - ['*mut u32', uint32x4_t, '32', 'transmute(a)', 'crate::mem::align_of::()', 'q_v4i32'] + - ['*mut u64', uint64x1_t, '64', 'transmute(a)', 'crate::mem::align_of::()', '_v1i64' ] + - ['*mut u64', uint64x2_t, '64', 'transmute(a)', 'crate::mem::align_of::()', 'q_v2i64'] + - ['*mut p8', poly8x8_t, '8', 'transmute(a)', 'crate::mem::align_of::()', '_v8i8' ] + - ['*mut p8', poly8x16_t, '8', 'transmute(a)', 'crate::mem::align_of::()', 'q_v16i8'] + - ['*mut p16', poly16x4_t, '16', 'transmute(a)', 'crate::mem::align_of::()', '_v4i16' ] + - ['*mut p16', poly16x8_t, '16', 'transmute(a)', 'crate::mem::align_of::()', 'q_v8i16'] + - ['*mut p64', poly64x1_t, '64', 'transmute(a)', 'crate::mem::align_of::()', '_v1i64' ] + - ['*mut p64', poly64x2_t, '64', 'transmute(a)', 'crate::mem::align_of::()', 'q_v2i64'] + - ['*mut f32', float32x2_t, '32', 'transmute(a)', 'crate::mem::align_of::()', '_v2f32' ] + - ['*mut f32', float32x4_t, '32', 'transmute(a)', 'crate::mem::align_of::()', 'q_v4f32'] compose: + - Const: + - ALIGN + - "i32" + - "{type[4]} as i32" - FnCall: - "vst1{type[5]}" - - - 'ptr as *const i8' - - '{type[3]}' - - '{type[4]}' - + - ['ptr as *const i8','{type[3]}'] + - ['ALIGN'] - name: "vst1{neon_type[1].no}" doc: "Store multiple single-element structures from one, two, three, or four registers." @@ -13839,32 +13925,64 @@ intrinsics: - '{type[3]}' - '{type[4]}' - - - name: "vshiftins{type[0]}" + - name: "vshiftlins{type[0]}" visibility: private - doc: "Shift Right and Insert (immediate)" - arguments: ["a: {neon_type[1]}", "b: {neon_type[1]}", "c: {neon_type[1]}"] + arguments: ["a: {neon_type[1]}", "b: {neon_type[1]}"] return_type: "{neon_type[1]}" safety: safe attr: - *target-is-arm - *neon-v7 - *neon-arm-unstable + - FnCall: [rustc_legacy_const_generics, ['2']] + static_defs: ['const N: i32'] types: - - ['_v8i8', "int8x8_t", '8'] - - ['_v16i8', 'int8x16_t', '8'] - - ['_v4i16', 'int16x4_t', '16'] - - ['_v8i16', 'int16x8_t', '16'] - - ['_v2i32', 'int32x2_t', '32'] - - ['_v4i32', 'int32x4_t', '32'] - - ['_v1i64', 'int64x1_t', '64'] - - ['_v2i64', 'int64x2_t', '64'] + - ['_v8i8', 'int8x8_t', '8', 'int8x8_t([N as i8; 8 ])' ] + - ['_v16i8', 'int8x16_t', '8', 'int8x16_t([N as i8; 16])'] + - ['_v4i16', 'int16x4_t', '16', 'int16x4_t([N as i16; 4])'] + - ['_v8i16', 'int16x8_t', '16', 'int16x8_t([N as i16; 8])'] + - ['_v2i32', 'int32x2_t', '32', 'int32x2_t([N; 2])' ] + - ['_v4i32', 'int32x4_t', '32', 'int32x4_t([N; 4])' ] + - ['_v1i64', 'int64x1_t', '64', 'int64x1_t([N as i64; 1])'] + - ['_v2i64', 'int64x2_t', '64', 'int64x2_t([N as i64; 2])'] compose: - LLVMLink: name: "_vshiftins{type[0]}" + arguments: ["a: {type[1]}", "b: {type[1]}", "c: {type[1]}"] links: - link: "llvm.arm.neon.vshiftins.{neon_type[1]}" arch: arm + - FnCall: ["_vshiftlins{type[0]}", [a,b, "const {{ {type[3]} }}"], [], true] + + - name: "vshiftrins{type[0]}" + doc: "Shift Right and Insert (immediate)" + visibility: private + arguments: ["a: {neon_type[1]}", "b: {neon_type[1]}"] + return_type: "{neon_type[1]}" + safety: safe + attr: + - *target-is-arm + - *neon-v7 + - *neon-arm-unstable + - FnCall: [rustc_legacy_const_generics, ['2']] + static_defs: ['const N: i32'] + types: + - ['_v8i8', 'int8x8_t', '8', 'int8x8_t([-N as i8; 8 ])' ] + - ['_v16i8', 'int8x16_t', '8', 'int8x16_t([-N as i8; 16])'] + - ['_v4i16', 'int16x4_t', '16', 'int16x4_t([-N as i16; 4])'] + - ['_v8i16', 'int16x8_t', '16', 'int16x8_t([-N as i16; 8])'] + - ['_v2i32', 'int32x2_t', '32', 'int32x2_t([-N; 2])' ] + - ['_v4i32', 'int32x4_t', '32', 'int32x4_t([-N; 4])' ] + - ['_v1i64', 'int64x1_t', '64', 'int64x1_t([-N as i64; 1])'] + - ['_v2i64', 'int64x2_t', '64', 'int64x2_t([-N as i64; 2])'] + compose: + - LLVMLink: + name: "_vshiftins{type[0]}" + arguments: ["a: {type[1]}", "b: {type[1]}", "c: {type[1]}"] + links: + - link: "llvm.arm.neon.vshiftins.{neon_type[1]}" + arch: arm + - FnCall: ["_vshiftrins{type[0]}", [a,b, "const {{ {type[3]} }}"], [], true] - name: "vsri{neon_type[0].N}" doc: "Shift Right and Insert (immediate)" @@ -13879,18 +13997,18 @@ intrinsics: - FnCall: [rustc_legacy_const_generics, ['2']] static_defs: ['const N: i32'] types: - - [uint8x8_t, "neon,v7", '8', '1 <= N && N <= 8', 'v8i8', 'int8x8_t::splat', '-N as i8'] - - [uint8x16_t, "neon,v7", '8', '1 <= N && N <= 8', 'v16i8', 'int8x16_t::splat', '-N as i8'] - - [uint16x4_t, "neon,v7", '16', '1 <= N && N <= 16', 'v4i16', 'int16x4_t::splat', '-N as i16'] - - [uint16x8_t, "neon,v7", '16', '1 <= N && N <= 16', 'v8i16', 'int16x8_t::splat', '-N as i16'] - - [uint32x2_t, "neon,v7", '32', '1 <= N && N <= 32', 'v2i32', 'int32x2_t::splat', '-N'] - - [uint32x4_t, "neon,v7", '32', '1 <= N && N <= 32', 'v4i32', 'int32x4_t::splat', '-N'] - - [uint64x1_t, "neon,v7", '64', '1 <= N && N <= 64', 'v1i64', 'int64x1_t::splat', '-N as i64'] - - [uint64x2_t, "neon,v7", '64', '1 <= N && N <= 64', 'v2i64', 'int64x2_t::splat', '-N as i64'] - - [poly8x8_t, "neon,v7", '8', '1 <= N && N <= 8', 'v8i8', 'int8x8_t::splat', '-N as i8'] - - [poly8x16_t, "neon,v7", '8', '1 <= N && N <= 8', 'v16i8', 'int8x16_t::splat', '-N as i8'] - - [poly16x4_t, "neon,v7", '16', '1 <= N && N <= 16', 'v4i16', 'int16x4_t::splat', '-N as i16'] - - [poly16x8_t, "neon,v7", '16', '1 <= N && N <= 16', 'v8i16', 'int16x8_t::splat', '-N as i16'] + - [uint8x8_t, "neon,v7", '8', '1 <= N && N <= 8', 'v8i8' ] + - [uint8x16_t, "neon,v7", '8', '1 <= N && N <= 8', 'v16i8'] + - [uint16x4_t, "neon,v7", '16', '1 <= N && N <= 16', 'v4i16'] + - [uint16x8_t, "neon,v7", '16', '1 <= N && N <= 16', 'v8i16'] + - [uint32x2_t, "neon,v7", '32', '1 <= N && N <= 32', 'v2i32'] + - [uint32x4_t, "neon,v7", '32', '1 <= N && N <= 32', 'v4i32'] + - [uint64x1_t, "neon,v7", '64', '1 <= N && N <= 64', 'v1i64'] + - [uint64x2_t, "neon,v7", '64', '1 <= N && N <= 64', 'v2i64'] + - [poly8x8_t, "neon,v7", '8', '1 <= N && N <= 8', 'v8i8' ] + - [poly8x16_t, "neon,v7", '8', '1 <= N && N <= 8', 'v16i8'] + - [poly16x4_t, "neon,v7", '16', '1 <= N && N <= 16', 'v4i16'] + - [poly16x8_t, "neon,v7", '16', '1 <= N && N <= 16', 'v8i16'] ## These live in ./crates/core_arch/src/arm/neon.rs #- [poly64x1_t, "neon,v7,aes", '64', '1 <= N && N <= 64', 'v1i64', 'int64x1_t::splat', '-N as i64'] #- [poly64x2_t, "neon,v7,aes", '64', '1 <= N && N <= 64', 'v2i64', 'int64x2_t::splat', '-N as i64'] @@ -13899,10 +14017,9 @@ intrinsics: - FnCall: - 'transmute' - - FnCall: - - "vshiftins_{type[4]}" + - "vshiftrins_{type[4]}::" - - FnCall: [transmute, [a]] - FnCall: [transmute, [b]] - - FnCall: ["{type[5]}", ["{type[6]}"]] - name: "vsri{neon_type[0].N}" doc: "Shift Right and Insert (immediate)" @@ -13917,21 +14034,20 @@ intrinsics: - FnCall: [rustc_legacy_const_generics, ['2']] safety: safe types: - - [int8x8_t, '8', '1 <= N && N <= 8', 'v8i8', 'int8x8_t::splat', '-N as i8'] - - [int8x16_t, '8', '1 <= N && N <= 8', 'v16i8', 'int8x16_t::splat', '-N as i8'] - - [int16x4_t, '16', '1 <= N && N <= 16', 'v4i16', 'int16x4_t::splat', '-N as i16'] - - [int16x8_t, '16', '1 <= N && N <= 16', 'v8i16', 'int16x8_t::splat', '-N as i16'] - - [int32x2_t, '32', '1 <= N && N <= 32', 'v2i32', 'int32x2_t::splat', '-N'] - - [int32x4_t, '32', '1 <= N && N <= 32', 'v4i32', 'int32x4_t::splat', '-N'] - - [int64x1_t, '64', '1 <= N && N <= 64', 'v1i64', 'int64x1_t::splat', '-N as i64'] - - [int64x2_t, '64', '1 <= N && N <= 64', 'v2i64', 'int64x2_t::splat', '-N as i64'] + - [int8x8_t, '8', '1 <= N && N <= 8', 'v8i8' ] + - [int8x16_t, '8', '1 <= N && N <= 8', 'v16i8'] + - [int16x4_t, '16', '1 <= N && N <= 16', 'v4i16'] + - [int16x8_t, '16', '1 <= N && N <= 16', 'v8i16'] + - [int32x2_t, '32', '1 <= N && N <= 32', 'v2i32'] + - [int32x4_t, '32', '1 <= N && N <= 32', 'v4i32'] + - [int64x1_t, '64', '1 <= N && N <= 64', 'v1i64'] + - [int64x2_t, '64', '1 <= N && N <= 64', 'v2i64'] compose: - FnCall: ["static_assert!", ['{type[2]}']] - FnCall: - - "vshiftins_{type[3]}" + - "vshiftrins_{type[3]}::" - - a - b - - FnCall: ["{type[4]}", ["{type[5]}"]] - name: "vsli{neon_type[0].N}" doc: "Shift Left and Insert (immediate)" @@ -13946,18 +14062,18 @@ intrinsics: - FnCall: [rustc_legacy_const_generics, ['2']] static_defs: ['const N: i32'] types: - - [uint8x8_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8', 'int8x8_t::splat', 'N as i8'] - - [uint8x16_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8', 'int8x16_t::splat', 'N as i8'] - - [uint16x4_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16', 'int16x4_t::splat', 'N as i16'] - - [uint16x8_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16', 'int16x8_t::splat', 'N as i16'] - - [uint32x2_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v2i32', 'int32x2_t::splat', 'N'] - - [uint32x4_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v4i32', 'int32x4_t::splat', 'N'] - - [uint64x1_t, "neon,v7", '64', 'static_assert!', 'N >= 0 && N <= 63', 'v1i64', 'int64x1_t::splat', 'N as i64'] - - [uint64x2_t, "neon,v7", '64', 'static_assert!', 'N >= 0 && N <= 63', 'v2i64', 'int64x2_t::splat', 'N as i64'] - - [poly8x8_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8', 'int8x8_t::splat', 'N as i8'] - - [poly8x16_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8', 'int8x16_t::splat', 'N as i8'] - - [poly16x4_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16', 'int16x4_t::splat', 'N as i16'] - - [poly16x8_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16', 'int16x8_t::splat', 'N as i16'] + - [uint8x8_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8'] + - [uint8x16_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8'] + - [uint16x4_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16'] + - [uint16x8_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16'] + - [uint32x2_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v2i32'] + - [uint32x4_t, "neon,v7", '32', 'static_assert!', 'N >= 0 && N <= 31', 'v4i32'] + - [uint64x1_t, "neon,v7", '64', 'static_assert!', 'N >= 0 && N <= 63', 'v1i64'] + - [uint64x2_t, "neon,v7", '64', 'static_assert!', 'N >= 0 && N <= 63', 'v2i64'] + - [poly8x8_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8'] + - [poly8x16_t, "neon,v7", '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8'] + - [poly16x4_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16'] + - [poly16x8_t, "neon,v7", '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16'] ## These live in ./crates/core_arch/src/arm/neon.rs #- [poly64x1_t, "neon,v7,aes", '"vsli.64"', 'static_assert!', '0 <= N && N <= 63', 'v1i64', 'int64x1_t::splat', 'N as i64'] #- [poly64x2_t, "neon,v7,aes", '"vsli.64"', 'static_assert!', '0 <= N && N <= 63', 'v2i64', 'int64x2_t::splat', 'N as i64'] @@ -13966,10 +14082,9 @@ intrinsics: - FnCall: - 'transmute' - - FnCall: - - "vshiftins_{type[5]}" + - "vshiftlins_{type[5]}::" - - FnCall: [transmute, [a]] - FnCall: [transmute, [b]] - - FnCall: ["{type[6]}", ["{type[7]}"]] - name: "vsli{neon_type[0].N}" doc: "Shift Left and Insert (immediate)" @@ -13984,21 +14099,20 @@ intrinsics: - FnCall: [rustc_legacy_const_generics, ['2']] static_defs: ['const N: i32'] types: - - [int8x8_t, '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8', 'int8x8_t::splat', 'N as i8'] - - [int8x16_t, '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8', 'int8x16_t::splat', 'N as i8'] - - [int16x4_t, '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16', 'int16x4_t::splat', 'N as i16'] - - [int16x8_t, '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16', 'int16x8_t::splat', 'N as i16'] - - [int32x2_t, '32', 'static_assert!', 'N >= 0 && N <= 31', 'v2i32', 'int32x2_t::splat', 'N'] - - [int32x4_t, '32', 'static_assert!', 'N >= 0 && N <= 31', 'v4i32', 'int32x4_t::splat', 'N'] - - [int64x1_t, '64', 'static_assert!', 'N >= 0 && N <= 63', 'v1i64', 'int64x1_t::splat', 'N as i64'] - - [int64x2_t, '64', 'static_assert!', 'N >= 0 && N <= 63', 'v2i64', 'int64x2_t::splat', 'N as i64'] + - [int8x8_t, '8', 'static_assert_uimm_bits!', 'N, 3', 'v8i8' ] + - [int8x16_t, '8', 'static_assert_uimm_bits!', 'N, 3', 'v16i8'] + - [int16x4_t, '16', 'static_assert_uimm_bits!', 'N, 4', 'v4i16'] + - [int16x8_t, '16', 'static_assert_uimm_bits!', 'N, 4', 'v8i16'] + - [int32x2_t, '32', 'static_assert!', 'N >= 0 && N <= 31', 'v2i32'] + - [int32x4_t, '32', 'static_assert!', 'N >= 0 && N <= 31', 'v4i32'] + - [int64x1_t, '64', 'static_assert!', 'N >= 0 && N <= 63', 'v1i64'] + - [int64x2_t, '64', 'static_assert!', 'N >= 0 && N <= 63', 'v2i64'] compose: - FnCall: ["{type[2]}", ['{type[3]}']] - FnCall: - - "vshiftins_{type[4]}" + - "vshiftlins_{type[4]}::" - - a - b - - FnCall: ["{type[5]}", ["{type[6]}"]] - name: "vcombine{neon_type[0].no}" doc: Join two smaller vectors into a single larger vector @@ -14006,8 +14120,9 @@ intrinsics: return_type: "{neon_type[1]}" attr: - *neon-v7 - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec assert_instr: [nop] safety: safe @@ -14022,8 +14137,9 @@ intrinsics: return_type: "{neon_type[0]}" attr: - *neon-v7 - - *neon-fp16 - - *neon-unstable-f16 + - *arm-fp16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec assert_instr: [nop] safety: safe @@ -14039,10 +14155,10 @@ intrinsics: return_type: "{type[1]}" attr: - *neon-v7 - - *neon-fp16 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, [nop, 'LANE = 0']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [nop, 'LANE = 0']]}]] - FnCall: [rustc_legacy_const_generics, ["1"]] + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec static_defs: ['const LANE: i32'] @@ -14062,7 +14178,7 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, {FnCall: [assert_instr, ['"vdup.16"']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, [dup]]}]] - - *neon-fp16 + - *arm-fp16 - *neon-unstable-f16 - *target-not-arm64ec safety: safe @@ -14678,7 +14794,8 @@ intrinsics: - *neon-v7 - FnCall: [cfg_attr, [*test-is-arm, { FnCall: [assert_instr, ['vbsl']]}]] - FnCall: [cfg_attr, [*neon-target-aarch64-arm64ec, {FnCall: [assert_instr, ['bsl']]}]] - - *neon-unstable-f16 + - *neon-not-arm-stable-fp16 + - *neon-cfg-arm-unstable - *target-not-arm64ec safety: safe types: diff --git a/library/stdarch/crates/stdarch-gen-arm/src/expression.rs b/library/stdarch/crates/stdarch-gen-arm/src/expression.rs index d5644ef27d4b..bf48f0dab749 100644 --- a/library/stdarch/crates/stdarch-gen-arm/src/expression.rs +++ b/library/stdarch/crates/stdarch-gen-arm/src/expression.rs @@ -108,6 +108,8 @@ impl ToTokens for FnCall { pub enum Expression { /// (Re)Defines a variable Let(LetVariant), + /// Defines a const + Const(WildString, TypeKind, Box), /// Performs a variable assignment operation Assign(String, Box), /// Performs a macro call @@ -169,6 +171,7 @@ impl Expression { | LetVariant::WithType(_, _, ex) | LetVariant::MutWithType(_, _, ex), ) => ex.pre_build(ctx), + Self::Const(_, _, ex) => ex.pre_build(ctx), Self::CastAs(ex, _) => ex.pre_build(ctx), Self::Multiply(lhs, rhs) | Self::Xor(lhs, rhs) => { lhs.pre_build(ctx)?; @@ -245,6 +248,15 @@ impl Expression { ); ex.build(intrinsic, ctx) } + Self::Const(var_name, ty, ex) => { + var_name.build_acle(ctx.local)?; + ctx.local.variables.insert( + var_name.to_string(), + (ty.to_owned(), VariableType::Internal), + ); + ex.build(intrinsic, ctx) + } + Self::CastAs(ex, _) => ex.build(intrinsic, ctx), Self::Multiply(lhs, rhs) | Self::Xor(lhs, rhs) => { lhs.build(intrinsic, ctx)?; @@ -303,6 +315,7 @@ impl Expression { | LetVariant::WithType(_, _, exp) | LetVariant::MutWithType(_, _, exp), ) => exp.requires_unsafe_wrapper(ctx_fn), + Self::Const(_, _, exp) => exp.requires_unsafe_wrapper(ctx_fn), Self::Array(exps) => exps.iter().any(|exp| exp.requires_unsafe_wrapper(ctx_fn)), Self::Multiply(lhs, rhs) | Self::Xor(lhs, rhs) => { lhs.requires_unsafe_wrapper(ctx_fn) || rhs.requires_unsafe_wrapper(ctx_fn) @@ -462,6 +475,10 @@ impl ToTokens for Expression { let var_ident = format_ident!("{}", var_name.to_string()); tokens.append_all(quote! { let mut #var_ident: #ty = #exp }) } + Self::Const(var_name, ty, exp) => { + let var_ident = format_ident!("{}", var_name.to_string()); + tokens.append_all(quote! { const #var_ident: #ty = #exp }) + } Self::Assign(var_name, exp) => { /* If we are dereferencing a variable to assign a value \ * the 'format_ident!' macro does not like the asterix */ diff --git a/library/stdarch/crates/stdarch-gen-arm/src/intrinsic.rs b/library/stdarch/crates/stdarch-gen-arm/src/intrinsic.rs index efaa9e141889..0cdff6ff6c39 100644 --- a/library/stdarch/crates/stdarch-gen-arm/src/intrinsic.rs +++ b/library/stdarch/crates/stdarch-gen-arm/src/intrinsic.rs @@ -1730,7 +1730,8 @@ fn create_tokens(intrinsic: &Intrinsic, endianness: Endianness, tokens: &mut Tok "{fn_name} needs to be private, or to have documentation." ); assert!( - !safety.has_doc_comments(), + !safety.has_doc_comments() + || matches!(intrinsic.visibility, FunctionVisibility::Private), "{fn_name} needs a documentation section for its safety comments." ); } diff --git a/library/stdarch/rust-version b/library/stdarch/rust-version index 04d41c96f5c0..df8693cd1ca8 100644 --- a/library/stdarch/rust-version +++ b/library/stdarch/rust-version @@ -1 +1 @@ -8401398e1f14a24670ee1a3203713dc2f0f8b3a8 +48622726c4a91c87bf6cd4dbe1000c95df59906e diff --git a/library/stdarch/triagebot.toml b/library/stdarch/triagebot.toml index 2c281c8f7d42..621f39b2cbbf 100644 --- a/library/stdarch/triagebot.toml +++ b/library/stdarch/triagebot.toml @@ -56,7 +56,3 @@ Thanks! # Documentation at: https://forge.rust-lang.org/triagebot/issue-links.html [issue-links] check-commits = false - -# Prevents mentions in commits to avoid users being spammed -# Documentation at: https://forge.rust-lang.org/triagebot/no-mentions.html -[no-mentions] diff --git a/library/unwind/src/libunwind.rs b/library/unwind/src/libunwind.rs index 9ac9b54ed4a2..091efa9c5129 100644 --- a/library/unwind/src/libunwind.rs +++ b/library/unwind/src/libunwind.rs @@ -78,8 +78,8 @@ pub const unwinder_private_data_size: usize = 20; #[cfg(all(target_arch = "wasm32", target_os = "linux"))] pub const unwinder_private_data_size: usize = 2; -#[cfg(all(target_arch = "hexagon", target_os = "linux"))] -pub const unwinder_private_data_size: usize = 35; +#[cfg(target_arch = "hexagon")] +pub const unwinder_private_data_size: usize = 5; #[cfg(any(target_arch = "loongarch32", target_arch = "loongarch64"))] pub const unwinder_private_data_size: usize = 2; diff --git a/package.json b/package.json index 007e2c116321..ef74853b77a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "browser-ui-test": "^0.22.2", + "browser-ui-test": "^0.23.0", "es-check": "^9.4.4", "eslint": "^8.57.1", "typescript": "^5.8.3" diff --git a/rust-bors.toml b/rust-bors.toml index 996b50b2ea27..0d59918e3f77 100644 --- a/rust-bors.toml +++ b/rust-bors.toml @@ -29,6 +29,9 @@ labels_blocking_approval = [ # If CI runs quicker than this duration, consider it to be a failure min_ci_time = 600 +merge_queue_enabled = true +report_merge_conflicts = true + [labels] approved = [ "+S-waiting-on-bors", @@ -51,7 +54,9 @@ try_failed = [ "-S-waiting-on-review", "-S-waiting-on-crater" ] -auto_build_succeeded = ["+merged-by-bors"] +auto_build_succeeded = [ + "+merged-by-bors" +] auto_build_failed = [ "+S-waiting-on-review", "-S-blocked", @@ -60,7 +65,3 @@ auto_build_failed = [ "-S-waiting-on-crater", "-S-waiting-on-team" ] - -# Flip this two once new bors is used for actual merges on this repository -merge_queue_enabled = false -report_merge_conflicts = true diff --git a/rustfmt.toml b/rustfmt.toml index 6172a2bb3bf9..910eea103798 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -21,7 +21,7 @@ ignore = [ "/tests/pretty/", # These tests are very sensitive to source code layout. "/tests/run-make/export", # These tests contain syntax errors. "/tests/run-make/translation/test.rs", # This test contains syntax errors. - "/tests/rustdoc/", # Some have syntax errors, some are whitespace-sensitive. + "/tests/rustdoc-html/", # Some have syntax errors, some are whitespace-sensitive. "/tests/rustdoc-gui/", # Some tests are sensitive to source code layout. "/tests/rustdoc-ui/", # Some have syntax errors, some are whitespace-sensitive. "/tests/ui/", # Some have syntax errors, some are whitespace-sensitive. diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 4dd465edb0df..2e16f2cf27e7 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1113,6 +1113,19 @@ class RustBuild(object): else: env["RUSTFLAGS"] = "-Zallow-features=" + if not os.path.isfile(self.cargo()): + raise Exception("no cargo executable found at `{}`".format(self.cargo())) + args = [ + self.cargo(), + "build", + "--jobs=" + self.jobs, + "--manifest-path", + os.path.join(self.rust_root, "src/bootstrap/Cargo.toml"), + "-Zroot-dir=" + self.rust_root, + ] + # verbose cargo output is very noisy, so only enable it with -vv + args.extend("--verbose" for _ in range(self.verbose - 1)) + target_features = [] if self.get_toml("crt-static", build_section) == "true": target_features += ["+crt-static"] @@ -1131,28 +1144,15 @@ class RustBuild(object): else: deny_warnings = self.warnings == "deny" if deny_warnings: - env["RUSTFLAGS"] += " -Dwarnings" + args += ["-Zwarnings"] + env["CARGO_BUILD_WARNINGS"] = "deny" # Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation. # Note that RUSTFLAGS_BOOTSTRAP should always be added to the end of - # RUSTFLAGS to be actually effective (e.g., if we have `-Dwarnings` in - # RUSTFLAGS, passing `-Awarnings` from RUSTFLAGS_BOOTSTRAP should override it). + # RUSTFLAGS, since that causes RUSTFLAGS_BOOTSTRAP to override RUSTFLAGS. if "RUSTFLAGS_BOOTSTRAP" in env: env["RUSTFLAGS"] += " " + env["RUSTFLAGS_BOOTSTRAP"] - if not os.path.isfile(self.cargo()): - raise Exception("no cargo executable found at `{}`".format(self.cargo())) - args = [ - self.cargo(), - "build", - "--jobs=" + self.jobs, - "--manifest-path", - os.path.join(self.rust_root, "src/bootstrap/Cargo.toml"), - "-Zroot-dir=" + self.rust_root, - ] - # verbose cargo output is very noisy, so only enable it with -vv - args.extend("--verbose" for _ in range(self.verbose - 1)) - if "BOOTSTRAP_TRACING" in env: args.append("--features=tracing") diff --git a/src/bootstrap/bootstrap_test.py b/src/bootstrap/bootstrap_test.py index 9e12982a43dc..1dbe997d23f3 100644 --- a/src/bootstrap/bootstrap_test.py +++ b/src/bootstrap/bootstrap_test.py @@ -244,8 +244,10 @@ class BuildBootstrap(unittest.TestCase): if toml_warnings is not None: configure_args = ["--set", "rust.deny-warnings=" + toml_warnings] - _, env = self.build_args(configure_args, args=["--warnings=warn"]) - self.assertFalse("-Dwarnings" in env["RUSTFLAGS"]) + args, env = self.build_args(configure_args, args=["--warnings=warn"]) + self.assertFalse("CARGO_BUILD_WARNINGS" in env) + self.assertFalse("-Zwarnings" in args) - _, env = self.build_args(configure_args, args=["--warnings=deny"]) - self.assertTrue("-Dwarnings" in env["RUSTFLAGS"]) + args, env = self.build_args(configure_args, args=["--warnings=deny"]) + self.assertEqual("deny", env["CARGO_BUILD_WARNINGS"]) + self.assertTrue("-Zwarnings" in args) diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index e3895d4e0a18..fda8f004eff4 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -120,6 +120,11 @@ o("optimize-llvm", "llvm.optimize", "build optimized LLVM") o("llvm-assertions", "llvm.assertions", "build LLVM with assertions") o("llvm-enzyme", "llvm.enzyme", "build LLVM with enzyme") o("llvm-offload", "llvm.offload", "build LLVM with gpu offload support") +o( + "llvm-offload-clang-dir", + "llvm.offload-clang-dir", + "pass the absolute directory of ClangConfig.cmake", +) o("llvm-plugins", "llvm.plugins", "build LLVM with plugin interface") o("debug-assertions", "rust.debug-assertions", "build with debugging assertions") o( diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in index 03caa764ccf4..6bef58a0ac20 100644 --- a/src/bootstrap/mk/Makefile.in +++ b/src/bootstrap/mk/Makefile.in @@ -56,8 +56,7 @@ check-aux: # Run standard library tests in Miri. $(Q)MIRIFLAGS="-Zmiri-strict-provenance" \ $(BOOTSTRAP) miri --stage 2 \ - library/coretests \ - library/alloctests \ + library/core \ library/alloc \ $(BOOTSTRAP_ARGS) \ --no-doc @@ -65,8 +64,7 @@ check-aux: # so we have to run them with isolation disabled. $(Q)MIRIFLAGS="-Zmiri-disable-isolation" \ $(BOOTSTRAP) miri --stage 2 \ - library/coretests \ - library/alloctests \ + library/core \ library/alloc \ $(BOOTSTRAP_ARGS) \ --doc diff --git a/src/bootstrap/src/bin/rustdoc.rs b/src/bootstrap/src/bin/rustdoc.rs index 784041985b72..2925892fed28 100644 --- a/src/bootstrap/src/bin/rustdoc.rs +++ b/src/bootstrap/src/bin/rustdoc.rs @@ -40,6 +40,12 @@ fn main() { if !args.iter().any(|arg| arg == "--sysroot") { cmd.arg("--sysroot").arg(&sysroot); } + } else { + // Find any host flags that were passed by bootstrap. + // The flags are stored in a RUSTC_HOST_FLAGS variable, separated by spaces. + if let Ok(flags) = std::env::var("RUSTC_HOST_FLAGS") { + cmd.args(flags.split(' ')); + } } cmd.args(&args); diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 84ab983dc7c6..762aeea9f451 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1430,10 +1430,12 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect if builder.config.llvm_enzyme { cargo.env("LLVM_ENZYME", "1"); } + let llvm::LlvmResult { host_llvm_config, .. } = builder.ensure(llvm::Llvm { target }); if builder.config.llvm_offload { + builder.ensure(llvm::OmpOffload { target }); cargo.env("LLVM_OFFLOAD", "1"); } - let llvm::LlvmResult { host_llvm_config, .. } = builder.ensure(llvm::Llvm { target }); + cargo.env("LLVM_CONFIG", &host_llvm_config); // Some LLVM linker flags (-L and -l) may be needed to link `rustc_llvm`. Its build script @@ -2296,6 +2298,24 @@ impl Step for Assemble { } } + if builder.config.llvm_offload && !builder.config.dry_run() { + debug!("`llvm_offload` requested"); + let offload_install = builder.ensure(llvm::OmpOffload { target: build_compiler.host }); + if let Some(_llvm_config) = builder.llvm_config(builder.config.host_target) { + let target_libdir = + builder.sysroot_target_libdir(target_compiler, target_compiler.host); + for p in offload_install.offload_paths() { + let libname = p.file_name().unwrap(); + let dst_lib = target_libdir.join(libname); + builder.resolve_symlink_and_copy(&p, &dst_lib); + } + // FIXME(offload): Add amdgcn-amd-amdhsa and nvptx64-nvidia-cuda folder + // This one is slightly more tricky, since we have the same file twice, in two + // subfolders for amdgcn and nvptx64. We'll likely find two more in the future, once + // Intel and Spir-V support lands in offload. + } + } + // Build the libraries for this compiler to link to (i.e., the libraries // it uses at runtime). debug!( diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index cbbdc7e02419..0e7051cc22df 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -181,7 +181,7 @@ impl Step for RustcDocs { let mut tarball = Tarball::new(builder, "rustc-docs", &target.triple); tarball.set_product_name("Rustc Documentation"); - tarball.add_bulk_dir(builder.compiler_doc_out(target), "share/doc/rust/html/rustc"); + tarball.add_bulk_dir(builder.compiler_doc_out(target), "share/doc/rust/html/rustc-docs"); tarball.generate() } } @@ -1211,6 +1211,9 @@ impl Step for Src { } } +/// Tarball for people who want to build rustc and other components from the source. +/// Does not contain GPL code, which is separated into `PlainSourceTarballGpl` +/// for licensing reasons. #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct PlainSourceTarball; @@ -1233,51 +1236,18 @@ impl Step for PlainSourceTarball { /// Creates the plain source tarball fn run(self, builder: &Builder<'_>) -> GeneratedTarball { - // NOTE: This is a strange component in a lot of ways. It uses `src` as the target, which - // means neither rustup nor rustup-toolchain-install-master know how to download it. - // It also contains symbolic links, unlike other any other dist tarball. - // It's used for distros building rustc from source in a pre-vendored environment. - let mut tarball = Tarball::new(builder, "rustc", "src"); - tarball.permit_symlinks(true); - let plain_dst_src = tarball.image_dir(); - - // This is the set of root paths which will become part of the source package - let src_files = [ - // tidy-alphabetical-start - ".gitmodules", - "CONTRIBUTING.md", - "COPYRIGHT", - "Cargo.lock", - "Cargo.toml", - "LICENSE-APACHE", - "LICENSE-MIT", - "README.md", - "RELEASES.md", - "REUSE.toml", - "bootstrap.example.toml", - "configure", - "license-metadata.json", - "package.json", - "x", - "x.ps1", - "x.py", - "yarn.lock", - // tidy-alphabetical-end - ]; - let src_dirs = ["src", "compiler", "library", "tests", "LICENSES"]; - - copy_src_dirs( + let tarball = prepare_source_tarball( builder, - &builder.src, - &src_dirs, + "src", &[ // We don't currently use the GCC source code for building any official components, // it is very big, and has unclear licensing implications due to being GPL licensed. // We thus exclude it from the source tarball from now. "src/gcc", ], - plain_dst_src, ); + + let plain_dst_src = tarball.image_dir(); // We keep something in src/gcc because it is a registered submodule, // and if it misses completely it can cause issues elsewhere // (see https://github.com/rust-lang/rust/issues/137332). @@ -1289,76 +1259,138 @@ impl Step for PlainSourceTarball { "The GCC source code is not included due to unclear licensing implications\n" )); } - - // Copy the files normally - for item in &src_files { - builder.copy_link( - &builder.src.join(item), - &plain_dst_src.join(item), - FileType::Regular, - ); - } - - // Create the version file - builder.create(&plain_dst_src.join("version"), &builder.rust_version()); - - // Create the files containing git info, to ensure --version outputs the same. - let write_git_info = |info: Option<&Info>, path: &Path| { - if let Some(info) = info { - t!(std::fs::create_dir_all(path)); - channel::write_commit_hash_file(path, &info.sha); - channel::write_commit_info_file(path, info); - } - }; - write_git_info(builder.rust_info().info(), plain_dst_src); - write_git_info(builder.cargo_info.info(), &plain_dst_src.join("./src/tools/cargo")); - - if builder.config.dist_vendor { - builder.require_and_update_all_submodules(); - - // Vendor packages that are required by opt-dist to collect PGO profiles. - let pkgs_for_pgo_training = build_helper::LLVM_PGO_CRATES - .iter() - .chain(build_helper::RUSTC_PGO_CRATES) - .map(|pkg| { - let mut manifest_path = - builder.src.join("./src/tools/rustc-perf/collector/compile-benchmarks"); - manifest_path.push(pkg); - manifest_path.push("Cargo.toml"); - manifest_path - }); - - // Vendor all Cargo dependencies - let vendor = builder.ensure(Vendor { - sync_args: pkgs_for_pgo_training.collect(), - versioned_dirs: true, - root_dir: plain_dst_src.into(), - output_dir: VENDOR_DIR.into(), - }); - - let cargo_config_dir = plain_dst_src.join(".cargo"); - builder.create_dir(&cargo_config_dir); - builder.create(&cargo_config_dir.join("config.toml"), &vendor.config); - } - - // Delete extraneous directories - // FIXME: if we're managed by git, we should probably instead ask git if the given path - // is managed by it? - for entry in walkdir::WalkDir::new(tarball.image_dir()) - .follow_links(true) - .into_iter() - .filter_map(|e| e.ok()) - { - if entry.path().is_dir() && entry.path().file_name() == Some(OsStr::new("__pycache__")) - { - t!(fs::remove_dir_all(entry.path())); - } - } - tarball.bare() } } +/// Tarball with *all* source code for source builds, including GPL-licensed code. +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct PlainSourceTarballGpl; + +impl Step for PlainSourceTarballGpl { + /// Produces the location of the tarball generated + type Output = GeneratedTarball; + const IS_HOST: bool = true; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.alias("rustc-src-gpl") + } + + fn is_default_step(builder: &Builder<'_>) -> bool { + builder.config.rust_dist_src + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(PlainSourceTarballGpl); + } + + /// Creates the plain source tarball + fn run(self, builder: &Builder<'_>) -> GeneratedTarball { + let tarball = prepare_source_tarball(builder, "src-gpl", &[]); + tarball.bare() + } +} + +fn prepare_source_tarball<'a>( + builder: &'a Builder<'a>, + name: &str, + exclude_dirs: &[&str], +) -> Tarball<'a> { + // NOTE: This is a strange component in a lot of ways. It uses `src` as the target, which + // means neither rustup nor rustup-toolchain-install-master know how to download it. + // It also contains symbolic links, unlike other any other dist tarball. + // It's used for distros building rustc from source in a pre-vendored environment. + let mut tarball = Tarball::new(builder, "rustc", name); + tarball.permit_symlinks(true); + let plain_dst_src = tarball.image_dir(); + + // This is the set of root paths which will become part of the source package + let src_files = [ + // tidy-alphabetical-start + ".gitmodules", + "CONTRIBUTING.md", + "COPYRIGHT", + "Cargo.lock", + "Cargo.toml", + "LICENSE-APACHE", + "LICENSE-MIT", + "README.md", + "RELEASES.md", + "REUSE.toml", + "bootstrap.example.toml", + "configure", + "license-metadata.json", + "package.json", + "x", + "x.ps1", + "x.py", + "yarn.lock", + // tidy-alphabetical-end + ]; + let src_dirs = ["src", "compiler", "library", "tests", "LICENSES"]; + + copy_src_dirs(builder, &builder.src, &src_dirs, exclude_dirs, plain_dst_src); + + // Copy the files normally + for item in &src_files { + builder.copy_link(&builder.src.join(item), &plain_dst_src.join(item), FileType::Regular); + } + + // Create the version file + builder.create(&plain_dst_src.join("version"), &builder.rust_version()); + + // Create the files containing git info, to ensure --version outputs the same. + let write_git_info = |info: Option<&Info>, path: &Path| { + if let Some(info) = info { + t!(std::fs::create_dir_all(path)); + channel::write_commit_hash_file(path, &info.sha); + channel::write_commit_info_file(path, info); + } + }; + write_git_info(builder.rust_info().info(), plain_dst_src); + write_git_info(builder.cargo_info.info(), &plain_dst_src.join("./src/tools/cargo")); + + if builder.config.dist_vendor { + builder.require_and_update_all_submodules(); + + // Vendor packages that are required by opt-dist to collect PGO profiles. + let pkgs_for_pgo_training = + build_helper::LLVM_PGO_CRATES.iter().chain(build_helper::RUSTC_PGO_CRATES).map(|pkg| { + let mut manifest_path = + builder.src.join("./src/tools/rustc-perf/collector/compile-benchmarks"); + manifest_path.push(pkg); + manifest_path.push("Cargo.toml"); + manifest_path + }); + + // Vendor all Cargo dependencies + let vendor = builder.ensure(Vendor { + sync_args: pkgs_for_pgo_training.collect(), + versioned_dirs: true, + root_dir: plain_dst_src.into(), + output_dir: VENDOR_DIR.into(), + }); + + let cargo_config_dir = plain_dst_src.join(".cargo"); + builder.create_dir(&cargo_config_dir); + builder.create(&cargo_config_dir.join("config.toml"), &vendor.config); + } + + // Delete extraneous directories + // FIXME: if we're managed by git, we should probably instead ask git if the given path + // is managed by it? + for entry in walkdir::WalkDir::new(tarball.image_dir()) + .follow_links(true) + .into_iter() + .filter_map(|e| e.ok()) + { + if entry.path().is_dir() && entry.path().file_name() == Some(OsStr::new("__pycache__")) { + t!(fs::remove_dir_all(entry.path())); + } + } + tarball +} + #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct Cargo { pub build_compiler: Compiler, @@ -2839,24 +2871,26 @@ impl Step for ReproducibleArtifacts { /// Tarball containing a prebuilt version of the libgccjit library, /// needed as a dependency for the GCC codegen backend (similarly to the LLVM /// backend needing a prebuilt libLLVM). +/// +/// This component is used for `download-ci-gcc`. #[derive(Clone, Debug, Eq, Hash, PartialEq)] -pub struct Gcc { +pub struct GccDev { target: TargetSelection, } -impl Step for Gcc { +impl Step for GccDev { type Output = GeneratedTarball; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.alias("gcc") + run.alias("gcc-dev") } fn make_run(run: RunConfig<'_>) { - run.builder.ensure(Gcc { target: run.target }); + run.builder.ensure(GccDev { target: run.target }); } fn run(self, builder: &Builder<'_>) -> Self::Output { - let tarball = Tarball::new(builder, "gcc", &self.target.triple); + let tarball = Tarball::new(builder, "gcc-dev", &self.target.triple); let output = builder .ensure(super::gcc::Gcc { target_pair: GccTargetPair::for_native_build(self.target) }); tarball.add_file(output.libgccjit(), "lib", FileType::NativeLibrary); @@ -2864,6 +2898,6 @@ impl Step for Gcc { } fn metadata(&self) -> Option { - Some(StepMetadata::dist("gcc", self.target)) + Some(StepMetadata::dist("gcc-dev", self.target)) } } diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 648a2bea4181..34da87a8d1ce 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -325,6 +325,7 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target_pair: GccTargetPair) .arg("--enable-checking=release") .arg("--disable-bootstrap") .arg("--disable-multilib") + .arg("--with-bugurl=https://github.com/rust-lang/gcc/") .arg(format!("--prefix={}", install_dir.display())); let cc = builder.build.cc(host).display().to_string(); @@ -346,6 +347,9 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target_pair: GccTargetPair) .map_or_else(|| cxx.clone(), |ccache| format!("{ccache} {cxx}")); configure_cmd.env("CXX", cxx); } + // Disable debuginfo to reduce size of libgccjit.so 10x + configure_cmd.env("CXXFLAGS", "-O2 -g0"); + configure_cmd.env("CFLAGS", "-O2 -g0"); configure_cmd.run(builder); command("make") diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 51a791daef28..c3935d9810e9 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -14,6 +14,7 @@ use std::path::{Path, PathBuf}; use std::sync::OnceLock; use std::{env, fs}; +use build_helper::exit; use build_helper::git::PathFreshness; use crate::core::builder::{Builder, RunConfig, ShouldRun, Step, StepMetadata}; @@ -63,6 +64,25 @@ impl LlvmBuildStatus { } } +/// Allows each step to add C/Cxx flags which are only used for a specific cmake invocation. +#[derive(Debug, Clone, Default)] +struct CcFlags { + /// Additional values for CMAKE_CC_FLAGS, to be added before all other values. + cflags: OsString, + /// Additional values for CMAKE_CXX_FLAGS, to be added before all other values. + cxxflags: OsString, +} + +impl CcFlags { + fn push_all(&mut self, s: impl AsRef) { + let s = s.as_ref(); + self.cflags.push(" "); + self.cflags.push(s); + self.cxxflags.push(" "); + self.cxxflags.push(s); + } +} + /// Linker flags to pass to LLVM's CMake invocation. #[derive(Debug, Clone, Default)] struct LdFlags { @@ -454,16 +474,6 @@ impl Step for Llvm { enabled_llvm_runtimes.push("compiler-rt"); } - // This is an experimental flag, which likely builds more than necessary. - // We will optimize it when we get closer to releasing it on nightly. - if builder.config.llvm_offload { - enabled_llvm_runtimes.push("offload"); - //FIXME(ZuseZ4): LLVM intends to drop the offload dependency on openmp. - //Remove this line once they achieved it. - enabled_llvm_runtimes.push("openmp"); - enabled_llvm_projects.push("compiler-rt"); - } - if !enabled_llvm_projects.is_empty() { enabled_llvm_projects.sort(); enabled_llvm_projects.dedup(); @@ -527,7 +537,7 @@ impl Step for Llvm { cfg.define("LLVM_VERSION_SUFFIX", suffix); } - configure_cmake(builder, target, &mut cfg, true, ldflags, &[]); + configure_cmake(builder, target, &mut cfg, true, ldflags, CcFlags::default(), &[]); configure_llvm(builder, target, &mut cfg); for (key, val) in &builder.config.llvm_build_config { @@ -633,6 +643,7 @@ fn configure_cmake( cfg: &mut cmake::Config, use_compiler_launcher: bool, mut ldflags: LdFlags, + ccflags: CcFlags, suppressed_compiler_flag_prefixes: &[&str], ) { // Do not print installation messages for up-to-date files. @@ -761,23 +772,21 @@ fn configure_cmake( .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc)); cfg.build_arg("-j").build_arg(builder.jobs().to_string()); + let mut cflags = ccflags.cflags.clone(); // FIXME(madsmtm): Allow `cmake-rs` to select flags by itself by passing // our flags via `.cflag`/`.cxxflag` instead. // // Needs `suppressed_compiler_flag_prefixes` to be gone, and hence // https://github.com/llvm/llvm-project/issues/88780 to be fixed. - let mut cflags: OsString = builder + for flag in builder .cc_handled_clags(target, CLang::C) .into_iter() .chain(builder.cc_unhandled_cflags(target, GitRepo::Llvm, CLang::C)) - .filter(|flag| { - !suppressed_compiler_flag_prefixes - .iter() - .any(|suppressed_prefix| flag.starts_with(suppressed_prefix)) - }) - .collect::>() - .join(" ") - .into(); + .filter(|flag| !suppressed_compiler_flag_prefixes.iter().any(|p| flag.starts_with(p))) + { + cflags.push(" "); + cflags.push(flag); + } if let Some(ref s) = builder.config.llvm_cflags { cflags.push(" "); cflags.push(s); @@ -789,7 +798,8 @@ fn configure_cmake( cflags.push(format!(" --target={target}")); } cfg.define("CMAKE_C_FLAGS", cflags); - let mut cxxflags: OsString = builder + let mut cxxflags = ccflags.cxxflags.clone(); + for flag in builder .cc_handled_clags(target, CLang::Cxx) .into_iter() .chain(builder.cc_unhandled_cflags(target, GitRepo::Llvm, CLang::Cxx)) @@ -798,9 +808,10 @@ fn configure_cmake( .iter() .any(|suppressed_prefix| flag.starts_with(suppressed_prefix)) }) - .collect::>() - .join(" ") - .into(); + { + cxxflags.push(" "); + cxxflags.push(flag); + } if let Some(ref s) = builder.config.llvm_cxxflags { cxxflags.push(" "); cxxflags.push(s); @@ -811,6 +822,7 @@ fn configure_cmake( if builder.config.llvm_clang_cl.is_some() { cxxflags.push(format!(" --target={target}")); } + cfg.define("CMAKE_CXX_FLAGS", cxxflags); if let Some(ar) = builder.ar(target) && ar.is_absolute() @@ -896,6 +908,175 @@ fn get_var(var_base: &str, host: &str, target: &str) -> Option { .or_else(|| env::var_os(var_base)) } +#[derive(Clone)] +pub struct BuiltOmpOffload { + /// Path to the omp and offload dylibs. + offload: Vec, +} + +impl BuiltOmpOffload { + pub fn offload_paths(&self) -> Vec { + self.offload.clone() + } +} + +// FIXME(offload): In an ideal world, we would just enable the offload runtime in our previous LLVM +// build step. For now, we still depend on the openmp runtime since we use some of it's API, so we +// build both. However, when building those runtimes as part of the LLVM step, then LLVM's cmake +// implicitly assumes that Clang has also been build and will try to use it. In the Rust CI, we +// don't always build clang (due to compile times), but instead use a slightly older external clang. +// LLVM tries to remove this build dependency of offload/openmp on Clang for LLVM-22, so in the +// future we might be able to integrate this step into the LLVM step. For now, we instead introduce +// a Clang_DIR bootstrap option, which allows us tell CMake to use an external clang for these two +// runtimes. This external clang will try to use it's own (older) include dirs when building our +// in-tree LLVM submodule, which will cause build failures. To prevent those, we now also +// explicitly set our include dirs. +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct OmpOffload { + pub target: TargetSelection, +} + +impl Step for OmpOffload { + type Output = BuiltOmpOffload; + const IS_HOST: bool = true; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/llvm-project/offload") + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(OmpOffload { target: run.target }); + } + + /// Compile OpenMP offload runtimes for `target`. + #[allow(unused)] + fn run(self, builder: &Builder<'_>) -> Self::Output { + if builder.config.dry_run() { + return BuiltOmpOffload { + offload: vec![builder.config.tempdir().join("llvm-offload-dry-run")], + }; + } + let target = self.target; + + let LlvmResult { host_llvm_config, llvm_cmake_dir } = + builder.ensure(Llvm { target: self.target }); + + // Running cmake twice in the same folder is known to cause issues, like deleting existing + // binaries. We therefore write our offload artifacts into it's own folder, instead of + // using the llvm build dir. + let out_dir = builder.offload_out(target); + + let mut files = vec![]; + let lib_ext = std::env::consts::DLL_EXTENSION; + files.push(out_dir.join("lib").join("libLLVMOffload").with_extension(lib_ext)); + files.push(out_dir.join("lib").join("libomp").with_extension(lib_ext)); + files.push(out_dir.join("lib").join("libomptarget").with_extension(lib_ext)); + + // Offload/OpenMP are just subfolders of LLVM, so we can use the LLVM sha. + static STAMP_HASH_MEMO: OnceLock = OnceLock::new(); + let smart_stamp_hash = STAMP_HASH_MEMO.get_or_init(|| { + generate_smart_stamp_hash( + builder, + &builder.config.src.join("src/llvm-project/offload"), + builder.in_tree_llvm_info.sha().unwrap_or_default(), + ) + }); + let stamp = BuildStamp::new(&out_dir).with_prefix("offload").add_stamp(smart_stamp_hash); + + trace!("checking build stamp to see if we need to rebuild offload/openmp artifacts"); + if stamp.is_up_to_date() { + trace!(?out_dir, "offload/openmp build artifacts are up to date"); + if stamp.stamp().is_empty() { + builder.info( + "Could not determine the Offload submodule commit hash. \ + Assuming that an Offload rebuild is not necessary.", + ); + builder.info(&format!( + "To force Offload/OpenMP to rebuild, remove the file `{}`", + stamp.path().display() + )); + } + return BuiltOmpOffload { offload: files }; + } + + trace!(?target, "(re)building offload/openmp artifacts"); + builder.info(&format!("Building OpenMP/Offload for {target}")); + t!(stamp.remove()); + let _time = helpers::timeit(builder); + t!(fs::create_dir_all(&out_dir)); + + builder.config.update_submodule("src/llvm-project"); + let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/runtimes/")); + + // If we use an external clang as opposed to building our own llvm_clang, than that clang will + // come with it's own set of default include directories, which are based on a potentially older + // LLVM. This can cause issues, so we overwrite it to include headers based on our + // `src/llvm-project` submodule instead. + // FIXME(offload): With LLVM-22 we hopefully won't need an external clang anymore. + let mut cflags = CcFlags::default(); + if !builder.config.llvm_clang { + let base = builder.llvm_out(target).join("include"); + let inc_dir = base.display(); + cflags.push_all(format!(" -I {inc_dir}")); + } + + configure_cmake(builder, target, &mut cfg, true, LdFlags::default(), cflags, &[]); + + // Re-use the same flags as llvm to control the level of debug information + // generated for offload. + let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) { + (false, _) => "Debug", + (true, false) => "Release", + (true, true) => "RelWithDebInfo", + }; + trace!(?profile); + + // OpenMP/Offload builds currently (LLVM-21) still depend on Clang, although there are + // intentions to loosen this requirement for LLVM-22. If we were to + let clang_dir = if !builder.config.llvm_clang { + // We must have an external clang to use. + assert!(&builder.build.config.llvm_clang_dir.is_some()); + builder.build.config.llvm_clang_dir.clone() + } else { + // No need to specify it, since we use the in-tree clang + None + }; + + // FIXME(offload): Once we move from OMP to Offload (Ol) APIs, we should drop the openmp + // runtime to simplify our build. We should also re-evaluate the LLVM_Root and try to get + // rid of the Clang_DIR, once we upgrade to LLVM-22. + cfg.out_dir(&out_dir) + .profile(profile) + .env("LLVM_CONFIG_REAL", &host_llvm_config) + .define("LLVM_ENABLE_ASSERTIONS", "ON") + .define("LLVM_ENABLE_RUNTIMES", "openmp;offload") + .define("LLVM_INCLUDE_TESTS", "OFF") + .define("OFFLOAD_INCLUDE_TESTS", "OFF") + .define("OPENMP_STANDALONE_BUILD", "ON") + .define("LLVM_ROOT", builder.llvm_out(target).join("build")) + .define("LLVM_DIR", llvm_cmake_dir); + if let Some(p) = clang_dir { + cfg.define("Clang_DIR", p); + } + cfg.build(); + + t!(stamp.write()); + + for p in &files { + // At this point, `out_dir` should contain the built . + // files. + if !p.exists() { + eprintln!( + "`{p:?}` not found in `{}`. Either the build has failed or Offload was built with a wrong version of LLVM", + out_dir.display() + ); + exit!(1); + } + } + BuiltOmpOffload { offload: files } + } +} + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Enzyme { pub target: TargetSelection, @@ -970,7 +1151,12 @@ impl Step for Enzyme { builder.config.update_submodule("src/tools/enzyme"); let mut cfg = cmake::Config::new(builder.src.join("src/tools/enzyme/enzyme/")); - configure_cmake(builder, target, &mut cfg, true, LdFlags::default(), &[]); + // Enzyme devs maintain upstream compatibility, but only fix deprecations when they are about + // to turn into a hard error. As such, Enzyme generates various warnings which could make it + // hard to spot more relevant issues. + let mut cflags = CcFlags::default(); + cflags.push_all("-Wno-deprecated"); + configure_cmake(builder, target, &mut cfg, true, LdFlags::default(), cflags, &[]); // Re-use the same flags as llvm to control the level of debug information // generated by Enzyme. @@ -1090,7 +1276,7 @@ impl Step for Lld { ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'"); } - configure_cmake(builder, target, &mut cfg, true, ldflags, &[]); + configure_cmake(builder, target, &mut cfg, true, ldflags, CcFlags::default(), &[]); configure_llvm(builder, target, &mut cfg); // Re-use the same flags as llvm to control the level of debug information @@ -1213,6 +1399,7 @@ impl Step for Sanitizers { &mut cfg, use_compiler_launcher, LdFlags::default(), + CcFlags::default(), suppressed_compiler_flag_prefixes, ); diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index a58739c9e65c..b26df1586e71 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1582,10 +1582,10 @@ test!(UiFullDeps { IS_HOST: true, }); -test!(Rustdoc { - path: "tests/rustdoc", - mode: CompiletestMode::Rustdoc, - suite: "rustdoc", +test!(RustdocHtml { + path: "tests/rustdoc-html", + mode: CompiletestMode::RustdocHtml, + suite: "rustdoc-html", default: true, IS_HOST: true, }); @@ -1969,7 +1969,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the if matches!( mode, CompiletestMode::RunMake - | CompiletestMode::Rustdoc + | CompiletestMode::RustdocHtml | CompiletestMode::RustdocJs | CompiletestMode::RustdocJson ) || matches!(suite, "rustdoc-ui" | "coverage-run-rustdoc") @@ -2064,6 +2064,10 @@ Please disable assertions with `rust.debug-assertions = false`. cmd.arg("--has-enzyme"); } + if builder.build.config.llvm_offload { + cmd.arg("--has-offload"); + } + if builder.config.cmd.bless() { cmd.arg("--bless"); } @@ -2754,7 +2758,7 @@ impl Step for ErrorIndex { fn make_run(run: RunConfig<'_>) { // error_index_generator depends on librustdoc. Use the compiler that // is normally used to build rustdoc for other tests (like compiletest - // tests in tests/rustdoc) so that it shares the same artifacts. + // tests in tests/rustdoc-html) so that it shares the same artifacts. let compilers = RustcPrivateCompilers::new( run.builder, run.builder.top_stage, @@ -3155,7 +3159,7 @@ impl Step for CrateRustdoc { builder.compiler(builder.top_stage, target) } else { // Use the previous stage compiler to reuse the artifacts that are - // created when running compiletest for tests/rustdoc. If this used + // created when running compiletest for tests/rustdoc-html. If this used // `compiler`, then it would cause rustdoc to be built *again*, which // isn't really necessary. builder.compiler_for(builder.top_stage, target, target) diff --git a/src/bootstrap/src/core/build_steps/test/compiletest.rs b/src/bootstrap/src/core/build_steps/test/compiletest.rs index 359f6bb1a6ef..230ed75a0868 100644 --- a/src/bootstrap/src/core/build_steps/test/compiletest.rs +++ b/src/bootstrap/src/core/build_steps/test/compiletest.rs @@ -21,7 +21,7 @@ pub(crate) enum CompiletestMode { MirOpt, Pretty, RunMake, - Rustdoc, + RustdocHtml, RustdocJs, RustdocJson, Ui, @@ -49,7 +49,7 @@ impl CompiletestMode { Self::MirOpt => "mir-opt", Self::Pretty => "pretty", Self::RunMake => "run-make", - Self::Rustdoc => "rustdoc", + Self::RustdocHtml => "rustdoc-html", Self::RustdocJs => "rustdoc-js", Self::RustdocJson => "rustdoc-json", Self::Ui => "ui", diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index b0a8ce77efe7..b95533e11202 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -503,6 +503,11 @@ impl Builder<'_> { let out_dir = self.stage_out(compiler, mode); cargo.env("CARGO_TARGET_DIR", &out_dir); + // Set this unconditionally. Cargo silently ignores `CARGO_BUILD_WARNINGS` when `-Z + // warnings` isn't present, which is hard to debug, and it's not worth the effort to keep + // them in sync. + cargo.arg("-Zwarnings"); + // Bootstrap makes a lot of assumptions about the artifacts produced in the target // directory. If users override the "build directory" using `build-dir` // (https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-dir), then @@ -1207,8 +1212,10 @@ impl Builder<'_> { lint_flags.push("-Wunused_lifetimes"); if self.config.deny_warnings { - lint_flags.push("-Dwarnings"); - rustdocflags.arg("-Dwarnings"); + // We use this instead of `lint_flags` so that we don't have to rebuild all + // workspace dependencies when `deny-warnings` changes, but we still get an error + // immediately instead of having to wait until the next rebuild. + cargo.env("CARGO_BUILD_WARNINGS", "deny"); } rustdocflags.arg("-Wrustdoc::invalid_codeblock_attributes"); diff --git a/src/bootstrap/src/core/builder/cli_paths.rs b/src/bootstrap/src/core/builder/cli_paths.rs index 470e83d341c7..5ff2b380e4b9 100644 --- a/src/bootstrap/src/core/builder/cli_paths.rs +++ b/src/bootstrap/src/core/builder/cli_paths.rs @@ -31,8 +31,8 @@ pub(crate) const PATH_REMAP: &[(&str, &[&str])] = &[ "tests/pretty", "tests/run-make", "tests/run-make-cargo", - "tests/rustdoc", "tests/rustdoc-gui", + "tests/rustdoc-html", "tests/rustdoc-js", "tests/rustdoc-js-std", "tests/rustdoc-json", diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_dist.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_dist.snap index 2fc8ca143dd0..7fae0b24df94 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_dist.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_dist.snap @@ -29,6 +29,9 @@ expression: dist [Dist] dist::PlainSourceTarball targets: [x86_64-unknown-linux-gnu] - Set({dist::rustc-src}) +[Dist] dist::PlainSourceTarballGpl + targets: [x86_64-unknown-linux-gnu] + - Set({dist::rustc-src-gpl}) [Dist] dist::ReproducibleArtifacts targets: [x86_64-unknown-linux-gnu] - Set({dist::reproducible-artifacts}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap index fd18b59a9c6d..4ab84c3cabc1 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap @@ -1,6 +1,5 @@ --- source: src/bootstrap/src/core/builder/cli_paths/tests.rs -assertion_line: 68 expression: test --- [Test] test::Tidy @@ -38,9 +37,9 @@ expression: test [Test] test::UiFullDeps targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/ui-fulldeps) -[Test] test::Rustdoc +[Test] test::RustdocHtml targets: [x86_64-unknown-linux-gnu] - - Suite(test::tests/rustdoc) + - Suite(test::tests/rustdoc-html) [Test] test::CoverageRunRustdoc targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/coverage-run-rustdoc) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc.snap index 6522a7e8edaf..c8eee72aec42 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc.snap @@ -5,9 +5,6 @@ expression: test librustdoc rustdoc [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] - Set({test::src/librustdoc, test::src/tools/rustdoc}) -[Test] test::Rustdoc - targets: [x86_64-unknown-linux-gnu] - - Suite(test::tests/rustdoc) [Test] test::RustdocBook targets: [x86_64-unknown-linux-gnu] - Set({test::src/doc/rustdoc}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc_html.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc_html.snap new file mode 100644 index 000000000000..21acc1e46069 --- /dev/null +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_librustdoc_rustdoc_html.snap @@ -0,0 +1,10 @@ +--- +source: src/bootstrap/src/core/builder/cli_paths/tests.rs +expression: test librustdoc rustdoc-html +--- +[Test] test::CrateRustdoc + targets: [x86_64-unknown-linux-gnu] + - Set({test::src/librustdoc}) +[Test] test::RustdocHtml + targets: [x86_64-unknown-linux-gnu] + - Suite(test::tests/rustdoc-html) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc.snap index 337ad33fe35f..897372dcd1c7 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc.snap @@ -2,9 +2,6 @@ source: src/bootstrap/src/core/builder/cli_paths/tests.rs expression: test rustdoc --- -[Test] test::Rustdoc - targets: [x86_64-unknown-linux-gnu] - - Suite(test::tests/rustdoc) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] - Set({test::src/tools/rustdoc}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc_html.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc_html.snap new file mode 100644 index 000000000000..a6a2a27c075e --- /dev/null +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_rustdoc_html.snap @@ -0,0 +1,7 @@ +--- +source: src/bootstrap/src/core/builder/cli_paths/tests.rs +expression: test rustdoc-html +--- +[Test] test::RustdocHtml + targets: [x86_64-unknown-linux-gnu] + - Suite(test::tests/rustdoc-html) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap index 171680515476..2a4805e4fd68 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap @@ -1,6 +1,5 @@ --- source: src/bootstrap/src/core/builder/cli_paths/tests.rs -assertion_line: 68 expression: test --skip=coverage --- [Test] test::Tidy @@ -37,9 +36,9 @@ expression: test --skip=coverage [Test] test::UiFullDeps targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/ui-fulldeps) -[Test] test::Rustdoc +[Test] test::RustdocHtml targets: [x86_64-unknown-linux-gnu] - - Suite(test::tests/rustdoc) + - Suite(test::tests/rustdoc-html) [Test] test::CoverageRunRustdoc targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/coverage-run-rustdoc) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests.snap index b38af13d49c3..ad9660ef5c91 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests.snap @@ -38,12 +38,12 @@ expression: test tests [Test] test::RunMakeCargo targets: [aarch64-unknown-linux-gnu] - Suite(test::tests/run-make-cargo) -[Test] test::Rustdoc - targets: [x86_64-unknown-linux-gnu] - - Suite(test::tests/rustdoc) [Test] test::RustdocGUI targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/rustdoc-gui) +[Test] test::RustdocHtml + targets: [x86_64-unknown-linux-gnu] + - Suite(test::tests/rustdoc-html) [Test] test::RustdocJSNotStd targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/rustdoc-js) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests_skip_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests_skip_coverage.snap index 6a158ea62bb3..4572f089b0ae 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests_skip_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_tests_skip_coverage.snap @@ -35,12 +35,12 @@ expression: test tests --skip=coverage [Test] test::RunMakeCargo targets: [aarch64-unknown-linux-gnu] - Suite(test::tests/run-make-cargo) -[Test] test::Rustdoc - targets: [x86_64-unknown-linux-gnu] - - Suite(test::tests/rustdoc) [Test] test::RustdocGUI targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/rustdoc-gui) +[Test] test::RustdocHtml + targets: [x86_64-unknown-linux-gnu] + - Suite(test::tests/rustdoc-html) [Test] test::RustdocJSNotStd targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/rustdoc-js) diff --git a/src/bootstrap/src/core/builder/cli_paths/tests.rs b/src/bootstrap/src/core/builder/cli_paths/tests.rs index 49f75c8bea77..39293abd4fb9 100644 --- a/src/bootstrap/src/core/builder/cli_paths/tests.rs +++ b/src/bootstrap/src/core/builder/cli_paths/tests.rs @@ -169,7 +169,9 @@ declare_tests!( (x_test_library, "test library"), (x_test_librustdoc, "test librustdoc"), (x_test_librustdoc_rustdoc, "test librustdoc rustdoc"), + (x_test_librustdoc_rustdoc_html, "test librustdoc rustdoc-html"), (x_test_rustdoc, "test rustdoc"), + (x_test_rustdoc_html, "test rustdoc-html"), (x_test_skip_coverage, "test --skip=coverage"), // FIXME(Zalathar): This doesn't skip the coverage-map or coverage-run tests. (x_test_skip_tests, "test --skip=tests"), diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index 0bf70883a47a..9e1a65bca79d 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -880,7 +880,7 @@ impl<'a> Builder<'a> { test::Incremental, test::Debuginfo, test::UiFullDeps, - test::Rustdoc, + test::RustdocHtml, test::CoverageRunRustdoc, test::Pretty, test::CodegenCranelift, @@ -986,9 +986,10 @@ impl<'a> Builder<'a> { // and force us to rebuild tools after vendoring dependencies. // To work around this, create the Tarball after building all the tools. dist::PlainSourceTarball, + dist::PlainSourceTarballGpl, dist::BuildManifest, dist::ReproducibleArtifacts, - dist::Gcc + dist::GccDev ), Kind::Install => describe!( install::Docs, diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 9146c470e358..66614cc6cced 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -2099,7 +2099,7 @@ mod snapshot { [test] compiletest-debuginfo 1 [test] compiletest-ui-fulldeps 1 [build] rustdoc 1 - [test] compiletest-rustdoc 1 + [test] compiletest-rustdoc-html 1 [test] compiletest-coverage-run-rustdoc 1 [test] compiletest-pretty 1 [build] rustc 1 -> std 1 @@ -2169,7 +2169,7 @@ mod snapshot { let ctx = TestCtx::new(); insta::assert_snapshot!( ctx.config("test") - .args(&["ui", "ui-fulldeps", "run-make", "rustdoc", "rustdoc-gui", "incremental"]) + .args(&["ui", "ui-fulldeps", "run-make", "rustdoc-html", "rustdoc-gui", "incremental"]) .render_steps(), @r" [build] llvm [build] rustc 0 -> rustc 1 @@ -2180,11 +2180,10 @@ mod snapshot { [build] rustc 0 -> RunMakeSupport 1 [build] rustdoc 1 [test] compiletest-run-make 1 - [test] compiletest-rustdoc 1 + [test] compiletest-rustdoc-html 1 [build] rustc 0 -> RustdocGUITest 1 [test] rustdoc-gui 1 [test] compiletest-incremental 1 - [build] rustc 1 -> rustc 2 "); } @@ -2193,7 +2192,7 @@ mod snapshot { let ctx = TestCtx::new(); insta::assert_snapshot!( ctx.config("test") - .args(&["ui", "ui-fulldeps", "run-make", "rustdoc", "rustdoc-gui", "incremental"]) + .args(&["ui", "ui-fulldeps", "run-make", "rustdoc-html", "rustdoc-gui", "incremental"]) .stage(2) .render_steps(), @r" [build] llvm @@ -2208,11 +2207,10 @@ mod snapshot { [build] rustc 0 -> RunMakeSupport 1 [build] rustdoc 2 [test] compiletest-run-make 2 - [test] compiletest-rustdoc 2 + [test] compiletest-rustdoc-html 2 [build] rustc 0 -> RustdocGUITest 1 [test] rustdoc-gui 2 [test] compiletest-incremental 2 - [build] rustdoc 1 "); } @@ -2241,12 +2239,11 @@ mod snapshot { [build] rustc 0 -> RunMakeSupport 1 [build] rustdoc 2 [test] compiletest-run-make 2 - [test] compiletest-rustdoc 2 + [build] rustc 1 -> rustc 2 + [build] rustdoc 1 [build] rustc 0 -> RustdocGUITest 1 [test] rustdoc-gui 2 [test] compiletest-incremental 2 - [build] rustc 1 -> rustc 2 - [build] rustdoc 1 [build] rustc 2 -> std 2 [build] rustdoc 2 "); @@ -2283,7 +2280,7 @@ mod snapshot { [build] rustc 2 -> rustc 3 [test] compiletest-ui-fulldeps 2 [build] rustdoc 2 - [test] compiletest-rustdoc 2 + [test] compiletest-rustdoc-html 2 [test] compiletest-coverage-run-rustdoc 2 [test] compiletest-pretty 2 [build] rustc 2 -> std 2 diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 683128a5e153..07405a0309fe 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -169,6 +169,7 @@ pub struct Config { pub llvm_link_jobs: Option, pub llvm_version_suffix: Option, pub llvm_use_linker: Option, + pub llvm_clang_dir: Option, pub llvm_allow_old_toolchain: bool, pub llvm_polly: bool, pub llvm_clang: bool, @@ -604,6 +605,7 @@ impl Config { use_linker: llvm_use_linker, allow_old_toolchain: llvm_allow_old_toolchain, offload: llvm_offload, + offload_clang_dir: llvm_clang_dir, polly: llvm_polly, clang: llvm_clang, enable_warnings: llvm_enable_warnings, @@ -1361,6 +1363,7 @@ impl Config { llvm_cflags, llvm_clang: llvm_clang.unwrap_or(false), llvm_clang_cl, + llvm_clang_dir: llvm_clang_dir.map(PathBuf::from), llvm_cxxflags, llvm_enable_warnings: llvm_enable_warnings.unwrap_or(false), llvm_enzyme: llvm_enzyme.unwrap_or(false), diff --git a/src/bootstrap/src/core/config/toml/llvm.rs b/src/bootstrap/src/core/config/toml/llvm.rs index 9751837a8879..5f08884e4ef7 100644 --- a/src/bootstrap/src/core/config/toml/llvm.rs +++ b/src/bootstrap/src/core/config/toml/llvm.rs @@ -35,6 +35,7 @@ define_config! { allow_old_toolchain: Option = "allow-old-toolchain", offload: Option = "offload", polly: Option = "polly", + offload_clang_dir: Option = "offload-clang-dir", clang: Option = "clang", enable_warnings: Option = "enable-warnings", download_ci_llvm: Option = "download-ci-llvm", @@ -112,6 +113,7 @@ pub fn check_incompatible_options_for_ci_llvm( use_linker, allow_old_toolchain, offload, + offload_clang_dir: _, polly, clang, enable_warnings, diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index d950dc1a1c58..43efdcd7db17 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -381,7 +381,7 @@ impl Config { } let base = &self.stage0_metadata.config.artifacts_server; let version = self.artifact_version_part(gcc_sha); - let filename = format!("gcc-{version}-{}.tar.xz", self.host_target.triple); + let filename = format!("gcc-dev-{version}-{}.tar.xz", self.host_target.triple); let tarball = gcc_cache.join(&filename); if !tarball.exists() { let help_on_error = "ERROR: failed to download gcc from ci diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index adae9a1b8b08..857c0539e7d2 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -975,6 +975,10 @@ impl Build { self.out.join(&*target.triple).join("enzyme") } + fn offload_out(&self, target: TargetSelection) -> PathBuf { + self.out.join(&*target.triple).join("offload") + } + fn lld_out(&self, target: TargetSelection) -> PathBuf { self.out.join(target).join("lld") } @@ -1624,26 +1628,20 @@ impl Build { self.release(&self.version) } - /// Returns the "package version" for a component given the `num` release - /// number. + /// Returns the "package version" for a component. /// /// The package version is typically what shows up in the names of tarballs. - /// For channels like beta/nightly it's just the channel name, otherwise - /// it's the `num` provided. - fn package_vers(&self, num: &str) -> String { + /// For channels like beta/nightly it's just the channel name, otherwise it's the release + /// version. + fn rust_package_vers(&self) -> String { match &self.config.channel[..] { - "stable" => num.to_string(), + "stable" => self.version.to_string(), "beta" => "beta".to_string(), "nightly" => "nightly".to_string(), - _ => format!("{num}-dev"), + _ => format!("{}-dev", self.version), } } - /// Returns the value of `package_vers` above for Rust itself. - fn rust_package_vers(&self) -> String { - self.package_vers(&self.version) - } - /// Returns the `version` string associated with this compiler for Rust /// itself. /// diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index d7990c2316d1..1077077cb97a 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -606,4 +606,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "New option `gcc.libgccjit-libs-dir` to specify which libgccjit.so to use per target.", }, + ChangeInfo { + change_id: 148671, + severity: ChangeSeverity::Info, + summary: "New option `llvm.offload-clang-dir` to allow building an in-tree llvm offload and openmp runtime with an external clang.", + }, ]; diff --git a/src/bootstrap/src/utils/proc_macro_deps.rs b/src/bootstrap/src/utils/proc_macro_deps.rs index 3873e0c928a5..71b6aacdebed 100644 --- a/src/bootstrap/src/utils/proc_macro_deps.rs +++ b/src/bootstrap/src/utils/proc_macro_deps.rs @@ -5,6 +5,7 @@ pub static CRATES: &[&str] = &[ // tidy-alphabetical-start "annotate-snippets", "anstyle", + "askama_derive", "askama_parser", "basic-toml", "block-buffer", diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index 42d9b00f004a..1fdc2ddb4cfc 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -152,6 +152,14 @@ pub fn has_changed_since(git_dir: &Path, base: &str, paths: &[&str]) -> bool { }) } +const LEGACY_BORS_EMAIL: &str = "bors@rust-lang.org"; + +/// Escape characters from the git user e-mail, so that git commands do not interpret it as regex +/// special characters. +fn escape_email_git_regex(text: &str) -> String { + text.replace("[", "\\[").replace("]", "\\]").replace(".", "\\.") +} + /// Returns the latest upstream commit that modified `target_paths`, or `None` if no such commit /// was found. fn get_latest_upstream_commit_that_modified_files( @@ -182,9 +190,15 @@ fn get_latest_upstream_commit_that_modified_files( "-n1", &upstream, "--author", - git_config.git_merge_commit_email, + &escape_email_git_regex(git_config.git_merge_commit_email), ]); + // Also search for legacy bors account, before we accrue enough commits to + // have changes to all relevant file paths done by new bors. + if git_config.git_merge_commit_email != LEGACY_BORS_EMAIL { + git.args(["--author", LEGACY_BORS_EMAIL]); + } + if !target_paths.is_empty() { git.arg("--").args(target_paths); } @@ -229,11 +243,17 @@ pub fn get_closest_upstream_commit( git.args([ "rev-list", "--author-date-order", - &format!("--author={}", config.git_merge_commit_email), + &format!("--author={}", &escape_email_git_regex(config.git_merge_commit_email),), "-n1", base, ]); + // Also search for legacy bors account, before we accrue enough commits to + // have changes to all relevant file paths done by new bors. + if config.git_merge_commit_email != LEGACY_BORS_EMAIL { + git.args(["--author", LEGACY_BORS_EMAIL]); + } + let output = output_result(&mut git)?.trim().to_owned(); if output.is_empty() { Ok(None) } else { Ok(Some(output)) } } diff --git a/src/build_helper/src/npm.rs b/src/build_helper/src/npm.rs index f250ced4dc8a..2a558b5618b3 100644 --- a/src/build_helper/src/npm.rs +++ b/src/build_helper/src/npm.rs @@ -22,7 +22,16 @@ pub fn install(src_root_path: &Path, out_dir: &Path, yarn: &Path) -> Result::from(format!( + "unable to run yarn: {}", + err.kind() + ))) + })? + .wait()?; if !exit_status.success() { eprintln!("yarn install did not exit successfully"); return Err(io::Error::other(Box::::from(format!( diff --git a/src/ci/citool/Cargo.lock b/src/ci/citool/Cargo.lock index ab5d2adc9dc5..9e1ded4d3f7c 100644 --- a/src/ci/citool/Cargo.lock +++ b/src/ci/citool/Cargo.lock @@ -66,11 +66,11 @@ checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "askama" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" +checksum = "bb7125972258312e79827b60c9eb93938334100245081cf701a2dee981b17427" dependencies = [ - "askama_derive", + "askama_macros", "itoa", "percent-encoding", "serde", @@ -79,9 +79,9 @@ dependencies = [ [[package]] name = "askama_derive" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" +checksum = "8ba5e7259a1580c61571e3116ebaaa01e3c001b2132b17c4cc5c70780ca3e994" dependencies = [ "askama_parser", "basic-toml", @@ -95,14 +95,24 @@ dependencies = [ ] [[package]] -name = "askama_parser" -version = "0.14.0" +name = "askama_macros" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" +checksum = "236ce20b77cb13506eaf5024899f4af6e12e8825f390bd943c4c37fd8f322e46" dependencies = [ - "memchr", + "askama_derive", +] + +[[package]] +name = "askama_parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c63392767bb2df6aa65a6e1e3b80fd89bb7af6d58359b924c0695620f1512e" +dependencies = [ + "rustc-hash", "serde", "serde_derive", + "unicode-ident", "winnow", ] diff --git a/src/ci/citool/Cargo.toml b/src/ci/citool/Cargo.toml index 078b877e44b1..468d8c8a02aa 100644 --- a/src/ci/citool/Cargo.toml +++ b/src/ci/citool/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] anyhow = "1" -askama = "0.14" +askama = "0.15.1" clap = { version = "4.5", features = ["derive"] } csv = "1" diff = "0.1" diff --git a/src/ci/citool/templates/test_group.askama b/src/ci/citool/templates/test_group.askama index 95731103f3b9..1a72c47d3788 100644 --- a/src/ci/citool/templates/test_group.askama +++ b/src/ci/citool/templates/test_group.askama @@ -24,12 +24,12 @@ passed: {{ r.passed.len() }}, ignored: {{ r.ignored.len() }} {% for (name, test) in root_tests %}

  • {% if let Some(result) = test.single_test() %} - {{ name }} ({% call test_result(result) %}) + {{ name }} ({% call test_result(result) %}{% endcall %}) {% else %} {{ name }} ({{ test.revisions.len() }} revision{{ test.revisions.len() | pluralize }})
      {% for (revision, result) in test.revisions %} -
    • #{{ revision }} ({% call test_result(result) %})
    • +
    • #{{ revision }} ({% call test_result(result) %}{% endcall %})
    • {% endfor %}
    {% endif %} diff --git a/src/ci/citool/tests/test-jobs.yml b/src/ci/citool/tests/test-jobs.yml index 512c80628574..e26104905491 100644 --- a/src/ci/citool/tests/test-jobs.yml +++ b/src/ci/citool/tests/test-jobs.yml @@ -27,7 +27,7 @@ runners: <<: *base-job envs: env-x86_64-apple-tests: &env-x86_64-apple-tests - SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact + SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc-html -- --exact RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 # Ensure that host tooling is tested on our minimum supported macOS version. diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh index 4c95d4a401e5..9579e0d79cb0 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh @@ -9,8 +9,8 @@ python3 ../x.py build --set rust.debug=true opt-dist --include-default-paths \ build-manifest bootstrap -# Use GCC for building GCC, as it seems to behave badly when built with Clang +# Use GCC for building GCC components, as it seems to behave badly when built with Clang # Only build GCC on full builds, not try builds if [ "${DIST_TRY_BUILD:-0}" == "0" ]; then - CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc + CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc-dev fi diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile index 0fd14ae232d7..f9c1ea531add 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-gcc/Dockerfile @@ -45,7 +45,7 @@ ENV SCRIPT python3 ../x.py \ --test-codegen-backend gcc \ --skip tests/coverage \ --skip tests/coverage-run-rustdoc \ - --skip tests/rustdoc \ + --skip tests/rustdoc-html \ --skip tests/rustdoc-gui \ --skip tests/rustdoc-js \ --skip tests/rustdoc-js-std \ diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 044f5a8fff32..691b8b8deb81 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -312,16 +312,6 @@ else command=(/checkout/src/ci/run.sh) fi -if isCI; then - # Get some needed information for $BASE_COMMIT - # - # This command gets the last merge commit which we'll use as base to list - # deleted files since then. - BASE_COMMIT="$(git log --author=bors@rust-lang.org -n 2 --pretty=format:%H | tail -n 1)" -else - BASE_COMMIT="" -fi - SUMMARY_FILE=github-summary.md touch $objdir/${SUMMARY_FILE} @@ -359,7 +349,6 @@ docker \ --env RUST_CI_OVERRIDE_RELEASE_CHANNEL \ --env CI_JOB_NAME="${CI_JOB_NAME-$image}" \ --env CI_JOB_DOC_URL="${CI_JOB_DOC_URL}" \ - --env BASE_COMMIT="$BASE_COMMIT" \ --env DIST_TRY_BUILD \ --env PR_CI_JOB \ --env OBJDIR_ON_HOST="$objdir" \ diff --git a/src/ci/run.sh b/src/ci/run.sh index b486f0525f40..425ad38a6655 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -187,8 +187,9 @@ else RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set llvm.static-libstdcpp" fi - # Download GCC from CI on test builders - RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set gcc.download-ci-gcc=true" + # Download GCC from CI on test builders (temporarily disabled because the CI gcc component + # was renamed). + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set gcc.download-ci-gcc=false" # download-rustc seems to be broken on CI after the stage0 redesign # Disable it until these issues are debugged and resolved diff --git a/src/ci/scripts/upload-artifacts.sh b/src/ci/scripts/upload-artifacts.sh index 975b4c527267..6c916eb90cbe 100755 --- a/src/ci/scripts/upload-artifacts.sh +++ b/src/ci/scripts/upload-artifacts.sh @@ -6,6 +6,7 @@ set -euo pipefail IFS=$'\n\t' +ci_dir=`cd $(dirname $0)/.. && pwd` source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" upload_dir="$(mktemp -d)" @@ -22,6 +23,22 @@ if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then mv "${dist_dir}"/* "${upload_dir}" fi +# We write the release channel into the output so that +# `rustup-toolchain-install-master` or other, similar, tools can automatically +# detect the appropriate name to use for downloading artifacts. +# +# For nightly and beta this isn't strictly necessary as just trying both is +# enough, but stable builds produce artifacts with a version (e.g., +# rust-src-1.92.0.tar.xz) which can't be easily guessed otherwise. +channel=$(releaseChannel) +if [[ "$channel" = "stable" ]]; then + # On stable, artifacts use the version number. See rust_package_vers in + # src/bootstrap/src/lib.rs. + cat "$ci_dir/../version" > "${upload_dir}/package-version" +else + echo "$channel" > "${upload_dir}/package-version" +fi + # CPU usage statistics. cp build/cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" diff --git a/src/ci/scripts/verify-channel.sh b/src/ci/scripts/verify-channel.sh index 9a9e713243d7..cac8ba332ed1 100755 --- a/src/ci/scripts/verify-channel.sh +++ b/src/ci/scripts/verify-channel.sh @@ -8,7 +8,8 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" -if isCiBranch auto || isCiBranch try || isCiBranch try-perf || isCiBranch automation/bors/try; then +if isCiBranch auto || isCiBranch try || isCiBranch try-perf || \ + isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then echo "channel verification is only executed on PR builds" exit fi diff --git a/src/doc/reference b/src/doc/reference index ec78de0ffe2f..6363385ac4eb 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit ec78de0ffe2f8344bd0e222b17ac7a7d32dc7a26 +Subproject commit 6363385ac4ebe1763f1e6fb2063c0b1db681a072 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index 7d21279e40e8..2e02f22a10e7 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 7d21279e40e8f0e91c2a22c5148dd2d745aef8b6 +Subproject commit 2e02f22a10e7eeb758e6aba484f13d0f1988a3e5 diff --git a/src/doc/rustc-dev-guide/.github/workflows/date-check.yml b/src/doc/rustc-dev-guide/.github/workflows/date-check.yml index 3bac68d23b74..e26dec6ce25d 100644 --- a/src/doc/rustc-dev-guide/.github/workflows/date-check.yml +++ b/src/doc/rustc-dev-guide/.github/workflows/date-check.yml @@ -22,9 +22,7 @@ jobs: rustup update stable - name: Run `date-check` - working-directory: ci/date-check - run: | - cargo run -- ../../src/ > ../../date-check-output.txt + run: cargo run --manifest-path ci/date-check/Cargo.toml . > date-check-output.txt - name: Open issue uses: actions/github-script@v7 diff --git a/src/doc/rustc-dev-guide/ci/date-check/src/main.rs b/src/doc/rustc-dev-guide/ci/date-check/src/main.rs index 0a32f4e9b7b6..c9f349147e79 100644 --- a/src/doc/rustc-dev-guide/ci/date-check/src/main.rs +++ b/src/doc/rustc-dev-guide/ci/date-check/src/main.rs @@ -153,9 +153,13 @@ fn main() { println!(); for (path, dates) in dates_by_file { - println!("- {}", path.strip_prefix(&root_dir_path).unwrap_or(&path).display(),); + let path = path.strip_prefix(&root_dir_path).unwrap_or(&path).display(); + println!("- {path}"); for (line, date) in dates { - println!(" - [ ] line {}: {}", line, date); + let url = format!( + "https://github.com/rust-lang/rustc-dev-guide/blob/main/{path}?plain=1#L{line}" + ); + println!(" - [ ] {date} [line {line}]({url})"); } } println!(); diff --git a/src/doc/rustc-dev-guide/rust-version b/src/doc/rustc-dev-guide/rust-version index 7345c25066a8..7b444a9ef5f1 100644 --- a/src/doc/rustc-dev-guide/rust-version +++ b/src/doc/rustc-dev-guide/rust-version @@ -1 +1 @@ -2dc30247c5d8293aaa31e1d7dae2ed2fde908ada +85c8ff69cb3efd950395cc444a54bbbdad668865 diff --git a/src/doc/rustc-dev-guide/src/SUMMARY.md b/src/doc/rustc-dev-guide/src/SUMMARY.md index e80ee6a5137d..2dd07144a78c 100644 --- a/src/doc/rustc-dev-guide/src/SUMMARY.md +++ b/src/doc/rustc-dev-guide/src/SUMMARY.md @@ -100,7 +100,7 @@ - [Parallel compilation](./parallel-rustc.md) - [Rustdoc internals](./rustdoc-internals.md) - [Search](./rustdoc-internals/search.md) - - [The `rustdoc` test suite](./rustdoc-internals/rustdoc-test-suite.md) + - [The `rustdoc-html` test suite](./rustdoc-internals/rustdoc-html-test-suite.md) - [The `rustdoc-gui` test suite](./rustdoc-internals/rustdoc-gui-test-suite.md) - [The `rustdoc-json` test suite](./rustdoc-internals/rustdoc-json-test-suite.md) - [GPU offload internals](./offload/internals.md) diff --git a/src/doc/rustc-dev-guide/src/getting-started.md b/src/doc/rustc-dev-guide/src/getting-started.md index 36d19e6c570e..6ccc5a75497a 100644 --- a/src/doc/rustc-dev-guide/src/getting-started.md +++ b/src/doc/rustc-dev-guide/src/getting-started.md @@ -179,7 +179,7 @@ The following tasks are doable without much background knowledge but are incredi to read a part of the code and write doc comments for it. This will help you to learn some part of the compiler while also producing a useful artifact! - [Triaging issues][triage]: categorizing, replicating, and minimizing issues is very helpful to the Rust maintainers. -- [Working groups][wg]: there are a bunch of working groups on a wide variety +- [Working areas][wa]: there are a bunch of working areas on a wide variety of rust-related things. - Answer questions on [users.rust-lang.org][users], or on [Stack Overflow][so]. - Participate in the [RFC process](https://github.com/rust-lang/rfcs). @@ -191,7 +191,7 @@ The following tasks are doable without much background knowledge but are incredi [so]: http://stackoverflow.com/questions/tagged/rust [community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library [wd]: ./contributing.md#writing-documentation -[wg]: https://rust-lang.github.io/compiler-team/working-groups/ +[wa]: https://forge.rust-lang.org/compiler/working-areas.html [triage]: ./contributing.md#issue-triage ## Cloning and Building diff --git a/src/doc/rustc-dev-guide/src/offload/usage.md b/src/doc/rustc-dev-guide/src/offload/usage.md index 062534a4b655..4d3222123aaf 100644 --- a/src/doc/rustc-dev-guide/src/offload/usage.md +++ b/src/doc/rustc-dev-guide/src/offload/usage.md @@ -57,7 +57,7 @@ fn main() { #[inline(never)] unsafe fn kernel(x: *mut [f64; 256]) { - core::intrinsics::offload(kernel_1, (x,)) + core::intrinsics::offload(_kernel_1, [256, 1, 1], [32, 1, 1], (x,)) } #[cfg(target_os = "linux")] diff --git a/src/doc/rustc-dev-guide/src/overview.md b/src/doc/rustc-dev-guide/src/overview.md index 23cc94d41846..1200a854f8ed 100644 --- a/src/doc/rustc-dev-guide/src/overview.md +++ b/src/doc/rustc-dev-guide/src/overview.md @@ -50,10 +50,10 @@ preserves full fidelity information for both IDEs and procedural macros The *parser* [translates the token stream from the `lexer` into an Abstract Syntax Tree (AST)][parser]. It uses a recursive descent (top-down) approach to syntax analysis. The crate entry points for the `parser` are the -[`Parser::parse_crate_mod()`][parse_crate_mod] and [`Parser::parse_mod()`][parse_mod] +[`Parser::parse_crate_mod`][parse_crate_mod] and [`Parser::parse_mod`][parse_mod] methods found in [`rustc_parse::parser::Parser`]. The external module parsing entry point is [`rustc_expand::module::parse_external_mod`][parse_external_mod]. -And the macro-`parser` entry point is [`Parser::parse_nonterminal()`][parse_nonterminal]. +And the macro-`parser` entry point is [`Parser::parse_nonterminal`][parse_nonterminal]. Parsing is performed with a set of [`parser`] utility methods including [`bump`], [`check`], [`eat`], [`expect`], [`look_ahead`]. diff --git a/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md b/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-html-test-suite.md similarity index 98% rename from src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md rename to src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-html-test-suite.md index 9516968df803..b74405d310eb 100644 --- a/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md +++ b/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-html-test-suite.md @@ -1,6 +1,6 @@ -# The `rustdoc` test suite +# The `rustdoc-html` test suite -This page is about the test suite named `rustdoc` used to test the HTML output of `rustdoc`. +This page is about the test suite named `rustdoc-html` used to test the HTML output of `rustdoc`. For other rustdoc-specific test suites, see [Rustdoc test suites]. Each test file in this test suite is simply a Rust source file `file.rs` sprinkled with diff --git a/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-json-test-suite.md b/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-json-test-suite.md index 5781a12ca44c..7a846b711326 100644 --- a/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-json-test-suite.md +++ b/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-json-test-suite.md @@ -24,7 +24,7 @@ Also, talk about how it works ## jsondocck [jsondocck] processes directives given in comments, to assert that the values in the output are expected. -It's a lot like [htmldocck](./rustdoc-test-suite.md) in that way. +It's a lot like [htmldocck](./rustdoc-html-test-suite.md) in that way. It uses [JSONPath] as a query language, which takes a path, and returns a *list* of values that that path is said to match to. diff --git a/src/doc/rustc-dev-guide/src/tests/best-practices.md b/src/doc/rustc-dev-guide/src/tests/best-practices.md index 10372c36ac99..ff4ea11bbc7a 100644 --- a/src/doc/rustc-dev-guide/src/tests/best-practices.md +++ b/src/doc/rustc-dev-guide/src/tests/best-practices.md @@ -153,6 +153,7 @@ This may include remarks on: - Try to make sure the test is as minimal as possible. - Minimize non-critical code and especially minimize unnecessary syntax and type errors which can clutter stderr snapshots. +- Use `#![allow(...)]` or `#![expect(...)]` to suppress unrelated warnings. - Where possible, use semantically meaningful names (e.g. `fn bare_coverage_attributes() {}`). diff --git a/src/doc/rustc-dev-guide/src/tests/compiletest.md b/src/doc/rustc-dev-guide/src/tests/compiletest.md index e0924f8538ef..d69e0a5ce988 100644 --- a/src/doc/rustc-dev-guide/src/tests/compiletest.md +++ b/src/doc/rustc-dev-guide/src/tests/compiletest.md @@ -82,7 +82,7 @@ The following test suites are available, with links for more information: | Test suite | Purpose | |--------------------------------------|--------------------------------------------------------------------------| -| [`rustdoc`][rustdoc-html-tests] | Check HTML output of `rustdoc` | +| [`rustdoc-html`][rustdoc-html-tests] | Check HTML output of `rustdoc` | | [`rustdoc-gui`][rustdoc-gui-tests] | Check `rustdoc`'s GUI using a web browser | | [`rustdoc-js`][rustdoc-js-tests] | Check `rustdoc`'s search engine and index | | [`rustdoc-js-std`][rustdoc-js-tests] | Check `rustdoc`'s search engine and index on the std library docs | @@ -94,7 +94,7 @@ These tests ensure that certain lints that are emitted as part of executing rust are also run when executing rustc. Run-make tests pertaining to rustdoc are typically named `run-make/rustdoc-*/`. -[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-test-suite.md +[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-html-test-suite.md [rustdoc-gui-tests]: ../rustdoc-internals/rustdoc-gui-test-suite.md [rustdoc-js-tests]: ../rustdoc-internals/search.md#testing-the-search-engine [rustdoc-json-tests]: ../rustdoc-internals/rustdoc-json-test-suite.md diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index c8b0072dc101..52e1f09dca0f 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -213,6 +213,8 @@ settings: that this directive can be overriden with the `--bypass-ignore-backends=[BACKEND]` command line flag. - `needs-backends` — only runs the test if current codegen backend is listed. +- `needs-offload` — ignores if our LLVM backend was not built with offload support. +- `needs-enzyme` — ignores if our Enzyme submodule was not built. The following directives will check LLVM support: @@ -306,12 +308,12 @@ Asked in #### Test-suite-specific directives -The test suites [`rustdoc`][rustdoc-html-tests], [`rustdoc-js`/`rustdoc-js-std`][rustdoc-js-tests] +The test suites [`rustdoc-html`][rustdoc-html-tests], [`rustdoc-js`/`rustdoc-js-std`][rustdoc-js-tests] and [`rustdoc-json`][rustdoc-json-tests] each feature an additional set of directives whose basic syntax resembles the one of compiletest directives but which are ultimately read and checked by separate tools. For more information, please read their respective chapters as linked above. -[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-test-suite.md +[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-html-test-suite.md [rustdoc-js-tests]: ../rustdoc-internals/search.html#testing-the-search-engine [rustdoc-json-tests]: ../rustdoc-internals/rustdoc-json-test-suite.md diff --git a/src/doc/rustc-dev-guide/src/tests/perf.md b/src/doc/rustc-dev-guide/src/tests/perf.md index e460ed8187eb..18762556137e 100644 --- a/src/doc/rustc-dev-guide/src/tests/perf.md +++ b/src/doc/rustc-dev-guide/src/tests/perf.md @@ -41,7 +41,9 @@ To evaluate the performance impact of a PR, write this comment on the PR: > repository](https://github.com/rust-lang/team) with the `perf = true` value in > the `[permissions]` section (and bors permissions are also required). If you > are not on one of those teams, feel free to ask for someone to post it for you -> (either on Zulip or ask the assigned reviewer). +> (either on [Zulip][perf run] or ask the assigned reviewer). + +[perf run]: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/perf.20run This will first tell bors to do a "try" build which do a full release build for `x86_64-unknown-linux-gnu`. After the build finishes, it will place it in the diff --git a/src/doc/rustc-dev-guide/triagebot.toml b/src/doc/rustc-dev-guide/triagebot.toml index fbfe74234148..974f4cd3dd96 100644 --- a/src/doc/rustc-dev-guide/triagebot.toml +++ b/src/doc/rustc-dev-guide/triagebot.toml @@ -58,9 +58,6 @@ allow-unauthenticated = [ # Documentation at: https://forge.rust-lang.org/triagebot/issue-links.html [issue-links] -[behind-upstream] -days-threshold = 7 - # Enable triagebot (PR) assignment. # Documentation at: https://forge.rust-lang.org/triagebot/pr-assignment.html [assign] diff --git a/src/doc/rustc/book.toml b/src/doc/rustc/book.toml index 9a7c28525f0e..565f6247dcb2 100644 --- a/src/doc/rustc/book.toml +++ b/src/doc/rustc/book.toml @@ -3,7 +3,7 @@ title = "The rustc book" [output.html] git-repository-url = "https://github.com/rust-lang/rust/tree/HEAD/src/doc/rustc" -edit-url-template = "https://github.com/rust-lang/rust/edit/HEAD/src/doc/rustc/{path}" +edit-url-template = "https://github.com/rust-lang/rust/edit/main/src/doc/rustc/{path}" [output.html.search] use-boolean-and = true diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 5164ab69d353..754d0c975ec3 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -163,10 +163,10 @@ target | std | notes `armv7-unknown-linux-musleabi` | ✓ | Armv7-A Linux with musl 1.2.5 `armv7-unknown-linux-musleabihf` | ✓ | Armv7-A Linux with musl 1.2.5, hardfloat [`armv7a-none-eabi`](platform-support/armv7a-none-eabi.md) | * | Bare Armv7-A -[`armv7a-none-eabihf`](platform-support/armv7a-none-eabi.md) | * | | Bare Armv7-A, hardfloat +[`armv7a-none-eabihf`](platform-support/armv7a-none-eabi.md) | * | Bare Armv7-A, hardfloat [`armv7r-none-eabi`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R [`armv7r-none-eabihf`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, hardfloat -[`armv8r-none-eabihf`](platform-support/armv8r-none-eabihf.md) | * | | Bare Armv8-R, hardfloat +[`armv8r-none-eabihf`](platform-support/armv8r-none-eabihf.md) | * | Bare Armv8-R, hardfloat `i586-unknown-linux-gnu` | ✓ | 32-bit Linux (kernel 3.2+, glibc 2.17, original Pentium) [^x86_32-floats-x87] `i586-unknown-linux-musl` | ✓ | 32-bit Linux (musl 1.2.5, original Pentium) [^x86_32-floats-x87] [`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android ([Pentium 4 plus various extensions](https://developer.android.com/ndk/guides/abis.html#x86)) [^x86_32-floats-return-ABI] @@ -260,7 +260,7 @@ target | std | host | notes [`aarch64-unknown-hermit`](platform-support/hermit.md) | ✓ | | ARM64 Hermit [`aarch64-unknown-illumos`](platform-support/illumos.md) | ✓ | ✓ | ARM64 illumos `aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI) -[`aarch64-unknown-managarm-mlibc`](platform-support/managarm.md) | ? | | ARM64 Managarm +[`aarch64-unknown-managarm-mlibc`](platform-support/managarm.md) | ? | | ARM64 Managarm [`aarch64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | ARM64 NetBSD [`aarch64-unknown-nto-qnx700`](platform-support/nto-qnx.md) | ? | | ARM64 QNX Neutrino 7.0 RTOS | [`aarch64-unknown-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS with default network stack (io-pkt) | @@ -282,11 +282,11 @@ target | std | host | notes [`amdgcn-amd-amdhsa`](platform-support/amdgcn-amd-amdhsa.md) | * | | `-Ctarget-cpu=gfx...` to specify [the AMD GPU] to compile for [`arm64_32-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | Arm Apple WatchOS 64-bit with 32-bit pointers [`arm64e-apple-darwin`](platform-support/arm64e-apple-darwin.md) | ✓ | ✓ | ARM64e Apple Darwin -[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS -[`arm64e-apple-tvos`](platform-support/arm64e-apple-tvos.md) | ✓ | | ARM64e Apple tvOS +[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS +[`arm64e-apple-tvos`](platform-support/arm64e-apple-tvos.md) | ✓ | | ARM64e Apple tvOS [`armeb-unknown-linux-gnueabi`](platform-support/armeb-unknown-linux-gnueabi.md) | ✓ | ? | Arm BE8 the default Arm big-endian architecture since [Armv6](https://developer.arm.com/documentation/101754/0616/armlink-Reference/armlink-Command-line-Options/--be8?lang=en). -[`armebv7r-none-eabi`](platform-support/armebv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian -[`armebv7r-none-eabihf`](platform-support/armebv7r-none-eabi.md) | * | Bare Armv7-R, Big Endian, hardfloat +[`armebv7r-none-eabi`](platform-support/armebv7r-none-eabi.md) | * | | Bare Armv7-R, Big Endian +[`armebv7r-none-eabihf`](platform-support/armebv7r-none-eabi.md) | * | | Bare Armv7-R, Big Endian, hardfloat [`armv4t-none-eabi`](platform-support/armv4t-none-eabi.md) | * | | Bare Armv4T `armv4t-unknown-linux-gnueabi` | ? | | Armv4T Linux [`armv5te-none-eabi`](platform-support/armv5te-none-eabi.md) | * | | Bare Armv5TE @@ -314,9 +314,9 @@ target | std | host | notes `bpfel-unknown-none` | * | | BPF (little endian) `csky-unknown-linux-gnuabiv2` | ✓ | | C-SKY abiv2 Linux (little endian) `csky-unknown-linux-gnuabiv2hf` | ✓ | | C-SKY abiv2 Linux, hardfloat (little endian) -[`hexagon-unknown-linux-musl`](platform-support/hexagon-unknown-linux-musl.md) | ✓ | | Hexagon Linux with musl 1.2.5 -[`hexagon-unknown-none-elf`](platform-support/hexagon-unknown-none-elf.md)| * | | Bare Hexagon (v60+, HVX) -[`hexagon-unknown-qurt`](platform-support/hexagon-unknown-qurt.md)| * | | Hexagon QuRT +[`hexagon-unknown-linux-musl`](platform-support/hexagon-unknown-linux-musl.md) | ✓ | | Hexagon Linux with musl 1.2.5 +[`hexagon-unknown-none-elf`](platform-support/hexagon-unknown-none-elf.md)| * | | Bare Hexagon (v60+, HVX) +[`hexagon-unknown-qurt`](platform-support/hexagon-unknown-qurt.md)| * | | Hexagon QuRT [`i386-apple-ios`](platform-support/apple-ios.md) | ✓ | | 32-bit x86 iOS (Penryn) [^x86_32-floats-return-ABI] [`i586-unknown-netbsd`](platform-support/netbsd.md) | ✓ | | 32-bit x86 (original Pentium) [^x86_32-floats-x87] [`i586-unknown-redox`](platform-support/redox.md) | ✓ | | 32-bit x86 Redox OS (PentiumPro) [^x86_32-floats-x87] @@ -329,12 +329,12 @@ target | std | host | notes [`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD (Pentium 4) [^x86_32-floats-return-ABI] `i686-uwp-windows-gnu` | ✓ | | [^x86_32-floats-return-ABI] [`i686-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | ✓ | | [^x86_32-floats-return-ABI] [^win32-msvc-alignment] -[`i686-win7-windows-gnu`](platform-support/win7-windows-gnu.md) | ✓ | | 32-bit Windows 7 support [^x86_32-floats-return-ABI] -[`i686-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 32-bit Windows 7 support [^x86_32-floats-return-ABI] [^win32-msvc-alignment] +[`i686-win7-windows-gnu`](platform-support/win7-windows-gnu.md) | ✓ | | 32-bit Windows 7 support [^x86_32-floats-return-ABI] +[`i686-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 32-bit Windows 7 support [^x86_32-floats-return-ABI] [^win32-msvc-alignment] [`i686-wrs-vxworks`](platform-support/vxworks.md) | ✓ | | [^x86_32-floats-return-ABI] -[`loongarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | | LoongArch64 OpenHarmony -[`loongarch32-unknown-none`](platform-support/loongarch-none.md) | * | | LoongArch32 Bare-metal (ILP32D ABI) -[`loongarch32-unknown-none-softfloat`](platform-support/loongarch-none.md) | * | | LoongArch32 Bare-metal (ILP32S ABI) +[`loongarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | | LoongArch64 OpenHarmony +[`loongarch32-unknown-none`](platform-support/loongarch-none.md) | * | | LoongArch32 Bare-metal (ILP32D ABI) +[`loongarch32-unknown-none-softfloat`](platform-support/loongarch-none.md) | * | | LoongArch32 Bare-metal (ILP32S ABI) [`m68k-unknown-linux-gnu`](platform-support/m68k-unknown-linux-gnu.md) | ? | | Motorola 680x0 Linux [`m68k-unknown-none-elf`](platform-support/m68k-unknown-none-elf.md) | | | Motorola 680x0 `mips-unknown-linux-gnu` | ✓ | ✓ | MIPS Linux (kernel 4.4, glibc 2.23) @@ -359,8 +359,8 @@ target | std | host | notes [`mipsisa64r6-unknown-linux-gnuabi64`](platform-support/mips-release-6.md) | ? | | 64-bit MIPS Release 6 Big Endian [`mipsisa64r6el-unknown-linux-gnuabi64`](platform-support/mips-release-6.md) | ✓ | ✓ | 64-bit MIPS Release 6 Little Endian `msp430-none-elf` | * | | 16-bit MSP430 microcontrollers -[`powerpc-unknown-freebsd`](platform-support/freebsd.md) | ? | | PowerPC FreeBSD -[`powerpc-unknown-helenos`](platform-support/helenos.md) | ✓ | | PowerPC HelenOS +[`powerpc-unknown-freebsd`](platform-support/freebsd.md) | ? | | PowerPC FreeBSD +[`powerpc-unknown-helenos`](platform-support/helenos.md) | ✓ | | PowerPC HelenOS [`powerpc-unknown-linux-gnuspe`](platform-support/powerpc-unknown-linux-gnuspe.md) | ✓ | | PowerPC SPE Linux `powerpc-unknown-linux-musl` | ? | | PowerPC Linux with musl 1.2.5 [`powerpc-unknown-linux-muslspe`](platform-support/powerpc-unknown-linux-muslspe.md) | ? | | PowerPC SPE Linux with musl 1.2.5 @@ -378,8 +378,8 @@ target | std | host | notes [`riscv32e-unknown-none-elf`](platform-support/riscv32e-unknown-none-elf.md) | * | | Bare RISC-V (RV32E ISA) [`riscv32em-unknown-none-elf`](platform-support/riscv32e-unknown-none-elf.md) | * | | Bare RISC-V (RV32EM ISA) [`riscv32emc-unknown-none-elf`](platform-support/riscv32e-unknown-none-elf.md) | * | | Bare RISC-V (RV32EMC ISA) -`riscv32gc-unknown-linux-gnu` | ✓ | | RISC-V Linux (kernel 5.4, glibc 2.33) -`riscv32gc-unknown-linux-musl` | ? | | RISC-V Linux (kernel 5.4, musl 1.2.5) +`riscv32gc-unknown-linux-gnu` | ✓ | | RISC-V Linux (kernel 5.4, glibc 2.33) +`riscv32gc-unknown-linux-musl` | ? | | RISC-V Linux (kernel 5.4, musl 1.2.5) [`riscv32im-risc0-zkvm-elf`](platform-support/riscv32im-risc0-zkvm-elf.md) | ? | | RISC Zero's zero-knowledge Virtual Machine (RV32IM ISA) [`riscv32ima-unknown-none-elf`](platform-support/riscv32-unknown-none-elf.md) | * | | Bare RISC-V (RV32IMA ISA) [`riscv32imac-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF @@ -389,12 +389,12 @@ target | std | host | notes [`riscv32imafc-unknown-nuttx-elf`](platform-support/nuttx.md) | ✓ | | RISC-V 32bit with NuttX [`riscv32imc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF [`riscv32imc-unknown-nuttx-elf`](platform-support/nuttx.md) | ✓ | | RISC-V 32bit with NuttX -[`riscv64-linux-android`](platform-support/android.md) | ? | | RISC-V 64-bit Android +[`riscv64-linux-android`](platform-support/android.md) | ? | | RISC-V 64-bit Android [`riscv64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | | -`riscv64gc-unknown-freebsd` | ? | | RISC-V FreeBSD -`riscv64gc-unknown-fuchsia` | ? | | RISC-V Fuchsia -[`riscv64gc-unknown-hermit`](platform-support/hermit.md) | ✓ | | RISC-V Hermit -[`riscv64gc-unknown-managarm-mlibc`](platform-support/managarm.md) | ? | | RISC-V Managarm +`riscv64gc-unknown-freebsd` | ? | | RISC-V FreeBSD +`riscv64gc-unknown-fuchsia` | ? | | RISC-V Fuchsia +[`riscv64gc-unknown-hermit`](platform-support/hermit.md) | ✓ | | RISC-V Hermit +[`riscv64gc-unknown-managarm-mlibc`](platform-support/managarm.md) | ? | | RISC-V Managarm [`riscv64gc-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | RISC-V NetBSD [`riscv64gc-unknown-nuttx-elf`](platform-support/nuttx.md) | ✓ | | RISC-V 64bit with NuttX [`riscv64gc-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/riscv64 @@ -423,15 +423,15 @@ target | std | host | notes [`thumbv8m.main-nuttx-eabihf`](platform-support/nuttx.md) | ✓ | | ARMv8M Mainline with NuttX, hardfloat [`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly [`wasm32-wali-linux-musl`](platform-support/wasm32-wali-linux.md) | ? | | WebAssembly with [WALI](https://github.com/arjunr2/WALI) -[`wasm32-wasip3`](platform-support/wasm32-wasip3.md) | ✓ | WebAssembly with WASIp3 +[`wasm32-wasip3`](platform-support/wasm32-wasip3.md) | ✓ | | WebAssembly with WASIp3 [`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | x86 64-bit tvOS [`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator -[`x86_64-lynx-lynxos178`](platform-support/lynxos178.md) | | | x86_64 LynxOS-178 +[`x86_64-lynx-lynxos178`](platform-support/lynxos178.md) | | | x86_64 LynxOS-178 [`x86_64-pc-cygwin`](platform-support/x86_64-pc-cygwin.md) | ✓ | | 64-bit x86 Cygwin | [`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with default network stack (io-pkt) | [`x86_64-pc-nto-qnx710_iosock`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with new network stack (io-sock) | [`x86_64-pc-nto-qnx800`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 8.0 RTOS | -[`x86_64-unikraft-linux-musl`](platform-support/unikraft-linux-musl.md) | ✓ | | 64-bit Unikraft with musl 1.2.5 +[`x86_64-unikraft-linux-musl`](platform-support/unikraft-linux-musl.md) | ✓ | | 64-bit Unikraft with musl 1.2.5 `x86_64-unknown-dragonfly` | ✓ | ✓ | 64-bit DragonFlyBSD `x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku [`x86_64-unknown-hermit`](platform-support/hermit.md) | ✓ | | x86_64 Hermit @@ -439,13 +439,13 @@ target | std | host | notes [`x86_64-unknown-hurd-gnu`](platform-support/hurd.md) | ✓ | ✓ | 64-bit GNU/Hurd `x86_64-unknown-l4re-uclibc` | ? | | [`x86_64-unknown-linux-none`](platform-support/x86_64-unknown-linux-none.md) | * | | 64-bit Linux with no libc -[`x86_64-unknown-managarm-mlibc`](platform-support/managarm.md) | ? | | x86_64 Managarm +[`x86_64-unknown-managarm-mlibc`](platform-support/managarm.md) | ? | | x86_64 Managarm [`x86_64-unknown-motor`](platform-support/motor.md) | ✓ | | x86_64 Motor OS [`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD [`x86_64-unknown-trusty`](platform-support/trusty.md) | ✓ | | `x86_64-uwp-windows-gnu` | ✓ | | [`x86_64-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | ✓ | | -[`x86_64-win7-windows-gnu`](platform-support/win7-windows-gnu.md) | ✓ | | 64-bit Windows 7 support +[`x86_64-win7-windows-gnu`](platform-support/win7-windows-gnu.md) | ✓ | | 64-bit Windows 7 support [`x86_64-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | ✓ | 64-bit Windows 7 support [`x86_64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | | [`x86_64h-apple-darwin`](platform-support/x86_64h-apple-darwin.md) | ✓ | ✓ | macOS with late-gen Intel (at least Haswell) diff --git a/src/doc/rustc/src/remap-source-paths.md b/src/doc/rustc/src/remap-source-paths.md index 03f5d98091cc..dc00278fac67 100644 --- a/src/doc/rustc/src/remap-source-paths.md +++ b/src/doc/rustc/src/remap-source-paths.md @@ -3,7 +3,7 @@ `rustc` supports remapping source paths prefixes **as a best effort** in all compiler generated output, including compiler diagnostics, debugging information, macro expansions, etc. -This is useful for normalizing build products, for example by removing the current directory +This is useful for normalizing build products, for example, by removing the current directory out of the paths emitted into object files. The remapping is done via the `--remap-path-prefix` option. @@ -17,6 +17,20 @@ The replacement is purely textual, with no consideration of the current system's When multiple remappings are given and several of them match, the **last** matching one is applied. +### Relative paths + +Some build systems, such as Cargo, may compile crates using relative paths (for example, +`src/main.rs` instead of `/home/user/project/src/main.rs)`. + +`rustc` preserves these relative paths where possible. However, certain inputs +(like `#[path = "..."]`) and outputs (such as debug information) may still contain absolute paths. + +To ensure consistency, it’s recommended to remap both relative and absolute paths. + +```bash +rustc --remap-path-prefix "src/=/redacted/src" --remap-path-prefix "/home/user/project=/redacted" +``` + ### Example ```bash @@ -27,7 +41,7 @@ This example replaces all occurrences of `/home/user/project` in emitted paths w ## Caveats and Limitations -### Linkers generated paths +### Paths generated by linkers On some platforms like `x86_64-pc-windows-msvc`, the linker may embed absolute host paths and compiler arguments into debug info files (like `.pdb`) independently of `rustc`. @@ -40,7 +54,7 @@ The `--remap-path-prefix` option does not affect these linker-generated paths. ### Textual replacement only The remapping is strictly textual and does not account for different path separator conventions across -platforms. Care must be taken when specifying prefixes, especially on Windows where both `/` and `\` may +platforms. Care must be taken when specifying prefixes, especially on Windows, where both `/` and `\` may appear in paths. ### External tools diff --git a/src/doc/unstable-book/book.toml b/src/doc/unstable-book/book.toml index c357949f6c2e..8a3d11499cdd 100644 --- a/src/doc/unstable-book/book.toml +++ b/src/doc/unstable-book/book.toml @@ -3,4 +3,4 @@ title = "The Rust Unstable Book" [output.html] git-repository-url = "https://github.com/rust-lang/rust/tree/HEAD/src/doc/unstable-book" -edit-url-template = "https://github.com/rust-lang/rust/edit/HEAD/src/doc/unstable-book/{path}" +edit-url-template = "https://github.com/rust-lang/rust/edit/main/src/doc/unstable-book/{path}" diff --git a/src/doc/unstable-book/src/language-features/deref-patterns.md b/src/doc/unstable-book/src/language-features/deref-patterns.md index 4c3d456b9af8..23c2dc688400 100644 --- a/src/doc/unstable-book/src/language-features/deref-patterns.md +++ b/src/doc/unstable-book/src/language-features/deref-patterns.md @@ -7,7 +7,7 @@ The tracking issue for this feature is: [#87121] ------------------------ > **Note**: This feature is incomplete. In the future, it is meant to supersede -> [`box_patterns`] and [`string_deref_patterns`]. +> [`box_patterns`]. This feature permits pattern matching on [smart pointers in the standard library] through their `Deref` target types, either implicitly or with explicit `deref!(_)` patterns (the syntax of which @@ -103,5 +103,4 @@ match *(b"test" as &[u8]) { ``` [`box_patterns`]: ./box-patterns.md -[`string_deref_patterns`]: ./string-deref-patterns.md [smart pointers in the standard library]: https://doc.rust-lang.org/std/ops/trait.DerefPure.html#implementors diff --git a/src/doc/unstable-book/src/language-features/string-deref-patterns.md b/src/doc/unstable-book/src/language-features/string-deref-patterns.md deleted file mode 100644 index 366bb15d4ea8..000000000000 --- a/src/doc/unstable-book/src/language-features/string-deref-patterns.md +++ /dev/null @@ -1,48 +0,0 @@ -# `string_deref_patterns` - -The tracking issue for this feature is: [#87121] - -[#87121]: https://github.com/rust-lang/rust/issues/87121 - ------------------------- - -> **Note**: This feature will be superseded by [`deref_patterns`] in the future. - -This feature permits pattern matching `String` to `&str` through [its `Deref` implementation]. - -```rust -#![feature(string_deref_patterns)] - -pub enum Value { - String(String), - Number(u32), -} - -pub fn is_it_the_answer(value: Value) -> bool { - match value { - Value::String("42") => true, - Value::Number(42) => true, - _ => false, - } -} -``` - -Without this feature other constructs such as match guards have to be used. - -```rust -# pub enum Value { -# String(String), -# Number(u32), -# } -# -pub fn is_it_the_answer(value: Value) -> bool { - match value { - Value::String(s) if s == "42" => true, - Value::Number(42) => true, - _ => false, - } -} -``` - -[`deref_patterns`]: ./deref-patterns.md -[its `Deref` implementation]: https://doc.rust-lang.org/std/string/struct.String.html#impl-Deref-for-String diff --git a/src/etc/gdb_providers.py b/src/etc/gdb_providers.py index 676842f66240..b0b6682f5279 100644 --- a/src/etc/gdb_providers.py +++ b/src/etc/gdb_providers.py @@ -298,7 +298,7 @@ def children_of_btree_map(map): for i in xrange(0, length + 1): if height > 0: - child_ptr = edges[i]["value"]["value"] + child_ptr = edges[i]["value"]["value"][ZERO_FIELD] for child in children_of_node(child_ptr, height - 1): yield child if i < length: @@ -306,12 +306,12 @@ def children_of_btree_map(map): key_type_size = keys.type.sizeof val_type_size = vals.type.sizeof key = ( - keys[i]["value"]["value"] + keys[i]["value"]["value"][ZERO_FIELD] if key_type_size > 0 else gdb.parse_and_eval("()") ) val = ( - vals[i]["value"]["value"] + vals[i]["value"]["value"][ZERO_FIELD] if val_type_size > 0 else gdb.parse_and_eval("()") ) diff --git a/src/etc/natvis/libcore.natvis b/src/etc/natvis/libcore.natvis index 8fe87a999895..d09f0d635692 100644 --- a/src/etc/natvis/libcore.natvis +++ b/src/etc/natvis/libcore.natvis @@ -35,9 +35,9 @@ - {value} + {value.__0} - value + value.__0 diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index ab75d2dfa429..3c5d01c7201b 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" [dependencies] # tidy-alphabetical-start arrayvec = { version = "0.7", default-features = false } -askama = { version = "0.14", default-features = false, features = ["alloc", "config", "derive"] } +askama = { version = "0.15.1", default-features = false, features = ["alloc", "config", "derive"] } base64 = "0.21.7" indexmap = { version = "2", features = ["serde"] } itertools = "0.12" @@ -22,7 +22,7 @@ rustdoc-json-types = { path = "../rustdoc-json-types" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" smallvec = "1.8.1" -stringdex = "=0.0.4" +stringdex = "=0.0.5" tempfile = "3" threadpool = "1.8.1" tracing = "0.1" diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index 7ab2a72d75b5..485af5ab1d01 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -7,7 +7,6 @@ use std::sync::Arc; use std::{fmt, mem, ops}; use itertools::Either; -use rustc_ast::{LitKind, MetaItem, MetaItemInner, MetaItemKind, MetaItemLit}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::thin_vec::{ThinVec, thin_vec}; use rustc_hir as hir; @@ -29,12 +28,6 @@ mod tests; #[cfg_attr(test, derive(PartialEq))] pub(crate) struct Cfg(CfgEntry); -#[derive(PartialEq, Debug)] -pub(crate) struct InvalidCfgError { - pub(crate) msg: &'static str, - pub(crate) span: Span, -} - /// Whether the configuration consists of just `Cfg` or `Not`. fn is_simple_cfg(cfg: &CfgEntry) -> bool { match cfg { @@ -105,106 +98,6 @@ fn should_capitalize_first_letter(cfg: &CfgEntry) -> bool { } impl Cfg { - /// Parses a `MetaItemInner` into a `Cfg`. - fn parse_nested( - nested_cfg: &MetaItemInner, - exclude: &FxHashSet, - ) -> Result, InvalidCfgError> { - match nested_cfg { - MetaItemInner::MetaItem(cfg) => Cfg::parse_without(cfg, exclude), - MetaItemInner::Lit(MetaItemLit { kind: LitKind::Bool(b), .. }) => { - Ok(Some(Cfg(CfgEntry::Bool(*b, DUMMY_SP)))) - } - MetaItemInner::Lit(lit) => { - Err(InvalidCfgError { msg: "unexpected literal", span: lit.span }) - } - } - } - - fn parse_without( - cfg: &MetaItem, - exclude: &FxHashSet, - ) -> Result, InvalidCfgError> { - let name = match cfg.ident() { - Some(ident) => ident.name, - None => { - return Err(InvalidCfgError { - msg: "expected a single identifier", - span: cfg.span, - }); - } - }; - match cfg.kind { - MetaItemKind::Word => { - if exclude.contains(&NameValueCfg::new(name)) { - Ok(None) - } else { - Ok(Some(Cfg(CfgEntry::NameValue { name, value: None, span: DUMMY_SP }))) - } - } - MetaItemKind::NameValue(ref lit) => match lit.kind { - LitKind::Str(value, _) => { - if exclude.contains(&NameValueCfg::new_value(name, value)) { - Ok(None) - } else { - Ok(Some(Cfg(CfgEntry::NameValue { - name, - value: Some(value), - span: DUMMY_SP, - }))) - } - } - _ => Err(InvalidCfgError { - // FIXME: if the main #[cfg] syntax decided to support non-string literals, - // this should be changed as well. - msg: "value of cfg option should be a string literal", - span: lit.span, - }), - }, - MetaItemKind::List(ref items) => { - let orig_len = items.len(); - let mut sub_cfgs = - items.iter().filter_map(|i| Cfg::parse_nested(i, exclude).transpose()); - let ret = match name { - sym::all => { - sub_cfgs.try_fold(Cfg(CfgEntry::Bool(true, DUMMY_SP)), |x, y| Ok(x & y?)) - } - sym::any => { - sub_cfgs.try_fold(Cfg(CfgEntry::Bool(false, DUMMY_SP)), |x, y| Ok(x | y?)) - } - sym::not => { - if orig_len == 1 { - let mut sub_cfgs = sub_cfgs.collect::>(); - if sub_cfgs.len() == 1 { - Ok(!sub_cfgs.pop().unwrap()?) - } else { - return Ok(None); - } - } else { - Err(InvalidCfgError { msg: "expected 1 cfg-pattern", span: cfg.span }) - } - } - _ => Err(InvalidCfgError { msg: "invalid predicate", span: cfg.span }), - }; - match ret { - Ok(c) => Ok(Some(c)), - Err(e) => Err(e), - } - } - } - } - - /// Parses a `MetaItem` into a `Cfg`. - /// - /// The `MetaItem` should be the content of the `#[cfg(...)]`, e.g., `unix` or - /// `target_os = "redox"`. - /// - /// If the content is not properly formatted, it will return an error indicating what and where - /// the error is. - pub(crate) fn parse(cfg: &MetaItemInner) -> Result { - Self::parse_nested(cfg, &FxHashSet::default()).map(|ret| ret.unwrap()) - } - /// Renders the configuration for human display, as a short HTML description. pub(crate) fn render_short_html(&self) -> String { let mut msg = Display(&self.0, Format::ShortHtml).to_string(); @@ -644,10 +537,6 @@ impl NameValueCfg { fn new(name: Symbol) -> Self { Self { name, value: None } } - - fn new_value(name: Symbol, value: Symbol) -> Self { - Self { name, value: Some(value) } - } } impl<'a> From<&'a CfgEntry> for NameValueCfg { @@ -751,15 +640,6 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator tcx: TyCtxt<'_>, cfg_info: &mut CfgInfo, ) -> Option> { - fn single(it: T) -> Option { - let mut iter = it.into_iter(); - let item = iter.next()?; - if iter.next().is_some() { - return None; - } - Some(item) - } - fn check_changed_auto_active_status( changed_auto_active_status: &mut Option, attr_span: Span, @@ -859,12 +739,11 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator } continue; } else if !cfg_info.parent_is_doc_cfg - && let Some(ident) = attr.ident() - && matches!(ident.name, sym::cfg | sym::cfg_trace) - && let Some(attr) = single(attr.meta_item_list()?) - && let Ok(new_cfg) = Cfg::parse(&attr) + && let hir::Attribute::Parsed(AttributeKind::CfgTrace(cfgs)) = attr { - cfg_info.current_cfg &= new_cfg; + for (new_cfg, _) in cfgs { + cfg_info.current_cfg &= Cfg(new_cfg.clone()); + } } } diff --git a/src/librustdoc/clean/cfg/tests.rs b/src/librustdoc/clean/cfg/tests.rs index 09316ead76ac..e0c21865d8df 100644 --- a/src/librustdoc/clean/cfg/tests.rs +++ b/src/librustdoc/clean/cfg/tests.rs @@ -1,8 +1,5 @@ -use rustc_ast::ast::LitIntType; -use rustc_ast::{MetaItemInner, MetaItemLit, Path, Safety, StrStyle}; use rustc_data_structures::thin_vec::thin_vec; use rustc_hir::attrs::CfgEntry; -use rustc_span::symbol::{Ident, kw}; use rustc_span::{DUMMY_SP, create_default_session_globals_then}; use super::*; @@ -28,10 +25,6 @@ fn name_value_cfg_e(name: &str, value: &str) -> CfgEntry { } } -fn dummy_lit(symbol: Symbol, kind: LitKind) -> MetaItemInner { - MetaItemInner::Lit(MetaItemLit { symbol, suffix: None, kind, span: DUMMY_SP }) -} - fn cfg_all(v: ThinVec) -> Cfg { Cfg(cfg_all_e(v)) } @@ -52,51 +45,6 @@ fn cfg_not(v: CfgEntry) -> Cfg { Cfg(CfgEntry::Not(Box::new(v), DUMMY_SP)) } -fn dummy_meta_item_word(name: &str) -> MetaItemInner { - MetaItemInner::MetaItem(MetaItem { - unsafety: Safety::Default, - path: Path::from_ident(Ident::from_str(name)), - kind: MetaItemKind::Word, - span: DUMMY_SP, - }) -} - -fn dummy_meta_item_name_value(name: &str, symbol: Symbol, kind: LitKind) -> MetaItemInner { - let lit = MetaItemLit { symbol, suffix: None, kind, span: DUMMY_SP }; - MetaItemInner::MetaItem(MetaItem { - unsafety: Safety::Default, - path: Path::from_ident(Ident::from_str(name)), - kind: MetaItemKind::NameValue(lit), - span: DUMMY_SP, - }) -} - -macro_rules! dummy_meta_item_list { - ($name:ident, [$($list:ident),* $(,)?]) => { - MetaItemInner::MetaItem(MetaItem { - unsafety: Safety::Default, - path: Path::from_ident(Ident::from_str(stringify!($name))), - kind: MetaItemKind::List(thin_vec![ - $( - dummy_meta_item_word(stringify!($list)), - )* - ]), - span: DUMMY_SP, - }) - }; - - ($name:ident, [$($list:expr),* $(,)?]) => { - MetaItemInner::MetaItem(MetaItem { - unsafety: Safety::Default, - path: Path::from_ident(Ident::from_str(stringify!($name))), - kind: MetaItemKind::List(thin_vec![ - $($list,)* - ]), - span: DUMMY_SP, - }) - }; -} - fn cfg_true() -> Cfg { Cfg(CfgEntry::Bool(true, DUMMY_SP)) } @@ -303,87 +251,6 @@ fn test_cfg_or() { }) } -#[test] -fn test_parse_ok() { - create_default_session_globals_then(|| { - let r#true = Symbol::intern("true"); - let mi = dummy_lit(r#true, LitKind::Bool(true)); - assert_eq!(Cfg::parse(&mi), Ok(cfg_true())); - - let r#false = Symbol::intern("false"); - let mi = dummy_lit(r#false, LitKind::Bool(false)); - assert_eq!(Cfg::parse(&mi), Ok(cfg_false())); - - let mi = dummy_meta_item_word("all"); - assert_eq!(Cfg::parse(&mi), Ok(word_cfg("all"))); - - let done = Symbol::intern("done"); - let mi = dummy_meta_item_name_value("all", done, LitKind::Str(done, StrStyle::Cooked)); - assert_eq!(Cfg::parse(&mi), Ok(name_value_cfg("all", "done"))); - - let mi = dummy_meta_item_list!(all, [a, b]); - assert_eq!(Cfg::parse(&mi), Ok(word_cfg("a") & word_cfg("b"))); - - let mi = dummy_meta_item_list!(any, [a, b]); - assert_eq!(Cfg::parse(&mi), Ok(word_cfg("a") | word_cfg("b"))); - - let mi = dummy_meta_item_list!(not, [a]); - assert_eq!(Cfg::parse(&mi), Ok(!word_cfg("a"))); - - let mi = dummy_meta_item_list!( - not, - [dummy_meta_item_list!( - any, - [dummy_meta_item_word("a"), dummy_meta_item_list!(all, [b, c]),] - ),] - ); - assert_eq!(Cfg::parse(&mi), Ok(!(word_cfg("a") | (word_cfg("b") & word_cfg("c"))))); - - let mi = dummy_meta_item_list!(all, [a, b, c]); - assert_eq!(Cfg::parse(&mi), Ok(word_cfg("a") & word_cfg("b") & word_cfg("c"))); - }) -} - -#[test] -fn test_parse_err() { - create_default_session_globals_then(|| { - let mi = dummy_meta_item_name_value("foo", kw::False, LitKind::Bool(false)); - assert!(Cfg::parse(&mi).is_err()); - - let mi = dummy_meta_item_list!(not, [a, b]); - assert!(Cfg::parse(&mi).is_err()); - - let mi = dummy_meta_item_list!(not, []); - assert!(Cfg::parse(&mi).is_err()); - - let mi = dummy_meta_item_list!(foo, []); - assert!(Cfg::parse(&mi).is_err()); - - let mi = dummy_meta_item_list!( - all, - [dummy_meta_item_list!(foo, []), dummy_meta_item_word("b"),] - ); - assert!(Cfg::parse(&mi).is_err()); - - let mi = dummy_meta_item_list!( - any, - [dummy_meta_item_word("a"), dummy_meta_item_list!(foo, []),] - ); - assert!(Cfg::parse(&mi).is_err()); - - let mi = dummy_meta_item_list!(not, [dummy_meta_item_list!(foo, []),]); - assert!(Cfg::parse(&mi).is_err()); - - let c = Symbol::intern("e"); - let mi = dummy_lit(c, LitKind::Char('e')); - assert!(Cfg::parse(&mi).is_err()); - - let five = Symbol::intern("5"); - let mi = dummy_lit(five, LitKind::Int(5.into(), LitIntType::Unsuffixed)); - assert!(Cfg::parse(&mi).is_err()); - }) -} - #[test] fn test_render_short_html() { create_default_session_globals_then(|| { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 707b48b355ba..e05d3e416430 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -51,7 +51,7 @@ use rustc_middle::ty::{self, AdtKind, GenericArgsRef, Ty, TyCtxt, TypeVisitableE use rustc_middle::{bug, span_bug}; use rustc_span::ExpnKind; use rustc_span::hygiene::{AstPass, MacroKind}; -use rustc_span::symbol::{Ident, Symbol, kw, sym}; +use rustc_span::symbol::{Ident, Symbol, kw}; use rustc_trait_selection::traits::wf::object_region_bounds; use tracing::{debug, instrument}; use utils::*; @@ -323,6 +323,13 @@ pub(crate) fn clean_const<'tcx>(constant: &hir::ConstArg<'tcx>) -> ConstantKind // FIXME(mgca): proper printing :3 ConstantKind::Path { path: "/* STRUCT EXPR */".to_string().into() } } + hir::ConstArgKind::TupleCall(..) => { + ConstantKind::Path { path: "/* TUPLE CALL */".to_string().into() } + } + hir::ConstArgKind::Tup(..) => { + // FIXME(mgca): proper printing :3 + ConstantKind::Path { path: "/* TUPLE EXPR */".to_string().into() } + } hir::ConstArgKind::Anon(anon) => ConstantKind::Anonymous { body: anon.body }, hir::ConstArgKind::Infer(..) | hir::ConstArgKind::Error(..) => ConstantKind::Infer, } @@ -1804,7 +1811,10 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T let ct = cx.tcx.normalize_erasing_regions(typing_env, ct); print_const(cx, ct) } - hir::ConstArgKind::Struct(..) | hir::ConstArgKind::Path(..) => { + hir::ConstArgKind::Struct(..) + | hir::ConstArgKind::Path(..) + | hir::ConstArgKind::TupleCall(..) + | hir::ConstArgKind::Tup(..) => { let ct = lower_const_arg_for_rustdoc(cx.tcx, const_arg, FeedConstTy::No); print_const(cx, ct) } @@ -2677,17 +2687,13 @@ fn add_without_unwanted_attributes<'hir>( import_parent, )); } - hir::Attribute::Unparsed(normal) if let [ident] = &*normal.path.segments => { - if is_inline || ident.name != sym::cfg_trace { - // If it's not a `cfg()` attribute, we keep it. - attrs.push((Cow::Borrowed(attr), import_parent)); - } - } - // FIXME: make sure to exclude `#[cfg_trace]` here when it is ported to the new parsers - hir::Attribute::Parsed(..) => { + + // We discard `#[cfg(...)]` attributes unless we're inlining + hir::Attribute::Parsed(AttributeKind::CfgTrace(..)) if !is_inline => {} + // We keep all other attributes + _ => { attrs.push((Cow::Borrowed(attr), import_parent)); } - _ => {} } } } diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 0b52c0b56b82..84e93a479b5b 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -40,90 +40,6 @@ use crate::html::render::sidebar::filters; use crate::html::render::{document_full, document_item_info}; use crate::html::url_parts_builder::UrlPartsBuilder; -/// Generates an Askama template struct for rendering items with common methods. -/// -/// Usage: -/// ```ignore (illustrative) -/// item_template!( -/// #[template(path = "", /* additional values */)] -/// /* additional meta items */ -/// struct MyItem<'a, 'cx> { -/// cx: RefCell<&'a mut Context<'cx>>, -/// it: &'a clean::Item, -/// /* additional fields */ -/// }, -/// methods = [ /* method names (comma separated; refer to macro definition of `item_template_methods!()`) */ ] -/// ) -/// ``` -/// -/// NOTE: ensure that the generic lifetimes (`'a`, `'cx`) and -/// required fields (`cx`, `it`) are identical (in terms of order and definition). -macro_rules! item_template { - ( - $(#[$meta:meta])* - struct $name:ident<'a, 'cx> { - cx: &'a Context<'cx>, - it: &'a clean::Item, - $($field_name:ident: $field_ty:ty),*, - }, - methods = [$($methods:tt),* $(,)?] - ) => { - #[derive(Template)] - $(#[$meta])* - struct $name<'a, 'cx> { - cx: &'a Context<'cx>, - it: &'a clean::Item, - $($field_name: $field_ty),* - } - - impl<'a, 'cx: 'a> ItemTemplate<'a, 'cx> for $name<'a, 'cx> { - fn item_and_cx(&self) -> (&'a clean::Item, &'a Context<'cx>) { - (&self.it, &self.cx) - } - } - - impl<'a, 'cx: 'a> $name<'a, 'cx> { - item_template_methods!($($methods)*); - } - }; -} - -/// Implement common methods for item template structs generated by `item_template!()`. -/// -/// NOTE: this macro is intended to be used only by `item_template!()`. -macro_rules! item_template_methods { - () => {}; - (document $($rest:tt)*) => { - fn document(&self) -> impl fmt::Display { - let (item, cx) = self.item_and_cx(); - document(cx, item, None, HeadingOffset::H2) - } - item_template_methods!($($rest)*); - }; - (document_type_layout $($rest:tt)*) => { - fn document_type_layout(&self) -> impl fmt::Display { - let (item, cx) = self.item_and_cx(); - let def_id = item.item_id.expect_def_id(); - document_type_layout(cx, def_id) - } - item_template_methods!($($rest)*); - }; - (render_assoc_items $($rest:tt)*) => { - fn render_assoc_items(&self) -> impl fmt::Display { - let (item, cx) = self.item_and_cx(); - let def_id = item.item_id.expect_def_id(); - render_assoc_items(cx, item, def_id, AssocItemRender::All) - } - item_template_methods!($($rest)*); - }; - ($method:ident $($rest:tt)*) => { - compile_error!(concat!("unknown method: ", stringify!($method))); - }; - ($token:tt $($rest:tt)*) => { - compile_error!(concat!("unexpected token: ", stringify!($token))); - }; -} - const ITEM_TABLE_OPEN: &str = "
    "; const REEXPORTS_TABLE_OPEN: &str = "
    "; const ITEM_TABLE_CLOSE: &str = "
    "; @@ -300,10 +216,6 @@ fn toggle_close(mut w: impl fmt::Write) { w.write_str("").unwrap(); } -trait ItemTemplate<'a, 'cx: 'a>: askama::Template + Display { - fn item_and_cx(&self) -> (&'a clean::Item, &'a Context<'cx>); -} - fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> impl fmt::Display { fmt::from_fn(|w| { write!(w, "{}", document(cx, item, None, HeadingOffset::H2))?; @@ -398,18 +310,34 @@ fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> i let mut types = not_stripped_items.keys().copied().collect::>(); types.sort_unstable_by(|a, b| reorder(*a).cmp(&reorder(*b))); + let mut last_section: Option = None; + for type_ in types { let my_section = item_ty_to_section(type_); - let tag = if my_section == super::ItemSection::Reexports { - REEXPORTS_TABLE_OPEN - } else { - ITEM_TABLE_OPEN - }; - write!( - w, - "{}", - write_section_heading(my_section.name(), &cx.derive_id(my_section.id()), None, tag) - )?; + + // Only render section heading if the section changed + if last_section != Some(my_section) { + // Close the previous section if there was one + if last_section.is_some() { + w.write_str(ITEM_TABLE_CLOSE)?; + } + let tag = if my_section == super::ItemSection::Reexports { + REEXPORTS_TABLE_OPEN + } else { + ITEM_TABLE_OPEN + }; + write!( + w, + "{}", + write_section_heading( + my_section.name(), + &cx.derive_id(my_section.id()), + None, + tag + ) + )?; + last_section = Some(my_section); + } for (_, myitem) in ¬_stripped_items[&type_] { match myitem.kind { @@ -526,6 +454,9 @@ fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> i } } } + } + // Close the final section + if last_section.is_some() { w.write_str(ITEM_TABLE_CLOSE)?; } @@ -1463,20 +1394,32 @@ fn item_type_alias(cx: &Context<'_>, it: &clean::Item, t: &clean::TypeAlias) -> }) } -item_template!( - #[template(path = "item_union.html")] - struct ItemUnion<'a, 'cx> { - cx: &'a Context<'cx>, - it: &'a clean::Item, - fields: &'a [clean::Item], - generics: &'a clean::Generics, - is_type_alias: bool, - def_id: DefId, - }, - methods = [document, document_type_layout, render_assoc_items] -); +#[derive(Template)] +#[template(path = "item_union.html")] +struct ItemUnion<'a, 'cx> { + cx: &'a Context<'cx>, + it: &'a clean::Item, + fields: &'a [clean::Item], + generics: &'a clean::Generics, + is_type_alias: bool, + def_id: DefId, +} impl<'a, 'cx: 'a> ItemUnion<'a, 'cx> { + fn document(&self) -> impl fmt::Display { + document(self.cx, self.it, None, HeadingOffset::H2) + } + + fn document_type_layout(&self) -> impl fmt::Display { + let def_id = self.it.item_id.expect_def_id(); + document_type_layout(self.cx, def_id) + } + + fn render_assoc_items(&self) -> impl fmt::Display { + let def_id = self.it.item_id.expect_def_id(); + render_assoc_items(self.cx, self.it, def_id, AssocItemRender::All) + } + fn render_union(&self) -> impl Display { render_union( self.it, diff --git a/src/librustdoc/html/render/sidebar.rs b/src/librustdoc/html/render/sidebar.rs index df9e8631bbdd..a4535792ac3c 100644 --- a/src/librustdoc/html/render/sidebar.rs +++ b/src/librustdoc/html/render/sidebar.rs @@ -128,10 +128,12 @@ pub(crate) mod filters { use askama::filters::Safe; use crate::html::escape::EscapeBodyTextWithWbr; - pub(crate) fn wrapped(v: T, _: V) -> askama::Result> - where - T: Display, - { + + #[askama::filter_fn] + pub(crate) fn wrapped( + v: impl Display, + _: &dyn askama::Values, + ) -> askama::Result> { let string = v.to_string(); Ok(Safe(fmt::from_fn(move |f| EscapeBodyTextWithWbr(&string).fmt(f)))) } diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index e0a37c95257c..af97ae93a2b9 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -882,7 +882,8 @@ impl<'item> DocVisitor<'item> for TypeImplCollector<'_, '_, 'item> { // // FIXME(lazy_type_alias): Once the feature is complete or stable, rewrite this // to use type unification. - // Be aware of `tests/rustdoc/type-alias/deeply-nested-112515.rs` which might regress. + // Be aware of `tests/rustdoc-html/type-alias/deeply-nested-112515.rs` which might + // regress. let Some(impl_did) = impl_item_id.as_def_id() else { continue }; let for_ty = self.cx.tcx().type_of(impl_did).skip_binder(); let reject_cx = DeepRejectCtxt::relate_infer_infer(self.cx.tcx()); diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 69a79f2736e7..b93e921dd5b7 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -997,7 +997,7 @@ rustdoc-topbar { .example-wrap [data-nosnippet] { width: calc(var(--example-wrap-digits-count) + var(--line-number-padding) * 2); } -.example-wrap pre > code { +.example-wrap:not(.hide-lines) pre > code { padding-left: calc( var(--example-wrap-digits-count) + var(--line-number-padding) * 2 + var(--line-number-right-margin)); diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 476ecd42d6f9..f438fe173810 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -1669,7 +1669,7 @@ function preLoadCss(cssUrl) { restrict the search to a given item kind.", "Accepted kinds are: fn, mod, struct, \ enum, trait, type, macro, \ - and const.", + and constant.", "Search functions by type signature (e.g., vec -> usize or \ -> vec or String, enum:Cow -> bool)", "You can look for items with an exact name by putting double quotes around \ @@ -2163,7 +2163,15 @@ function preLoadCss(cssUrl) { // Should never happen, but the world is a dark and dangerous place. return; } - copyContentToClipboard(codeElem.textContent); + let content = ""; + for (const node of codeElem.childNodes) { + // We exclude line numbers. + if (node instanceof HTMLElement && node.hasAttribute("data-nosnippet")) { + continue; + } + content += node.textContent; + } + copyContentToClipboard(content); } /** diff --git a/src/librustdoc/passes/propagate_doc_cfg.rs b/src/librustdoc/passes/propagate_doc_cfg.rs index 95f5537f394c..54da158d4d39 100644 --- a/src/librustdoc/passes/propagate_doc_cfg.rs +++ b/src/librustdoc/passes/propagate_doc_cfg.rs @@ -2,7 +2,6 @@ use rustc_hir::Attribute; use rustc_hir::attrs::{AttributeKind, DocAttribute}; -use rustc_span::symbol::sym; use crate::clean::inline::{load_attrs, merge_attrs}; use crate::clean::{CfgInfo, Crate, Item, ItemKind}; @@ -39,10 +38,7 @@ fn add_only_cfg_attributes(attrs: &mut Vec, new_attrs: &[Attribute]) let mut new_attr = DocAttribute::default(); new_attr.cfg = d.cfg.clone(); attrs.push(Attribute::Parsed(AttributeKind::Doc(Box::new(new_attr)))); - } else if let Attribute::Unparsed(normal) = attr - && let [ident] = &*normal.path.segments - && ident.name == sym::cfg_trace - { + } else if let Attribute::Parsed(AttributeKind::CfgTrace(..)) = attr { // If it's a `cfg()` attribute, we keep it. attrs.push(attr.clone()); } diff --git a/src/stage0 b/src/stage0 index 66b652a844f3..226f1d6f645e 100644 --- a/src/stage0 +++ b/src/stage0 @@ -1,7 +1,7 @@ dist_server=https://static.rust-lang.org artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt -git_merge_commit_email=bors@rust-lang.org +git_merge_commit_email=122020455+rust-bors[bot]@users.noreply.github.com nightly_branch=main # The configuration above this comment is editable, and can be changed diff --git a/src/tools/cargo b/src/tools/cargo index 3861f60f6b58..b54051b15052 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 3861f60f6b58f57524c0e7aab1f5c1ad83e35409 +Subproject commit b54051b1505281ec7a45a250140a0ff25d33f319 diff --git a/src/tools/clippy/.github/workflows/clippy_dev.yml b/src/tools/clippy/.github/workflows/clippy_dev.yml index d530eb6c73a3..3a99d65233d3 100644 --- a/src/tools/clippy/.github/workflows/clippy_dev.yml +++ b/src/tools/clippy/.github/workflows/clippy_dev.yml @@ -16,7 +16,7 @@ jobs: steps: # Setup - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: # Unsetting this would make so that any malicious package could get our Github Token persist-credentials: false diff --git a/src/tools/clippy/.github/workflows/clippy_pr.yml b/src/tools/clippy/.github/workflows/clippy_pr.yml index d91c638a8fb5..f9e882d9757c 100644 --- a/src/tools/clippy/.github/workflows/clippy_pr.yml +++ b/src/tools/clippy/.github/workflows/clippy_pr.yml @@ -24,7 +24,7 @@ jobs: steps: # Setup - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: # Unsetting this would make so that any malicious package could get our Github Token persist-credentials: false diff --git a/src/tools/clippy/.github/workflows/remark.yml b/src/tools/clippy/.github/workflows/remark.yml index 03641a9aa62f..d4dc80efe79d 100644 --- a/src/tools/clippy/.github/workflows/remark.yml +++ b/src/tools/clippy/.github/workflows/remark.yml @@ -20,9 +20,9 @@ jobs: persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: - node-version: '20.x' + node-version: '24.x' - name: Install remark run: npm install remark-cli remark-lint remark-lint-maximum-line-length@^3.1.3 remark-preset-lint-recommended remark-gfm diff --git a/src/tools/clippy/CHANGELOG.md b/src/tools/clippy/CHANGELOG.md index 6f666caf306f..91d793489be2 100644 --- a/src/tools/clippy/CHANGELOG.md +++ b/src/tools/clippy/CHANGELOG.md @@ -6916,6 +6916,7 @@ Released 2018-09-13 [`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges [`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition [`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push +[`same_length_and_capacity`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_length_and_capacity [`same_name_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_name_method [`search_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some [`seek_from_current`]: https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current diff --git a/src/tools/clippy/clippy_dev/Cargo.toml b/src/tools/clippy/clippy_dev/Cargo.toml index 10c08dba50b9..c2abbac37535 100644 --- a/src/tools/clippy/clippy_dev/Cargo.toml +++ b/src/tools/clippy/clippy_dev/Cargo.toml @@ -10,6 +10,7 @@ clap = { version = "4.4", features = ["derive"] } indoc = "1.0" itertools = "0.12" opener = "0.7" +rustc-literal-escaper = "0.0.5" walkdir = "2.3" [package.metadata.rust-analyzer] diff --git a/src/tools/clippy/clippy_dev/src/lib.rs b/src/tools/clippy/clippy_dev/src/lib.rs index dcca08aee7e6..cd103908be03 100644 --- a/src/tools/clippy/clippy_dev/src/lib.rs +++ b/src/tools/clippy/clippy_dev/src/lib.rs @@ -22,7 +22,6 @@ extern crate rustc_arena; #[expect(unused_extern_crates, reason = "required to link to rustc crates")] extern crate rustc_driver; extern crate rustc_lexer; -extern crate rustc_literal_escaper; pub mod deprecate_lint; pub mod dogfood; diff --git a/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs b/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs index 2586c89bc868..4aa55e53445c 100644 --- a/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs +++ b/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs @@ -3,6 +3,7 @@ use clippy_utils::consts::{ConstEvalCtxt, Constant}; use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::macros::{find_assert_args, root_macro_call_first_node}; use clippy_utils::msrvs::Msrv; +use clippy_utils::visitors::is_const_evaluatable; use clippy_utils::{is_inside_always_const_context, msrvs}; use rustc_ast::LitKind; use rustc_hir::{Expr, ExprKind}; @@ -50,6 +51,7 @@ impl<'tcx> LateLintPass<'tcx> for AssertionsOnConstants { _ => return, } && let Some((condition, _)) = find_assert_args(cx, e, macro_call.expn) + && is_const_evaluatable(cx, condition) && let Some((Constant::Bool(assert_val), const_src)) = ConstEvalCtxt::new(cx).eval_with_source(condition, macro_call.span.ctxt()) && let in_const_context = is_inside_always_const_context(cx.tcx, e.hir_id) diff --git a/src/tools/clippy/clippy_lints/src/attrs/allow_attributes.rs b/src/tools/clippy/clippy_lints/src/attrs/allow_attributes.rs index 53d9725703c3..84b65d3185e3 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/allow_attributes.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/allow_attributes.rs @@ -4,18 +4,19 @@ use clippy_utils::is_from_proc_macro; use rustc_ast::{AttrStyle, Attribute}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, LintContext}; +use rustc_ast::attr::AttributeExt; // Separate each crate's features. pub fn check<'cx>(cx: &EarlyContext<'cx>, attr: &'cx Attribute) { if !attr.span.in_external_macro(cx.sess().source_map()) && let AttrStyle::Outer = attr.style - && let Some(ident) = attr.ident() + && let Some(path_span) = attr.path_span() && !is_from_proc_macro(cx, attr) { #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] - span_lint_and_then(cx, ALLOW_ATTRIBUTES, ident.span, "#[allow] attribute found", |diag| { + span_lint_and_then(cx, ALLOW_ATTRIBUTES, path_span, "#[allow] attribute found", |diag| { diag.span_suggestion( - ident.span, + path_span, "replace it with", "expect", Applicability::MachineApplicable, diff --git a/src/tools/clippy/clippy_lints/src/attrs/mod.rs b/src/tools/clippy/clippy_lints/src/attrs/mod.rs index 91c2dc7f3dc6..366f5873a1aa 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/mod.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/mod.rs @@ -16,7 +16,7 @@ mod utils; use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::msrvs::{self, Msrv, MsrvStack}; -use rustc_ast::{self as ast, AttrArgs, AttrKind, Attribute, MetaItemInner, MetaItemKind}; +use rustc_ast::{self as ast, AttrArgs, AttrKind, Attribute, MetaItemInner, MetaItemKind, AttrItemKind}; use rustc_hir::{ImplItem, Item, ItemKind, TraitItem}; use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass}; use rustc_session::impl_lint_pass; @@ -574,16 +574,16 @@ impl EarlyLintPass for PostExpansionEarlyAttributes { fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { if let Some(items) = &attr.meta_item_list() - && let Some(ident) = attr.ident() + && let Some(name) = attr.name() { - if matches!(ident.name, sym::allow) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { + if matches!(name, sym::allow) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { allow_attributes::check(cx, attr); } - if matches!(ident.name, sym::allow | sym::expect) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { - allow_attributes_without_reason::check(cx, ident.name, items, attr); + if matches!(name, sym::allow | sym::expect) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { + allow_attributes_without_reason::check(cx, name, items, attr); } - if is_lint_level(ident.name, attr.id) { - blanket_clippy_restriction_lints::check(cx, ident.name, items); + if is_lint_level(name, attr.id) { + blanket_clippy_restriction_lints::check(cx, name, items); } if items.is_empty() || !attr.has_name(sym::deprecated) { return; @@ -604,7 +604,7 @@ impl EarlyLintPass for PostExpansionEarlyAttributes { if attr.has_name(sym::ignore) && match &attr.kind { - AttrKind::Normal(normal_attr) => !matches!(normal_attr.item.args, AttrArgs::Eq { .. }), + AttrKind::Normal(normal_attr) => !matches!(normal_attr.item.args, AttrItemKind::Unparsed(AttrArgs::Eq { .. })), AttrKind::DocComment(..) => true, } { diff --git a/src/tools/clippy/clippy_lints/src/attrs/should_panic_without_expect.rs b/src/tools/clippy/clippy_lints/src/attrs/should_panic_without_expect.rs index fd27e30a67f3..b854a3070bef 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/should_panic_without_expect.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/should_panic_without_expect.rs @@ -2,19 +2,19 @@ use super::{Attribute, SHOULD_PANIC_WITHOUT_EXPECT}; use clippy_utils::diagnostics::span_lint_and_sugg; use rustc_ast::token::{Token, TokenKind}; use rustc_ast::tokenstream::TokenTree; -use rustc_ast::{AttrArgs, AttrKind}; +use rustc_ast::{AttrArgs, AttrKind, AttrItemKind}; use rustc_errors::Applicability; use rustc_lint::EarlyContext; use rustc_span::sym; pub(super) fn check(cx: &EarlyContext<'_>, attr: &Attribute) { if let AttrKind::Normal(normal_attr) = &attr.kind { - if let AttrArgs::Eq { .. } = &normal_attr.item.args { + if let AttrItemKind::Unparsed(AttrArgs::Eq { .. }) = &normal_attr.item.args { // `#[should_panic = ".."]` found, good return; } - if let AttrArgs::Delimited(args) = &normal_attr.item.args + if let AttrItemKind::Unparsed(AttrArgs::Delimited(args)) = &normal_attr.item.args && let mut tt_iter = args.tokens.iter() && let Some(TokenTree::Token( Token { diff --git a/src/tools/clippy/clippy_lints/src/attrs/useless_attribute.rs b/src/tools/clippy/clippy_lints/src/attrs/useless_attribute.rs index 1cebc18edc90..aa9a6654bee3 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/useless_attribute.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/useless_attribute.rs @@ -15,7 +15,7 @@ pub(super) fn check(cx: &EarlyContext<'_>, item: &Item, attrs: &[Attribute]) { return; } if let Some(lint_list) = &attr.meta_item_list() - && attr.ident().is_some_and(|ident| is_lint_level(ident.name, attr.id)) + && attr.name().is_some_and(|name| is_lint_level(name, attr.id)) { for lint in lint_list { match item.kind { diff --git a/src/tools/clippy/clippy_lints/src/booleans.rs b/src/tools/clippy/clippy_lints/src/booleans.rs index 902ba70577b9..a04a56d72bc0 100644 --- a/src/tools/clippy/clippy_lints/src/booleans.rs +++ b/src/tools/clippy/clippy_lints/src/booleans.rs @@ -433,7 +433,7 @@ fn simplify_not(cx: &LateContext<'_>, curr_msrv: Msrv, expr: &Expr<'_>) -> Optio }, ExprKind::MethodCall(path, receiver, args, _) => { let type_of_receiver = cx.typeck_results().expr_ty(receiver); - if !type_of_receiver.is_diag_item(cx, sym::Option) && !type_of_receiver.is_diag_item(cx, sym::Result) { + if !matches!(type_of_receiver.opt_diag_name(cx), Some(sym::Option | sym::Result)) { return None; } METHODS_WITH_NEGATION diff --git a/src/tools/clippy/clippy_lints/src/casts/cast_precision_loss.rs b/src/tools/clippy/clippy_lints/src/casts/cast_precision_loss.rs index 712e38db499f..748ab3163496 100644 --- a/src/tools/clippy/clippy_lints/src/casts/cast_precision_loss.rs +++ b/src/tools/clippy/clippy_lints/src/casts/cast_precision_loss.rs @@ -23,15 +23,11 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_from: Ty<'_>, ca let cast_to_f64 = to_nbits == 64; let mantissa_nbits = if cast_to_f64 { 52 } else { 23 }; - let arch_dependent = is_isize_or_usize(cast_from) && cast_to_f64; - let arch_dependent_str = "on targets with 64-bit wide pointers "; - let from_nbits_str = if arch_dependent { - "64".to_owned() - } else if is_isize_or_usize(cast_from) { - // FIXME: handle 16 bits `usize` type - "32 or 64".to_owned() + + let has_width = if is_isize_or_usize(cast_from) { + "can be up to 64 bits wide depending on the target architecture".to_owned() } else { - from_nbits.to_string() + format!("is {from_nbits} bits wide") }; span_lint( @@ -39,13 +35,9 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_from: Ty<'_>, ca CAST_PRECISION_LOSS, expr.span, format!( - "casting `{0}` to `{1}` causes a loss of precision {2}(`{0}` is {3} bits wide, \ - but `{1}`'s mantissa is only {4} bits wide)", - cast_from, - if cast_to_f64 { "f64" } else { "f32" }, - if arch_dependent { arch_dependent_str } else { "" }, - from_nbits_str, - mantissa_nbits + "casting `{cast_from}` to `{cast_to}` may cause a loss of precision \ + (`{cast_from}` {has_width}, \ + but `{cast_to}`'s mantissa is only {mantissa_nbits} bits wide)", ), ); } diff --git a/src/tools/clippy/clippy_lints/src/casts/mod.rs b/src/tools/clippy/clippy_lints/src/casts/mod.rs index 494d6180d3cb..7220a8a80066 100644 --- a/src/tools/clippy/clippy_lints/src/casts/mod.rs +++ b/src/tools/clippy/clippy_lints/src/casts/mod.rs @@ -836,7 +836,7 @@ declare_clippy_lint! { /// ``` #[clippy::version = "1.93.0"] pub NEEDLESS_TYPE_CAST, - pedantic, + nursery, "binding defined with one type but always cast to another" } diff --git a/src/tools/clippy/clippy_lints/src/casts/needless_type_cast.rs b/src/tools/clippy/clippy_lints/src/casts/needless_type_cast.rs index ca6aa0f87bbf..1d899a21c229 100644 --- a/src/tools/clippy/clippy_lints/src/casts/needless_type_cast.rs +++ b/src/tools/clippy/clippy_lints/src/casts/needless_type_cast.rs @@ -1,6 +1,8 @@ -use clippy_utils::diagnostics::span_lint_and_sugg; +use clippy_utils::diagnostics::span_lint_and_then; +use clippy_utils::sugg::Sugg; use clippy_utils::visitors::{Descend, for_each_expr, for_each_expr_without_closures}; use core::ops::ControlFlow; +use rustc_ast::ast::{LitFloatType, LitIntType, LitKind}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; use rustc_hir::def::{DefKind, Res}; @@ -14,6 +16,7 @@ use super::NEEDLESS_TYPE_CAST; struct BindingInfo<'a> { source_ty: Ty<'a>, ty_span: Span, + init: Option<&'a Expr<'a>>, } struct UsageInfo<'a> { @@ -73,6 +76,7 @@ fn collect_binding_from_let<'a>( BindingInfo { source_ty: ty, ty_span: ty_hir.span, + init: Some(let_expr.init), }, ); } @@ -103,6 +107,7 @@ fn collect_binding_from_local<'a>( BindingInfo { source_ty: ty, ty_span: ty_hir.span, + init: let_stmt.init, }, ); } @@ -182,12 +187,7 @@ fn is_generic_res(cx: &LateContext<'_>, res: Res) -> bool { .iter() .any(|p| p.kind.is_ty_or_const()) }; - match res { - Res::Def(DefKind::Fn | DefKind::AssocFn, def_id) => has_type_params(def_id), - // Ctor → Variant → ADT: constructor's parent is variant, variant's parent is the ADT - Res::Def(DefKind::Ctor(..), def_id) => has_type_params(cx.tcx.parent(cx.tcx.parent(def_id))), - _ => false, - } + cx.tcx.res_generics_def_id(res).is_some_and(has_type_params) } fn is_cast_in_generic_context<'a>(cx: &LateContext<'a>, cast_expr: &Expr<'a>) -> bool { @@ -234,6 +234,18 @@ fn is_cast_in_generic_context<'a>(cx: &LateContext<'a>, cast_expr: &Expr<'a>) -> } } +fn can_coerce_to_target_type(expr: &Expr<'_>) -> bool { + match expr.kind { + ExprKind::Lit(lit) => matches!( + lit.node, + LitKind::Int(_, LitIntType::Unsuffixed) | LitKind::Float(_, LitFloatType::Unsuffixed) + ), + ExprKind::Unary(rustc_hir::UnOp::Neg, inner) => can_coerce_to_target_type(inner), + ExprKind::Binary(_, lhs, rhs) => can_coerce_to_target_type(lhs) && can_coerce_to_target_type(rhs), + _ => false, + } +} + fn check_binding_usages<'a>(cx: &LateContext<'a>, body: &Body<'a>, hir_id: HirId, binding_info: &BindingInfo<'a>) { let mut usages = Vec::new(); @@ -274,7 +286,19 @@ fn check_binding_usages<'a>(cx: &LateContext<'a>, body: &Body<'a>, hir_id: HirId return; }; - span_lint_and_sugg( + // Don't lint if there's exactly one use and the initializer cannot be coerced to the + // target type (i.e., would require an explicit cast). In such cases, the fix would add + // a cast to the initializer rather than eliminating one - the cast isn't truly "needless." + // See: https://github.com/rust-lang/rust-clippy/issues/16240 + if usages.len() == 1 + && binding_info + .init + .is_some_and(|init| !can_coerce_to_target_type(init) && !init.span.from_expansion()) + { + return; + } + + span_lint_and_then( cx, NEEDLESS_TYPE_CAST, binding_info.ty_span, @@ -282,8 +306,28 @@ fn check_binding_usages<'a>(cx: &LateContext<'a>, body: &Body<'a>, hir_id: HirId "this binding is defined as `{}` but is always cast to `{}`", binding_info.source_ty, first_target ), - "consider defining it as", - first_target.to_string(), - Applicability::MaybeIncorrect, + |diag| { + if let Some(init) = binding_info + .init + .filter(|i| !can_coerce_to_target_type(i) && !i.span.from_expansion()) + { + let sugg = Sugg::hir(cx, init, "..").as_ty(first_target); + diag.multipart_suggestion( + format!("consider defining it as `{first_target}` and casting the initializer"), + vec![ + (binding_info.ty_span, first_target.to_string()), + (init.span, sugg.to_string()), + ], + Applicability::MachineApplicable, + ); + } else { + diag.span_suggestion( + binding_info.ty_span, + "consider defining it as", + first_target.to_string(), + Applicability::MachineApplicable, + ); + } + }, ); } diff --git a/src/tools/clippy/clippy_lints/src/casts/ref_as_ptr.rs b/src/tools/clippy/clippy_lints/src/casts/ref_as_ptr.rs index 592c820a25e1..b3805c678174 100644 --- a/src/tools/clippy/clippy_lints/src/casts/ref_as_ptr.rs +++ b/src/tools/clippy/clippy_lints/src/casts/ref_as_ptr.rs @@ -1,9 +1,9 @@ use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::source::snippet_with_applicability; use clippy_utils::sugg::Sugg; -use clippy_utils::{ExprUseNode, expr_use_ctxt, std_or_core}; +use clippy_utils::{ExprUseNode, expr_use_ctxt, is_expr_temporary_value, std_or_core}; use rustc_errors::Applicability; -use rustc_hir::{Expr, Mutability, Ty, TyKind}; +use rustc_hir::{Expr, ExprKind, Mutability, Ty, TyKind}; use rustc_lint::LateContext; use rustc_middle::ty; @@ -23,10 +23,18 @@ pub(super) fn check<'tcx>( if matches!(cast_from.kind(), ty::Ref(..)) && let ty::RawPtr(_, to_mutbl) = cast_to.kind() && let use_cx = expr_use_ctxt(cx, expr) - // TODO: only block the lint if `cast_expr` is a temporary - && !matches!(use_cx.use_node(cx), ExprUseNode::LetStmt(_) | ExprUseNode::ConstStatic(_)) && let Some(std_or_core) = std_or_core(cx) { + if let ExprKind::AddrOf(_, _, addr_inner) = cast_expr.kind + && is_expr_temporary_value(cx, addr_inner) + && matches!( + use_cx.use_node(cx), + ExprUseNode::LetStmt(_) | ExprUseNode::ConstStatic(_) + ) + { + return; + } + let fn_name = match to_mutbl { Mutability::Not => "from_ref", Mutability::Mut => "from_mut", diff --git a/src/tools/clippy/clippy_lints/src/cfg_not_test.rs b/src/tools/clippy/clippy_lints/src/cfg_not_test.rs index 7590fe96fd21..ec543d02c9dd 100644 --- a/src/tools/clippy/clippy_lints/src/cfg_not_test.rs +++ b/src/tools/clippy/clippy_lints/src/cfg_not_test.rs @@ -1,7 +1,10 @@ use clippy_utils::diagnostics::span_lint_and_then; -use rustc_ast::MetaItemInner; use rustc_lint::{EarlyContext, EarlyLintPass}; use rustc_session::declare_lint_pass; +use rustc_ast::AttrItemKind; +use rustc_ast::EarlyParsedAttribute; +use rustc_span::sym; +use rustc_ast::attr::data_structures::CfgEntry; declare_clippy_lint! { /// ### What it does @@ -32,29 +35,34 @@ declare_lint_pass!(CfgNotTest => [CFG_NOT_TEST]); impl EarlyLintPass for CfgNotTest { fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &rustc_ast::Attribute) { - if attr.has_name(rustc_span::sym::cfg_trace) && contains_not_test(attr.meta_item_list().as_deref(), false) { - span_lint_and_then( - cx, - CFG_NOT_TEST, - attr.span, - "code is excluded from test builds", - |diag| { - diag.help("consider not excluding any code from test builds"); - diag.note_once("this could increase code coverage despite not actually being tested"); - }, - ); + if attr.has_name(sym::cfg_trace) { + let AttrItemKind::Parsed(EarlyParsedAttribute::CfgTrace(cfg)) = &attr.get_normal_item().args else { + unreachable!() + }; + + if contains_not_test(&cfg, false) { + span_lint_and_then( + cx, + CFG_NOT_TEST, + attr.span, + "code is excluded from test builds", + |diag| { + diag.help("consider not excluding any code from test builds"); + diag.note_once("this could increase code coverage despite not actually being tested"); + }, + ); + } } } } -fn contains_not_test(list: Option<&[MetaItemInner]>, not: bool) -> bool { - list.is_some_and(|list| { - list.iter().any(|item| { - item.ident().is_some_and(|ident| match ident.name { - rustc_span::sym::not => contains_not_test(item.meta_item_list(), !not), - rustc_span::sym::test => not, - _ => contains_not_test(item.meta_item_list(), not), - }) - }) - }) +fn contains_not_test(cfg: &CfgEntry, not: bool) -> bool { + match cfg { + CfgEntry::All(subs, _) | CfgEntry::Any(subs, _) => subs.iter().any(|item| { + contains_not_test(item, not) + }), + CfgEntry::Not(sub, _) => contains_not_test(sub, !not), + CfgEntry::NameValue { name: sym::test, .. } => not, + _ => false + } } diff --git a/src/tools/clippy/clippy_lints/src/collapsible_if.rs b/src/tools/clippy/clippy_lints/src/collapsible_if.rs index b13e307a3f9c..be07ce1272bd 100644 --- a/src/tools/clippy/clippy_lints/src/collapsible_if.rs +++ b/src/tools/clippy/clippy_lints/src/collapsible_if.rs @@ -76,7 +76,7 @@ declare_clippy_lint! { /// ``` #[clippy::version = "1.51.0"] pub COLLAPSIBLE_ELSE_IF, - style, + pedantic, "nested `else`-`if` expressions that can be collapsed (e.g., `else { if x { ... } }`)" } @@ -267,6 +267,9 @@ impl LateLintPass<'_> for CollapsibleIf { && !expr.span.from_expansion() { if let Some(else_) = else_ + // Short circuit if both `if` branches contain only a single `if {..} else {}`, as + // collapsing such blocks can lead to less readable code (#4971) + && !(single_inner_if_else(then) && single_inner_if_else(else_)) && let ExprKind::Block(else_, None) = else_.kind { self.check_collapsible_else_if(cx, then.span, else_); @@ -280,6 +283,19 @@ impl LateLintPass<'_> for CollapsibleIf { } } +/// Returns true if `expr` is a block that contains only one `if {..} else {}` statement +fn single_inner_if_else(expr: &Expr<'_>) -> bool { + if let ExprKind::Block(block, None) = expr.kind + && let Some(inner_expr) = expr_block(block) + && let ExprKind::If(_, _, else_) = inner_expr.kind + && else_.is_some() + { + true + } else { + false + } +} + /// If `block` is a block with either one expression or a statement containing an expression, /// return the expression. We don't peel blocks recursively, as extra blocks might be intentional. fn expr_block<'tcx>(block: &Block<'tcx>) -> Option<&'tcx Expr<'tcx>> { diff --git a/src/tools/clippy/clippy_lints/src/declared_lints.rs b/src/tools/clippy/clippy_lints/src/declared_lints.rs index 87d75234ebc0..6b68940c6423 100644 --- a/src/tools/clippy/clippy_lints/src/declared_lints.rs +++ b/src/tools/clippy/clippy_lints/src/declared_lints.rs @@ -667,6 +667,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[ crate::returns::LET_AND_RETURN_INFO, crate::returns::NEEDLESS_RETURN_INFO, crate::returns::NEEDLESS_RETURN_WITH_QUESTION_MARK_INFO, + crate::same_length_and_capacity::SAME_LENGTH_AND_CAPACITY_INFO, crate::same_name_method::SAME_NAME_METHOD_INFO, crate::self_named_constructors::SELF_NAMED_CONSTRUCTORS_INFO, crate::semicolon_block::SEMICOLON_INSIDE_BLOCK_INFO, diff --git a/src/tools/clippy/clippy_lints/src/disallowed_methods.rs b/src/tools/clippy/clippy_lints/src/disallowed_methods.rs index 8c067432cb4e..58403ad19235 100644 --- a/src/tools/clippy/clippy_lints/src/disallowed_methods.rs +++ b/src/tools/clippy/clippy_lints/src/disallowed_methods.rs @@ -88,6 +88,9 @@ impl_lint_pass!(DisallowedMethods => [DISALLOWED_METHODS]); impl<'tcx> LateLintPass<'tcx> for DisallowedMethods { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + if expr.span.desugaring_kind().is_some() { + return; + } let (id, span) = match &expr.kind { ExprKind::Path(path) if let Res::Def(_, id) = cx.qpath_res(path, expr.hir_id) => (id, expr.span), ExprKind::MethodCall(name, ..) if let Some(id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) => { diff --git a/src/tools/clippy/clippy_lints/src/doc/include_in_doc_without_cfg.rs b/src/tools/clippy/clippy_lints/src/doc/include_in_doc_without_cfg.rs index bca1cd03bb7e..f8e9e870f629 100644 --- a/src/tools/clippy/clippy_lints/src/doc/include_in_doc_without_cfg.rs +++ b/src/tools/clippy/clippy_lints/src/doc/include_in_doc_without_cfg.rs @@ -1,6 +1,6 @@ use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::source::snippet_opt; -use rustc_ast::{AttrArgs, AttrKind, AttrStyle, Attribute}; +use rustc_ast::{AttrArgs, AttrKind, AttrStyle, Attribute, AttrItemKind}; use rustc_errors::Applicability; use rustc_lint::EarlyContext; @@ -11,7 +11,7 @@ pub fn check(cx: &EarlyContext<'_>, attrs: &[Attribute]) { if !attr.span.from_expansion() && let AttrKind::Normal(ref item) = attr.kind && attr.doc_str().is_some() - && let AttrArgs::Eq { expr: meta, .. } = &item.item.args + && let AttrItemKind::Unparsed(AttrArgs::Eq { expr: meta, .. }) = &item.item.args && !attr.span.contains(meta.span) // Since the `include_str` is already expanded at this point, we can only take the // whole attribute snippet and then modify for our suggestion. diff --git a/src/tools/clippy/clippy_lints/src/empty_with_brackets.rs b/src/tools/clippy/clippy_lints/src/empty_with_brackets.rs index e7230ebf8cba..7e335d5c9809 100644 --- a/src/tools/clippy/clippy_lints/src/empty_with_brackets.rs +++ b/src/tools/clippy/clippy_lints/src/empty_with_brackets.rs @@ -1,16 +1,18 @@ use clippy_utils::attrs::span_contains_cfg; use clippy_utils::diagnostics::{span_lint_and_then, span_lint_hir_and_then}; -use rustc_data_structures::fx::FxIndexMap; +use clippy_utils::source::SpanRangeExt; +use clippy_utils::span_contains_non_whitespace; +use rustc_data_structures::fx::{FxIndexMap, IndexEntry}; use rustc_errors::Applicability; -use rustc_hir::def::CtorOf; use rustc_hir::def::DefKind::Ctor; use rustc_hir::def::Res::Def; +use rustc_hir::def::{CtorOf, DefKind}; use rustc_hir::def_id::LocalDefId; -use rustc_hir::{Expr, ExprKind, Item, ItemKind, Node, Path, QPath, Variant, VariantData}; +use rustc_hir::{Expr, ExprKind, Item, ItemKind, Node, Pat, PatKind, Path, QPath, Variant, VariantData}; use rustc_lint::{LateContext, LateLintPass}; -use rustc_middle::ty::TyCtxt; +use rustc_middle::ty::{self, TyCtxt}; use rustc_session::impl_lint_pass; -use rustc_span::Span; +use rustc_span::{BytePos, Span}; declare_clippy_lint! { /// ### What it does @@ -118,7 +120,6 @@ impl LateLintPass<'_> for EmptyWithBrackets { } fn check_variant(&mut self, cx: &LateContext<'_>, variant: &Variant<'_>) { - // FIXME: handle `$name {}` if !variant.span.from_expansion() && !variant.ident.span.from_expansion() && let span_after_ident = variant.span.with_lo(variant.ident.span.hi()) @@ -126,44 +127,14 @@ impl LateLintPass<'_> for EmptyWithBrackets { { match variant.data { VariantData::Struct { .. } => { - // Empty struct variants can be linted immediately - span_lint_and_then( - cx, - EMPTY_ENUM_VARIANTS_WITH_BRACKETS, - span_after_ident, - "enum variant has empty brackets", - |diagnostic| { - diagnostic.span_suggestion_hidden( - span_after_ident, - "remove the brackets", - "", - Applicability::MaybeIncorrect, - ); - }, - ); + self.add_enum_variant(variant.def_id); }, VariantData::Tuple(.., local_def_id) => { // Don't lint reachable tuple enums if cx.effective_visibilities.is_reachable(variant.def_id) { return; } - if let Some(entry) = self.empty_tuple_enum_variants.get_mut(&local_def_id) { - // empty_tuple_enum_variants contains Usage::NoDefinition if the variant was called before the - // definition was encountered. Now that there's a definition, convert it - // to Usage::Unused. - if let Usage::NoDefinition { redundant_use_sites } = entry { - *entry = Usage::Unused { - redundant_use_sites: redundant_use_sites.clone(), - }; - } - } else { - self.empty_tuple_enum_variants.insert( - local_def_id, - Usage::Unused { - redundant_use_sites: vec![], - }, - ); - } + self.add_enum_variant(local_def_id); }, VariantData::Unit(..) => {}, } @@ -171,56 +142,58 @@ impl LateLintPass<'_> for EmptyWithBrackets { } fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { - if let Some(def_id) = check_expr_for_enum_as_function(expr) { - if let Some(parentheses_span) = call_parentheses_span(cx.tcx, expr) { + if let Some((def_id, mut span)) = check_expr_for_enum_as_function(cx, expr) { + if span.is_empty() + && let Some(parentheses_span) = call_parentheses_span(cx.tcx, expr) + { + span = parentheses_span; + } + + if span.is_empty() { + // The parentheses are not redundant. + self.empty_tuple_enum_variants.insert(def_id, Usage::Used); + } else { // Do not count expressions from macro expansion as a redundant use site. if expr.span.from_expansion() { return; } - match self.empty_tuple_enum_variants.get_mut(&def_id) { - Some( - &mut (Usage::Unused { - ref mut redundant_use_sites, - } - | Usage::NoDefinition { - ref mut redundant_use_sites, - }), - ) => { - redundant_use_sites.push(parentheses_span); - }, - None => { - // The variant isn't in the IndexMap which means its definition wasn't encountered yet. - self.empty_tuple_enum_variants.insert( - def_id, - Usage::NoDefinition { - redundant_use_sites: vec![parentheses_span], - }, - ); - }, - _ => {}, - } - } else { - // The parentheses are not redundant. - self.empty_tuple_enum_variants.insert(def_id, Usage::Used); + self.update_enum_variant_usage(def_id, span); } } } + fn check_pat(&mut self, cx: &LateContext<'_>, pat: &Pat<'_>) { + if !pat.span.from_expansion() + && let Some((def_id, span)) = check_pat_for_enum_as_function(cx, pat) + { + self.update_enum_variant_usage(def_id, span); + } + } + fn check_crate_post(&mut self, cx: &LateContext<'_>) { - for (local_def_id, usage) in &self.empty_tuple_enum_variants { + for (&local_def_id, usage) in &self.empty_tuple_enum_variants { // Ignore all variants with Usage::Used or Usage::NoDefinition let Usage::Unused { redundant_use_sites } = usage else { continue; }; + // Attempt to fetch the Variant from LocalDefId. - let Node::Variant(variant) = cx.tcx.hir_node( - cx.tcx - .local_def_id_to_hir_id(cx.tcx.parent(local_def_id.to_def_id()).expect_local()), - ) else { + let variant = if let Node::Variant(variant) = cx.tcx.hir_node_by_def_id(local_def_id) { + variant + } else if let Node::Variant(variant) = cx.tcx.hir_node_by_def_id(cx.tcx.local_parent(local_def_id)) { + variant + } else { continue; }; + // Span of the parentheses in variant definition let span = variant.span.with_lo(variant.ident.span.hi()); + let span_inner = span + .with_lo(SpanRangeExt::trim_start(span, cx).start + BytePos(1)) + .with_hi(span.hi() - BytePos(1)); + if span_contains_non_whitespace(cx, span_inner, false) { + continue; + } span_lint_hir_and_then( cx, EMPTY_ENUM_VARIANTS_WITH_BRACKETS, @@ -252,6 +225,43 @@ impl LateLintPass<'_> for EmptyWithBrackets { } } +impl EmptyWithBrackets { + fn add_enum_variant(&mut self, local_def_id: LocalDefId) { + self.empty_tuple_enum_variants + .entry(local_def_id) + .and_modify(|entry| { + // empty_tuple_enum_variants contains Usage::NoDefinition if the variant was called before + // the definition was encountered. Now that there's a + // definition, convert it to Usage::Unused. + if let Usage::NoDefinition { redundant_use_sites } = entry { + *entry = Usage::Unused { + redundant_use_sites: redundant_use_sites.clone(), + }; + } + }) + .or_insert_with(|| Usage::Unused { + redundant_use_sites: vec![], + }); + } + + fn update_enum_variant_usage(&mut self, def_id: LocalDefId, parentheses_span: Span) { + match self.empty_tuple_enum_variants.entry(def_id) { + IndexEntry::Occupied(mut e) => { + if let Usage::Unused { redundant_use_sites } | Usage::NoDefinition { redundant_use_sites } = e.get_mut() + { + redundant_use_sites.push(parentheses_span); + } + }, + IndexEntry::Vacant(e) => { + // The variant isn't in the IndexMap which means its definition wasn't encountered yet. + e.insert(Usage::NoDefinition { + redundant_use_sites: vec![parentheses_span], + }); + }, + } + } +} + fn has_brackets(var_data: &VariantData<'_>) -> bool { !matches!(var_data, VariantData::Unit(..)) } @@ -277,17 +287,47 @@ fn call_parentheses_span(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> Option { } // Returns the LocalDefId of the variant being called as a function if it exists. -fn check_expr_for_enum_as_function(expr: &Expr<'_>) -> Option { - if let ExprKind::Path(QPath::Resolved( - _, - Path { - res: Def(Ctor(CtorOf::Variant, _), def_id), - .. +fn check_expr_for_enum_as_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<(LocalDefId, Span)> { + match expr.kind { + ExprKind::Path(QPath::Resolved( + _, + Path { + res: Def(Ctor(CtorOf::Variant, _), def_id), + span, + .. + }, + )) => def_id.as_local().map(|id| (id, span.with_lo(expr.span.hi()))), + ExprKind::Struct(qpath, ..) + if let Def(DefKind::Variant, mut def_id) = cx.typeck_results().qpath_res(qpath, expr.hir_id) => + { + let ty = cx.tcx.type_of(def_id).instantiate_identity(); + if let ty::FnDef(ctor_def_id, _) = ty.kind() { + def_id = *ctor_def_id; + } + + def_id.as_local().map(|id| (id, qpath.span().with_lo(expr.span.hi()))) }, - )) = expr.kind - { - def_id.as_local() - } else { - None + _ => None, + } +} + +fn check_pat_for_enum_as_function(cx: &LateContext<'_>, pat: &Pat<'_>) -> Option<(LocalDefId, Span)> { + match pat.kind { + PatKind::TupleStruct(qpath, ..) + if let Def(Ctor(CtorOf::Variant, _), def_id) = cx.typeck_results().qpath_res(&qpath, pat.hir_id) => + { + def_id.as_local().map(|id| (id, qpath.span().with_lo(pat.span.hi()))) + }, + PatKind::Struct(qpath, ..) + if let Def(DefKind::Variant, mut def_id) = cx.typeck_results().qpath_res(&qpath, pat.hir_id) => + { + let ty = cx.tcx.type_of(def_id).instantiate_identity(); + if let ty::FnDef(ctor_def_id, _) = ty.kind() { + def_id = *ctor_def_id; + } + + def_id.as_local().map(|id| (id, qpath.span().with_lo(pat.span.hi()))) + }, + _ => None, } } diff --git a/src/tools/clippy/clippy_lints/src/entry.rs b/src/tools/clippy/clippy_lints/src/entry.rs index bdfe2e49e66e..75ab890a8a7f 100644 --- a/src/tools/clippy/clippy_lints/src/entry.rs +++ b/src/tools/clippy/clippy_lints/src/entry.rs @@ -4,7 +4,7 @@ use clippy_utils::ty::is_copy; use clippy_utils::visitors::for_each_expr; use clippy_utils::{ SpanlessEq, can_move_expr_to_closure_no_visit, desugar_await, higher, is_expr_final_block_expr, - is_expr_used_or_unified, paths, peel_hir_expr_while, + is_expr_used_or_unified, paths, peel_hir_expr_while, span_contains_non_whitespace, }; use core::fmt::{self, Write}; use rustc_errors::Applicability; @@ -167,7 +167,11 @@ impl<'tcx> LateLintPass<'tcx> for HashMapPass { "if let {}::{entry_kind} = {map_str}.entry({key_str}) {body_str}", map_ty.entry_path(), )) - } else if let Some(insertion) = then_search.as_single_insertion() { + } else if let Some(insertion) = then_search.as_single_insertion() + && let span_in_between = then_expr.span.shrink_to_lo().between(insertion.call.span) + && let span_in_between = span_in_between.split_at(1).1 + && !span_contains_non_whitespace(cx, span_in_between, true) + { let value_str = snippet_with_context(cx, insertion.value.span, then_expr.span.ctxt(), "..", &mut app).0; if contains_expr.negated { if insertion.value.can_have_side_effects() { diff --git a/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs b/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs index c42998ffc3f5..bd2bd6628464 100644 --- a/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs +++ b/src/tools/clippy/clippy_lints/src/fallible_impl_from.rs @@ -82,7 +82,7 @@ fn lint_impl_body(cx: &LateContext<'_>, item_def_id: hir::OwnerId, impl_span: Sp // check for `unwrap` if let Some(arglists) = method_chain_args(expr, &[sym::unwrap]) { let receiver_ty = self.typeck_results.expr_ty(arglists[0].0).peel_refs(); - if receiver_ty.is_diag_item(self.lcx, sym::Option) || receiver_ty.is_diag_item(self.lcx, sym::Result) { + if matches!(receiver_ty.opt_diag_name(self.lcx), Some(sym::Option | sym::Result)) { self.result.push(expr.span); } } diff --git a/src/tools/clippy/clippy_lints/src/format_push_string.rs b/src/tools/clippy/clippy_lints/src/format_push_string.rs index a23ba9ab837a..fea55f91bce7 100644 --- a/src/tools/clippy/clippy_lints/src/format_push_string.rs +++ b/src/tools/clippy/clippy_lints/src/format_push_string.rs @@ -1,10 +1,13 @@ use clippy_utils::diagnostics::span_lint_and_then; -use clippy_utils::higher; +use clippy_utils::macros::{FormatArgsStorage, format_args_inputs_span, root_macro_call_first_node}; use clippy_utils::res::MaybeDef; +use clippy_utils::source::{snippet_with_applicability, snippet_with_context}; +use clippy_utils::std_or_core; +use rustc_errors::Applicability; use rustc_hir::{AssignOpKind, Expr, ExprKind, LangItem, MatchSource}; -use rustc_lint::{LateContext, LateLintPass}; -use rustc_session::declare_lint_pass; -use rustc_span::sym; +use rustc_lint::{LateContext, LateLintPass, LintContext}; +use rustc_session::impl_lint_pass; +use rustc_span::{Span, sym}; declare_clippy_lint! { /// ### What it does @@ -38,7 +41,152 @@ declare_clippy_lint! { pedantic, "`format!(..)` appended to existing `String`" } -declare_lint_pass!(FormatPushString => [FORMAT_PUSH_STRING]); +impl_lint_pass!(FormatPushString => [FORMAT_PUSH_STRING]); + +pub(crate) struct FormatPushString { + format_args: FormatArgsStorage, +} + +enum FormatSearchResults { + /// The expression is itself a `format!()` invocation -- we can make a suggestion to replace it + Direct(Span), + /// The expression contains zero or more `format!()`s, e.g.: + /// ```ignore + /// if true { + /// format!("hello") + /// } else { + /// format!("world") + /// } + /// ``` + /// or + /// ```ignore + /// match true { + /// true => format!("hello"), + /// false => format!("world"), + /// } + Nested(Vec), +} + +impl FormatPushString { + pub(crate) fn new(format_args: FormatArgsStorage) -> Self { + Self { format_args } + } + + fn find_formats<'tcx>(&self, cx: &LateContext<'_>, e: &'tcx Expr<'tcx>) -> FormatSearchResults { + let expr_as_format = |e| { + if let Some(macro_call) = root_macro_call_first_node(cx, e) + && cx.tcx.is_diagnostic_item(sym::format_macro, macro_call.def_id) + && let Some(format_args) = self.format_args.get(cx, e, macro_call.expn) + { + Some(format_args_inputs_span(format_args)) + } else { + None + } + }; + + let e = e.peel_blocks().peel_borrows(); + if let Some(fmt) = expr_as_format(e) { + FormatSearchResults::Direct(fmt) + } else { + fn inner<'tcx>( + e: &'tcx Expr<'tcx>, + expr_as_format: &impl Fn(&'tcx Expr<'tcx>) -> Option, + out: &mut Vec, + ) { + let e = e.peel_blocks().peel_borrows(); + + match e.kind { + _ if expr_as_format(e).is_some() => out.push(e.span), + ExprKind::Match(_, arms, MatchSource::Normal) => { + for arm in arms { + inner(arm.body, expr_as_format, out); + } + }, + ExprKind::If(_, then, els) => { + inner(then, expr_as_format, out); + if let Some(els) = els { + inner(els, expr_as_format, out); + } + }, + _ => {}, + } + } + let mut spans = vec![]; + inner(e, &expr_as_format, &mut spans); + FormatSearchResults::Nested(spans) + } + } +} + +impl<'tcx> LateLintPass<'tcx> for FormatPushString { + fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + let (recv, arg) = match expr.kind { + ExprKind::MethodCall(_, recv, [arg], _) => { + if let Some(fn_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) + && cx.tcx.is_diagnostic_item(sym::string_push_str, fn_def_id) + { + (recv, arg) + } else { + return; + } + }, + ExprKind::AssignOp(op, recv, arg) if op.node == AssignOpKind::AddAssign && is_string(cx, recv) => { + (recv, arg) + }, + _ => return, + }; + let Some(std_or_core) = std_or_core(cx) else { + // not even `core` is available, so can't suggest `write!` + return; + }; + match self.find_formats(cx, arg) { + FormatSearchResults::Direct(format_args) => { + span_lint_and_then( + cx, + FORMAT_PUSH_STRING, + expr.span, + "`format!(..)` appended to existing `String`", + |diag| { + let mut app = Applicability::MaybeIncorrect; + let msg = "consider using `write!` to avoid the extra allocation"; + + let sugg = format!( + "let _ = write!({recv}, {format_args})", + recv = snippet_with_context(cx.sess(), recv.span, expr.span.ctxt(), "_", &mut app).0, + format_args = snippet_with_applicability(cx.sess(), format_args, "..", &mut app), + ); + diag.span_suggestion_verbose(expr.span, msg, sugg, app); + + // TODO: omit the note if the `Write` trait is imported at point + // Tip: `TyCtxt::in_scope_traits` isn't it -- it returns a non-empty list only when called on + // the `HirId` of a `ExprKind::MethodCall` that is a call of a _trait_ method. + diag.note(format!("you may need to import the `{std_or_core}::fmt::Write` trait")); + }, + ); + }, + FormatSearchResults::Nested(spans) => { + if !spans.is_empty() { + span_lint_and_then( + cx, + FORMAT_PUSH_STRING, + expr.span, + "`format!(..)` appended to existing `String`", + |diag| { + diag.help("consider using `write!` to avoid the extra allocation"); + diag.span_labels(spans, "`format!` used here"); + + // TODO: omit the note if the `Write` trait is imported at point + // Tip: `TyCtxt::in_scope_traits` isn't it -- it returns a non-empty list only when called + // on the `HirId` of a `ExprKind::MethodCall` that is a call of + // a _trait_ method. + diag.note(format!("you may need to import the `{std_or_core}::fmt::Write` trait")); + }, + ); + } + }, + } + } +} fn is_string(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { cx.typeck_results() @@ -46,54 +194,3 @@ fn is_string(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { .peel_refs() .is_lang_item(cx, LangItem::String) } -fn is_format(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { - let e = e.peel_blocks().peel_borrows(); - - if e.span.from_expansion() - && let Some(macro_def_id) = e.span.ctxt().outer_expn_data().macro_def_id - { - cx.tcx.get_diagnostic_name(macro_def_id) == Some(sym::format_macro) - } else if let Some(higher::If { then, r#else, .. }) = higher::If::hir(e) { - is_format(cx, then) || r#else.is_some_and(|e| is_format(cx, e)) - } else { - match higher::IfLetOrMatch::parse(cx, e) { - Some(higher::IfLetOrMatch::Match(_, arms, MatchSource::Normal)) => { - arms.iter().any(|arm| is_format(cx, arm.body)) - }, - Some(higher::IfLetOrMatch::IfLet(_, _, then, r#else, _)) => { - is_format(cx, then) || r#else.is_some_and(|e| is_format(cx, e)) - }, - _ => false, - } - } -} - -impl<'tcx> LateLintPass<'tcx> for FormatPushString { - fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - let arg = match expr.kind { - ExprKind::MethodCall(_, _, [arg], _) => { - if let Some(fn_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) - && cx.tcx.is_diagnostic_item(sym::string_push_str, fn_def_id) - { - arg - } else { - return; - } - }, - ExprKind::AssignOp(op, left, arg) if op.node == AssignOpKind::AddAssign && is_string(cx, left) => arg, - _ => return, - }; - if is_format(cx, arg) { - #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] - span_lint_and_then( - cx, - FORMAT_PUSH_STRING, - expr.span, - "`format!(..)` appended to existing `String`", - |diag| { - diag.help("consider using `write!` to avoid the extra allocation"); - }, - ); - } - } -} diff --git a/src/tools/clippy/clippy_lints/src/functions/mod.rs b/src/tools/clippy/clippy_lints/src/functions/mod.rs index bdc366f6878a..9a7427ea1447 100644 --- a/src/tools/clippy/clippy_lints/src/functions/mod.rs +++ b/src/tools/clippy/clippy_lints/src/functions/mod.rs @@ -596,4 +596,8 @@ impl<'tcx> LateLintPass<'tcx> for Functions { impl_trait_in_params::check_trait_item(cx, item, self.avoid_breaking_exported_api); ref_option::check_trait_item(cx, item, self.avoid_breaking_exported_api); } + + fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { + result::check_expr(cx, expr, self.large_error_threshold, &self.large_error_ignored); + } } diff --git a/src/tools/clippy/clippy_lints/src/functions/result.rs b/src/tools/clippy/clippy_lints/src/functions/result.rs index 04e15a1d8a0e..77fec9371425 100644 --- a/src/tools/clippy/clippy_lints/src/functions/result.rs +++ b/src/tools/clippy/clippy_lints/src/functions/result.rs @@ -50,7 +50,7 @@ pub(super) fn check_item<'tcx>( let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); check_result_unit_err(cx, err_ty, fn_header_span, msrv); } - check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored); + check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); } } @@ -70,7 +70,7 @@ pub(super) fn check_impl_item<'tcx>( let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); check_result_unit_err(cx, err_ty, fn_header_span, msrv); } - check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored); + check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); } } @@ -87,7 +87,7 @@ pub(super) fn check_trait_item<'tcx>( if cx.effective_visibilities.is_exported(item.owner_id.def_id) { check_result_unit_err(cx, err_ty, fn_header_span, msrv); } - check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored); + check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); } } } @@ -111,12 +111,15 @@ fn check_result_large_err<'tcx>( hir_ty_span: Span, large_err_threshold: u64, large_err_ignored: &DefIdSet, + is_closure: bool, ) { if let ty::Adt(adt, _) = err_ty.kind() && large_err_ignored.contains(&adt.did()) { return; } + + let subject = if is_closure { "closure" } else { "function" }; if let ty::Adt(adt, subst) = err_ty.kind() && let Some(local_def_id) = adt.did().as_local() && let hir::Node::Item(item) = cx.tcx.hir_node_by_def_id(local_def_id) @@ -130,7 +133,7 @@ fn check_result_large_err<'tcx>( cx, RESULT_LARGE_ERR, hir_ty_span, - "the `Err`-variant returned from this function is very large", + format!("the `Err`-variant returned from this {subject} is very large"), |diag| { diag.span_label( def.variants[first_variant.ind].span, @@ -161,7 +164,7 @@ fn check_result_large_err<'tcx>( cx, RESULT_LARGE_ERR, hir_ty_span, - "the `Err`-variant returned from this function is very large", + format!("the `Err`-variant returned from this {subject} is very large"), |diag: &mut Diag<'_, ()>| { diag.span_label(hir_ty_span, format!("the `Err`-variant is at least {ty_size} bytes")); diag.help(format!("try reducing the size of `{err_ty}`, for example by boxing large elements or replacing it with `Box<{err_ty}>`")); @@ -170,3 +173,33 @@ fn check_result_large_err<'tcx>( } } } + +pub(super) fn check_expr<'tcx>( + cx: &LateContext<'tcx>, + expr: &'tcx hir::Expr<'tcx>, + large_err_threshold: u64, + large_err_ignored: &DefIdSet, +) { + if let hir::ExprKind::Closure(closure) = expr.kind + && let ty::Closure(_, args) = cx.typeck_results().expr_ty(expr).kind() + && let closure_sig = args.as_closure().sig() + && let Ok(err_binder) = closure_sig.output().try_map_bound(|output_ty| { + if let ty::Adt(adt, args) = output_ty.kind() + && let [_, err_arg] = args.as_slice() + && let Some(err_ty) = err_arg.as_type() + && adt.is_diag_item(cx, sym::Result) + { + return Ok(err_ty); + } + + Err(()) + }) + { + let err_ty = cx.tcx.instantiate_bound_regions_with_erased(err_binder); + let hir_ty_span = match closure.fn_decl.output { + hir::FnRetTy::Return(hir_ty) => hir_ty.span, + hir::FnRetTy::DefaultReturn(_) => expr.span, + }; + check_result_large_err(cx, err_ty, hir_ty_span, large_err_threshold, large_err_ignored, true); + } +} diff --git a/src/tools/clippy/clippy_lints/src/if_not_else.rs b/src/tools/clippy/clippy_lints/src/if_not_else.rs index 54e9538fcb99..ff22ba4fcd0d 100644 --- a/src/tools/clippy/clippy_lints/src/if_not_else.rs +++ b/src/tools/clippy/clippy_lints/src/if_not_else.rs @@ -1,7 +1,7 @@ use clippy_utils::consts::is_zero_integer_const; use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_sugg}; use clippy_utils::is_else_clause; -use clippy_utils::source::{HasSession, indent_of, reindent_multiline, snippet}; +use clippy_utils::source::{HasSession, indent_of, reindent_multiline, snippet_with_context}; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; use rustc_lint::{LateContext, LateLintPass}; @@ -78,6 +78,7 @@ impl LateLintPass<'_> for IfNotElse { // } // ``` if !e.span.from_expansion() && !is_else_clause(cx.tcx, e) { + let mut applicability = Applicability::MachineApplicable; match cond.kind { ExprKind::Unary(UnOp::Not, _) | ExprKind::Binary(_, _, _) => span_lint_and_sugg( cx, @@ -85,8 +86,16 @@ impl LateLintPass<'_> for IfNotElse { e.span, msg, "try", - make_sugg(cx, &cond.kind, cond_inner.span, els.span, "..", Some(e.span)), - Applicability::MachineApplicable, + make_sugg( + cx, + e.span, + &cond.kind, + cond_inner.span, + els.span, + "..", + &mut applicability, + ), + applicability, ), _ => span_lint_and_help(cx, IF_NOT_ELSE, e.span, msg, None, help), } @@ -97,28 +106,26 @@ impl LateLintPass<'_> for IfNotElse { fn make_sugg<'a>( sess: &impl HasSession, + expr_span: Span, cond_kind: &'a ExprKind<'a>, cond_inner: Span, els_span: Span, default: &'a str, - indent_relative_to: Option, + applicability: &mut Applicability, ) -> String { - let cond_inner_snip = snippet(sess, cond_inner, default); - let els_snip = snippet(sess, els_span, default); - let indent = indent_relative_to.and_then(|s| indent_of(sess, s)); + let (cond_inner_snip, _) = snippet_with_context(sess, cond_inner, expr_span.ctxt(), default, applicability); + let (els_snip, _) = snippet_with_context(sess, els_span, expr_span.ctxt(), default, applicability); + let indent = indent_of(sess, expr_span); let suggestion = match cond_kind { ExprKind::Unary(UnOp::Not, cond_rest) => { - format!( - "if {} {} else {}", - snippet(sess, cond_rest.span, default), - els_snip, - cond_inner_snip - ) + let (cond_rest_snip, _) = + snippet_with_context(sess, cond_rest.span, expr_span.ctxt(), default, applicability); + format!("if {cond_rest_snip} {els_snip} else {cond_inner_snip}") }, ExprKind::Binary(_, lhs, rhs) => { - let lhs_snip = snippet(sess, lhs.span, default); - let rhs_snip = snippet(sess, rhs.span, default); + let (lhs_snip, _) = snippet_with_context(sess, lhs.span, expr_span.ctxt(), default, applicability); + let (rhs_snip, _) = snippet_with_context(sess, rhs.span, expr_span.ctxt(), default, applicability); format!("if {lhs_snip} == {rhs_snip} {els_snip} else {cond_inner_snip}") }, diff --git a/src/tools/clippy/clippy_lints/src/if_then_some_else_none.rs b/src/tools/clippy/clippy_lints/src/if_then_some_else_none.rs index 7f3ef58c93d1..9e5e4fa58d2f 100644 --- a/src/tools/clippy/clippy_lints/src/if_then_some_else_none.rs +++ b/src/tools/clippy/clippy_lints/src/if_then_some_else_none.rs @@ -4,10 +4,12 @@ use clippy_utils::eager_or_lazy::switch_to_eager_eval; use clippy_utils::msrvs::{self, Msrv}; use clippy_utils::source::{snippet_with_applicability, snippet_with_context, walk_span_to_context}; use clippy_utils::sugg::Sugg; +use clippy_utils::visitors::for_each_expr_without_closures; use clippy_utils::{ - as_some_expr, contains_return, expr_adjustment_requires_coercion, higher, is_else_clause, is_in_const_context, - is_none_expr, peel_blocks, sym, + as_some_expr, expr_adjustment_requires_coercion, higher, is_else_clause, is_in_const_context, is_none_expr, + peel_blocks, sym, }; +use core::ops::ControlFlow; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; @@ -76,8 +78,14 @@ impl<'tcx> LateLintPass<'tcx> for IfThenSomeElseNone { && !is_else_clause(cx.tcx, expr) && !is_in_const_context(cx) && self.msrv.meets(cx, msrvs::BOOL_THEN) - && !contains_return(then_block.stmts) - && then_block.expr.is_none_or(|expr| !contains_return(expr)) + && for_each_expr_without_closures(then_block, |e| { + if matches!(e.kind, ExprKind::Ret(..) | ExprKind::Yield(..)) { + ControlFlow::Break(()) + } else { + ControlFlow::Continue(()) + } + }) + .is_none() { let method_name = if switch_to_eager_eval(cx, expr) && self.msrv.meets(cx, msrvs::BOOL_THEN_SOME) { sym::then_some @@ -101,13 +109,19 @@ impl<'tcx> LateLintPass<'tcx> for IfThenSomeElseNone { .maybe_paren() .to_string(); let arg_snip = snippet_with_context(cx, then_arg.span, ctxt, "[body]", &mut app).0; - let method_body = if let Some(first_stmt) = then_block.stmts.first() - && let Some(first_stmt_span) = walk_span_to_context(first_stmt.span, ctxt) + let method_body = if let Some(_) = then_block.stmts.first() + && let Some(then_span) = walk_span_to_context(then.span, ctxt) { - let block_snippet = - snippet_with_applicability(cx, first_stmt_span.until(then_expr.span), "..", &mut app); + let block_before_snippet = + snippet_with_applicability(cx, then_span.until(then_expr.span), "..", &mut app); + let block_after_snippet = snippet_with_applicability( + cx, + then_expr.span.shrink_to_hi().until(then_span.shrink_to_hi()), + "..", + &mut app, + ); let closure = if method_name == sym::then { "|| " } else { "" }; - format!("{closure} {{ {} {arg_snip} }}", block_snippet.trim_end()) + format!("{closure}{block_before_snippet}{arg_snip}{block_after_snippet}") } else if method_name == sym::then { (std::borrow::Cow::Borrowed("|| ") + arg_snip).into_owned() } else { diff --git a/src/tools/clippy/clippy_lints/src/ifs/branches_sharing_code.rs b/src/tools/clippy/clippy_lints/src/ifs/branches_sharing_code.rs index b3f597cc8736..b6e8d047c5cd 100644 --- a/src/tools/clippy/clippy_lints/src/ifs/branches_sharing_code.rs +++ b/src/tools/clippy/clippy_lints/src/ifs/branches_sharing_code.rs @@ -9,7 +9,7 @@ use clippy_utils::{ use core::iter; use core::ops::ControlFlow; use rustc_errors::Applicability; -use rustc_hir::{Block, Expr, ExprKind, HirId, HirIdSet, LetStmt, Node, Stmt, StmtKind, intravisit}; +use rustc_hir::{Block, Expr, ExprKind, HirId, HirIdSet, ItemKind, LetStmt, Node, Stmt, StmtKind, UseKind, intravisit}; use rustc_lint::LateContext; use rustc_span::hygiene::walk_chain; use rustc_span::source_map::SourceMap; @@ -108,6 +108,7 @@ struct BlockEq { /// The name and id of every local which can be moved at the beginning and the end. moved_locals: Vec<(HirId, Symbol)>, } + impl BlockEq { fn start_span(&self, b: &Block<'_>, sm: &SourceMap) -> Option { match &b.stmts[..self.start_end_eq] { @@ -129,20 +130,33 @@ impl BlockEq { } /// If the statement is a local, checks if the bound names match the expected list of names. -fn eq_binding_names(s: &Stmt<'_>, names: &[(HirId, Symbol)]) -> bool { - if let StmtKind::Let(l) = s.kind { - let mut i = 0usize; - let mut res = true; - l.pat.each_binding_or_first(&mut |_, _, _, name| { - if names.get(i).is_some_and(|&(_, n)| n == name.name) { - i += 1; - } else { - res = false; - } - }); - res && i == names.len() - } else { - false +fn eq_binding_names(cx: &LateContext<'_>, s: &Stmt<'_>, names: &[(HirId, Symbol)]) -> bool { + match s.kind { + StmtKind::Let(l) => { + let mut i = 0usize; + let mut res = true; + l.pat.each_binding_or_first(&mut |_, _, _, name| { + if names.get(i).is_some_and(|&(_, n)| n == name.name) { + i += 1; + } else { + res = false; + } + }); + res && i == names.len() + }, + StmtKind::Item(item_id) + if let [(_, name)] = names + && let item = cx.tcx.hir_item(item_id) + && let ItemKind::Static(_, ident, ..) + | ItemKind::Const(ident, ..) + | ItemKind::Fn { ident, .. } + | ItemKind::TyAlias(ident, ..) + | ItemKind::Use(_, UseKind::Single(ident)) + | ItemKind::Mod(ident, _) = item.kind => + { + *name == ident.name + }, + _ => false, } } @@ -164,6 +178,7 @@ fn modifies_any_local<'tcx>(cx: &LateContext<'tcx>, s: &'tcx Stmt<'_>, locals: & /// Checks if the given statement should be considered equal to the statement in the same /// position for each block. fn eq_stmts( + cx: &LateContext<'_>, stmt: &Stmt<'_>, blocks: &[&Block<'_>], get_stmt: impl for<'a> Fn(&'a Block<'a>) -> Option<&'a Stmt<'a>>, @@ -178,7 +193,7 @@ fn eq_stmts( let new_bindings = &moved_bindings[old_count..]; blocks .iter() - .all(|b| get_stmt(b).is_some_and(|s| eq_binding_names(s, new_bindings))) + .all(|b| get_stmt(b).is_some_and(|s| eq_binding_names(cx, s, new_bindings))) } else { true }) && blocks.iter().all(|b| get_stmt(b).is_some_and(|s| eq.eq_stmt(s, stmt))) @@ -218,7 +233,7 @@ fn scan_block_for_eq<'tcx>( return true; } modifies_any_local(cx, stmt, &cond_locals) - || !eq_stmts(stmt, blocks, |b| b.stmts.get(i), &mut eq, &mut moved_locals) + || !eq_stmts(cx, stmt, blocks, |b| b.stmts.get(i), &mut eq, &mut moved_locals) }) .map_or(block.stmts.len(), |(i, stmt)| { adjust_by_closest_callsite(i, stmt, block.stmts[..i].iter().enumerate().rev()) @@ -279,6 +294,7 @@ fn scan_block_for_eq<'tcx>( })) .fold(end_search_start, |init, (stmt, offset)| { if eq_stmts( + cx, stmt, blocks, |b| b.stmts.get(b.stmts.len() - offset), @@ -290,11 +306,26 @@ fn scan_block_for_eq<'tcx>( // Clear out all locals seen at the end so far. None of them can be moved. let stmts = &blocks[0].stmts; for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] { - if let StmtKind::Let(l) = stmt.kind { - l.pat.each_binding_or_first(&mut |_, id, _, _| { - // FIXME(rust/#120456) - is `swap_remove` correct? - eq.locals.swap_remove(&id); - }); + match stmt.kind { + StmtKind::Let(l) => { + l.pat.each_binding_or_first(&mut |_, id, _, _| { + // FIXME(rust/#120456) - is `swap_remove` correct? + eq.locals.swap_remove(&id); + }); + }, + StmtKind::Item(item_id) => { + let item = cx.tcx.hir_item(item_id); + if let ItemKind::Static(..) + | ItemKind::Const(..) + | ItemKind::Fn { .. } + | ItemKind::TyAlias(..) + | ItemKind::Use(..) + | ItemKind::Mod(..) = item.kind + { + eq.local_items.swap_remove(&item.owner_id.to_def_id()); + } + }, + _ => {}, } } moved_locals.truncate(moved_locals_at_start); diff --git a/src/tools/clippy/clippy_lints/src/implicit_hasher.rs b/src/tools/clippy/clippy_lints/src/implicit_hasher.rs index 638a08b096db..9dc74a157cbf 100644 --- a/src/tools/clippy/clippy_lints/src/implicit_hasher.rs +++ b/src/tools/clippy/clippy_lints/src/implicit_hasher.rs @@ -223,25 +223,20 @@ impl<'tcx> ImplicitHasherType<'tcx> { _ => None, }) .collect(); - let params_len = params.len(); let ty = lower_ty(cx.tcx, hir_ty); - if ty.is_diag_item(cx, sym::HashMap) && params_len == 2 { - Some(ImplicitHasherType::HashMap( + match (ty.opt_diag_name(cx), ¶ms[..]) { + (Some(sym::HashMap), [k, v]) => Some(ImplicitHasherType::HashMap( hir_ty.span, ty, - snippet(cx, params[0].span, "K"), - snippet(cx, params[1].span, "V"), - )) - } else if ty.is_diag_item(cx, sym::HashSet) && params_len == 1 { - Some(ImplicitHasherType::HashSet( - hir_ty.span, - ty, - snippet(cx, params[0].span, "T"), - )) - } else { - None + snippet(cx, k.span, "K"), + snippet(cx, v.span, "V"), + )), + (Some(sym::HashSet), [t]) => { + Some(ImplicitHasherType::HashSet(hir_ty.span, ty, snippet(cx, t.span, "T"))) + }, + _ => None, } } else { None diff --git a/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs b/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs index c3bc9048c23a..e0149a23fccf 100644 --- a/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs +++ b/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs @@ -9,6 +9,8 @@ use rustc_middle::ty::{self, TyCtxt}; use rustc_session::impl_lint_pass; use rustc_span::def_id::{CrateNum, DefId}; use rustc_span::{ExpnKind, Span}; +use rustc_hir::attrs::AttributeKind; +use rustc_hir::find_attr; declare_clippy_lint! { /// ### What it does @@ -268,11 +270,6 @@ impl<'tcx> LateLintPass<'tcx> for IncompatibleMsrv { /// attribute. fn is_under_cfg_attribute(cx: &LateContext<'_>, hir_id: HirId) -> bool { cx.tcx.hir_parent_id_iter(hir_id).any(|id| { - cx.tcx.hir_attrs(id).iter().any(|attr| { - matches!( - attr.ident().map(|ident| ident.name), - Some(sym::cfg_trace | sym::cfg_attr_trace) - ) - }) + find_attr!(cx.tcx.hir_attrs(id), AttributeKind::CfgTrace(..) | AttributeKind::CfgAttrTrace) }) } diff --git a/src/tools/clippy/clippy_lints/src/large_include_file.rs b/src/tools/clippy/clippy_lints/src/large_include_file.rs index 48ce1afc6e69..5c37747b8c9b 100644 --- a/src/tools/clippy/clippy_lints/src/large_include_file.rs +++ b/src/tools/clippy/clippy_lints/src/large_include_file.rs @@ -1,3 +1,4 @@ +use rustc_ast::AttrItemKind; use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::macros::root_macro_call_first_node; @@ -92,7 +93,7 @@ impl EarlyLintPass for LargeIncludeFile { && let AttrKind::Normal(ref item) = attr.kind && let Some(doc) = attr.doc_str() && doc.as_str().len() as u64 > self.max_file_size - && let AttrArgs::Eq { expr: meta, .. } = &item.item.args + && let AttrItemKind::Unparsed(AttrArgs::Eq { expr: meta, .. }) = &item.item.args && !attr.span.contains(meta.span) // Since the `include_str` is already expanded at this point, we can only take the // whole attribute snippet and then modify for our suggestion. diff --git a/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs b/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs index 620e27fa67c6..261b03abba17 100644 --- a/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs +++ b/src/tools/clippy/clippy_lints/src/large_stack_arrays.rs @@ -126,7 +126,7 @@ fn might_be_expanded<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> bool { let ExprKind::Repeat(_, len_ct) = expr.kind else { return false; }; - !expr.span.contains(len_ct.span()) + !expr.span.contains(len_ct.span) } expr.span.from_expansion() || is_from_proc_macro(cx, expr) || repeat_expr_might_be_expanded(expr) diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs index 40487fe48f22..a957afdb1910 100644 --- a/src/tools/clippy/clippy_lints/src/lib.rs +++ b/src/tools/clippy/clippy_lints/src/lib.rs @@ -318,6 +318,7 @@ mod replace_box; mod reserve_after_initialization; mod return_self_not_must_use; mod returns; +mod same_length_and_capacity; mod same_name_method; mod self_named_constructors; mod semicolon_block; @@ -739,7 +740,10 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co Box::new(move |_| Box::new(cargo::Cargo::new(conf))), Box::new(|_| Box::new(empty_with_brackets::EmptyWithBrackets::default())), Box::new(|_| Box::new(unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings)), - Box::new(|_| Box::new(format_push_string::FormatPushString)), + { + let format_args = format_args_storage.clone(); + Box::new(move |_| Box::new(format_push_string::FormatPushString::new(format_args.clone()))) + }, Box::new(move |_| Box::new(large_include_file::LargeIncludeFile::new(conf))), Box::new(|_| Box::new(strings::TrimSplitWhitespace)), Box::new(|_| Box::new(rc_clone_in_vec_init::RcCloneInVecInit)), @@ -852,6 +856,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co Box::new(|_| Box::new(volatile_composites::VolatileComposites)), Box::new(|_| Box::::default()), Box::new(move |_| Box::new(manual_ilog2::ManualIlog2::new(conf))), + Box::new(|_| Box::new(same_length_and_capacity::SameLengthAndCapacity)), // add late passes here, used by `cargo dev new_lint` ]; store.late_passes.extend(late_lints); diff --git a/src/tools/clippy/clippy_lints/src/loops/for_kv_map.rs b/src/tools/clippy/clippy_lints/src/loops/for_kv_map.rs index c6b650a1a88b..39b2391c98ec 100644 --- a/src/tools/clippy/clippy_lints/src/loops/for_kv_map.rs +++ b/src/tools/clippy/clippy_lints/src/loops/for_kv_map.rs @@ -34,7 +34,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>, arg: &'tcx _ => arg, }; - if ty.is_diag_item(cx, sym::HashMap) || ty.is_diag_item(cx, sym::BTreeMap) { + if matches!(ty.opt_diag_name(cx), Some(sym::HashMap | sym::BTreeMap)) { span_lint_and_then( cx, FOR_KV_MAP, diff --git a/src/tools/clippy/clippy_lints/src/loops/mod.rs b/src/tools/clippy/clippy_lints/src/loops/mod.rs index 21198c3c8bc2..ddc783069385 100644 --- a/src/tools/clippy/clippy_lints/src/loops/mod.rs +++ b/src/tools/clippy/clippy_lints/src/loops/mod.rs @@ -26,6 +26,7 @@ mod while_let_on_iterator; use clippy_config::Conf; use clippy_utils::msrvs::Msrv; +use clippy_utils::res::{MaybeDef, MaybeTypeckRes}; use clippy_utils::{higher, sym}; use rustc_ast::Label; use rustc_hir::{Expr, ExprKind, LoopSource, Pat}; @@ -881,13 +882,44 @@ impl<'tcx> LateLintPass<'tcx> for Loops { manual_while_let_some::check(cx, condition, body, span); } - if let ExprKind::MethodCall(path, recv, [arg], _) = expr.kind - && matches!( - path.ident.name, - sym::all | sym::any | sym::filter_map | sym::find_map | sym::flat_map | sym::for_each | sym::map - ) - { - unused_enumerate_index::check_method(cx, expr, recv, arg); + if let ExprKind::MethodCall(path, recv, args, _) = expr.kind { + let name = path.ident.name; + + let is_iterator_method = || { + cx.ty_based_def(expr) + .assoc_fn_parent(cx) + .is_diag_item(cx, sym::Iterator) + }; + + // is_iterator_method is a bit expensive, so we call it last in each match arm + match (name, args) { + (sym::for_each | sym::all | sym::any, [arg]) => { + if let ExprKind::Closure(closure) = arg.kind + && is_iterator_method() + { + unused_enumerate_index::check_method(cx, recv, arg, closure); + never_loop::check_iterator_reduction(cx, expr, recv, closure); + } + }, + + (sym::filter_map | sym::find_map | sym::flat_map | sym::map, [arg]) => { + if let ExprKind::Closure(closure) = arg.kind + && is_iterator_method() + { + unused_enumerate_index::check_method(cx, recv, arg, closure); + } + }, + + (sym::try_for_each | sym::reduce, [arg]) | (sym::fold | sym::try_fold, [_, arg]) => { + if let ExprKind::Closure(closure) = arg.kind + && is_iterator_method() + { + never_loop::check_iterator_reduction(cx, expr, recv, closure); + } + }, + + _ => {}, + } } } } diff --git a/src/tools/clippy/clippy_lints/src/loops/never_loop.rs b/src/tools/clippy/clippy_lints/src/loops/never_loop.rs index 0d37be17689a..a037af3433c3 100644 --- a/src/tools/clippy/clippy_lints/src/loops/never_loop.rs +++ b/src/tools/clippy/clippy_lints/src/loops/never_loop.rs @@ -3,14 +3,16 @@ use super::utils::make_iterator_snippet; use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::higher::ForLoop; use clippy_utils::macros::root_macro_call_first_node; -use clippy_utils::source::snippet; +use clippy_utils::source::{snippet, snippet_with_context}; +use clippy_utils::sym; use clippy_utils::visitors::{Descend, for_each_expr_without_closures}; use rustc_errors::Applicability; use rustc_hir::{ - Block, Destination, Expr, ExprKind, HirId, InlineAsm, InlineAsmOperand, Node, Pat, Stmt, StmtKind, StructTailExpr, + Block, Closure, Destination, Expr, ExprKind, HirId, InlineAsm, InlineAsmOperand, Node, Pat, Stmt, StmtKind, + StructTailExpr, }; use rustc_lint::LateContext; -use rustc_span::{BytePos, Span, sym}; +use rustc_span::{BytePos, Span}; use std::iter::once; use std::ops::ControlFlow; @@ -72,6 +74,31 @@ pub(super) fn check<'tcx>( } } +pub(super) fn check_iterator_reduction<'tcx>( + cx: &LateContext<'tcx>, + expr: &'tcx Expr<'tcx>, + recv: &'tcx Expr<'tcx>, + closure: &'tcx Closure<'tcx>, +) { + let closure_body = cx.tcx.hir_body(closure.body).value; + let body_ty = cx.typeck_results().expr_ty(closure_body); + if body_ty.is_never() { + span_lint_and_then( + cx, + NEVER_LOOP, + expr.span, + "this iterator reduction never loops (closure always diverges)", + |diag| { + let mut app = Applicability::HasPlaceholders; + let recv_snip = snippet_with_context(cx, recv.span, expr.span.ctxt(), "", &mut app).0; + diag.note("if you only need one element, `if let Some(x) = iter.next()` is clearer"); + let sugg = format!("if let Some(x) = {recv_snip}.next() {{ ... }}"); + diag.span_suggestion_verbose(expr.span, "consider this pattern", sugg, app); + }, + ); + } +} + fn contains_any_break_or_continue(block: &Block<'_>) -> bool { for_each_expr_without_closures(block, |e| match e.kind { ExprKind::Break(..) | ExprKind::Continue(..) => ControlFlow::Break(()), diff --git a/src/tools/clippy/clippy_lints/src/loops/unused_enumerate_index.rs b/src/tools/clippy/clippy_lints/src/loops/unused_enumerate_index.rs index 82ded453616d..816273c7ba8b 100644 --- a/src/tools/clippy/clippy_lints/src/loops/unused_enumerate_index.rs +++ b/src/tools/clippy/clippy_lints/src/loops/unused_enumerate_index.rs @@ -1,10 +1,10 @@ use super::UNUSED_ENUMERATE_INDEX; use clippy_utils::diagnostics::span_lint_hir_and_then; -use clippy_utils::res::{MaybeDef, MaybeTypeckRes}; +use clippy_utils::res::MaybeDef; use clippy_utils::source::{SpanRangeExt, walk_span_to_context}; use clippy_utils::{expr_or_init, pat_is_wild}; use rustc_errors::Applicability; -use rustc_hir::{Expr, ExprKind, Pat, PatKind, TyKind}; +use rustc_hir::{Closure, Expr, ExprKind, Pat, PatKind, TyKind}; use rustc_lint::LateContext; use rustc_span::{Span, SyntaxContext, sym}; @@ -60,14 +60,12 @@ pub(super) fn check<'tcx>( pub(super) fn check_method<'tcx>( cx: &LateContext<'tcx>, - e: &'tcx Expr<'tcx>, recv: &'tcx Expr<'tcx>, arg: &'tcx Expr<'tcx>, + closure: &'tcx Closure<'tcx>, ) { - if let ExprKind::Closure(closure) = arg.kind - && let body = cx.tcx.hir_body(closure.body) - && let [param] = body.params - && cx.ty_based_def(e).opt_parent(cx).is_diag_item(cx, sym::Iterator) + let body = cx.tcx.hir_body(closure.body); + if let [param] = body.params && let [input] = closure.fn_decl.inputs && !arg.span.from_expansion() && !input.span.from_expansion() diff --git a/src/tools/clippy/clippy_lints/src/manual_let_else.rs b/src/tools/clippy/clippy_lints/src/manual_let_else.rs index 0f3d8b336675..38ee4ce104a5 100644 --- a/src/tools/clippy/clippy_lints/src/manual_let_else.rs +++ b/src/tools/clippy/clippy_lints/src/manual_let_else.rs @@ -374,7 +374,7 @@ fn pat_allowed_for_else(cx: &LateContext<'_>, pat: &'_ Pat<'_>, check_types: boo } let ty = typeck_results.pat_ty(pat); // Option and Result are allowed, everything else isn't. - if !(ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result)) { + if !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) { has_disallowed = true; } }); diff --git a/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs b/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs index 89411115f730..c26b2dbde7fc 100644 --- a/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs +++ b/src/tools/clippy/clippy_lints/src/matches/match_like_matches.rs @@ -3,7 +3,7 @@ use super::REDUNDANT_PATTERN_MATCHING; use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::higher::has_let_expr; -use clippy_utils::source::snippet_with_applicability; +use clippy_utils::source::{snippet_with_applicability, snippet_with_context}; use clippy_utils::{is_lint_allowed, is_wild, span_contains_comment}; use rustc_ast::LitKind; use rustc_errors::Applicability; @@ -44,6 +44,8 @@ pub(crate) fn check_if_let<'tcx>( { ex_new = ex_inner; } + + let (snippet, _) = snippet_with_context(cx, ex_new.span, expr.span.ctxt(), "..", &mut applicability); span_lint_and_then( cx, MATCH_LIKE_MATCHES_MACRO, @@ -53,11 +55,7 @@ pub(crate) fn check_if_let<'tcx>( diag.span_suggestion_verbose( expr.span, "use `matches!` directly", - format!( - "{}matches!({}, {pat})", - if b0 { "" } else { "!" }, - snippet_with_applicability(cx, ex_new.span, "..", &mut applicability), - ), + format!("{}matches!({snippet}, {pat})", if b0 { "" } else { "!" }), applicability, ); }, @@ -178,6 +176,8 @@ pub(super) fn check_match<'tcx>( { ex_new = ex_inner; } + + let (snippet, _) = snippet_with_context(cx, ex_new.span, e.span.ctxt(), "..", &mut applicability); span_lint_and_then( cx, MATCH_LIKE_MATCHES_MACRO, @@ -187,11 +187,7 @@ pub(super) fn check_match<'tcx>( diag.span_suggestion_verbose( e.span, "use `matches!` directly", - format!( - "{}matches!({}, {pat_and_guard})", - if b0 { "" } else { "!" }, - snippet_with_applicability(cx, ex_new.span, "..", &mut applicability), - ), + format!("{}matches!({snippet}, {pat_and_guard})", if b0 { "" } else { "!" },), applicability, ); }, diff --git a/src/tools/clippy/clippy_lints/src/matches/match_wild_enum.rs b/src/tools/clippy/clippy_lints/src/matches/match_wild_enum.rs index fa44a56af182..00bd1c2ca698 100644 --- a/src/tools/clippy/clippy_lints/src/matches/match_wild_enum.rs +++ b/src/tools/clippy/clippy_lints/src/matches/match_wild_enum.rs @@ -16,7 +16,7 @@ pub(crate) fn check(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>]) { let ty = cx.typeck_results().expr_ty(ex).peel_refs(); let adt_def = match ty.kind() { ty::Adt(adt_def, _) - if adt_def.is_enum() && !(ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result)) => + if adt_def.is_enum() && !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) => { adt_def }, diff --git a/src/tools/clippy/clippy_lints/src/methods/expect_fun_call.rs b/src/tools/clippy/clippy_lints/src/methods/expect_fun_call.rs index 288f966991ac..e891b2ac6d64 100644 --- a/src/tools/clippy/clippy_lints/src/methods/expect_fun_call.rs +++ b/src/tools/clippy/clippy_lints/src/methods/expect_fun_call.rs @@ -26,12 +26,10 @@ pub(super) fn check<'tcx>( let arg_root = get_arg_root(cx, arg); if contains_call(cx, arg_root) && !contains_return(arg_root) { let receiver_type = cx.typeck_results().expr_ty_adjusted(receiver); - let closure_args = if receiver_type.is_diag_item(cx, sym::Option) { - "||" - } else if receiver_type.is_diag_item(cx, sym::Result) { - "|_|" - } else { - return; + let closure_args = match receiver_type.opt_diag_name(cx) { + Some(sym::Option) => "||", + Some(sym::Result) => "|_|", + _ => return, }; let span_replace_word = method_span.with_hi(expr.span.hi()); diff --git a/src/tools/clippy/clippy_lints/src/methods/is_empty.rs b/src/tools/clippy/clippy_lints/src/methods/is_empty.rs index add01b6a0837..834456ff6668 100644 --- a/src/tools/clippy/clippy_lints/src/methods/is_empty.rs +++ b/src/tools/clippy/clippy_lints/src/methods/is_empty.rs @@ -5,7 +5,8 @@ use clippy_utils::res::MaybeResPath; use clippy_utils::{find_binding_init, get_parent_expr, is_inside_always_const_context}; use rustc_hir::{Expr, HirId}; use rustc_lint::{LateContext, LintContext}; -use rustc_span::sym; +use rustc_hir::attrs::AttributeKind; +use rustc_hir::find_attr; use super::CONST_IS_EMPTY; @@ -40,7 +41,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &'_ Expr<'_>, receiver: &Expr<'_ fn is_under_cfg(cx: &LateContext<'_>, id: HirId) -> bool { cx.tcx .hir_parent_id_iter(id) - .any(|id| cx.tcx.hir_attrs(id).iter().any(|attr| attr.has_name(sym::cfg_trace))) + .any(|id| find_attr!(cx.tcx.hir_attrs(id), AttributeKind::CfgTrace(..))) } /// Similar to [`clippy_utils::expr_or_init`], but does not go up the chain if the initialization diff --git a/src/tools/clippy/clippy_lints/src/methods/iter_count.rs b/src/tools/clippy/clippy_lints/src/methods/iter_count.rs index ea2508cd7f38..8b303c0ca5b2 100644 --- a/src/tools/clippy/clippy_lints/src/methods/iter_count.rs +++ b/src/tools/clippy/clippy_lints/src/methods/iter_count.rs @@ -11,26 +11,17 @@ use super::ITER_COUNT; pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, recv: &'tcx Expr<'tcx>, iter_method: Symbol) { let ty = cx.typeck_results().expr_ty(recv); - let caller_type = if derefs_to_slice(cx, recv, ty).is_some() { - "slice" - } else if ty.is_diag_item(cx, sym::Vec) { - "Vec" - } else if ty.is_diag_item(cx, sym::VecDeque) { - "VecDeque" - } else if ty.is_diag_item(cx, sym::HashSet) { - "HashSet" - } else if ty.is_diag_item(cx, sym::HashMap) { - "HashMap" - } else if ty.is_diag_item(cx, sym::BTreeMap) { - "BTreeMap" - } else if ty.is_diag_item(cx, sym::BTreeSet) { - "BTreeSet" - } else if ty.is_diag_item(cx, sym::LinkedList) { - "LinkedList" - } else if ty.is_diag_item(cx, sym::BinaryHeap) { - "BinaryHeap" - } else { - return; + let caller_type = match ty.opt_diag_name(cx) { + _ if derefs_to_slice(cx, recv, ty).is_some() => "slice", + Some(sym::Vec) => "Vec", + Some(sym::VecDeque) => "VecDeque", + Some(sym::HashSet) => "HashSet", + Some(sym::HashMap) => "HashMap", + Some(sym::BTreeMap) => "BTreeMap", + Some(sym::BTreeSet) => "BTreeSet", + Some(sym::LinkedList) => "LinkedList", + Some(sym::BinaryHeap) => "BinaryHeap", + _ => return, }; let mut applicability = Applicability::MachineApplicable; span_lint_and_sugg( diff --git a/src/tools/clippy/clippy_lints/src/methods/iter_kv_map.rs b/src/tools/clippy/clippy_lints/src/methods/iter_kv_map.rs index 2d6bc36dc535..16db8663941e 100644 --- a/src/tools/clippy/clippy_lints/src/methods/iter_kv_map.rs +++ b/src/tools/clippy/clippy_lints/src/methods/iter_kv_map.rs @@ -38,7 +38,7 @@ pub(super) fn check<'tcx>( _ => return, } && let ty = cx.typeck_results().expr_ty_adjusted(recv).peel_refs() - && (ty.is_diag_item(cx, sym::HashMap) || ty.is_diag_item(cx, sym::BTreeMap)) + && matches!(ty.opt_diag_name(cx), Some(sym::HashMap | sym::BTreeMap)) { let mut applicability = rustc_errors::Applicability::MachineApplicable; let recv_snippet = snippet_with_applicability(cx, recv.span, "map", &mut applicability); diff --git a/src/tools/clippy/clippy_lints/src/methods/join_absolute_paths.rs b/src/tools/clippy/clippy_lints/src/methods/join_absolute_paths.rs index e84b7452c758..905a58afa795 100644 --- a/src/tools/clippy/clippy_lints/src/methods/join_absolute_paths.rs +++ b/src/tools/clippy/clippy_lints/src/methods/join_absolute_paths.rs @@ -13,7 +13,7 @@ use super::JOIN_ABSOLUTE_PATHS; pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, recv: &'tcx Expr<'tcx>, join_arg: &'tcx Expr<'tcx>, expr_span: Span) { let ty = cx.typeck_results().expr_ty(recv).peel_refs(); - if (ty.is_diag_item(cx, sym::Path) || ty.is_diag_item(cx, sym::PathBuf)) + if matches!(ty.opt_diag_name(cx), Some(sym::Path | sym::PathBuf)) && let ExprKind::Lit(spanned) = expr_or_init(cx, join_arg).kind && let LitKind::Str(symbol, _) = spanned.node && let sym_str = symbol.as_str() diff --git a/src/tools/clippy/clippy_lints/src/methods/map_clone.rs b/src/tools/clippy/clippy_lints/src/methods/map_clone.rs index a1aac96ccf86..8a1cc664ac60 100644 --- a/src/tools/clippy/clippy_lints/src/methods/map_clone.rs +++ b/src/tools/clippy/clippy_lints/src/methods/map_clone.rs @@ -25,7 +25,7 @@ fn should_run_lint(cx: &LateContext<'_>, e: &hir::Expr<'_>, method_parent_id: De } // We check if it's an `Option` or a `Result`. if let Some(ty) = method_parent_id.opt_impl_ty(cx) { - if !ty.is_diag_item(cx, sym::Option) && !ty.is_diag_item(cx, sym::Result) { + if !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) { return false; } } else { diff --git a/src/tools/clippy/clippy_lints/src/methods/map_unwrap_or.rs b/src/tools/clippy/clippy_lints/src/methods/map_unwrap_or.rs index 62bdc4a3e411..8eb26fb50747 100644 --- a/src/tools/clippy/clippy_lints/src/methods/map_unwrap_or.rs +++ b/src/tools/clippy/clippy_lints/src/methods/map_unwrap_or.rs @@ -1,4 +1,4 @@ -use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg}; +use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::msrvs::{self, Msrv}; use clippy_utils::res::MaybeDef; use clippy_utils::source::snippet; @@ -51,11 +51,8 @@ pub(super) fn check<'tcx>( // get snippets for args to map() and unwrap_or_else() let map_snippet = snippet(cx, map_arg.span, ".."); let unwrap_snippet = snippet(cx, unwrap_arg.span, ".."); - // lint, with note if neither arg is > 1 line and both map() and - // unwrap_or_else() have the same span - let multiline = map_snippet.lines().count() > 1 || unwrap_snippet.lines().count() > 1; - let same_span = map_arg.span.eq_ctxt(unwrap_arg.span); - if same_span && !multiline { + // lint, with note if both map() and unwrap_or_else() have the same span + if map_arg.span.eq_ctxt(unwrap_arg.span) { let var_snippet = snippet(cx, recv.span, ".."); span_lint_and_sugg( cx, @@ -67,9 +64,6 @@ pub(super) fn check<'tcx>( Applicability::MachineApplicable, ); return true; - } else if same_span && multiline { - span_lint(cx, MAP_UNWRAP_OR, expr.span, msg); - return true; } } diff --git a/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs b/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs index 055fdcabdd21..0e2012319147 100644 --- a/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs +++ b/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs @@ -81,7 +81,9 @@ pub(super) fn check<'tcx>( }, _ => return, }; - } else if let ExprKind::Index(_, index, _) = parent.kind { + } else if let ExprKind::Index(_, index, _) = parent.kind + && cx.typeck_results().expr_ty(index).is_usize() + { app = Applicability::MaybeIncorrect; let snip = snippet_with_applicability(cx, index.span, "_", &mut app); sugg = format!("nth({snip}).unwrap()"); diff --git a/src/tools/clippy/clippy_lints/src/methods/obfuscated_if_else.rs b/src/tools/clippy/clippy_lints/src/methods/obfuscated_if_else.rs index b2466bbd982d..69d851e81600 100644 --- a/src/tools/clippy/clippy_lints/src/methods/obfuscated_if_else.rs +++ b/src/tools/clippy/clippy_lints/src/methods/obfuscated_if_else.rs @@ -1,7 +1,7 @@ use super::OBFUSCATED_IF_ELSE; use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::eager_or_lazy::switch_to_eager_eval; -use clippy_utils::source::snippet_with_applicability; +use clippy_utils::source::snippet_with_context; use clippy_utils::sugg::Sugg; use clippy_utils::{get_parent_expr, sym}; use rustc_errors::Applicability; @@ -33,20 +33,22 @@ pub(super) fn check<'tcx>( let if_then = match then_method_name { sym::then if let ExprKind::Closure(closure) = then_arg.kind => { let body = cx.tcx.hir_body(closure.body); - snippet_with_applicability(cx, body.value.span, "..", &mut applicability) + snippet_with_context(cx, body.value.span, expr.span.ctxt(), "..", &mut applicability).0 }, - sym::then_some => snippet_with_applicability(cx, then_arg.span, "..", &mut applicability), + sym::then_some => snippet_with_context(cx, then_arg.span, expr.span.ctxt(), "..", &mut applicability).0, _ => return, }; let els = match unwrap { - Unwrap::Or(arg) => snippet_with_applicability(cx, arg.span, "..", &mut applicability), + Unwrap::Or(arg) => snippet_with_context(cx, arg.span, expr.span.ctxt(), "..", &mut applicability).0, Unwrap::OrElse(arg) => match arg.kind { ExprKind::Closure(closure) => { let body = cx.tcx.hir_body(closure.body); - snippet_with_applicability(cx, body.value.span, "..", &mut applicability) + snippet_with_context(cx, body.value.span, expr.span.ctxt(), "..", &mut applicability).0 + }, + ExprKind::Path(_) => { + snippet_with_context(cx, arg.span, expr.span.ctxt(), "_", &mut applicability).0 + "()" }, - ExprKind::Path(_) => snippet_with_applicability(cx, arg.span, "_", &mut applicability) + "()", _ => return, }, Unwrap::OrDefault => "Default::default()".into(), @@ -54,7 +56,7 @@ pub(super) fn check<'tcx>( let sugg = format!( "if {} {{ {} }} else {{ {} }}", - Sugg::hir_with_applicability(cx, then_recv, "..", &mut applicability), + Sugg::hir_with_context(cx, then_recv, expr.span.ctxt(), "..", &mut applicability), if_then, els ); diff --git a/src/tools/clippy/clippy_lints/src/methods/or_then_unwrap.rs b/src/tools/clippy/clippy_lints/src/methods/or_then_unwrap.rs index 07199b84f39e..448ab621a7ce 100644 --- a/src/tools/clippy/clippy_lints/src/methods/or_then_unwrap.rs +++ b/src/tools/clippy/clippy_lints/src/methods/or_then_unwrap.rs @@ -20,24 +20,28 @@ pub(super) fn check<'tcx>( let title; let or_arg_content: Span; - if ty.is_diag_item(cx, sym::Option) { - title = "found `.or(Some(…)).unwrap()`"; - if let Some(content) = get_content_if_ctor_matches(cx, or_arg, LangItem::OptionSome) { - or_arg_content = content; - } else { + match ty.opt_diag_name(cx) { + Some(sym::Option) => { + title = "found `.or(Some(…)).unwrap()`"; + if let Some(content) = get_content_if_ctor_matches(cx, or_arg, LangItem::OptionSome) { + or_arg_content = content; + } else { + return; + } + }, + Some(sym::Result) => { + title = "found `.or(Ok(…)).unwrap()`"; + if let Some(content) = get_content_if_ctor_matches(cx, or_arg, LangItem::ResultOk) { + or_arg_content = content; + } else { + return; + } + }, + _ => { + // Someone has implemented a struct with .or(...).unwrap() chaining, + // but it's not an Option or a Result, so bail return; - } - } else if ty.is_diag_item(cx, sym::Result) { - title = "found `.or(Ok(…)).unwrap()`"; - if let Some(content) = get_content_if_ctor_matches(cx, or_arg, LangItem::ResultOk) { - or_arg_content = content; - } else { - return; - } - } else { - // Someone has implemented a struct with .or(...).unwrap() chaining, - // but it's not an Option or a Result, so bail - return; + }, } let mut applicability = Applicability::MachineApplicable; diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_fold.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_fold.rs index bd471e0b18e3..9dae6fbb48dd 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_fold.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_fold.rs @@ -1,44 +1,52 @@ use clippy_utils::diagnostics::span_lint_and_sugg; -use clippy_utils::res::{MaybeDef, MaybeResPath, MaybeTypeckRes}; +use clippy_utils::res::{MaybeDef, MaybeQPath, MaybeResPath, MaybeTypeckRes}; use clippy_utils::source::snippet_with_applicability; -use clippy_utils::{peel_blocks, strip_pat_refs}; +use clippy_utils::{DefinedTy, ExprUseNode, expr_use_ctxt, peel_blocks, strip_pat_refs}; use rustc_ast::ast; use rustc_data_structures::packed::Pu128; use rustc_errors::Applicability; use rustc_hir as hir; use rustc_hir::PatKind; +use rustc_hir::def::{DefKind, Res}; use rustc_lint::LateContext; -use rustc_middle::ty; -use rustc_span::{Span, sym}; +use rustc_middle::ty::{self, Ty}; +use rustc_span::{Span, Symbol, sym}; use super::UNNECESSARY_FOLD; /// Do we need to suggest turbofish when suggesting a replacement method? /// Changing `fold` to `sum` needs it sometimes when the return type can't be /// inferred. This checks for some common cases where it can be safely omitted -fn needs_turbofish(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool { - let parent = cx.tcx.parent_hir_node(expr.hir_id); - - // some common cases where turbofish isn't needed: - // - assigned to a local variable with a type annotation - if let hir::Node::LetStmt(local) = parent - && local.ty.is_some() +fn needs_turbofish<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'tcx>) -> bool { + let use_cx = expr_use_ctxt(cx, expr); + if use_cx.same_ctxt + && let use_node = use_cx.use_node(cx) + && let Some(ty) = use_node.defined_ty(cx) { - return false; - } + // some common cases where turbofish isn't needed: + match (use_node, ty) { + // - assigned to a local variable with a type annotation + (ExprUseNode::LetStmt(_), _) => return false, - // - part of a function call argument, can be inferred from the function signature (provided that - // the parameter is not a generic type parameter) - if let hir::Node::Expr(parent_expr) = parent - && let hir::ExprKind::Call(recv, args) = parent_expr.kind - && let hir::ExprKind::Path(ref qpath) = recv.kind - && let Some(fn_def_id) = cx.qpath_res(qpath, recv.hir_id).opt_def_id() - && let fn_sig = cx.tcx.fn_sig(fn_def_id).skip_binder().skip_binder() - && let Some(arg_pos) = args.iter().position(|arg| arg.hir_id == expr.hir_id) - && let Some(ty) = fn_sig.inputs().get(arg_pos) - && !matches!(ty.kind(), ty::Param(_)) - { - return false; + // - part of a function call argument, can be inferred from the function signature (provided that the + // parameter is not a generic type parameter) + (ExprUseNode::FnArg(..), DefinedTy::Mir { ty: arg_ty, .. }) + if !matches!(arg_ty.skip_binder().kind(), ty::Param(_)) => + { + return false; + }, + + // - the final expression in the body of a function with a simple return type + (ExprUseNode::Return(_), DefinedTy::Mir { ty: fn_return_ty, .. }) + if !fn_return_ty + .skip_binder() + .walk() + .any(|generic| generic.as_type().is_some_and(Ty::is_impl_trait)) => + { + return false; + }, + _ => {}, + } } // if it's neither of those, stay on the safe side and suggest turbofish, @@ -60,7 +68,7 @@ fn check_fold_with_op( fold_span: Span, op: hir::BinOpKind, replacement: Replacement, -) { +) -> bool { if let hir::ExprKind::Closure(&hir::Closure { body, .. }) = acc.kind // Extract the body of the closure passed to fold && let closure_body = cx.tcx.hir_body(body) @@ -93,7 +101,7 @@ fn check_fold_with_op( r = snippet_with_applicability(cx, right_expr.span, "EXPR", &mut applicability), ) } else { - format!("{method}{turbofish}()", method = replacement.method_name,) + format!("{method}{turbofish}()", method = replacement.method_name) }; span_lint_and_sugg( @@ -105,12 +113,47 @@ fn check_fold_with_op( sugg, applicability, ); + return true; + } + false +} + +fn check_fold_with_method( + cx: &LateContext<'_>, + expr: &hir::Expr<'_>, + acc: &hir::Expr<'_>, + fold_span: Span, + method: Symbol, + replacement: Replacement, +) { + // Extract the name of the function passed to `fold` + if let Res::Def(DefKind::AssocFn, fn_did) = acc.res_if_named(cx, method) + // Check if the function belongs to the operator + && cx.tcx.is_diagnostic_item(method, fn_did) + { + let applicability = Applicability::MachineApplicable; + + let turbofish = if replacement.has_generic_return { + format!("::<{}>", cx.typeck_results().expr_ty(expr)) + } else { + String::new() + }; + + span_lint_and_sugg( + cx, + UNNECESSARY_FOLD, + fold_span.with_hi(expr.span.hi()), + "this `.fold` can be written more succinctly using another method", + "try", + format!("{method}{turbofish}()", method = replacement.method_name), + applicability, + ); } } -pub(super) fn check( - cx: &LateContext<'_>, - expr: &hir::Expr<'_>, +pub(super) fn check<'tcx>( + cx: &LateContext<'tcx>, + expr: &hir::Expr<'tcx>, init: &hir::Expr<'_>, acc: &hir::Expr<'_>, fold_span: Span, @@ -124,60 +167,40 @@ pub(super) fn check( if let hir::ExprKind::Lit(lit) = init.kind { match lit.node { ast::LitKind::Bool(false) => { - check_fold_with_op( - cx, - expr, - acc, - fold_span, - hir::BinOpKind::Or, - Replacement { - method_name: "any", - has_args: true, - has_generic_return: false, - }, - ); + let replacement = Replacement { + method_name: "any", + has_args: true, + has_generic_return: false, + }; + check_fold_with_op(cx, expr, acc, fold_span, hir::BinOpKind::Or, replacement); }, ast::LitKind::Bool(true) => { - check_fold_with_op( - cx, - expr, - acc, - fold_span, - hir::BinOpKind::And, - Replacement { - method_name: "all", - has_args: true, - has_generic_return: false, - }, - ); + let replacement = Replacement { + method_name: "all", + has_args: true, + has_generic_return: false, + }; + check_fold_with_op(cx, expr, acc, fold_span, hir::BinOpKind::And, replacement); }, ast::LitKind::Int(Pu128(0), _) => { - check_fold_with_op( - cx, - expr, - acc, - fold_span, - hir::BinOpKind::Add, - Replacement { - method_name: "sum", - has_args: false, - has_generic_return: needs_turbofish(cx, expr), - }, - ); + let replacement = Replacement { + method_name: "sum", + has_args: false, + has_generic_return: needs_turbofish(cx, expr), + }; + if !check_fold_with_op(cx, expr, acc, fold_span, hir::BinOpKind::Add, replacement) { + check_fold_with_method(cx, expr, acc, fold_span, sym::add, replacement); + } }, ast::LitKind::Int(Pu128(1), _) => { - check_fold_with_op( - cx, - expr, - acc, - fold_span, - hir::BinOpKind::Mul, - Replacement { - method_name: "product", - has_args: false, - has_generic_return: needs_turbofish(cx, expr), - }, - ); + let replacement = Replacement { + method_name: "product", + has_args: false, + has_generic_return: needs_turbofish(cx, expr), + }; + if !check_fold_with_op(cx, expr, acc, fold_span, hir::BinOpKind::Mul, replacement) { + check_fold_with_method(cx, expr, acc, fold_span, sym::mul, replacement); + } }, _ => (), } diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_get_then_check.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_get_then_check.rs index 10ea0c0c3e23..3207c4207fc0 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_get_then_check.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_get_then_check.rs @@ -11,11 +11,11 @@ use rustc_span::{Span, sym}; use super::UNNECESSARY_GET_THEN_CHECK; fn is_a_std_set_type(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { - ty.is_diag_item(cx, sym::HashSet) || ty.is_diag_item(cx, sym::BTreeSet) + matches!(ty.opt_diag_name(cx), Some(sym::HashSet | sym::BTreeSet)) } fn is_a_std_map_type(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { - ty.is_diag_item(cx, sym::HashMap) || ty.is_diag_item(cx, sym::BTreeMap) + matches!(ty.opt_diag_name(cx), Some(sym::HashMap | sym::BTreeMap)) } pub(super) fn check( diff --git a/src/tools/clippy/clippy_lints/src/methods/unwrap_expect_used.rs b/src/tools/clippy/clippy_lints/src/methods/unwrap_expect_used.rs index 73a407be4f21..30db2a75df57 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unwrap_expect_used.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unwrap_expect_used.rs @@ -46,19 +46,19 @@ pub(super) fn check( ) { let ty = cx.typeck_results().expr_ty(recv).peel_refs(); - let (kind, none_value, none_prefix) = if ty.is_diag_item(cx, sym::Option) && !is_err { - ("an `Option`", "None", "") - } else if ty.is_diag_item(cx, sym::Result) - && let ty::Adt(_, substs) = ty.kind() - && let Some(t_or_e_ty) = substs[usize::from(!is_err)].as_type() - { - if is_never_like(t_or_e_ty) { - return; - } + let (kind, none_value, none_prefix) = match ty.opt_diag_name(cx) { + Some(sym::Option) if !is_err => ("an `Option`", "None", ""), + Some(sym::Result) + if let ty::Adt(_, substs) = ty.kind() + && let Some(t_or_e_ty) = substs[usize::from(!is_err)].as_type() => + { + if is_never_like(t_or_e_ty) { + return; + } - ("a `Result`", if is_err { "Ok" } else { "Err" }, "an ") - } else { - return; + ("a `Result`", if is_err { "Ok" } else { "Err" }, "an ") + }, + _ => return, }; let method_suffix = if is_err { "_err" } else { "" }; diff --git a/src/tools/clippy/clippy_lints/src/missing_doc.rs b/src/tools/clippy/clippy_lints/src/missing_doc.rs index ac221743cfd6..375b275cd113 100644 --- a/src/tools/clippy/clippy_lints/src/missing_doc.rs +++ b/src/tools/clippy/clippy_lints/src/missing_doc.rs @@ -287,8 +287,8 @@ fn is_doc_attr(attr: &Attribute) -> bool { match attr { Attribute::Parsed(AttributeKind::DocComment { .. }) => true, Attribute::Unparsed(attr) - if let [ident] = &*attr.path.segments - && ident.name == sym::doc => + if let [name] = &*attr.path.segments + && *name == sym::doc => { matches!(attr.args, AttrArgs::Eq { .. }) }, diff --git a/src/tools/clippy/clippy_lints/src/missing_fields_in_debug.rs b/src/tools/clippy/clippy_lints/src/missing_fields_in_debug.rs index 15b773c2c64f..a26f24d15247 100644 --- a/src/tools/clippy/clippy_lints/src/missing_fields_in_debug.rs +++ b/src/tools/clippy/clippy_lints/src/missing_fields_in_debug.rs @@ -112,10 +112,14 @@ fn should_lint<'tcx>( if let ExprKind::MethodCall(path, recv, ..) = &expr.kind { let recv_ty = typeck_results.expr_ty(recv).peel_refs(); - if path.ident.name == sym::debug_struct && recv_ty.is_diag_item(cx, sym::Formatter) { - has_debug_struct = true; - } else if path.ident.name == sym::finish_non_exhaustive && recv_ty.is_diag_item(cx, sym::DebugStruct) { - has_finish_non_exhaustive = true; + match (path.ident.name, recv_ty.opt_diag_name(cx)) { + (sym::debug_struct, Some(sym::Formatter)) => { + has_debug_struct = true; + }, + (sym::finish_non_exhaustive, Some(sym::DebugStruct)) => { + has_finish_non_exhaustive = true; + }, + _ => {}, } } ControlFlow::::Continue(()) diff --git a/src/tools/clippy/clippy_lints/src/multiple_unsafe_ops_per_block.rs b/src/tools/clippy/clippy_lints/src/multiple_unsafe_ops_per_block.rs index 80cf081992cc..42dc9f2f1fa8 100644 --- a/src/tools/clippy/clippy_lints/src/multiple_unsafe_ops_per_block.rs +++ b/src/tools/clippy/clippy_lints/src/multiple_unsafe_ops_per_block.rs @@ -3,13 +3,14 @@ use clippy_utils::diagnostics::span_lint_and_then; use hir::def::{DefKind, Res}; use hir::{BlockCheckMode, ExprKind, QPath, UnOp}; use rustc_ast::{BorrowKind, Mutability}; +use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; use rustc_hir::intravisit::{Visitor, walk_body, walk_expr}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, TyCtxt, TypeckResults}; use rustc_session::declare_lint_pass; -use rustc_span::{DesugaringKind, Span}; +use rustc_span::Span; declare_clippy_lint! { /// ### What it does @@ -56,12 +57,16 @@ declare_clippy_lint! { /// } /// ``` /// - /// ### Note + /// ### Notes /// - /// Taking a raw pointer to a union field is always safe and will - /// not be considered unsafe by this lint, even when linting code written - /// with a specified Rust version of 1.91 or earlier (which required - /// using an `unsafe` block). + /// - Unsafe operations only count towards the total for the innermost + /// enclosing `unsafe` block. + /// - Each call to a macro expanding to unsafe operations count for one + /// unsafe operation. + /// - Taking a raw pointer to a union field is always safe and will + /// not be considered unsafe by this lint, even when linting code written + /// with a specified Rust version of 1.91 or earlier (which required + /// using an `unsafe` block). #[clippy::version = "1.69.0"] pub MULTIPLE_UNSAFE_OPS_PER_BLOCK, restriction, @@ -71,10 +76,7 @@ declare_lint_pass!(MultipleUnsafeOpsPerBlock => [MULTIPLE_UNSAFE_OPS_PER_BLOCK]) impl<'tcx> LateLintPass<'tcx> for MultipleUnsafeOpsPerBlock { fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx hir::Block<'_>) { - if !matches!(block.rules, BlockCheckMode::UnsafeBlock(_)) - || block.span.in_external_macro(cx.tcx.sess.source_map()) - || block.span.is_desugaring(DesugaringKind::Await) - { + if !matches!(block.rules, BlockCheckMode::UnsafeBlock(_)) || block.span.from_expansion() { return; } let unsafe_ops = UnsafeExprCollector::collect_unsafe_exprs(cx, block); @@ -100,7 +102,7 @@ impl<'tcx> LateLintPass<'tcx> for MultipleUnsafeOpsPerBlock { struct UnsafeExprCollector<'tcx> { tcx: TyCtxt<'tcx>, typeck_results: &'tcx TypeckResults<'tcx>, - unsafe_ops: Vec<(&'static str, Span)>, + unsafe_ops: FxHashMap, } impl<'tcx> UnsafeExprCollector<'tcx> { @@ -108,10 +110,33 @@ impl<'tcx> UnsafeExprCollector<'tcx> { let mut collector = Self { tcx: cx.tcx, typeck_results: cx.typeck_results(), - unsafe_ops: vec![], + unsafe_ops: FxHashMap::default(), }; collector.visit_block(block); - collector.unsafe_ops + #[allow( + rustc::potential_query_instability, + reason = "span ordering only needed inside the one expression being walked" + )] + let mut unsafe_ops = collector + .unsafe_ops + .into_iter() + .map(|(span, msg)| (msg, span)) + .collect::>(); + unsafe_ops.sort_unstable(); + unsafe_ops + } +} + +impl UnsafeExprCollector<'_> { + fn insert_span(&mut self, span: Span, message: &'static str) { + if span.from_expansion() { + self.unsafe_ops.insert( + span.source_callsite(), + "this macro call expands into one or more unsafe operations", + ); + } else { + self.unsafe_ops.insert(span, message); + } } } @@ -126,7 +151,10 @@ impl<'tcx> Visitor<'tcx> for UnsafeExprCollector<'tcx> { return self.visit_expr(e); }, - ExprKind::InlineAsm(_) => self.unsafe_ops.push(("inline assembly used here", expr.span)), + // Do not recurse inside an inner `unsafe` block, it will be checked on its own + ExprKind::Block(block, _) if matches!(block.rules, BlockCheckMode::UnsafeBlock(_)) => return, + + ExprKind::InlineAsm(_) => self.insert_span(expr.span, "inline assembly used here"), ExprKind::AddrOf(BorrowKind::Raw, _, mut inner) => { while let ExprKind::Field(prefix, _) = inner.kind @@ -139,7 +167,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeExprCollector<'tcx> { ExprKind::Field(e, _) => { if self.typeck_results.expr_ty(e).is_union() { - self.unsafe_ops.push(("union field access occurs here", expr.span)); + self.insert_span(expr.span, "union field access occurs here"); } }, @@ -157,12 +185,11 @@ impl<'tcx> Visitor<'tcx> for UnsafeExprCollector<'tcx> { .. }, )) => { - self.unsafe_ops - .push(("access of a mutable static occurs here", expr.span)); + self.insert_span(expr.span, "access of a mutable static occurs here"); }, ExprKind::Unary(UnOp::Deref, e) if self.typeck_results.expr_ty(e).is_raw_ptr() => { - self.unsafe_ops.push(("raw pointer dereference occurs here", expr.span)); + self.insert_span(expr.span, "raw pointer dereference occurs here"); }, ExprKind::Call(path_expr, _) => { @@ -172,7 +199,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeExprCollector<'tcx> { _ => None, }; if opt_sig.is_some_and(|sig| sig.safety().is_unsafe()) { - self.unsafe_ops.push(("unsafe function call occurs here", expr.span)); + self.insert_span(expr.span, "unsafe function call occurs here"); } }, @@ -182,7 +209,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeExprCollector<'tcx> { .type_dependent_def_id(expr.hir_id) .map(|def_id| self.tcx.fn_sig(def_id)); if opt_sig.is_some_and(|sig| sig.skip_binder().safety().is_unsafe()) { - self.unsafe_ops.push(("unsafe method call occurs here", expr.span)); + self.insert_span(expr.span, "unsafe method call occurs here"); } }, @@ -203,8 +230,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeExprCollector<'tcx> { } )) ) { - self.unsafe_ops - .push(("modification of a mutable static occurs here", expr.span)); + self.insert_span(expr.span, "modification of a mutable static occurs here"); return self.visit_expr(rhs); } }, diff --git a/src/tools/clippy/clippy_lints/src/needless_pass_by_ref_mut.rs b/src/tools/clippy/clippy_lints/src/needless_pass_by_ref_mut.rs index 3d2285efbe18..f3e42b1c58f8 100644 --- a/src/tools/clippy/clippy_lints/src/needless_pass_by_ref_mut.rs +++ b/src/tools/clippy/clippy_lints/src/needless_pass_by_ref_mut.rs @@ -1,7 +1,7 @@ use super::needless_pass_by_value::requires_exact_signature; use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_hir_and_then; -use clippy_utils::source::snippet; +use clippy_utils::source::HasSession as _; use clippy_utils::visitors::for_each_expr; use clippy_utils::{inherits_cfg, is_from_proc_macro, is_self}; use core::ops::ControlFlow; @@ -18,9 +18,9 @@ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::mir::FakeReadCause; use rustc_middle::ty::{self, Ty, TyCtxt, UpvarId, UpvarPath}; use rustc_session::impl_lint_pass; -use rustc_span::Span; use rustc_span::def_id::LocalDefId; use rustc_span::symbol::kw; +use rustc_span::{BytePos, Span}; declare_clippy_lint! { /// ### What it does @@ -269,18 +269,27 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByRefMut<'tcx> { // If the argument is never used mutably, we emit the warning. let sp = input.span; if let rustc_hir::TyKind::Ref(_, inner_ty) = input.kind { + let Some(after_mut_span) = cx.sess().source_map().span_extend_to_prev_str( + inner_ty.ty.span.shrink_to_lo(), + "mut", + true, + true, + ) else { + return; + }; + let mut_span = after_mut_span.with_lo(after_mut_span.lo() - BytePos(3)); let is_cfged = is_cfged.get_or_insert_with(|| inherits_cfg(cx.tcx, *fn_def_id)); span_lint_hir_and_then( cx, NEEDLESS_PASS_BY_REF_MUT, cx.tcx.local_def_id_to_hir_id(*fn_def_id), sp, - "this argument is a mutable reference, but not used mutably", + "this parameter is a mutable reference but is not used mutably", |diag| { diag.span_suggestion( - sp, - "consider changing to".to_string(), - format!("&{}", snippet(cx, cx.tcx.hir_span(inner_ty.ty.hir_id), "_"),), + mut_span, + "consider removing this `mut`", + "", Applicability::Unspecified, ); if cx.effective_visibilities.is_exported(*fn_def_id) { diff --git a/src/tools/clippy/clippy_lints/src/new_without_default.rs b/src/tools/clippy/clippy_lints/src/new_without_default.rs index 6fc034b6fc5d..67493d54b552 100644 --- a/src/tools/clippy/clippy_lints/src/new_without_default.rs +++ b/src/tools/clippy/clippy_lints/src/new_without_default.rs @@ -9,6 +9,8 @@ use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::ty::AssocKind; use rustc_session::impl_lint_pass; use rustc_span::sym; +use rustc_hir::Attribute; +use rustc_hir::attrs::AttributeKind; declare_clippy_lint! { /// ### What it does @@ -121,7 +123,7 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault { let attrs_sugg = { let mut sugg = String::new(); for attr in cx.tcx.hir_attrs(assoc_item_hir_id) { - if !attr.has_name(sym::cfg_trace) { + let Attribute::Parsed(AttributeKind::CfgTrace(attrs)) = attr else { // This might be some other attribute that the `impl Default` ought to inherit. // But it could also be one of the many attributes that: // - can't be put on an impl block -- like `#[inline]` @@ -131,10 +133,13 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault { // reduce the applicability app = Applicability::MaybeIncorrect; continue; + }; + + for (_, attr_span) in attrs { + sugg.push_str(&snippet_with_applicability(cx.sess(), *attr_span, "_", &mut app)); + sugg.push('\n'); } - sugg.push_str(&snippet_with_applicability(cx.sess(), attr.span(), "_", &mut app)); - sugg.push('\n'); } sugg }; diff --git a/src/tools/clippy/clippy_lints/src/ptr/cmp_null.rs b/src/tools/clippy/clippy_lints/src/ptr/cmp_null.rs index 905b48e6d1d4..f2d1c855eddd 100644 --- a/src/tools/clippy/clippy_lints/src/ptr/cmp_null.rs +++ b/src/tools/clippy/clippy_lints/src/ptr/cmp_null.rs @@ -14,13 +14,14 @@ pub(super) fn check<'tcx>( l: &Expr<'_>, r: &Expr<'_>, ) -> bool { + let mut applicability = Applicability::MachineApplicable; let non_null_path_snippet = match ( is_lint_allowed(cx, CMP_NULL, expr.hir_id), is_null_path(cx, l), is_null_path(cx, r), ) { - (false, true, false) if let Some(sugg) = Sugg::hir_opt(cx, r) => sugg.maybe_paren(), - (false, false, true) if let Some(sugg) = Sugg::hir_opt(cx, l) => sugg.maybe_paren(), + (false, true, false) => Sugg::hir_with_context(cx, r, expr.span.ctxt(), "..", &mut applicability).maybe_paren(), + (false, false, true) => Sugg::hir_with_context(cx, l, expr.span.ctxt(), "..", &mut applicability).maybe_paren(), _ => return false, }; let invert = if op == BinOpKind::Eq { "" } else { "!" }; @@ -32,7 +33,7 @@ pub(super) fn check<'tcx>( "comparing with null is better expressed by the `.is_null()` method", "try", format!("{invert}{non_null_path_snippet}.is_null()",), - Applicability::MachineApplicable, + applicability, ); true } diff --git a/src/tools/clippy/clippy_lints/src/ptr/mod.rs b/src/tools/clippy/clippy_lints/src/ptr/mod.rs index 6b2647e7b0a2..c4f40a7ffcaa 100644 --- a/src/tools/clippy/clippy_lints/src/ptr/mod.rs +++ b/src/tools/clippy/clippy_lints/src/ptr/mod.rs @@ -45,7 +45,7 @@ declare_clippy_lint! { declare_clippy_lint! { /// ### What it does - /// This lint checks for equality comparisons with `ptr::null` + /// This lint checks for equality comparisons with `ptr::null` or `ptr::null_mut` /// /// ### Why is this bad? /// It's easier and more readable to use the inherent @@ -56,7 +56,7 @@ declare_clippy_lint! { /// ```rust,ignore /// use std::ptr; /// - /// if x == ptr::null { + /// if x == ptr::null() { /// // .. /// } /// ``` diff --git a/src/tools/clippy/clippy_lints/src/same_length_and_capacity.rs b/src/tools/clippy/clippy_lints/src/same_length_and_capacity.rs new file mode 100644 index 000000000000..042dec35f7c9 --- /dev/null +++ b/src/tools/clippy/clippy_lints/src/same_length_and_capacity.rs @@ -0,0 +1,105 @@ +use clippy_utils::diagnostics::span_lint_and_help; +use clippy_utils::res::MaybeDef; +use clippy_utils::{eq_expr_value, sym}; +use rustc_hir::{Expr, ExprKind, LangItem, QPath}; +use rustc_lint::{LateContext, LateLintPass}; +use rustc_session::declare_lint_pass; +use rustc_span::symbol::sym as rustc_sym; + +declare_clippy_lint! { + /// ### What it does + /// + /// Checks for usages of `Vec::from_raw_parts` and `String::from_raw_parts` + /// where the same expression is used for the length and the capacity. + /// + /// ### Why is this bad? + /// + /// If the same expression is being passed for the length and + /// capacity, it is most likely a semantic error. In the case of a + /// Vec, for example, the only way to end up with one that has + /// the same length and capacity is by going through a boxed slice, + /// e.g. `Box::from(some_vec)`, which shrinks the capacity to match + /// the length. + /// + /// ### Example + /// + /// ```no_run + /// #![feature(vec_into_raw_parts)] + /// let mut original: Vec:: = Vec::with_capacity(20); + /// original.extend([1, 2, 3, 4, 5]); + /// + /// let (ptr, mut len, cap) = original.into_raw_parts(); + /// + /// // I will add three more integers: + /// unsafe { + /// let ptr = ptr as *mut i32; + /// + /// for i in 6..9 { + /// *ptr.add(i - 1) = i as i32; + /// len += 1; + /// } + /// } + /// + /// // But I forgot the capacity was separate from the length: + /// let reconstructed = unsafe { Vec::from_raw_parts(ptr, len, len) }; + /// ``` + /// + /// Use instead: + /// ```no_run + /// #![feature(vec_into_raw_parts)] + /// let mut original: Vec:: = Vec::with_capacity(20); + /// original.extend([1, 2, 3, 4, 5]); + /// + /// let (ptr, mut len, cap) = original.into_raw_parts(); + /// + /// // I will add three more integers: + /// unsafe { + /// let ptr = ptr as *mut i32; + /// + /// for i in 6..9 { + /// *ptr.add(i - 1) = i as i32; + /// len += 1; + /// } + /// } + /// + /// // This time, leverage the previously saved capacity: + /// let reconstructed = unsafe { Vec::from_raw_parts(ptr, len, cap) }; + /// ``` + #[clippy::version = "1.93.0"] + pub SAME_LENGTH_AND_CAPACITY, + pedantic, + "`from_raw_parts` with same length and capacity" +} +declare_lint_pass!(SameLengthAndCapacity => [SAME_LENGTH_AND_CAPACITY]); + +impl<'tcx> LateLintPass<'tcx> for SameLengthAndCapacity { + fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + if let ExprKind::Call(path_expr, args) = expr.kind + && let ExprKind::Path(QPath::TypeRelative(ty, fn_path)) = path_expr.kind + && fn_path.ident.name == sym::from_raw_parts + && args.len() >= 3 + && eq_expr_value(cx, &args[1], &args[2]) + { + let middle_ty = cx.typeck_results().node_type(ty.hir_id); + if middle_ty.is_diag_item(cx, rustc_sym::Vec) { + span_lint_and_help( + cx, + SAME_LENGTH_AND_CAPACITY, + expr.span, + "usage of `Vec::from_raw_parts` with the same expression for length and capacity", + None, + "try `Box::from(slice::from_raw_parts(...)).into::>()`", + ); + } else if middle_ty.is_lang_item(cx, LangItem::String) { + span_lint_and_help( + cx, + SAME_LENGTH_AND_CAPACITY, + expr.span, + "usage of `String::from_raw_parts` with the same expression for length and capacity", + None, + "try `String::from(str::from_utf8_unchecked(slice::from_raw_parts(...)))`", + ); + } + } + } +} diff --git a/src/tools/clippy/clippy_lints/src/set_contains_or_insert.rs b/src/tools/clippy/clippy_lints/src/set_contains_or_insert.rs index 688da33a1777..7482bac4c7b4 100644 --- a/src/tools/clippy/clippy_lints/src/set_contains_or_insert.rs +++ b/src/tools/clippy/clippy_lints/src/set_contains_or_insert.rs @@ -112,6 +112,16 @@ fn try_parse_op_call<'tcx>( None } +fn is_set_mutated<'tcx>(cx: &LateContext<'tcx>, contains_expr: &OpExpr<'tcx>, expr: &'tcx Expr<'_>) -> bool { + // Guard on type to avoid useless potentially expansive `SpanlessEq` checks + cx.typeck_results().expr_ty_adjusted(expr).is_mutable_ptr() + && matches!( + cx.typeck_results().expr_ty(expr).peel_refs().opt_diag_name(cx), + Some(sym::HashSet | sym::BTreeSet) + ) + && SpanlessEq::new(cx).eq_expr(contains_expr.receiver, expr.peel_borrows()) +} + fn find_insert_calls<'tcx>( cx: &LateContext<'tcx>, contains_expr: &OpExpr<'tcx>, @@ -122,9 +132,14 @@ fn find_insert_calls<'tcx>( && SpanlessEq::new(cx).eq_expr(contains_expr.receiver, insert_expr.receiver) && SpanlessEq::new(cx).eq_expr(contains_expr.value, insert_expr.value) { - ControlFlow::Break(insert_expr) - } else { - ControlFlow::Continue(()) + return ControlFlow::Break(Some(insert_expr)); } + + if is_set_mutated(cx, contains_expr, e) { + return ControlFlow::Break(None); + } + + ControlFlow::Continue(()) }) + .flatten() } diff --git a/src/tools/clippy/clippy_lints/src/time_subtraction.rs b/src/tools/clippy/clippy_lints/src/time_subtraction.rs index e0fdca97dbee..3ba59aefea06 100644 --- a/src/tools/clippy/clippy_lints/src/time_subtraction.rs +++ b/src/tools/clippy/clippy_lints/src/time_subtraction.rs @@ -8,7 +8,6 @@ use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::Ty; use rustc_session::impl_lint_pass; -use rustc_span::source_map::Spanned; use rustc_span::sym; declare_clippy_lint! { @@ -84,43 +83,38 @@ impl_lint_pass!(UncheckedTimeSubtraction => [MANUAL_INSTANT_ELAPSED, UNCHECKED_T impl LateLintPass<'_> for UncheckedTimeSubtraction { fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { - if let ExprKind::Binary( - Spanned { - node: BinOpKind::Sub, .. + let (lhs, rhs) = match expr.kind { + ExprKind::Binary(op, lhs, rhs) if matches!(op.node, BinOpKind::Sub,) => (lhs, rhs), + ExprKind::MethodCall(fn_name, lhs, [rhs], _) if cx.ty_based_def(expr).is_diag_item(cx, sym::sub) => { + (lhs, rhs) }, - lhs, - rhs, - ) = expr.kind - { - let typeck = cx.typeck_results(); - let lhs_ty = typeck.expr_ty(lhs); - let rhs_ty = typeck.expr_ty(rhs); + _ => return, + }; + let typeck = cx.typeck_results(); + let lhs_name = typeck.expr_ty(lhs).opt_diag_name(cx); + let rhs_name = typeck.expr_ty(rhs).opt_diag_name(cx); - if lhs_ty.is_diag_item(cx, sym::Instant) { - // Instant::now() - instant - if is_instant_now_call(cx, lhs) - && rhs_ty.is_diag_item(cx, sym::Instant) - && let Some(sugg) = Sugg::hir_opt(cx, rhs) - { - print_manual_instant_elapsed_sugg(cx, expr, sugg); - } - // instant - duration - else if rhs_ty.is_diag_item(cx, sym::Duration) - && !expr.span.from_expansion() - && self.msrv.meets(cx, msrvs::TRY_FROM) - { - print_unchecked_duration_subtraction_sugg(cx, lhs, rhs, expr); - } + if lhs_name == Some(sym::Instant) { + // Instant::now() - instant + if is_instant_now_call(cx, lhs) && rhs_name == Some(sym::Instant) { + print_manual_instant_elapsed_sugg(cx, expr, rhs); } - // duration - duration - else if lhs_ty.is_diag_item(cx, sym::Duration) - && rhs_ty.is_diag_item(cx, sym::Duration) + // instant - duration + else if rhs_name == Some(sym::Duration) && !expr.span.from_expansion() && self.msrv.meets(cx, msrvs::TRY_FROM) { print_unchecked_duration_subtraction_sugg(cx, lhs, rhs, expr); } } + // duration - duration + else if lhs_name == Some(sym::Duration) + && rhs_name == Some(sym::Duration) + && !expr.span.from_expansion() + && self.msrv.meets(cx, msrvs::TRY_FROM) + { + print_unchecked_duration_subtraction_sugg(cx, lhs, rhs, expr); + } } } @@ -150,10 +144,12 @@ fn is_chained_time_subtraction(cx: &LateContext<'_>, lhs: &Expr<'_>) -> bool { /// Returns true if the type is Duration or Instant fn is_time_type(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { - ty.is_diag_item(cx, sym::Duration) || ty.is_diag_item(cx, sym::Instant) + matches!(ty.opt_diag_name(cx), Some(sym::Duration | sym::Instant)) } -fn print_manual_instant_elapsed_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, sugg: Sugg<'_>) { +fn print_manual_instant_elapsed_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, rhs: &Expr<'_>) { + let mut applicability = Applicability::MachineApplicable; + let sugg = Sugg::hir_with_context(cx, rhs, expr.span.ctxt(), "", &mut applicability); span_lint_and_sugg( cx, MANUAL_INSTANT_ELAPSED, @@ -161,7 +157,7 @@ fn print_manual_instant_elapsed_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, sugg "manual implementation of `Instant::elapsed`", "try", format!("{}.elapsed()", sugg.maybe_paren()), - Applicability::MachineApplicable, + applicability, ); } @@ -181,8 +177,9 @@ fn print_unchecked_duration_subtraction_sugg( // avoid suggestions if !is_chained_time_subtraction(cx, left_expr) { let mut applicability = Applicability::MachineApplicable; - let left_sugg = Sugg::hir_with_applicability(cx, left_expr, "", &mut applicability); - let right_sugg = Sugg::hir_with_applicability(cx, right_expr, "", &mut applicability); + let left_sugg = Sugg::hir_with_context(cx, left_expr, expr.span.ctxt(), "", &mut applicability); + let right_sugg = + Sugg::hir_with_context(cx, right_expr, expr.span.ctxt(), "", &mut applicability); diag.span_suggestion( expr.span, diff --git a/src/tools/clippy/clippy_lints/src/transmute/transmuting_null.rs b/src/tools/clippy/clippy_lints/src/transmute/transmuting_null.rs index 1a6262f2ff76..31e770f421e1 100644 --- a/src/tools/clippy/clippy_lints/src/transmute/transmuting_null.rs +++ b/src/tools/clippy/clippy_lints/src/transmute/transmuting_null.rs @@ -1,6 +1,6 @@ use clippy_utils::consts::{ConstEvalCtxt, Constant}; use clippy_utils::diagnostics::span_lint; -use clippy_utils::is_integer_literal; +use clippy_utils::is_integer_const; use clippy_utils::res::{MaybeDef, MaybeResPath}; use rustc_hir::{Expr, ExprKind}; use rustc_lint::LateContext; @@ -27,7 +27,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arg: &'t // Catching: // `std::mem::transmute(0 as *const i32)` if let ExprKind::Cast(inner_expr, _cast_ty) = arg.kind - && is_integer_literal(inner_expr, 0) + && is_integer_const(cx, inner_expr, 0) { span_lint(cx, TRANSMUTING_NULL, expr.span, LINT_MSG); return true; @@ -42,10 +42,5 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arg: &'t return true; } - // FIXME: - // Also catch transmutations of variables which are known nulls. - // To do this, MIR const propagation seems to be the better tool. - // Whenever MIR const prop routines are more developed, this will - // become available. As of this writing (25/03/19) it is not yet. false } diff --git a/src/tools/clippy/clippy_lints/src/use_self.rs b/src/tools/clippy/clippy_lints/src/use_self.rs index eba60501ae21..38ce9dc3f916 100644 --- a/src/tools/clippy/clippy_lints/src/use_self.rs +++ b/src/tools/clippy/clippy_lints/src/use_self.rs @@ -10,13 +10,14 @@ use rustc_hir::def_id::LocalDefId; use rustc_hir::intravisit::{InferKind, Visitor, VisitorExt, walk_ty}; use rustc_hir::{ self as hir, AmbigArg, Expr, ExprKind, FnRetTy, FnSig, GenericArgsParentheses, GenericParamKind, HirId, Impl, - ImplItemImplKind, ImplItemKind, Item, ItemKind, Pat, PatExpr, PatExprKind, PatKind, Path, QPath, Ty, TyKind, + ImplItemImplKind, ImplItemKind, Item, ItemKind, Node, Pat, PatExpr, PatExprKind, PatKind, Path, QPath, Ty, TyKind, }; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::Ty as MiddleTy; use rustc_session::impl_lint_pass; use rustc_span::Span; use std::iter; +use std::ops::ControlFlow; declare_clippy_lint! { /// ### What it does @@ -213,6 +214,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf { path.res, Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } | Res::Def(DefKind::TyParam, _) ) + && !ty_is_in_generic_args(cx, hir_ty) && !types_to_skip.contains(&hir_ty.hir_id) && let ty = ty_from_hir_ty(cx, hir_ty.as_unambig_ty()) && let impl_ty = cx.tcx.type_of(impl_id).instantiate_identity() @@ -312,6 +314,38 @@ fn lint_path_to_variant(cx: &LateContext<'_>, path: &Path<'_>) { } } +fn ty_is_in_generic_args<'tcx>(cx: &LateContext<'tcx>, hir_ty: &Ty<'tcx, AmbigArg>) -> bool { + cx.tcx.hir_parent_iter(hir_ty.hir_id).any(|(_, parent)| { + matches!(parent, Node::ImplItem(impl_item) if impl_item.generics.params.iter().any(|param| { + let GenericParamKind::Const { ty: const_ty, .. } = ¶m.kind else { + return false; + }; + ty_contains_ty(const_ty, hir_ty) + })) + }) +} + +fn ty_contains_ty<'tcx>(outer: &Ty<'tcx>, inner: &Ty<'tcx, AmbigArg>) -> bool { + struct ContainsVisitor<'tcx> { + inner: &'tcx Ty<'tcx, AmbigArg>, + } + + impl<'tcx> Visitor<'tcx> for ContainsVisitor<'tcx> { + type Result = ControlFlow<()>; + + fn visit_ty(&mut self, t: &'tcx Ty<'tcx, AmbigArg>) -> Self::Result { + if t.hir_id == self.inner.hir_id { + return ControlFlow::Break(()); + } + + walk_ty(self, t) + } + } + + let mut visitor = ContainsVisitor { inner }; + visitor.visit_ty_unambig(outer).is_break() +} + /// Checks whether types `a` and `b` have the same lifetime parameters. /// /// This function does not check that types `a` and `b` are the same types. diff --git a/src/tools/clippy/clippy_lints/src/utils/author.rs b/src/tools/clippy/clippy_lints/src/utils/author.rs index 685b0a9c0d60..455f76edc904 100644 --- a/src/tools/clippy/clippy_lints/src/utils/author.rs +++ b/src/tools/clippy/clippy_lints/src/utils/author.rs @@ -320,6 +320,8 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> { self.body(field!(anon_const.body)); }, ConstArgKind::Struct(..) => chain!(self, "let ConstArgKind::Struct(..) = {const_arg}.kind"), + ConstArgKind::TupleCall(..) => chain!(self, "let ConstArgKind::TupleCall(..) = {const_arg}.kind"), + ConstArgKind::Tup(..) => chain!(self, "let ConstArgKind::Tup(..) = {const_arg}.kind"), ConstArgKind::Infer(..) => chain!(self, "let ConstArgKind::Infer(..) = {const_arg}.kind"), ConstArgKind::Error(..) => chain!(self, "let ConstArgKind::Error(..) = {const_arg}.kind"), } @@ -724,7 +726,6 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> { kind!("Lit {{ ref {lit}, {negated} }}"); self.lit(lit); }, - PatExprKind::ConstBlock(_) => kind!("ConstBlock(_)"), PatExprKind::Path(_) => self.maybe_path(pat), } } diff --git a/src/tools/clippy/clippy_lints/src/write/empty_string.rs b/src/tools/clippy/clippy_lints/src/write/empty_string.rs index e7eb99eb34ec..1291f2489a21 100644 --- a/src/tools/clippy/clippy_lints/src/write/empty_string.rs +++ b/src/tools/clippy/clippy_lints/src/write/empty_string.rs @@ -1,37 +1,43 @@ use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::macros::MacroCall; use clippy_utils::source::expand_past_previous_comma; -use clippy_utils::sym; +use clippy_utils::{span_extract_comments, sym}; use rustc_ast::{FormatArgs, FormatArgsPiece}; use rustc_errors::Applicability; -use rustc_lint::LateContext; +use rustc_lint::{LateContext, LintContext}; use super::{PRINTLN_EMPTY_STRING, WRITELN_EMPTY_STRING}; pub(super) fn check(cx: &LateContext<'_>, format_args: &FormatArgs, macro_call: &MacroCall, name: &str) { if let [FormatArgsPiece::Literal(sym::LF)] = &format_args.template[..] { - let mut span = format_args.span; - - let lint = if name == "writeln" { - span = expand_past_previous_comma(cx, span); - - WRITELN_EMPTY_STRING - } else { - PRINTLN_EMPTY_STRING - }; + let is_writeln = name == "writeln"; span_lint_and_then( cx, - lint, + if is_writeln { + WRITELN_EMPTY_STRING + } else { + PRINTLN_EMPTY_STRING + }, macro_call.span, format!("empty string literal in `{name}!`"), |diag| { - diag.span_suggestion( - span, - "remove the empty string", - String::new(), - Applicability::MachineApplicable, - ); + if span_extract_comments(cx.sess().source_map(), macro_call.span).is_empty() { + let closing_paren = cx.sess().source_map().span_extend_to_prev_char_before( + macro_call.span.shrink_to_hi(), + ')', + false, + ); + let mut span = format_args.span.with_hi(closing_paren.lo()); + if is_writeln { + span = expand_past_previous_comma(cx, span); + } + + diag.span_suggestion(span, "remove the empty string", "", Applicability::MachineApplicable); + } else { + // If there is a comment in the span of macro call, we don't provide an auto-fix suggestion. + diag.span_note(format_args.span, "remove the empty string"); + } }, ); } diff --git a/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs b/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs index bf133d26ed9d..94c2fb20d5f5 100644 --- a/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs +++ b/src/tools/clippy/clippy_lints/src/zero_sized_map_values.rs @@ -49,7 +49,7 @@ impl LateLintPass<'_> for ZeroSizedMapValues { && !in_trait_impl(cx, hir_ty.hir_id) // We don't care about infer vars && let ty = ty_from_hir_ty(cx, hir_ty.as_unambig_ty()) - && (ty.is_diag_item(cx, sym::HashMap) || ty.is_diag_item(cx, sym::BTreeMap)) + && matches!(ty.opt_diag_name(cx), Some(sym::HashMap | sym::BTreeMap)) && let ty::Adt(_, args) = ty.kind() && let ty = args.type_at(1) // Ensure that no type information is missing, to avoid a delayed bug in the compiler if this is not the case. diff --git a/src/tools/clippy/clippy_lints_internal/src/almost_standard_lint_formulation.rs b/src/tools/clippy/clippy_lints_internal/src/almost_standard_lint_formulation.rs index 7eeec84720f7..b5a12606fb3e 100644 --- a/src/tools/clippy/clippy_lints_internal/src/almost_standard_lint_formulation.rs +++ b/src/tools/clippy/clippy_lints_internal/src/almost_standard_lint_formulation.rs @@ -1,9 +1,11 @@ use crate::lint_without_lint_pass::is_lint_ref_type; use clippy_utils::diagnostics::span_lint_and_help; use regex::Regex; +use rustc_ast::token::DocFragmentKind; use rustc_hir::{Attribute, Item, ItemKind, Mutability}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_tool_lint, impl_lint_pass}; +use rustc_span::{Span, Symbol}; declare_tool_lint! { /// ### What it does @@ -46,28 +48,22 @@ impl<'tcx> LateLintPass<'tcx> for AlmostStandardFormulation { fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { let mut check_next = false; if let ItemKind::Static(Mutability::Not, _, ty, _) = item.kind { - let lines = cx - .tcx - .hir_attrs(item.hir_id()) - .iter() - .filter_map(|attr| Attribute::doc_str(attr).map(|sym| (sym, attr))); + let lines = cx.tcx.hir_attrs(item.hir_id()).iter().filter_map(doc_attr); if is_lint_ref_type(cx, ty) { - for (line, attr) in lines { + for (line, span) in lines { let cur_line = line.as_str().trim(); if check_next && !cur_line.is_empty() { for formulation in &self.standard_formulations { let starts_with_correct_formulation = cur_line.starts_with(formulation.correction); if !starts_with_correct_formulation && formulation.wrong_pattern.is_match(cur_line) { - if let Some(ident) = attr.ident() { - span_lint_and_help( - cx, - ALMOST_STANDARD_LINT_FORMULATION, - ident.span, - "non-standard lint formulation", - None, - format!("consider using `{}`", formulation.correction), - ); - } + span_lint_and_help( + cx, + ALMOST_STANDARD_LINT_FORMULATION, + span, + "non-standard lint formulation", + None, + format!("consider using `{}`", formulation.correction), + ); return; } } @@ -84,3 +80,10 @@ impl<'tcx> LateLintPass<'tcx> for AlmostStandardFormulation { } } } + +fn doc_attr(attr: &Attribute) -> Option<(Symbol, Span)> { + match Attribute::doc_str_and_fragment_kind(attr) { + Some((symbol, DocFragmentKind::Raw(span))) => Some((symbol, span)), + _ => None, + } +} diff --git a/src/tools/clippy/clippy_lints_internal/src/internal_paths.rs b/src/tools/clippy/clippy_lints_internal/src/internal_paths.rs index 95bdf27b019c..14d4139a0065 100644 --- a/src/tools/clippy/clippy_lints_internal/src/internal_paths.rs +++ b/src/tools/clippy/clippy_lints_internal/src/internal_paths.rs @@ -17,6 +17,7 @@ pub static TY_CTXT: PathLookup = type_path!(rustc_middle::ty::TyCtxt); // Paths in clippy itself pub static CLIPPY_SYM_MODULE: PathLookup = type_path!(clippy_utils::sym); +pub static MAYBE_DEF: PathLookup = type_path!(clippy_utils::res::MaybeDef); pub static MSRV_STACK: PathLookup = type_path!(clippy_utils::msrvs::MsrvStack); pub static PATH_LOOKUP_NEW: PathLookup = value_path!(clippy_utils::paths::PathLookup::new); pub static SPAN_LINT_AND_THEN: PathLookup = value_path!(clippy_utils::diagnostics::span_lint_and_then); diff --git a/src/tools/clippy/clippy_lints_internal/src/lib.rs b/src/tools/clippy/clippy_lints_internal/src/lib.rs index d686ba73387c..cca5608fa6be 100644 --- a/src/tools/clippy/clippy_lints_internal/src/lib.rs +++ b/src/tools/clippy/clippy_lints_internal/src/lib.rs @@ -38,6 +38,7 @@ mod lint_without_lint_pass; mod msrv_attr_impl; mod outer_expn_data_pass; mod produce_ice; +mod repeated_is_diagnostic_item; mod symbols; mod unnecessary_def_path; mod unsorted_clippy_utils_paths; @@ -77,4 +78,5 @@ pub fn register_lints(store: &mut LintStore) { store.register_late_pass(|_| Box::new(msrv_attr_impl::MsrvAttrImpl)); store.register_late_pass(|_| Box::new(almost_standard_lint_formulation::AlmostStandardFormulation::new())); store.register_late_pass(|_| Box::new(unusual_names::UnusualNames)); + store.register_late_pass(|_| Box::new(repeated_is_diagnostic_item::RepeatedIsDiagnosticItem)); } diff --git a/src/tools/clippy/clippy_lints_internal/src/repeated_is_diagnostic_item.rs b/src/tools/clippy/clippy_lints_internal/src/repeated_is_diagnostic_item.rs new file mode 100644 index 000000000000..55fb78b1e296 --- /dev/null +++ b/src/tools/clippy/clippy_lints_internal/src/repeated_is_diagnostic_item.rs @@ -0,0 +1,561 @@ +use std::iter; +use std::ops::ControlFlow; + +use crate::internal_paths::MAYBE_DEF; +use clippy_utils::diagnostics::span_lint_and_then; +use clippy_utils::res::{MaybeDef, MaybeTypeckRes}; +use clippy_utils::source::{snippet_indent, snippet_with_applicability}; +use clippy_utils::visitors::for_each_expr; +use clippy_utils::{eq_expr_value, if_sequence, sym}; +use rustc_errors::Applicability; +use rustc_hir::{BinOpKind, Block, Expr, ExprKind, Node, StmtKind, UnOp}; +use rustc_lint::{LateContext, LateLintPass}; +use rustc_middle::ty::print::with_forced_trimmed_paths; +use rustc_session::{declare_lint_pass, declare_tool_lint}; +use rustc_span::Span; + +declare_tool_lint! { + /// ### What it does + /// Checks for repeated use of `MaybeDef::is_diag_item`/`TyCtxt::is_diagnostic_item`; + /// suggests to first call `MaybDef::opt_diag_name`/`TyCtxt::get_diagnostic_name` and then + /// compare the output with all the `Symbol`s. + /// + /// ### Why is this bad? + /// Each of such calls ultimately invokes the `diagnostic_items` query. + /// While the query is cached, it's still better to avoid calling it multiple times if possible. + /// + /// ### Example + /// ```no_run + /// ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result) + /// cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did) + /// + /// if ty.is_diag_item(cx, sym::Option) { + /// .. + /// } else if ty.is_diag_item(cx, sym::Result) { + /// .. + /// } else { + /// .. + /// } + /// + /// if cx.tcx.is_diagnostic_item(sym::Option, did) { + /// .. + /// } else if cx.tcx.is_diagnostic_item(sym::Result, did) { + /// .. + /// } else { + /// .. + /// } + /// + /// { + /// if ty.is_diag_item(cx, sym::Option) { + /// .. + /// } + /// if ty.is_diag_item(cx, sym::Result) { + /// .. + /// } + /// } + /// + /// { + /// if cx.tcx.is_diagnostic_item(sym::Option, did) { + /// .. + /// } + /// if cx.tcx.is_diagnostic_item(sym::Result, did) { + /// .. + /// } + /// } + /// ``` + /// Use instead: + /// ```no_run + /// matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) + /// matches!(cx.tcx.get_diagnostic_name(did), Some(sym::Option | sym::Result)) + /// + /// match ty.opt_diag_name(cx) { + /// Some(sym::Option) => { + /// .. + /// } + /// Some(sym::Result) => { + /// .. + /// } + /// _ => { + /// .. + /// } + /// } + /// + /// match cx.tcx.get_diagnostic_name(did) { + /// Some(sym::Option) => { + /// .. + /// } + /// Some(sym::Result) => { + /// .. + /// } + /// _ => { + /// .. + /// } + /// } + /// + /// { + /// let name = ty.opt_diag_name(cx); + /// if name == Some(sym::Option) { + /// .. + /// } + /// if name == Some(sym::Result) { + /// .. + /// } + /// } + /// + /// { + /// let name = cx.tcx.get_diagnostic_name(did); + /// if name == Some(sym::Option) { + /// .. + /// } + /// if name == Some(sym::Result) { + /// .. + /// } + /// } + /// ``` + pub clippy::REPEATED_IS_DIAGNOSTIC_ITEM, + Warn, + "repeated use of `MaybeDef::is_diag_item`/`TyCtxt::is_diagnostic_item`" +} +declare_lint_pass!(RepeatedIsDiagnosticItem => [REPEATED_IS_DIAGNOSTIC_ITEM]); + +const NOTE: &str = "each call performs the same compiler query -- it's faster to query once, and reuse the results"; + +impl<'tcx> LateLintPass<'tcx> for RepeatedIsDiagnosticItem { + #[expect(clippy::too_many_lines)] + fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'_>) { + for [(cond1, stmt1_span), (cond2, stmt2_span)] in block + .stmts + .windows(2) + .filter_map(|pair| { + if let [if1, if2] = pair + && let StmtKind::Expr(e1) | StmtKind::Semi(e1) = if1.kind + && let ExprKind::If(cond1, ..) = e1.kind + && let StmtKind::Expr(e2) | StmtKind::Semi(e2) = if2.kind + && let ExprKind::If(cond2, ..) = e2.kind + { + Some([(cond1, if1.span), (cond2, if2.span)]) + } else { + None + } + }) + .chain( + if let Some(if1) = block.stmts.last() + && let StmtKind::Expr(e1) | StmtKind::Semi(e1) = if1.kind + && let ExprKind::If(cond1, ..) = e1.kind + && let Some(e2) = block.expr + && let ExprKind::If(cond2, ..) = e2.kind + { + Some([(cond1, if1.span), (cond2, e2.span)]) + } else { + None + }, + ) + { + let lint_span = stmt1_span.to(stmt2_span); + + // if recv1.is_diag_item(cx, sym1) && .. { + // .. + // } + // if recv2.is_diag_item(cx, sym2) && .. { + // .. + // } + if let Some(first @ (span1, (cx1, recv1, _))) = extract_nested_is_diag_item(cx, cond1) + && let Some(second @ (span2, (cx2, recv2, _))) = extract_nested_is_diag_item(cx, cond2) + && eq_expr_value(cx, cx1, cx2) + && eq_expr_value(cx, recv1, recv2) + { + let recv_ty = + with_forced_trimmed_paths!(format!("{}", cx.typeck_results().expr_ty_adjusted(recv1).peel_refs())); + let recv_ty = recv_ty.trim_end_matches("<'_>"); + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + lint_span, + format!("repeated calls to `{recv_ty}::is_diag_item`"), + |diag| { + diag.span_labels([span1, span2], "called here"); + diag.note(NOTE); + + let mut app = Applicability::HasPlaceholders; + let cx_str = snippet_with_applicability(cx, cx1.span, "_", &mut app); + let recv = snippet_with_applicability(cx, recv1.span, "_", &mut app); + let indent = snippet_indent(cx, stmt1_span).unwrap_or_default(); + let sugg: Vec<_> = iter::once(( + stmt1_span.shrink_to_lo(), + format!("let /* name */ = {recv}.opt_diag_name({cx_str});\n{indent}"), + )) // call `opt_diag_name` once + .chain([first, second].into_iter().map(|(expr_span, (_, _, sym))| { + let sym = snippet_with_applicability(cx, sym.span, "_", &mut app); + (expr_span, format!("/* name */ == Some({sym})")) + })) + .collect(); + + diag.multipart_suggestion_verbose( + format!("call `{recv_ty}::opt_diag_name`, and reuse the results"), + sugg, + app, + ); + }, + ); + return; + } + + // if cx.tcx.is_diagnostic_item(sym1, did) && .. { + // .. + // } + // if cx.tcx.is_diagnostic_item(sym2, did) && .. { + // .. + // } + if let Some(first @ (span1, (tcx1, did1, _))) = extract_nested_is_diagnostic_item(cx, cond1) + && let Some(second @ (span2, (tcx2, did2, _))) = extract_nested_is_diagnostic_item(cx, cond2) + && eq_expr_value(cx, tcx1, tcx2) + && eq_expr_value(cx, did1, did2) + { + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + lint_span, + "repeated calls to `TyCtxt::is_diagnostic_item`", + |diag| { + diag.span_labels([span1, span2], "called here"); + diag.note(NOTE); + + let mut app = Applicability::HasPlaceholders; + let tcx = snippet_with_applicability(cx, tcx1.span, "_", &mut app); + let did = snippet_with_applicability(cx, did1.span, "_", &mut app); + let indent = snippet_indent(cx, stmt1_span).unwrap_or_default(); + let sugg: Vec<_> = iter::once(( + stmt1_span.shrink_to_lo(), + format!("let /* name */ = {tcx}.get_diagnostic_name({did});\n{indent}"), + )) // call `get_diagnostic_name` once + .chain([first, second].into_iter().map(|(expr_span, (_, _, sym))| { + let sym = snippet_with_applicability(cx, sym.span, "_", &mut app); + (expr_span, format!("/* name */ == Some({sym})")) + })) + .collect(); + + diag.multipart_suggestion_verbose( + "call `TyCtxt::get_diagnostic_name`, and reuse the results", + sugg, + app, + ); + }, + ); + } + } + } + + fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { + if let ExprKind::Binary(op, left, right) = expr.kind { + if op.node == BinOpKind::Or { + check_ors(cx, expr.span, left, right); + } else if op.node == BinOpKind::And + && let ExprKind::Unary(UnOp::Not, left) = left.kind + && let ExprKind::Unary(UnOp::Not, right) = right.kind + { + check_ands(cx, expr.span, left, right); + } + } else if let (conds, _) = if_sequence(expr) + && !conds.is_empty() + { + check_if_chains(cx, expr, conds); + } + } +} + +fn check_ors(cx: &LateContext<'_>, span: Span, left: &Expr<'_>, right: &Expr<'_>) { + // recv1.is_diag_item(cx, sym1) || recv2.is_diag_item(cx, sym2) + if let Some((cx1, recv1, sym1)) = extract_is_diag_item(cx, left) + && let Some((cx2, recv2, sym2)) = extract_is_diag_item(cx, right) + && eq_expr_value(cx, cx1, cx2) + && eq_expr_value(cx, recv1, recv2) + { + let recv_ty = + with_forced_trimmed_paths!(format!("{}", cx.typeck_results().expr_ty_adjusted(recv1).peel_refs())); + let recv_ty = recv_ty.trim_end_matches("<'_>"); + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + span, + format!("repeated calls to `{recv_ty}::is_diag_item`"), + |diag| { + diag.note(NOTE); + + let mut app = Applicability::MachineApplicable; + let cx_str = snippet_with_applicability(cx, cx1.span, "_", &mut app); + let recv = snippet_with_applicability(cx, recv1.span, "_", &mut app); + let sym1 = snippet_with_applicability(cx, sym1.span, "_", &mut app); + let sym2 = snippet_with_applicability(cx, sym2.span, "_", &mut app); + diag.span_suggestion_verbose( + span, + format!("call `{recv_ty}::opt_diag_name`, and reuse the results"), + format!("matches!({recv}.opt_diag_name({cx_str}), Some({sym1} | {sym2}))"), + app, + ); + }, + ); + return; + } + + // cx.tcx.is_diagnostic_item(sym1, did) || cx.tcx.is_diagnostic_item(sym2, did) + if let Some((tcx1, did1, sym1)) = extract_is_diagnostic_item(cx, left) + && let Some((tcx2, did2, sym2)) = extract_is_diagnostic_item(cx, right) + && eq_expr_value(cx, tcx1, tcx2) + && eq_expr_value(cx, did1, did2) + { + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + span, + "repeated calls to `TyCtxt::is_diagnostic_item`", + |diag| { + diag.note(NOTE); + + let mut app = Applicability::MachineApplicable; + let tcx = snippet_with_applicability(cx, tcx1.span, "_", &mut app); + let did = snippet_with_applicability(cx, did1.span, "_", &mut app); + let sym1 = snippet_with_applicability(cx, sym1.span, "_", &mut app); + let sym2 = snippet_with_applicability(cx, sym2.span, "_", &mut app); + diag.span_suggestion_verbose( + span, + "call `TyCtxt::get_diagnostic_name`, and reuse the results", + format!("matches!({tcx}.get_diagnostic_name({did}), Some({sym1} | {sym2}))"), + app, + ); + }, + ); + } +} + +fn check_ands(cx: &LateContext<'_>, span: Span, left: &Expr<'_>, right: &Expr<'_>) { + // !recv1.is_diag_item(cx, sym1) && !recv2.is_diag_item(cx, sym2) + if let Some((cx1, recv1, sym1)) = extract_is_diag_item(cx, left) + && let Some((cx2, recv2, sym2)) = extract_is_diag_item(cx, right) + && eq_expr_value(cx, cx1, cx2) + && eq_expr_value(cx, recv1, recv2) + { + let recv_ty = + with_forced_trimmed_paths!(format!("{}", cx.typeck_results().expr_ty_adjusted(recv1).peel_refs())); + let recv_ty = recv_ty.trim_end_matches("<'_>"); + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + span, + format!("repeated calls to `{recv_ty}::is_diag_item`"), + |diag| { + diag.note(NOTE); + + let mut app = Applicability::MachineApplicable; + let cx_str = snippet_with_applicability(cx, cx1.span, "_", &mut app); + let recv = snippet_with_applicability(cx, recv1.span, "_", &mut app); + let sym1 = snippet_with_applicability(cx, sym1.span, "_", &mut app); + let sym2 = snippet_with_applicability(cx, sym2.span, "_", &mut app); + diag.span_suggestion_verbose( + span, + format!("call `{recv_ty}::opt_diag_name`, and reuse the results"), + format!("!matches!({recv}.opt_diag_name({cx_str}), Some({sym1} | {sym2}))"), + app, + ); + }, + ); + return; + } + + // !cx.tcx.is_diagnostic_item(sym1, did) && !cx.tcx.is_diagnostic_item(sym2, did) + if let Some((tcx1, did1, sym1)) = extract_is_diagnostic_item(cx, left) + && let Some((tcx2, did2, sym2)) = extract_is_diagnostic_item(cx, right) + && eq_expr_value(cx, tcx1, tcx2) + && eq_expr_value(cx, did1, did2) + { + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + span, + "repeated calls to `TyCtxt::is_diagnostic_item`", + |diag| { + diag.note(NOTE); + + let mut app = Applicability::MachineApplicable; + let tcx = snippet_with_applicability(cx, tcx1.span, "_", &mut app); + let did = snippet_with_applicability(cx, did1.span, "_", &mut app); + let sym1 = snippet_with_applicability(cx, sym1.span, "_", &mut app); + let sym2 = snippet_with_applicability(cx, sym2.span, "_", &mut app); + diag.span_suggestion_verbose( + span, + "call `TyCtxt::get_diagnostic_name`, and reuse the results", + format!("!matches!({tcx}.get_diagnostic_name({did}), Some({sym1} | {sym2}))"), + app, + ); + }, + ); + } +} + +fn check_if_chains<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, conds: Vec<&'tcx Expr<'_>>) { + // if ty.is_diag_item(cx, sym1) { + // .. + // } else if ty.is_diag_item(cx, sym2) { + // .. + // } else { + // .. + // } + let mut found = conds.iter().filter_map(|cond| extract_nested_is_diag_item(cx, cond)); + if let Some(first @ (_, (cx_1, recv1, _))) = found.next() + && let other = + found.filter(|(_, (cx_, recv, _))| eq_expr_value(cx, cx_, cx_1) && eq_expr_value(cx, recv, recv1)) + && let results = iter::once(first).chain(other).collect::>() + && results.len() > 1 + { + let recv_ty = + with_forced_trimmed_paths!(format!("{}", cx.typeck_results().expr_ty_adjusted(recv1).peel_refs())); + let recv_ty = recv_ty.trim_end_matches("<'_>"); + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + expr.span, + format!("repeated calls to `{recv_ty}::is_diag_item`"), + |diag| { + diag.span_labels(results.iter().map(|(span, _)| *span), "called here"); + diag.note(NOTE); + + let mut app = Applicability::HasPlaceholders; + let cx_str = snippet_with_applicability(cx, cx_1.span, "_", &mut app); + let recv = snippet_with_applicability(cx, recv1.span, "_", &mut app); + let span_before = if let Node::LetStmt(let_stmt) = cx.tcx.parent_hir_node(expr.hir_id) { + let_stmt.span + } else { + expr.span + }; + let indent = snippet_indent(cx, span_before).unwrap_or_default(); + let sugg: Vec<_> = iter::once(( + span_before.shrink_to_lo(), + format!("let /* name */ = {recv}.opt_diag_name({cx_str});\n{indent}"), + )) // call `opt_diag_name` once + .chain(results.into_iter().map(|(expr_span, (_, _, sym))| { + let sym = snippet_with_applicability(cx, sym.span, "_", &mut app); + (expr_span, format!("/* name */ == Some({sym})")) + })) + .collect(); + + diag.multipart_suggestion_verbose( + format!("call `{recv_ty}::opt_diag_name`, and reuse the results"), + sugg, + app, + ); + }, + ); + } + + // if cx.tcx.is_diagnostic_item(sym1, did) { + // .. + // } else if cx.tcx.is_diagnostic_item(sym2, did) { + // .. + // } else { + // .. + // } + let mut found = conds + .into_iter() + .filter_map(|cond| extract_nested_is_diagnostic_item(cx, cond)); + if let Some(first @ (_, (tcx1, did1, _))) = found.next() + && let other = found.filter(|(_, (tcx, did, _))| eq_expr_value(cx, tcx, tcx1) && eq_expr_value(cx, did, did1)) + && let results = iter::once(first).chain(other).collect::>() + && results.len() > 1 + { + span_lint_and_then( + cx, + REPEATED_IS_DIAGNOSTIC_ITEM, + expr.span, + "repeated calls to `TyCtxt::is_diagnostic_item`", + |diag| { + diag.span_labels(results.iter().map(|(span, _)| *span), "called here"); + diag.note(NOTE); + + let mut app = Applicability::HasPlaceholders; + let tcx = snippet_with_applicability(cx, tcx1.span, "_", &mut app); + let recv = snippet_with_applicability(cx, did1.span, "_", &mut app); + let span_before = if let Node::LetStmt(let_stmt) = cx.tcx.parent_hir_node(expr.hir_id) { + let_stmt.span + } else { + expr.span + }; + let indent = snippet_indent(cx, span_before).unwrap_or_default(); + let sugg: Vec<_> = iter::once(( + span_before.shrink_to_lo(), + format!("let /* name */ = {tcx}.get_diagnostic_name({recv});\n{indent}"), + )) // call `get_diagnostic_name` once + .chain(results.into_iter().map(|(expr_span, (_, _, sym))| { + let sym = snippet_with_applicability(cx, sym.span, "_", &mut app); + (expr_span, format!("/* name */ == Some({sym})")) + })) + .collect(); + + diag.multipart_suggestion_verbose( + "call `TyCtxt::get_diagnostic_name`, and reuse the results", + sugg, + app, + ); + }, + ); + } +} + +fn extract_is_diag_item<'tcx>( + cx: &LateContext<'_>, + expr: &'tcx Expr<'tcx>, +) -> Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>)> { + if let ExprKind::MethodCall(is_diag_item, recv, [cx_, sym], _) = expr.kind + && is_diag_item.ident.name == sym::is_diag_item + // Whether this a method from the `MaybeDef` trait + && let Some(did) = cx.ty_based_def(expr).opt_parent(cx).opt_def_id() + && MAYBE_DEF.matches(cx, did) + { + Some((cx_, recv, sym)) + } else { + None + } +} + +fn extract_is_diagnostic_item<'tcx>( + cx: &LateContext<'_>, + expr: &'tcx Expr<'tcx>, +) -> Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>)> { + if let ExprKind::MethodCall(is_diag_item, tcx, [sym, did], _) = expr.kind + && is_diag_item.ident.name == sym::is_diagnostic_item + // Whether this is an inherent method on `TyCtxt` + && cx + .ty_based_def(expr) + .opt_parent(cx) + .opt_impl_ty(cx) + .is_diag_item(cx, sym::TyCtxt) + { + Some((tcx, did, sym)) + } else { + None + } +} + +fn extract_nested_is_diag_item<'tcx>( + cx: &LateContext<'tcx>, + cond: &'tcx Expr<'_>, +) -> Option<(Span, (&'tcx Expr<'tcx>, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>))> { + for_each_expr(cx, cond, |cond_part| { + if let Some(res) = extract_is_diag_item(cx, cond_part) { + ControlFlow::Break((cond_part.span, res)) + } else { + ControlFlow::Continue(()) + } + }) +} + +fn extract_nested_is_diagnostic_item<'tcx>( + cx: &LateContext<'tcx>, + cond: &'tcx Expr<'_>, +) -> Option<(Span, (&'tcx Expr<'tcx>, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>))> { + for_each_expr(cx, cond, |cond_part| { + if let Some(res) = extract_is_diagnostic_item(cx, cond_part) { + ControlFlow::Break((cond_part.span, res)) + } else { + ControlFlow::Continue(()) + } + }) +} diff --git a/src/tools/clippy/clippy_utils/README.md b/src/tools/clippy/clippy_utils/README.md index dc8695fef9f5..01257c1a3059 100644 --- a/src/tools/clippy/clippy_utils/README.md +++ b/src/tools/clippy/clippy_utils/README.md @@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain: ``` -nightly-2025-12-11 +nightly-2025-12-25 ``` diff --git a/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs b/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs index 432d7a251a21..618719286e8f 100644 --- a/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs +++ b/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs @@ -976,11 +976,19 @@ pub fn eq_attr(l: &Attribute, r: &Attribute) -> bool { l.style == r.style && match (&l.kind, &r.kind) { (DocComment(l1, l2), DocComment(r1, r2)) => l1 == r1 && l2 == r2, - (Normal(l), Normal(r)) => eq_path(&l.item.path, &r.item.path) && eq_attr_args(&l.item.args, &r.item.args), + (Normal(l), Normal(r)) => eq_path(&l.item.path, &r.item.path) && eq_attr_item_kind(&l.item.args, &r.item.args), _ => false, } } +pub fn eq_attr_item_kind(l: &AttrItemKind, r: &AttrItemKind) -> bool { + match (l, r) { + (AttrItemKind::Unparsed(l), AttrItemKind::Unparsed(r)) => eq_attr_args(l, r), + (AttrItemKind::Parsed(_l), AttrItemKind::Parsed(_r)) => todo!(), + _ => false, + } +} + pub fn eq_attr_args(l: &AttrArgs, r: &AttrArgs) -> bool { use AttrArgs::*; match (l, r) { diff --git a/src/tools/clippy/clippy_utils/src/attrs.rs b/src/tools/clippy/clippy_utils/src/attrs.rs index 2fd773b06781..87fdd755908b 100644 --- a/src/tools/clippy/clippy_utils/src/attrs.rs +++ b/src/tools/clippy/clippy_utils/src/attrs.rs @@ -20,10 +20,11 @@ pub fn get_builtin_attr<'a, A: AttributeExt + 'a>( name: Symbol, ) -> impl Iterator { attrs.iter().filter(move |attr| { - if let Some([clippy, segment2]) = attr.ident_path().as_deref() - && clippy.name == sym::clippy + if let [clippy, segment2] = &*attr.path() + && *clippy == sym::clippy { - let new_name = match segment2.name { + let path_span = attr.path_span().expect("Clippy attributes are unparsed and have a span"); + let new_name = match *segment2 { sym::cyclomatic_complexity => Some("cognitive_complexity"), sym::author | sym::version @@ -35,7 +36,7 @@ pub fn get_builtin_attr<'a, A: AttributeExt + 'a>( | sym::has_significant_drop | sym::format_args => None, _ => { - sess.dcx().span_err(segment2.span, "usage of unknown attribute"); + sess.dcx().span_err(path_span, "usage of unknown attribute"); return false; }, }; @@ -43,17 +44,17 @@ pub fn get_builtin_attr<'a, A: AttributeExt + 'a>( match new_name { Some(new_name) => { sess.dcx() - .struct_span_err(segment2.span, "usage of deprecated attribute") + .struct_span_err(path_span, "usage of deprecated attribute") .with_span_suggestion( - segment2.span, + path_span, "consider using", - new_name, + format!("clippy::{}", new_name), Applicability::MachineApplicable, ) .emit(); false }, - None => segment2.name == name, + None => *segment2 == name, } } else { false @@ -86,7 +87,7 @@ pub fn is_proc_macro(attrs: &[impl AttributeExt]) -> bool { /// Checks whether `attrs` contain `#[doc(hidden)]` pub fn is_doc_hidden(attrs: &[impl AttributeExt]) -> bool { - attrs.iter().any(|attr| attr.is_doc_hidden()) + attrs.iter().any(AttributeExt::is_doc_hidden) } /// Checks whether the given ADT, or any of its fields/variants, are marked as `#[non_exhaustive]` diff --git a/src/tools/clippy/clippy_utils/src/check_proc_macro.rs b/src/tools/clippy/clippy_utils/src/check_proc_macro.rs index d9254fca9453..7fb8616072a5 100644 --- a/src/tools/clippy/clippy_utils/src/check_proc_macro.rs +++ b/src/tools/clippy/clippy_utils/src/check_proc_macro.rs @@ -348,9 +348,9 @@ fn fn_kind_pat(tcx: TyCtxt<'_>, kind: &FnKind<'_>, body: &Body<'_>, hir_id: HirI fn attr_search_pat(attr: &Attribute) -> (Pat, Pat) { match attr.kind { AttrKind::Normal(..) => { - if let Some(ident) = attr.ident() { + if let Some(name) = attr.name() { // NOTE: This will likely have false positives, like `allow = 1` - let ident_string = ident.to_string(); + let ident_string = name.to_string(); if attr.style == AttrStyle::Outer { ( Pat::OwnedMultiStr(vec!["#[".to_owned() + &ident_string, ident_string]), diff --git a/src/tools/clippy/clippy_utils/src/consts.rs b/src/tools/clippy/clippy_utils/src/consts.rs index e43b0b95d9f7..46b87fd5df96 100644 --- a/src/tools/clippy/clippy_utils/src/consts.rs +++ b/src/tools/clippy/clippy_utils/src/consts.rs @@ -578,7 +578,6 @@ impl<'tcx> ConstEvalCtxt<'tcx> { Some(val) } }, - PatExprKind::ConstBlock(ConstBlock { body, .. }) => self.expr(self.tcx.hir_body(*body).value), PatExprKind::Path(qpath) => self.qpath(qpath, pat_expr.hir_id), } } @@ -809,10 +808,12 @@ impl<'tcx> ConstEvalCtxt<'tcx> { | sym::i128_legacy_const_max ) ) || self.tcx.opt_parent(did).is_some_and(|parent| { - parent.is_diag_item(&self.tcx, sym::f16_consts_mod) - || parent.is_diag_item(&self.tcx, sym::f32_consts_mod) - || parent.is_diag_item(&self.tcx, sym::f64_consts_mod) - || parent.is_diag_item(&self.tcx, sym::f128_consts_mod) + matches!( + parent.opt_diag_name(&self.tcx), + Some( + sym::f16_consts_mod | sym::f32_consts_mod | sym::f64_consts_mod | sym::f128_consts_mod + ) + ) })) => { did @@ -1139,7 +1140,9 @@ pub fn const_item_rhs_to_expr<'tcx>(tcx: TyCtxt<'tcx>, ct_rhs: ConstItemRhs<'tcx ConstItemRhs::Body(body_id) => Some(tcx.hir_body(body_id).value), ConstItemRhs::TypeConst(const_arg) => match const_arg.kind { ConstArgKind::Anon(anon) => Some(tcx.hir_body(anon.body).value), - ConstArgKind::Struct(..) | ConstArgKind::Path(_) | ConstArgKind::Error(..) | ConstArgKind::Infer(..) => None, + ConstArgKind::Struct(..) | ConstArgKind::TupleCall(..) | ConstArgKind::Tup(..) | ConstArgKind::Path(_) | ConstArgKind::Error(..) | ConstArgKind::Infer(..) => { + None + }, }, } } diff --git a/src/tools/clippy/clippy_utils/src/hir_utils.rs b/src/tools/clippy/clippy_utils/src/hir_utils.rs index 5cadf5fbb869..57c896c97172 100644 --- a/src/tools/clippy/clippy_utils/src/hir_utils.rs +++ b/src/tools/clippy/clippy_utils/src/hir_utils.rs @@ -4,14 +4,17 @@ use crate::source::{SpanRange, SpanRangeExt, walk_span_to_context}; use crate::tokenize_with_text; use rustc_ast::ast; use rustc_ast::ast::InlineAsmTemplatePiece; -use rustc_data_structures::fx::FxHasher; +use rustc_data_structures::fx::{FxHasher, FxIndexMap}; use rustc_hir::MatchSource::TryDesugar; use rustc_hir::def::{DefKind, Res}; +use rustc_hir::def_id::DefId; use rustc_hir::{ - AssocItemConstraint, BinOpKind, BindingMode, Block, BodyId, ByRef, Closure, ConstArg, ConstArgKind, Expr, - ExprField, ExprKind, FnRetTy, GenericArg, GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, - LifetimeKind, Node, Pat, PatExpr, PatExprKind, PatField, PatKind, Path, PathSegment, PrimTy, QPath, Stmt, StmtKind, - StructTailExpr, TraitBoundModifiers, Ty, TyKind, TyPat, TyPatKind, + AssocItemConstraint, BinOpKind, BindingMode, Block, BodyId, ByRef, Closure, ConstArg, ConstArgKind, ConstItemRhs, + Expr, ExprField, ExprKind, FnDecl, FnRetTy, FnSig, GenericArg, GenericArgs, GenericBound, GenericBounds, + GenericParam, GenericParamKind, GenericParamSource, Generics, HirId, HirIdMap, InlineAsmOperand, ItemId, ItemKind, + LetExpr, Lifetime, LifetimeKind, LifetimeParamKind, Node, ParamName, Pat, PatExpr, PatExprKind, PatField, PatKind, + Path, PathSegment, PreciseCapturingArgKind, PrimTy, QPath, Stmt, StmtKind, StructTailExpr, TraitBoundModifiers, Ty, + TyKind, TyPat, TyPatKind, UseKind, WherePredicate, WherePredicateKind, }; use rustc_lexer::{FrontmatterAllowed, TokenKind, tokenize}; use rustc_lint::LateContext; @@ -106,6 +109,7 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> { left_ctxt: SyntaxContext::root(), right_ctxt: SyntaxContext::root(), locals: HirIdMap::default(), + local_items: FxIndexMap::default(), } } @@ -144,6 +148,7 @@ pub struct HirEqInterExpr<'a, 'b, 'tcx> { // right. For example, when comparing `{ let x = 1; x + 2 }` and `{ let y = 1; y + 2 }`, // these blocks are considered equal since `x` is mapped to `y`. pub locals: HirIdMap, + pub local_items: FxIndexMap, } impl HirEqInterExpr<'_, '_, '_> { @@ -168,6 +173,189 @@ impl HirEqInterExpr<'_, '_, '_> { && self.eq_pat(l.pat, r.pat) }, (StmtKind::Expr(l), StmtKind::Expr(r)) | (StmtKind::Semi(l), StmtKind::Semi(r)) => self.eq_expr(l, r), + (StmtKind::Item(l), StmtKind::Item(r)) => self.eq_item(*l, *r), + _ => false, + } + } + + pub fn eq_item(&mut self, l: ItemId, r: ItemId) -> bool { + let left = self.inner.cx.tcx.hir_item(l); + let right = self.inner.cx.tcx.hir_item(r); + let eq = match (left.kind, right.kind) { + ( + ItemKind::Const(l_ident, l_generics, l_ty, ConstItemRhs::Body(l_body)), + ItemKind::Const(r_ident, r_generics, r_ty, ConstItemRhs::Body(r_body)), + ) => { + l_ident.name == r_ident.name + && self.eq_generics(l_generics, r_generics) + && self.eq_ty(l_ty, r_ty) + && self.eq_body(l_body, r_body) + }, + (ItemKind::Static(l_mut, l_ident, l_ty, l_body), ItemKind::Static(r_mut, r_ident, r_ty, r_body)) => { + l_mut == r_mut && l_ident.name == r_ident.name && self.eq_ty(l_ty, r_ty) && self.eq_body(l_body, r_body) + }, + ( + ItemKind::Fn { + sig: l_sig, + ident: l_ident, + generics: l_generics, + body: l_body, + has_body: l_has_body, + }, + ItemKind::Fn { + sig: r_sig, + ident: r_ident, + generics: r_generics, + body: r_body, + has_body: r_has_body, + }, + ) => { + l_ident.name == r_ident.name + && (l_has_body == r_has_body) + && self.eq_fn_sig(&l_sig, &r_sig) + && self.eq_generics(l_generics, r_generics) + && self.eq_body(l_body, r_body) + }, + (ItemKind::TyAlias(l_ident, l_generics, l_ty), ItemKind::TyAlias(r_ident, r_generics, r_ty)) => { + l_ident.name == r_ident.name && self.eq_generics(l_generics, r_generics) && self.eq_ty(l_ty, r_ty) + }, + (ItemKind::Use(l_path, l_kind), ItemKind::Use(r_path, r_kind)) => { + self.eq_path_segments(l_path.segments, r_path.segments) + && match (l_kind, r_kind) { + (UseKind::Single(l_ident), UseKind::Single(r_ident)) => l_ident.name == r_ident.name, + (UseKind::Glob, UseKind::Glob) | (UseKind::ListStem, UseKind::ListStem) => true, + _ => false, + } + }, + (ItemKind::Mod(l_ident, l_mod), ItemKind::Mod(r_ident, r_mod)) => { + l_ident.name == r_ident.name && over(l_mod.item_ids, r_mod.item_ids, |l, r| self.eq_item(*l, *r)) + }, + _ => false, + }; + if eq { + self.local_items.insert(l.owner_id.to_def_id(), r.owner_id.to_def_id()); + } + eq + } + + fn eq_fn_sig(&mut self, left: &FnSig<'_>, right: &FnSig<'_>) -> bool { + left.header.safety == right.header.safety + && left.header.constness == right.header.constness + && left.header.asyncness == right.header.asyncness + && left.header.abi == right.header.abi + && self.eq_fn_decl(left.decl, right.decl) + } + + fn eq_fn_decl(&mut self, left: &FnDecl<'_>, right: &FnDecl<'_>) -> bool { + over(left.inputs, right.inputs, |l, r| self.eq_ty(l, r)) + && (match (left.output, right.output) { + (FnRetTy::DefaultReturn(_), FnRetTy::DefaultReturn(_)) => true, + (FnRetTy::Return(l_ty), FnRetTy::Return(r_ty)) => self.eq_ty(l_ty, r_ty), + _ => false, + }) + && left.c_variadic == right.c_variadic + && left.implicit_self == right.implicit_self + && left.lifetime_elision_allowed == right.lifetime_elision_allowed + } + + fn eq_generics(&mut self, left: &Generics<'_>, right: &Generics<'_>) -> bool { + self.eq_generics_param(left.params, right.params) + && self.eq_generics_predicate(left.predicates, right.predicates) + } + + fn eq_generics_predicate(&mut self, left: &[WherePredicate<'_>], right: &[WherePredicate<'_>]) -> bool { + over(left, right, |l, r| match (l.kind, r.kind) { + (WherePredicateKind::BoundPredicate(l_bound), WherePredicateKind::BoundPredicate(r_bound)) => { + l_bound.origin == r_bound.origin + && self.eq_ty(l_bound.bounded_ty, r_bound.bounded_ty) + && self.eq_generics_param(l_bound.bound_generic_params, r_bound.bound_generic_params) + && self.eq_generics_bound(l_bound.bounds, r_bound.bounds) + }, + (WherePredicateKind::RegionPredicate(l_region), WherePredicateKind::RegionPredicate(r_region)) => { + Self::eq_lifetime(l_region.lifetime, r_region.lifetime) + && self.eq_generics_bound(l_region.bounds, r_region.bounds) + }, + (WherePredicateKind::EqPredicate(l_eq), WherePredicateKind::EqPredicate(r_eq)) => { + self.eq_ty(l_eq.lhs_ty, r_eq.lhs_ty) + }, + _ => false, + }) + } + + fn eq_generics_bound(&mut self, left: GenericBounds<'_>, right: GenericBounds<'_>) -> bool { + over(left, right, |l, r| match (l, r) { + (GenericBound::Trait(l_trait), GenericBound::Trait(r_trait)) => { + l_trait.modifiers == r_trait.modifiers + && self.eq_path(l_trait.trait_ref.path, r_trait.trait_ref.path) + && self.eq_generics_param(l_trait.bound_generic_params, r_trait.bound_generic_params) + }, + (GenericBound::Outlives(l_lifetime), GenericBound::Outlives(r_lifetime)) => { + Self::eq_lifetime(l_lifetime, r_lifetime) + }, + (GenericBound::Use(l_capture, _), GenericBound::Use(r_capture, _)) => { + over(l_capture, r_capture, |l, r| match (l, r) { + (PreciseCapturingArgKind::Lifetime(l_lifetime), PreciseCapturingArgKind::Lifetime(r_lifetime)) => { + Self::eq_lifetime(l_lifetime, r_lifetime) + }, + (PreciseCapturingArgKind::Param(l_param), PreciseCapturingArgKind::Param(r_param)) => { + l_param.ident == r_param.ident && l_param.res == r_param.res + }, + _ => false, + }) + }, + _ => false, + }) + } + + fn eq_generics_param(&mut self, left: &[GenericParam<'_>], right: &[GenericParam<'_>]) -> bool { + over(left, right, |l, r| { + (match (l.name, r.name) { + (ParamName::Plain(l_ident), ParamName::Plain(r_ident)) + | (ParamName::Error(l_ident), ParamName::Error(r_ident)) => l_ident.name == r_ident.name, + (ParamName::Fresh, ParamName::Fresh) => true, + _ => false, + }) && l.pure_wrt_drop == r.pure_wrt_drop + && self.eq_generics_param_kind(&l.kind, &r.kind) + && (matches!( + (l.source, r.source), + (GenericParamSource::Generics, GenericParamSource::Generics) + | (GenericParamSource::Binder, GenericParamSource::Binder) + )) + }) + } + + fn eq_generics_param_kind(&mut self, left: &GenericParamKind<'_>, right: &GenericParamKind<'_>) -> bool { + match (left, right) { + (GenericParamKind::Lifetime { kind: l_kind }, GenericParamKind::Lifetime { kind: r_kind }) => { + match (l_kind, r_kind) { + (LifetimeParamKind::Explicit, LifetimeParamKind::Explicit) + | (LifetimeParamKind::Error, LifetimeParamKind::Error) => true, + (LifetimeParamKind::Elided(l_lifetime_kind), LifetimeParamKind::Elided(r_lifetime_kind)) => { + l_lifetime_kind == r_lifetime_kind + }, + _ => false, + } + }, + ( + GenericParamKind::Type { + default: l_default, + synthetic: l_synthetic, + }, + GenericParamKind::Type { + default: r_default, + synthetic: r_synthetic, + }, + ) => both(*l_default, *r_default, |l, r| self.eq_ty(l, r)) && l_synthetic == r_synthetic, + ( + GenericParamKind::Const { + ty: l_ty, + default: l_default, + }, + GenericParamKind::Const { + ty: r_ty, + default: r_default, + }, + ) => self.eq_ty(l_ty, r_ty) && both(*l_default, *r_default, |l, r| self.eq_const_arg(l, r)), _ => false, } } @@ -473,22 +661,45 @@ impl HirEqInterExpr<'_, '_, '_> { } fn eq_const_arg(&mut self, left: &ConstArg<'_>, right: &ConstArg<'_>) -> bool { + if !self.check_ctxt(left.span.ctxt(), right.span.ctxt()) { + return false; + } + match (&left.kind, &right.kind) { (ConstArgKind::Path(l_p), ConstArgKind::Path(r_p)) => self.eq_qpath(l_p, r_p), (ConstArgKind::Anon(l_an), ConstArgKind::Anon(r_an)) => self.eq_body(l_an.body, r_an.body), (ConstArgKind::Infer(..), ConstArgKind::Infer(..)) => true, (ConstArgKind::Struct(path_a, inits_a), ConstArgKind::Struct(path_b, inits_b)) => { self.eq_qpath(path_a, path_b) - && inits_a.iter().zip(*inits_b).all(|(init_a, init_b)| { - self.eq_const_arg(init_a.expr, init_b.expr) - }) + && inits_a + .iter() + .zip(*inits_b) + .all(|(init_a, init_b)| self.eq_const_arg(init_a.expr, init_b.expr)) + } + (ConstArgKind::TupleCall(path_a, args_a), ConstArgKind::TupleCall(path_b, args_b)) => { + self.eq_qpath(path_a, path_b) + && args_a + .iter() + .zip(*args_b) + .all(|(arg_a, arg_b)| self.eq_const_arg(arg_a, arg_b)) + } + (ConstArgKind::Tup(args_a), ConstArgKind::Tup(args_b)) => { + args_a + .iter() + .zip(*args_b) + .all(|(arg_a, arg_b)| self.eq_const_arg(arg_a, arg_b)) } // Use explicit match for now since ConstArg is undergoing flux. - (ConstArgKind::Path(..), _) - | (ConstArgKind::Anon(..), _) - | (ConstArgKind::Infer(..), _) - | (ConstArgKind::Struct(..), _) - | (ConstArgKind::Error(..), _) => false, + ( + ConstArgKind::Path(..) + | ConstArgKind::Anon(..) + | ConstArgKind::TupleCall(..) + | ConstArgKind::Tup(..) + | ConstArgKind::Infer(..) + | ConstArgKind::Struct(..) + | ConstArgKind::Error(..), + _, + ) => false, } } @@ -513,9 +724,8 @@ impl HirEqInterExpr<'_, '_, '_> { negated: right_neg, }, ) => left_neg == right_neg && left.node == right.node, - (PatExprKind::ConstBlock(left), PatExprKind::ConstBlock(right)) => self.eq_body(left.body, right.body), (PatExprKind::Path(left), PatExprKind::Path(right)) => self.eq_qpath(left, right), - (PatExprKind::Lit { .. } | PatExprKind::ConstBlock(..) | PatExprKind::Path(..), _) => false, + (PatExprKind::Lit { .. } | PatExprKind::Path(..), _) => false, } } @@ -570,6 +780,17 @@ impl HirEqInterExpr<'_, '_, '_> { match (left.res, right.res) { (Res::Local(l), Res::Local(r)) => l == r || self.locals.get(&l) == Some(&r), (Res::Local(_), _) | (_, Res::Local(_)) => false, + (Res::Def(l_kind, l), Res::Def(r_kind, r)) + if l_kind == r_kind + && let DefKind::Const + | DefKind::Static { .. } + | DefKind::Fn + | DefKind::TyAlias + | DefKind::Use + | DefKind::Mod = l_kind => + { + (l == r || self.local_items.get(&l) == Some(&r)) && self.eq_path_segments(left.segments, right.segments) + }, _ => self.eq_path_segments(left.segments, right.segments), } } @@ -1109,7 +1330,6 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { lit.node.hash(&mut self.s); negated.hash(&mut self.s); }, - PatExprKind::ConstBlock(c) => self.hash_body(c.body), PatExprKind::Path(qpath) => self.hash_qpath(qpath), } } @@ -1344,7 +1564,18 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { for init in *inits { self.hash_const_arg(init.expr); } - } + }, + ConstArgKind::TupleCall(path, args) => { + self.hash_qpath(path); + for arg in *args { + self.hash_const_arg(arg); + } + }, + ConstArgKind::Tup(args) => { + for arg in *args { + self.hash_const_arg(arg); + } + }, ConstArgKind::Infer(..) | ConstArgKind::Error(..) => {}, } } diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs index 409f13013489..38e1542cd758 100644 --- a/src/tools/clippy/clippy_utils/src/lib.rs +++ b/src/tools/clippy/clippy_utils/src/lib.rs @@ -121,6 +121,7 @@ use rustc_middle::ty::{ self as rustc_ty, Binder, BorrowKind, ClosureKind, EarlyBinder, GenericArgKind, GenericArgsRef, IntTy, Ty, TyCtxt, TypeFlags, TypeVisitableExt, UintTy, UpvarCapture, }; +use rustc_hir::attrs::CfgEntry; use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_span::source_map::SourceMap; use rustc_span::symbol::{Ident, Symbol, kw}; @@ -2401,17 +2402,12 @@ pub fn is_test_function(tcx: TyCtxt<'_>, fn_def_id: LocalDefId) -> bool { /// This only checks directly applied attributes, to see if a node is inside a `#[cfg(test)]` parent /// use [`is_in_cfg_test`] pub fn is_cfg_test(tcx: TyCtxt<'_>, id: HirId) -> bool { - tcx.hir_attrs(id).iter().any(|attr| { - if attr.has_name(sym::cfg_trace) - && let Some(items) = attr.meta_item_list() - && let [item] = &*items - && item.has_name(sym::test) - { - true - } else { - false - } - }) + if let Some(cfgs) = find_attr!(tcx.hir_attrs(id), AttributeKind::CfgTrace(cfgs) => cfgs) + && cfgs.iter().any(|(cfg, _)| { matches!(cfg, CfgEntry::NameValue { name: sym::test, ..})}) { + true + } else { + false + } } /// Checks if any parent node of `HirId` has `#[cfg(test)]` attribute applied @@ -2426,11 +2422,10 @@ pub fn is_in_test(tcx: TyCtxt<'_>, hir_id: HirId) -> bool { /// Checks if the item of any of its parents has `#[cfg(...)]` attribute applied. pub fn inherits_cfg(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool { - tcx.has_attr(def_id, sym::cfg_trace) - || tcx + find_attr!(tcx.get_all_attrs(def_id), AttributeKind::CfgTrace(..)) + || find_attr!(tcx .hir_parent_iter(tcx.local_def_id_to_hir_id(def_id)) - .flat_map(|(parent_id, _)| tcx.hir_attrs(parent_id)) - .any(|attr| attr.has_name(sym::cfg_trace)) + .flat_map(|(parent_id, _)| tcx.hir_attrs(parent_id)), AttributeKind::CfgTrace(..)) } /// Walks up the HIR tree from the given expression in an attempt to find where the value is @@ -2490,7 +2485,7 @@ pub enum DefinedTy<'tcx> { /// in the context of its definition site. We also track the `def_id` of its /// definition site. /// - /// WARNING: As the `ty` in in the scope of the definition, not of the function + /// WARNING: As the `ty` is in the scope of the definition, not of the function /// using it, you must be very careful with how you use it. Using it in the wrong /// scope easily results in ICEs. Mir { @@ -2719,7 +2714,6 @@ pub fn expr_use_ctxt<'tcx>(cx: &LateContext<'tcx>, e: &Expr<'tcx>) -> ExprUseCtx moved_before_use, same_ctxt, }, - Some(ControlFlow::Break(_)) => unreachable!("type of node is ControlFlow"), None => ExprUseCtxt { node: Node::Crate(cx.tcx.hir_root_module()), child_id: HirId::INVALID, diff --git a/src/tools/clippy/clippy_utils/src/source.rs b/src/tools/clippy/clippy_utils/src/source.rs index b48d17863aa3..f30f26f3a70b 100644 --- a/src/tools/clippy/clippy_utils/src/source.rs +++ b/src/tools/clippy/clippy_utils/src/source.rs @@ -13,8 +13,8 @@ use rustc_middle::ty::TyCtxt; use rustc_session::Session; use rustc_span::source_map::{SourceMap, original_sp}; use rustc_span::{ - BytePos, DUMMY_SP, DesugaringKind, Pos, RelativeBytePos, SourceFile, SourceFileAndLine, - Span, SpanData, SyntaxContext, hygiene, + BytePos, DUMMY_SP, DesugaringKind, Pos, RelativeBytePos, SourceFile, SourceFileAndLine, Span, SpanData, + SyntaxContext, hygiene, }; use std::borrow::Cow; use std::fmt; diff --git a/src/tools/clippy/clippy_utils/src/sym.rs b/src/tools/clippy/clippy_utils/src/sym.rs index 00f4a9c7e586..a0d2e8673fe6 100644 --- a/src/tools/clippy/clippy_utils/src/sym.rs +++ b/src/tools/clippy/clippy_utils/src/sym.rs @@ -58,6 +58,7 @@ generate! { LowerHex, MAX, MIN, + MaybeDef, MsrvStack, Octal, OpenOptions, @@ -167,6 +168,7 @@ generate! { from_ne_bytes, from_ptr, from_raw, + from_raw_parts, from_str_radix, fs, fuse, @@ -192,6 +194,8 @@ generate! { io, is_ascii, is_char_boundary, + is_diag_item, + is_diagnostic_item, is_digit, is_empty, is_err, @@ -275,6 +279,7 @@ generate! { read_to_string, read_unaligned, read_volatile, + reduce, redundant_imports, redundant_pub_crate, regex, @@ -282,6 +287,7 @@ generate! { repeat, replace, replacen, + res, reserve, resize, restriction, @@ -364,6 +370,7 @@ generate! { trim_start, trim_start_matches, truncate, + try_fold, try_for_each, unreachable_pub, unsafe_removed_from_name, diff --git a/src/tools/clippy/rust-toolchain.toml b/src/tools/clippy/rust-toolchain.toml index 1384f4078ebe..dbec79e111fb 100644 --- a/src/tools/clippy/rust-toolchain.toml +++ b/src/tools/clippy/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # begin autogenerated nightly -channel = "nightly-2025-12-11" +channel = "nightly-2025-12-25" # end autogenerated nightly components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"] profile = "minimal" diff --git a/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.fixed b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.fixed new file mode 100644 index 000000000000..fcacf504804c --- /dev/null +++ b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.fixed @@ -0,0 +1,77 @@ +#![feature(rustc_private)] + +extern crate rustc_hir; +extern crate rustc_lint; +extern crate rustc_middle; +extern crate rustc_span; + +use clippy_utils::res::MaybeDef; +use clippy_utils::sym; +use rustc_hir::def_id::DefId; +use rustc_lint::LateContext; +use rustc_middle::ty::{AdtDef, Ty, TyCtxt}; +use rustc_span::Symbol; + +fn binops(cx: &LateContext<'_>, ty: Ty<'_>, adt_def: &AdtDef<'_>) { + let did = ty.opt_def_id().unwrap(); + + let _ = matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)); + //~^ repeated_is_diagnostic_item + let _ = !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)); + //~^ repeated_is_diagnostic_item + let _ = matches!(adt_def.opt_diag_name(cx), Some(sym::Option | sym::Result)); + //~^ repeated_is_diagnostic_item + let _ = !matches!(adt_def.opt_diag_name(cx), Some(sym::Option | sym::Result)); + //~^ repeated_is_diagnostic_item + let _ = matches!(cx.tcx.get_diagnostic_name(did), Some(sym::Option | sym::Result)); + //~^ repeated_is_diagnostic_item + let _ = !matches!(cx.tcx.get_diagnostic_name(did), Some(sym::Option | sym::Result)); + //~^ repeated_is_diagnostic_item + + // Don't lint: `is_diagnostic_item` is called not on `TyCtxt` + struct FakeTyCtxt; + impl FakeTyCtxt { + fn is_diagnostic_item(&self, sym: Symbol, did: DefId) -> bool { + unimplemented!() + } + } + let f = FakeTyCtxt; + let _ = f.is_diagnostic_item(sym::Option, did) || f.is_diagnostic_item(sym::Result, did); + + // Don't lint: `is_diagnostic_item` on `TyCtxt` comes from a(n unrelated) trait + trait IsDiagnosticItem { + fn is_diagnostic_item(&self, sym: Symbol, did: DefId) -> bool; + } + impl IsDiagnosticItem for TyCtxt<'_> { + fn is_diagnostic_item(&self, sym: Symbol, did: DefId) -> bool { + unimplemented!() + } + } + let _ = IsDiagnosticItem::is_diagnostic_item(&cx.tcx, sym::Option, did) + || IsDiagnosticItem::is_diagnostic_item(&cx.tcx, sym::Result, did); + + // Don't lint: `is_diag_item` is an inherent method + struct DoesntImplMaybeDef; + impl DoesntImplMaybeDef { + fn is_diag_item(&self, cx: &LateContext, sym: Symbol) -> bool { + unimplemented!() + } + } + let d = DoesntImplMaybeDef; + let _ = d.is_diag_item(cx, sym::Option) || d.is_diag_item(cx, sym::Result); + + // Don't lint: `is_diag_item` comes from a trait other than `MaybeDef` + trait FakeMaybeDef { + fn is_diag_item(&self, cx: &LateContext, sym: Symbol) -> bool; + } + struct Bar; + impl FakeMaybeDef for Bar { + fn is_diag_item(&self, cx: &LateContext, sym: Symbol) -> bool { + unimplemented!() + } + } + let b = Bar; + let _ = b.is_diag_item(cx, sym::Option) || b.is_diag_item(cx, sym::Result); +} + +fn main() {} diff --git a/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.rs b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.rs new file mode 100644 index 000000000000..7ccbbfd94029 --- /dev/null +++ b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.rs @@ -0,0 +1,77 @@ +#![feature(rustc_private)] + +extern crate rustc_hir; +extern crate rustc_lint; +extern crate rustc_middle; +extern crate rustc_span; + +use clippy_utils::res::MaybeDef; +use clippy_utils::sym; +use rustc_hir::def_id::DefId; +use rustc_lint::LateContext; +use rustc_middle::ty::{AdtDef, Ty, TyCtxt}; +use rustc_span::Symbol; + +fn binops(cx: &LateContext<'_>, ty: Ty<'_>, adt_def: &AdtDef<'_>) { + let did = ty.opt_def_id().unwrap(); + + let _ = ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result); + //~^ repeated_is_diagnostic_item + let _ = !ty.is_diag_item(cx, sym::Option) && !ty.is_diag_item(cx, sym::Result); + //~^ repeated_is_diagnostic_item + let _ = adt_def.is_diag_item(cx, sym::Option) || adt_def.is_diag_item(cx, sym::Result); + //~^ repeated_is_diagnostic_item + let _ = !adt_def.is_diag_item(cx, sym::Option) && !adt_def.is_diag_item(cx, sym::Result); + //~^ repeated_is_diagnostic_item + let _ = cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did); + //~^ repeated_is_diagnostic_item + let _ = !cx.tcx.is_diagnostic_item(sym::Option, did) && !cx.tcx.is_diagnostic_item(sym::Result, did); + //~^ repeated_is_diagnostic_item + + // Don't lint: `is_diagnostic_item` is called not on `TyCtxt` + struct FakeTyCtxt; + impl FakeTyCtxt { + fn is_diagnostic_item(&self, sym: Symbol, did: DefId) -> bool { + unimplemented!() + } + } + let f = FakeTyCtxt; + let _ = f.is_diagnostic_item(sym::Option, did) || f.is_diagnostic_item(sym::Result, did); + + // Don't lint: `is_diagnostic_item` on `TyCtxt` comes from a(n unrelated) trait + trait IsDiagnosticItem { + fn is_diagnostic_item(&self, sym: Symbol, did: DefId) -> bool; + } + impl IsDiagnosticItem for TyCtxt<'_> { + fn is_diagnostic_item(&self, sym: Symbol, did: DefId) -> bool { + unimplemented!() + } + } + let _ = IsDiagnosticItem::is_diagnostic_item(&cx.tcx, sym::Option, did) + || IsDiagnosticItem::is_diagnostic_item(&cx.tcx, sym::Result, did); + + // Don't lint: `is_diag_item` is an inherent method + struct DoesntImplMaybeDef; + impl DoesntImplMaybeDef { + fn is_diag_item(&self, cx: &LateContext, sym: Symbol) -> bool { + unimplemented!() + } + } + let d = DoesntImplMaybeDef; + let _ = d.is_diag_item(cx, sym::Option) || d.is_diag_item(cx, sym::Result); + + // Don't lint: `is_diag_item` comes from a trait other than `MaybeDef` + trait FakeMaybeDef { + fn is_diag_item(&self, cx: &LateContext, sym: Symbol) -> bool; + } + struct Bar; + impl FakeMaybeDef for Bar { + fn is_diag_item(&self, cx: &LateContext, sym: Symbol) -> bool { + unimplemented!() + } + } + let b = Bar; + let _ = b.is_diag_item(cx, sym::Option) || b.is_diag_item(cx, sym::Result); +} + +fn main() {} diff --git a/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.stderr b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.stderr new file mode 100644 index 000000000000..8c52ba561d79 --- /dev/null +++ b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item.stderr @@ -0,0 +1,82 @@ +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item.rs:18:13 + | +LL | let _ = ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results + = note: `-D clippy::repeated-is-diagnostic-item` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::repeated_is_diagnostic_item)]` +help: call `Ty::opt_diag_name`, and reuse the results + | +LL - let _ = ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result); +LL + let _ = matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)); + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item.rs:20:13 + | +LL | let _ = !ty.is_diag_item(cx, sym::Option) && !ty.is_diag_item(cx, sym::Result); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL - let _ = !ty.is_diag_item(cx, sym::Option) && !ty.is_diag_item(cx, sym::Result); +LL + let _ = !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)); + | + +error: repeated calls to `AdtDef::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item.rs:22:13 + | +LL | let _ = adt_def.is_diag_item(cx, sym::Option) || adt_def.is_diag_item(cx, sym::Result); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `AdtDef::opt_diag_name`, and reuse the results + | +LL - let _ = adt_def.is_diag_item(cx, sym::Option) || adt_def.is_diag_item(cx, sym::Result); +LL + let _ = matches!(adt_def.opt_diag_name(cx), Some(sym::Option | sym::Result)); + | + +error: repeated calls to `AdtDef::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item.rs:24:13 + | +LL | let _ = !adt_def.is_diag_item(cx, sym::Option) && !adt_def.is_diag_item(cx, sym::Result); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `AdtDef::opt_diag_name`, and reuse the results + | +LL - let _ = !adt_def.is_diag_item(cx, sym::Option) && !adt_def.is_diag_item(cx, sym::Result); +LL + let _ = !matches!(adt_def.opt_diag_name(cx), Some(sym::Option | sym::Result)); + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item.rs:26:13 + | +LL | let _ = cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL - let _ = cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did); +LL + let _ = matches!(cx.tcx.get_diagnostic_name(did), Some(sym::Option | sym::Result)); + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item.rs:28:13 + | +LL | let _ = !cx.tcx.is_diagnostic_item(sym::Option, did) && !cx.tcx.is_diagnostic_item(sym::Result, did); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL - let _ = !cx.tcx.is_diagnostic_item(sym::Option, did) && !cx.tcx.is_diagnostic_item(sym::Result, did); +LL + let _ = !matches!(cx.tcx.get_diagnostic_name(did), Some(sym::Option | sym::Result)); + | + +error: aborting due to 6 previous errors + diff --git a/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs new file mode 100644 index 000000000000..807da07ce8aa --- /dev/null +++ b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs @@ -0,0 +1,213 @@ +//@no-rustfix +#![feature(rustc_private)] + +extern crate rustc_hir; +extern crate rustc_lint; +extern crate rustc_middle; +extern crate rustc_span; + +use clippy_utils::res::MaybeDef; +use clippy_utils::sym; +use rustc_hir::def_id::DefId; +use rustc_lint::LateContext; +use rustc_middle::ty::{AdtDef, Ty, TyCtxt}; +use rustc_span::Symbol; + +fn main() {} + +// if-chains with repeated calls on the same `ty` +fn if_chains(cx: &LateContext<'_>, ty: Ty<'_>, adt_def: &AdtDef<'_>) { + let did = ty.opt_def_id().unwrap(); + + let _ = if ty.is_diag_item(cx, sym::Option) { + //~^ repeated_is_diagnostic_item + "Option" + } else if ty.is_diag_item(cx, sym::Result) { + "Result" + } else { + return; + }; + // should ideally suggest the following: + // let _ = match ty.opt_diag_name() { + // Some(sym::Option) => { + // "Option" + // } + // Some(sym::Result) => { + // "Result" + // } + // _ => { + // return; + // } + // }; + + // same but in a stmt + if ty.is_diag_item(cx, sym::Option) { + //~^ repeated_is_diagnostic_item + eprintln!("Option"); + } else if ty.is_diag_item(cx, sym::Result) { + eprintln!("Result"); + } + // should ideally suggest the following: + // match ty.opt_diag_name() { + // Some(sym::Option) => { + // "Option" + // } + // Some(sym::Result) => { + // "Result" + // } + // _ => {} + // }; + + // nested conditions + let _ = if ty.is_diag_item(cx, sym::Option) && 4 == 5 { + //~^ repeated_is_diagnostic_item + "Option" + } else if ty.is_diag_item(cx, sym::Result) && 4 == 5 { + "Result" + } else { + return; + }; + + let _ = if cx.tcx.is_diagnostic_item(sym::Option, did) { + //~^ repeated_is_diagnostic_item + "Option" + } else if cx.tcx.is_diagnostic_item(sym::Result, did) { + "Result" + } else { + return; + }; + // should ideally suggest the following: + // let _ = match cx.get_diagnostic_name(did) { + // Some(sym::Option) => { + // "Option" + // } + // Some(sym::Result) => { + // "Result" + // } + // _ => { + // return; + // } + // }; + + // same but in a stmt + if cx.tcx.is_diagnostic_item(sym::Option, did) { + //~^ repeated_is_diagnostic_item + eprintln!("Option"); + } else if cx.tcx.is_diagnostic_item(sym::Result, did) { + eprintln!("Result"); + } + // should ideally suggest the following: + // match cx.tcx.get_diagnostic_name(did) { + // Some(sym::Option) => { + // "Option" + // } + // Some(sym::Result) => { + // "Result" + // } + // _ => {} + // }; + + // nested conditions + let _ = if cx.tcx.is_diagnostic_item(sym::Option, did) && 4 == 5 { + //~^ repeated_is_diagnostic_item + "Option" + } else if cx.tcx.is_diagnostic_item(sym::Result, did) && 4 == 5 { + "Result" + } else { + return; + }; +} + +// if-chains with repeated calls on the same `ty` +fn consecutive_ifs(cx: &LateContext<'_>, ty: Ty<'_>, adt_def: &AdtDef<'_>) { + let did = ty.opt_def_id().unwrap(); + + { + if ty.is_diag_item(cx, sym::Option) { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if ty.is_diag_item(cx, sym::Result) { + println!("Result"); + } + println!("done!") + } + + // nested conditions + { + if ty.is_diag_item(cx, sym::Option) && 4 == 5 { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if ty.is_diag_item(cx, sym::Result) && 4 == 5 { + println!("Result"); + } + println!("done!") + } + + { + if cx.tcx.is_diagnostic_item(sym::Option, did) { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if cx.tcx.is_diagnostic_item(sym::Result, did) { + println!("Result"); + } + println!("done!") + } + + // nested conditions + { + if cx.tcx.is_diagnostic_item(sym::Option, did) && 4 == 5 { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if cx.tcx.is_diagnostic_item(sym::Result, did) && 4 == 5 { + println!("Result"); + } + println!("done!") + } + + // All the same, but the second if is the final expression + { + if ty.is_diag_item(cx, sym::Option) { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if ty.is_diag_item(cx, sym::Result) { + println!("Result"); + } + } + + // nested conditions + { + if ty.is_diag_item(cx, sym::Option) && 4 == 5 { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if ty.is_diag_item(cx, sym::Result) && 4 == 5 { + println!("Result"); + } + } + + { + if cx.tcx.is_diagnostic_item(sym::Option, did) { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if cx.tcx.is_diagnostic_item(sym::Result, did) { + println!("Result"); + } + } + + // nested conditions + { + if cx.tcx.is_diagnostic_item(sym::Option, did) && 4 == 5 { + //~^ repeated_is_diagnostic_item + println!("Option"); + } + if cx.tcx.is_diagnostic_item(sym::Result, did) && 4 == 5 { + println!("Result"); + } + } +} diff --git a/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item_unfixable.stderr b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item_unfixable.stderr new file mode 100644 index 000000000000..890817da5235 --- /dev/null +++ b/src/tools/clippy/tests/ui-internal/repeated_is_diagnostic_item_unfixable.stderr @@ -0,0 +1,374 @@ +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:22:13 + | +LL | let _ = if ty.is_diag_item(cx, sym::Option) { + | ^ -------------------------------- called here + | _____________| + | | +LL | | +LL | | "Option" +LL | | } else if ty.is_diag_item(cx, sym::Result) { + | | -------------------------------- called here +... | +LL | | return; +LL | | }; + | |_____^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results + = note: `-D clippy::repeated-is-diagnostic-item` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::repeated_is_diagnostic_item)]` +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ let _ = if /* name */ == Some(sym::Option) { +LL | +LL | "Option" +LL ~ } else if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:44:5 + | +LL | if ty.is_diag_item(cx, sym::Option) { + | ^ -------------------------------- called here + | _____| + | | +LL | | +LL | | eprintln!("Option"); +LL | | } else if ty.is_diag_item(cx, sym::Result) { + | | -------------------------------- called here +LL | | eprintln!("Result"); +LL | | } + | |_____^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ if /* name */ == Some(sym::Option) { +LL | +LL | eprintln!("Option"); +LL ~ } else if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:62:13 + | +LL | let _ = if ty.is_diag_item(cx, sym::Option) && 4 == 5 { + | ^ -------------------------------- called here + | _____________| + | | +LL | | +LL | | "Option" +LL | | } else if ty.is_diag_item(cx, sym::Result) && 4 == 5 { + | | -------------------------------- called here +... | +LL | | return; +LL | | }; + | |_____^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ let _ = if /* name */ == Some(sym::Option) && 4 == 5 { +LL | +LL | "Option" +LL ~ } else if /* name */ == Some(sym::Result) && 4 == 5 { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:71:13 + | +LL | let _ = if cx.tcx.is_diagnostic_item(sym::Option, did) { + | ^ ------------------------------------------- called here + | _____________| + | | +LL | | +LL | | "Option" +LL | | } else if cx.tcx.is_diagnostic_item(sym::Result, did) { + | | ------------------------------------------- called here +... | +LL | | return; +LL | | }; + | |_____^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ let _ = if /* name */ == Some(sym::Option) { +LL | +LL | "Option" +LL ~ } else if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:93:5 + | +LL | if cx.tcx.is_diagnostic_item(sym::Option, did) { + | ^ ------------------------------------------- called here + | _____| + | | +LL | | +LL | | eprintln!("Option"); +LL | | } else if cx.tcx.is_diagnostic_item(sym::Result, did) { + | | ------------------------------------------- called here +LL | | eprintln!("Result"); +LL | | } + | |_____^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ if /* name */ == Some(sym::Option) { +LL | +LL | eprintln!("Option"); +LL ~ } else if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:111:13 + | +LL | let _ = if cx.tcx.is_diagnostic_item(sym::Option, did) && 4 == 5 { + | ^ ------------------------------------------- called here + | _____________| + | | +LL | | +LL | | "Option" +LL | | } else if cx.tcx.is_diagnostic_item(sym::Result, did) && 4 == 5 { + | | ------------------------------------------- called here +... | +LL | | return; +LL | | }; + | |_____^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ let _ = if /* name */ == Some(sym::Option) && 4 == 5 { +LL | +LL | "Option" +LL ~ } else if /* name */ == Some(sym::Result) && 4 == 5 { + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:126:9 + | +LL | if ty.is_diag_item(cx, sym::Option) { + | ^ -------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if ty.is_diag_item(cx, sym::Result) { + | | -------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ if /* name */ == Some(sym::Option) { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:138:9 + | +LL | if ty.is_diag_item(cx, sym::Option) && 4 == 5 { + | ^ -------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if ty.is_diag_item(cx, sym::Result) && 4 == 5 { + | | -------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ if /* name */ == Some(sym::Option) && 4 == 5 { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) && 4 == 5 { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:149:9 + | +LL | if cx.tcx.is_diagnostic_item(sym::Option, did) { + | ^ ------------------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if cx.tcx.is_diagnostic_item(sym::Result, did) { + | | ------------------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ if /* name */ == Some(sym::Option) { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:161:9 + | +LL | if cx.tcx.is_diagnostic_item(sym::Option, did) && 4 == 5 { + | ^ ------------------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if cx.tcx.is_diagnostic_item(sym::Result, did) && 4 == 5 { + | | ------------------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ if /* name */ == Some(sym::Option) && 4 == 5 { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) && 4 == 5 { + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:173:9 + | +LL | if ty.is_diag_item(cx, sym::Option) { + | ^ -------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if ty.is_diag_item(cx, sym::Result) { + | | -------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ if /* name */ == Some(sym::Option) { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `Ty::is_diag_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:184:9 + | +LL | if ty.is_diag_item(cx, sym::Option) && 4 == 5 { + | ^ -------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if ty.is_diag_item(cx, sym::Result) && 4 == 5 { + | | -------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `Ty::opt_diag_name`, and reuse the results + | +LL ~ let /* name */ = ty.opt_diag_name(cx); +LL ~ if /* name */ == Some(sym::Option) && 4 == 5 { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) && 4 == 5 { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:194:9 + | +LL | if cx.tcx.is_diagnostic_item(sym::Option, did) { + | ^ ------------------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if cx.tcx.is_diagnostic_item(sym::Result, did) { + | | ------------------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ if /* name */ == Some(sym::Option) { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) { + | + +error: repeated calls to `TyCtxt::is_diagnostic_item` + --> tests/ui-internal/repeated_is_diagnostic_item_unfixable.rs:205:9 + | +LL | if cx.tcx.is_diagnostic_item(sym::Option, did) && 4 == 5 { + | ^ ------------------------------------------- called here + | _________| + | | +LL | | +LL | | println!("Option"); +LL | | } +LL | | if cx.tcx.is_diagnostic_item(sym::Result, did) && 4 == 5 { + | | ------------------------------------------- called here +LL | | println!("Result"); +LL | | } + | |_________^ + | + = note: each call performs the same compiler query -- it's faster to query once, and reuse the results +help: call `TyCtxt::get_diagnostic_name`, and reuse the results + | +LL ~ let /* name */ = cx.tcx.get_diagnostic_name(did); +LL ~ if /* name */ == Some(sym::Option) && 4 == 5 { +LL | +LL | println!("Option"); +LL | } +LL ~ if /* name */ == Some(sym::Result) && 4 == 5 { + | + +error: aborting due to 14 previous errors + diff --git a/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.fixed b/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.fixed index ec45dfd2033a..213b56b786b1 100644 --- a/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.fixed +++ b/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.fixed @@ -1,5 +1,5 @@ #![allow(clippy::eq_op, clippy::nonminimal_bool)] -#![warn(clippy::collapsible_if)] +#![warn(clippy::collapsible_else_if)] #[rustfmt::skip] fn main() { diff --git a/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.rs b/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.rs index 54315a3c32bf..2d4c2c54031e 100644 --- a/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.rs +++ b/src/tools/clippy/tests/ui-toml/collapsible_if/collapsible_else_if.rs @@ -1,5 +1,5 @@ #![allow(clippy::eq_op, clippy::nonminimal_bool)] -#![warn(clippy::collapsible_if)] +#![warn(clippy::collapsible_else_if)] #[rustfmt::skip] fn main() { diff --git a/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.fixed b/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.fixed index 40556ca5410f..962a4e00d86e 100644 --- a/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.fixed +++ b/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.fixed @@ -3,7 +3,7 @@ // Should warn pub fn pub_foo(s: &Vec, b: &u32, x: &mut u32) { - //~^ ERROR: this argument is a mutable reference, but not used mutably + //~^ needless_pass_by_ref_mut *x += *b + s.len() as u32; } diff --git a/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.rs b/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.rs index bbc63ceb15a3..5f584c6704f2 100644 --- a/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.rs +++ b/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.rs @@ -3,7 +3,7 @@ // Should warn pub fn pub_foo(s: &mut Vec, b: &u32, x: &mut u32) { - //~^ ERROR: this argument is a mutable reference, but not used mutably + //~^ needless_pass_by_ref_mut *x += *b + s.len() as u32; } diff --git a/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.stderr b/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.stderr index c10607bf4bab..57137ab08d1e 100644 --- a/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.stderr +++ b/src/tools/clippy/tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.stderr @@ -1,8 +1,10 @@ -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.rs:5:19 | LL | pub fn pub_foo(s: &mut Vec, b: &u32, x: &mut u32) { - | ^^^^^^^^^^^^^ help: consider changing to: `&Vec` + | ^----^^^^^^^^ + | | + | help: consider removing this `mut` | = warning: changing this function will impact semver compatibility = note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings` diff --git a/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/clippy.toml b/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/clippy.toml index c7a326f28295..2c54b73d72d7 100644 --- a/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/clippy.toml +++ b/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/clippy.toml @@ -17,4 +17,6 @@ disallowed-methods = [ # re-exports "conf_disallowed_methods::identity", "conf_disallowed_methods::renamed", + # also used in desugaring + "std::future::Future::poll", ] diff --git a/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs b/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs index 2dac01649a0f..621317246d6d 100644 --- a/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs +++ b/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs @@ -80,3 +80,19 @@ fn main() { renamed(1); //~^ disallowed_methods } + +mod issue16185 { + use std::pin::Pin; + use std::task::Context; + + async fn test(f: impl Future) { + // Should not lint even though desugaring uses + // disallowed method `std::future::Future::poll()`. + f.await + } + + fn explicit>(f: Pin<&mut F>, cx: &mut Context<'_>) { + f.poll(cx); + //~^ disallowed_methods + } +} diff --git a/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.stderr b/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.stderr index 20474ad6e927..8e7e112a93f3 100644 --- a/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.stderr +++ b/src/tools/clippy/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.stderr @@ -99,5 +99,11 @@ error: use of a disallowed method `conf_disallowed_methods::renamed` LL | renamed(1); | ^^^^^^^ -error: aborting due to 16 previous errors +error: use of a disallowed method `std::future::Future::poll` + --> tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs:95:11 + | +LL | f.poll(cx); + | ^^^^ + +error: aborting due to 17 previous errors diff --git a/src/tools/clippy/tests/ui/assertions_on_constants.rs b/src/tools/clippy/tests/ui/assertions_on_constants.rs index f467d4966aef..1c49b6e6b7b1 100644 --- a/src/tools/clippy/tests/ui/assertions_on_constants.rs +++ b/src/tools/clippy/tests/ui/assertions_on_constants.rs @@ -96,3 +96,8 @@ fn _f4() { assert!(C); //~^ assertions_on_constants } + +fn issue_16242(var: bool) { + // should not lint + assert!(cfg!(feature = "hey") && var); +} diff --git a/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.rs b/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.rs index fa322dc28a78..a7f950b44caf 100644 --- a/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.rs +++ b/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.rs @@ -300,3 +300,65 @@ fn issue15004() { //~^ branches_sharing_code }; } + +pub fn issue15347() -> isize { + if false { + static A: isize = 4; + return A; + } else { + static A: isize = 5; + return A; + } + + if false { + //~^ branches_sharing_code + type ISize = isize; + return ISize::MAX; + } else { + type ISize = isize; + return ISize::MAX; + } + + if false { + //~^ branches_sharing_code + fn foo() -> isize { + 4 + } + return foo(); + } else { + fn foo() -> isize { + 4 + } + return foo(); + } + + if false { + //~^ branches_sharing_code + use std::num::NonZeroIsize; + return NonZeroIsize::new(4).unwrap().get(); + } else { + use std::num::NonZeroIsize; + return NonZeroIsize::new(4).unwrap().get(); + } + + if false { + //~^ branches_sharing_code + const B: isize = 5; + return B; + } else { + const B: isize = 5; + return B; + } + + // Should not lint! + const A: isize = 1; + if false { + const B: isize = A; + return B; + } else { + const C: isize = A; + return C; + } + + todo!() +} diff --git a/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.stderr b/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.stderr index 1c470fb0da5e..4ff3990232a5 100644 --- a/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.stderr +++ b/src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.stderr @@ -202,5 +202,73 @@ LL ~ } LL ~ 1; | -error: aborting due to 12 previous errors +error: all if blocks contain the same code at the start + --> tests/ui/branches_sharing_code/shared_at_bottom.rs:313:5 + | +LL | / if false { +LL | | +LL | | type ISize = isize; +LL | | return ISize::MAX; + | |__________________________^ + | +help: consider moving these statements before the if + | +LL ~ type ISize = isize; +LL + return ISize::MAX; +LL + if false { + | + +error: all if blocks contain the same code at the start + --> tests/ui/branches_sharing_code/shared_at_bottom.rs:322:5 + | +LL | / if false { +LL | | +LL | | fn foo() -> isize { +LL | | 4 +LL | | } +LL | | return foo(); + | |_____________________^ + | +help: consider moving these statements before the if + | +LL ~ fn foo() -> isize { +LL + 4 +LL + } +LL + return foo(); +LL + if false { + | + +error: all if blocks contain the same code at the start + --> tests/ui/branches_sharing_code/shared_at_bottom.rs:335:5 + | +LL | / if false { +LL | | +LL | | use std::num::NonZeroIsize; +LL | | return NonZeroIsize::new(4).unwrap().get(); + | |___________________________________________________^ + | +help: consider moving these statements before the if + | +LL ~ use std::num::NonZeroIsize; +LL + return NonZeroIsize::new(4).unwrap().get(); +LL + if false { + | + +error: all if blocks contain the same code at the start + --> tests/ui/branches_sharing_code/shared_at_bottom.rs:344:5 + | +LL | / if false { +LL | | +LL | | const B: isize = 5; +LL | | return B; + | |_________________^ + | +help: consider moving these statements before the if + | +LL ~ const B: isize = 5; +LL + return B; +LL + if false { + | + +error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/cast.stderr b/src/tools/clippy/tests/ui/cast.stderr index 0ff1dc11c3ac..14b84b1ff1ef 100644 --- a/src/tools/clippy/tests/ui/cast.stderr +++ b/src/tools/clippy/tests/ui/cast.stderr @@ -1,4 +1,4 @@ -error: casting `i32` to `f32` causes a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `i32` to `f32` may cause a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast.rs:23:5 | LL | x0 as f32; @@ -7,31 +7,31 @@ LL | x0 as f32; = note: `-D clippy::cast-precision-loss` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::cast_precision_loss)]` -error: casting `i64` to `f32` causes a loss of precision (`i64` is 64 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `i64` to `f32` may cause a loss of precision (`i64` is 64 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast.rs:27:5 | LL | x1 as f32; | ^^^^^^^^^ -error: casting `i64` to `f64` causes a loss of precision (`i64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `i64` to `f64` may cause a loss of precision (`i64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast.rs:30:5 | LL | x1 as f64; | ^^^^^^^^^ -error: casting `u32` to `f32` causes a loss of precision (`u32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `u32` to `f32` may cause a loss of precision (`u32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast.rs:34:5 | LL | x2 as f32; | ^^^^^^^^^ -error: casting `u64` to `f32` causes a loss of precision (`u64` is 64 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `u64` to `f32` may cause a loss of precision (`u64` is 64 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast.rs:38:5 | LL | x3 as f32; | ^^^^^^^^^ -error: casting `u64` to `f64` causes a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `u64` to `f64` may cause a loss of precision (`u64` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast.rs:41:5 | LL | x3 as f64; diff --git a/src/tools/clippy/tests/ui/cast_size.r32bit.stderr b/src/tools/clippy/tests/ui/cast_size.r32bit.stderr index 5811cb3607ba..2f7eeda385e5 100644 --- a/src/tools/clippy/tests/ui/cast_size.r32bit.stderr +++ b/src/tools/clippy/tests/ui/cast_size.r32bit.stderr @@ -13,7 +13,7 @@ LL - 1isize as i8; LL + i8::try_from(1isize); | -error: casting `isize` to `f32` causes a loss of precision (`isize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `isize` to `f32` may cause a loss of precision (`isize` can be up to 64 bits wide depending on the target architecture, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:24:5 | LL | x0 as f32; @@ -22,19 +22,19 @@ LL | x0 as f32; = note: `-D clippy::cast-precision-loss` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::cast_precision_loss)]` -error: casting `usize` to `f32` causes a loss of precision (`usize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `usize` to `f32` may cause a loss of precision (`usize` can be up to 64 bits wide depending on the target architecture, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:26:5 | LL | x1 as f32; | ^^^^^^^^^ -error: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `isize` to `f64` may cause a loss of precision (`isize` can be up to 64 bits wide depending on the target architecture, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast_size.rs:28:5 | LL | x0 as f64; | ^^^^^^^^^ -error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `usize` to `f64` may cause a loss of precision (`usize` can be up to 64 bits wide depending on the target architecture, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast_size.rs:30:5 | LL | x1 as f64; @@ -165,13 +165,13 @@ error: casting `u32` to `isize` may wrap around the value on targets with 32-bit LL | 1u32 as isize; | ^^^^^^^^^^^^^ -error: casting `i32` to `f32` causes a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `i32` to `f32` may cause a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:61:5 | LL | 999_999_999 as f32; | ^^^^^^^^^^^^^^^^^^ -error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `usize` to `f64` may cause a loss of precision (`usize` can be up to 64 bits wide depending on the target architecture, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast_size.rs:63:5 | LL | 9_999_999_999_999_999usize as f64; diff --git a/src/tools/clippy/tests/ui/cast_size.r64bit.stderr b/src/tools/clippy/tests/ui/cast_size.r64bit.stderr index ba1419583aeb..8e5f38137602 100644 --- a/src/tools/clippy/tests/ui/cast_size.r64bit.stderr +++ b/src/tools/clippy/tests/ui/cast_size.r64bit.stderr @@ -13,7 +13,7 @@ LL - 1isize as i8; LL + i8::try_from(1isize); | -error: casting `isize` to `f32` causes a loss of precision (`isize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `isize` to `f32` may cause a loss of precision (`isize` can be up to 64 bits wide depending on the target architecture, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:24:5 | LL | x0 as f32; @@ -22,19 +22,19 @@ LL | x0 as f32; = note: `-D clippy::cast-precision-loss` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::cast_precision_loss)]` -error: casting `usize` to `f32` causes a loss of precision (`usize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `usize` to `f32` may cause a loss of precision (`usize` can be up to 64 bits wide depending on the target architecture, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:26:5 | LL | x1 as f32; | ^^^^^^^^^ -error: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `isize` to `f64` may cause a loss of precision (`isize` can be up to 64 bits wide depending on the target architecture, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast_size.rs:28:5 | LL | x0 as f64; | ^^^^^^^^^ -error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `usize` to `f64` may cause a loss of precision (`usize` can be up to 64 bits wide depending on the target architecture, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast_size.rs:30:5 | LL | x1 as f64; @@ -165,13 +165,13 @@ error: casting `u32` to `isize` may wrap around the value on targets with 32-bit LL | 1u32 as isize; | ^^^^^^^^^^^^^ -error: casting `i32` to `f32` causes a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) +error: casting `i32` to `f32` may cause a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:61:5 | LL | 999_999_999 as f32; | ^^^^^^^^^^^^^^^^^^ -error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide) +error: casting `usize` to `f64` may cause a loss of precision (`usize` can be up to 64 bits wide depending on the target architecture, but `f64`'s mantissa is only 52 bits wide) --> tests/ui/cast_size.rs:63:5 | LL | 9_999_999_999_999_999usize as f64; diff --git a/src/tools/clippy/tests/ui/cmp_null.fixed b/src/tools/clippy/tests/ui/cmp_null.fixed index c12279cf12e6..4a0ee439e94a 100644 --- a/src/tools/clippy/tests/ui/cmp_null.fixed +++ b/src/tools/clippy/tests/ui/cmp_null.fixed @@ -38,3 +38,23 @@ fn issue15010() { debug_assert!(!f.is_null()); //~^ cmp_null } + +fn issue16281() { + use std::ptr; + + struct Container { + value: *const i32, + } + let x = Container { value: ptr::null() }; + + macro_rules! dot_value { + ($obj:expr) => { + $obj.value + }; + } + + if dot_value!(x).is_null() { + //~^ cmp_null + todo!() + } +} diff --git a/src/tools/clippy/tests/ui/cmp_null.rs b/src/tools/clippy/tests/ui/cmp_null.rs index 2771a16e00c5..26ea8960e5fb 100644 --- a/src/tools/clippy/tests/ui/cmp_null.rs +++ b/src/tools/clippy/tests/ui/cmp_null.rs @@ -38,3 +38,23 @@ fn issue15010() { debug_assert!(f != std::ptr::null_mut()); //~^ cmp_null } + +fn issue16281() { + use std::ptr; + + struct Container { + value: *const i32, + } + let x = Container { value: ptr::null() }; + + macro_rules! dot_value { + ($obj:expr) => { + $obj.value + }; + } + + if dot_value!(x) == ptr::null() { + //~^ cmp_null + todo!() + } +} diff --git a/src/tools/clippy/tests/ui/cmp_null.stderr b/src/tools/clippy/tests/ui/cmp_null.stderr index 381747cb3c65..51b98d2a2320 100644 --- a/src/tools/clippy/tests/ui/cmp_null.stderr +++ b/src/tools/clippy/tests/ui/cmp_null.stderr @@ -37,5 +37,11 @@ error: comparing with null is better expressed by the `.is_null()` method LL | debug_assert!(f != std::ptr::null_mut()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!f.is_null()` -error: aborting due to 6 previous errors +error: comparing with null is better expressed by the `.is_null()` method + --> tests/ui/cmp_null.rs:56:8 + | +LL | if dot_value!(x) == ptr::null() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dot_value!(x).is_null()` + +error: aborting due to 7 previous errors diff --git a/src/tools/clippy/tests/ui/collapsible_else_if.fixed b/src/tools/clippy/tests/ui/collapsible_else_if.fixed index e7439beef186..cd2d9be9f433 100644 --- a/src/tools/clippy/tests/ui/collapsible_else_if.fixed +++ b/src/tools/clippy/tests/ui/collapsible_else_if.fixed @@ -1,5 +1,5 @@ #![allow(clippy::assertions_on_constants, clippy::equatable_if_let, clippy::needless_ifs)] -#![warn(clippy::collapsible_if, clippy::collapsible_else_if)] +#![warn(clippy::collapsible_else_if)] #[rustfmt::skip] fn main() { @@ -70,6 +70,17 @@ fn main() { } //~^^^^^^^^ collapsible_else_if + if x == "hello" { + if y == "world" { + print!("Hello "); + } else { + println!("world"); + } + } else if let Some(42) = Some(42) { + println!("42"); + } + //~^^^^^ collapsible_else_if + if x == "hello" { print!("Hello "); } else { @@ -78,6 +89,21 @@ fn main() { println!("world!") } } + + if x == "hello" { + if y == "world" { + print!("Hello "); + } else { + println!("world"); + } + } else { + if let Some(42) = Some(42) { + println!("42"); + } else { + println!("!"); + } + } + } #[rustfmt::skip] @@ -88,30 +114,12 @@ fn issue_7318() { } fn issue_13365() { - // all the `expect`s that we should fulfill + // ensure we fulfill `#[expect]` if true { } else { #[expect(clippy::collapsible_else_if)] if false {} } - - if true { - } else { - #[expect(clippy::style)] - if false {} - } - - if true { - } else { - #[expect(clippy::all)] - if false {} - } - - if true { - } else { - #[expect(warnings)] - if false {} - } } fn issue14799() { diff --git a/src/tools/clippy/tests/ui/collapsible_else_if.rs b/src/tools/clippy/tests/ui/collapsible_else_if.rs index 434ba3654f98..75f204328538 100644 --- a/src/tools/clippy/tests/ui/collapsible_else_if.rs +++ b/src/tools/clippy/tests/ui/collapsible_else_if.rs @@ -1,5 +1,5 @@ #![allow(clippy::assertions_on_constants, clippy::equatable_if_let, clippy::needless_ifs)] -#![warn(clippy::collapsible_if, clippy::collapsible_else_if)] +#![warn(clippy::collapsible_else_if)] #[rustfmt::skip] fn main() { @@ -84,6 +84,19 @@ fn main() { } //~^^^^^^^^ collapsible_else_if + if x == "hello" { + if y == "world" { + print!("Hello "); + } else { + println!("world"); + } + } else { + if let Some(42) = Some(42) { + println!("42"); + } + } + //~^^^^^ collapsible_else_if + if x == "hello" { print!("Hello "); } else { @@ -92,6 +105,21 @@ fn main() { println!("world!") } } + + if x == "hello" { + if y == "world" { + print!("Hello "); + } else { + println!("world"); + } + } else { + if let Some(42) = Some(42) { + println!("42"); + } else { + println!("!"); + } + } + } #[rustfmt::skip] @@ -104,30 +132,12 @@ fn issue_7318() { } fn issue_13365() { - // all the `expect`s that we should fulfill + // ensure we fulfill `#[expect]` if true { } else { #[expect(clippy::collapsible_else_if)] if false {} } - - if true { - } else { - #[expect(clippy::style)] - if false {} - } - - if true { - } else { - #[expect(clippy::all)] - if false {} - } - - if true { - } else { - #[expect(warnings)] - if false {} - } } fn issue14799() { diff --git a/src/tools/clippy/tests/ui/collapsible_else_if.stderr b/src/tools/clippy/tests/ui/collapsible_else_if.stderr index ce1da593a8e9..ebd78d2b1ffe 100644 --- a/src/tools/clippy/tests/ui/collapsible_else_if.stderr +++ b/src/tools/clippy/tests/ui/collapsible_else_if.stderr @@ -142,7 +142,25 @@ LL + } | error: this `else { if .. }` block can be collapsed - --> tests/ui/collapsible_else_if.rs:100:10 + --> tests/ui/collapsible_else_if.rs:93:12 + | +LL | } else { + | ____________^ +LL | | if let Some(42) = Some(42) { +LL | | println!("42"); +LL | | } +LL | | } + | |_____^ + | +help: collapse nested if block + | +LL ~ } else if let Some(42) = Some(42) { +LL + println!("42"); +LL + } + | + +error: this `else { if .. }` block can be collapsed + --> tests/ui/collapsible_else_if.rs:128:10 | LL | }else{ | __________^ @@ -151,7 +169,7 @@ LL | | } | |_____^ help: collapse nested if block: `if false {}` error: this `else { if .. }` block can be collapsed - --> tests/ui/collapsible_else_if.rs:157:12 + --> tests/ui/collapsible_else_if.rs:167:12 | LL | } else { | ____________^ @@ -159,5 +177,5 @@ LL | | (if y == "world" { println!("world") } else { println!("!") }) LL | | } | |_____^ help: collapse nested if block: `if y == "world" { println!("world") } else { println!("!") }` -error: aborting due to 9 previous errors +error: aborting due to 10 previous errors diff --git a/src/tools/clippy/tests/ui/crashes/ice-10148.stderr b/src/tools/clippy/tests/ui/crashes/ice-10148.stderr index 639cf2dd442b..e91fb3778a31 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-10148.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-10148.stderr @@ -2,7 +2,7 @@ error: empty string literal in `println!` --> tests/ui/crashes/ice-10148.rs:8:5 | LL | println!(with_span!(""something "")); - | ^^^^^^^^^^^^^^^^^^^^-----------^^^^^ + | ^^^^^^^^^^^^^^^^^^^^---------------^ | | | help: remove the empty string | diff --git a/src/tools/clippy/tests/ui/crashes/ice-7410.rs b/src/tools/clippy/tests/ui/crashes/ice-7410.rs index 71f00fb9aede..7b39f7ffc01a 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-7410.rs +++ b/src/tools/clippy/tests/ui/crashes/ice-7410.rs @@ -1,6 +1,6 @@ //@ check-pass //@compile-flags: -Clink-arg=-nostartfiles -//@ignore-target: apple windows +//@ignore-target: windows #![crate_type = "lib"] #![no_std] diff --git a/src/tools/clippy/tests/ui/def_id_nocore.rs b/src/tools/clippy/tests/ui/def_id_nocore.rs index 5c13d8622767..6aa023a8d450 100644 --- a/src/tools/clippy/tests/ui/def_id_nocore.rs +++ b/src/tools/clippy/tests/ui/def_id_nocore.rs @@ -1,5 +1,3 @@ -//@ignore-target: apple - #![feature(no_core, lang_items)] #![no_core] #![allow(clippy::missing_safety_doc)] diff --git a/src/tools/clippy/tests/ui/def_id_nocore.stderr b/src/tools/clippy/tests/ui/def_id_nocore.stderr index 175dd0754081..bf022fb56a36 100644 --- a/src/tools/clippy/tests/ui/def_id_nocore.stderr +++ b/src/tools/clippy/tests/ui/def_id_nocore.stderr @@ -1,5 +1,5 @@ error: methods called `as_*` usually take `self` by reference or `self` by mutable reference - --> tests/ui/def_id_nocore.rs:33:19 + --> tests/ui/def_id_nocore.rs:31:19 | LL | pub fn as_ref(self) -> &'static str { | ^^^^ diff --git a/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.fixed b/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.fixed index abdf6ca5cb61..caf34eaefab9 100644 --- a/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.fixed +++ b/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.fixed @@ -1,5 +1,6 @@ #![warn(clippy::empty_enum_variants_with_brackets)] #![allow(dead_code)] +#![feature(more_qualified_paths)] pub enum PublicTestEnum { NonEmptyBraces { x: i32, y: i32 }, // No error @@ -102,4 +103,62 @@ pub enum PubFoo { Variant3(), } +fn issue16157() { + enum E { + V, + //~^ empty_enum_variants_with_brackets + } + + let E::V = E::V; + + ::V = E::V; + ::V = E::V; +} + +fn variant_with_braces() { + enum E { + V, + //~^ empty_enum_variants_with_brackets + } + E::V = E::V; + E::V = E::V; + ::V = ::V; + + enum F { + U, + //~^ empty_enum_variants_with_brackets + } + F::U = F::U; + ::U = F::U; +} + +fn variant_with_comments_and_cfg() { + enum E { + V( + // This is a comment + ), + } + E::V() = E::V(); + + enum F { + U { + // This is a comment + }, + } + F::U {} = F::U {}; + + enum G { + V(#[cfg(target_os = "cuda")] String), + } + G::V() = G::V(); + + enum H { + U { + #[cfg(target_os = "cuda")] + value: String, + }, + } + H::U {} = H::U {}; +} + fn main() {} diff --git a/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.rs b/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.rs index 63a5a8e9143e..f7ab062edd1e 100644 --- a/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.rs +++ b/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.rs @@ -1,5 +1,6 @@ #![warn(clippy::empty_enum_variants_with_brackets)] #![allow(dead_code)] +#![feature(more_qualified_paths)] pub enum PublicTestEnum { NonEmptyBraces { x: i32, y: i32 }, // No error @@ -102,4 +103,62 @@ pub enum PubFoo { Variant3(), } +fn issue16157() { + enum E { + V(), + //~^ empty_enum_variants_with_brackets + } + + let E::V() = E::V(); + + ::V() = E::V(); + ::V {} = E::V(); +} + +fn variant_with_braces() { + enum E { + V(), + //~^ empty_enum_variants_with_brackets + } + E::V() = E::V(); + E::V() = E::V {}; + ::V {} = ::V {}; + + enum F { + U {}, + //~^ empty_enum_variants_with_brackets + } + F::U {} = F::U {}; + ::U {} = F::U {}; +} + +fn variant_with_comments_and_cfg() { + enum E { + V( + // This is a comment + ), + } + E::V() = E::V(); + + enum F { + U { + // This is a comment + }, + } + F::U {} = F::U {}; + + enum G { + V(#[cfg(target_os = "cuda")] String), + } + G::V() = G::V(); + + enum H { + U { + #[cfg(target_os = "cuda")] + value: String, + }, + } + H::U {} = H::U {}; +} + fn main() {} diff --git a/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.stderr b/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.stderr index 7fe85e829a35..d50b07036a94 100644 --- a/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.stderr +++ b/src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.stderr @@ -1,5 +1,5 @@ error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:7:16 + --> tests/ui/empty_enum_variants_with_brackets.rs:8:16 | LL | EmptyBraces {}, | ^^^ @@ -9,7 +9,7 @@ LL | EmptyBraces {}, = help: remove the brackets error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:15:16 + --> tests/ui/empty_enum_variants_with_brackets.rs:16:16 | LL | EmptyBraces {}, | ^^^ @@ -17,7 +17,7 @@ LL | EmptyBraces {}, = help: remove the brackets error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:17:21 + --> tests/ui/empty_enum_variants_with_brackets.rs:18:21 | LL | EmptyParentheses(), | ^^ @@ -25,7 +25,7 @@ LL | EmptyParentheses(), = help: remove the brackets error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:28:16 + --> tests/ui/empty_enum_variants_with_brackets.rs:29:16 | LL | Unknown(), | ^^ @@ -33,7 +33,7 @@ LL | Unknown(), = help: remove the brackets error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:47:16 + --> tests/ui/empty_enum_variants_with_brackets.rs:48:16 | LL | Unknown(), | ^^ @@ -41,7 +41,7 @@ LL | Unknown(), = help: remove the brackets error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:53:20 + --> tests/ui/empty_enum_variants_with_brackets.rs:54:20 | LL | Parentheses(), | ^^ @@ -56,7 +56,7 @@ LL ~ RedundantParenthesesFunctionCall::Parentheses; | error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:76:20 + --> tests/ui/empty_enum_variants_with_brackets.rs:77:20 | LL | Parentheses(), | ^^ @@ -71,12 +71,61 @@ LL ~ Parentheses, | error: enum variant has empty brackets - --> tests/ui/empty_enum_variants_with_brackets.rs:95:13 + --> tests/ui/empty_enum_variants_with_brackets.rs:96:13 | LL | Variant3(), | ^^ | = help: remove the brackets -error: aborting due to 8 previous errors +error: enum variant has empty brackets + --> tests/ui/empty_enum_variants_with_brackets.rs:108:10 + | +LL | V(), + | ^^ + | +help: remove the brackets + | +LL ~ V, +LL | +LL | } +LL | +LL ~ let E::V = E::V; +LL | +LL ~ ::V = E::V; +LL ~ ::V = E::V; + | + +error: enum variant has empty brackets + --> tests/ui/empty_enum_variants_with_brackets.rs:120:10 + | +LL | V(), + | ^^ + | +help: remove the brackets + | +LL ~ V, +LL | +LL | } +LL ~ E::V = E::V; +LL ~ E::V = E::V; +LL ~ ::V = ::V; + | + +error: enum variant has empty brackets + --> tests/ui/empty_enum_variants_with_brackets.rs:128:10 + | +LL | U {}, + | ^^^ + | +help: remove the brackets + | +LL ~ U, +LL | +LL | } +LL ~ F::U = F::U; +LL ~ ::U = F::U; + | + +error: aborting due to 11 previous errors diff --git a/src/tools/clippy/tests/ui/empty_loop_no_std.rs b/src/tools/clippy/tests/ui/empty_loop_no_std.rs index 6407bd678f9c..1ea96abbcd8b 100644 --- a/src/tools/clippy/tests/ui/empty_loop_no_std.rs +++ b/src/tools/clippy/tests/ui/empty_loop_no_std.rs @@ -1,6 +1,4 @@ //@compile-flags: -Clink-arg=-nostartfiles -//@ignore-target: apple - #![warn(clippy::empty_loop)] #![crate_type = "lib"] #![no_std] diff --git a/src/tools/clippy/tests/ui/empty_loop_no_std.stderr b/src/tools/clippy/tests/ui/empty_loop_no_std.stderr index f36fb9d9e3f2..e34b50ed1aef 100644 --- a/src/tools/clippy/tests/ui/empty_loop_no_std.stderr +++ b/src/tools/clippy/tests/ui/empty_loop_no_std.stderr @@ -1,5 +1,5 @@ error: empty `loop {}` wastes CPU cycles - --> tests/ui/empty_loop_no_std.rs:10:5 + --> tests/ui/empty_loop_no_std.rs:8:5 | LL | loop {} | ^^^^^^^ diff --git a/src/tools/clippy/tests/ui/entry.fixed b/src/tools/clippy/tests/ui/entry.fixed index 1e36ca4f1f09..75e173b9a84d 100644 --- a/src/tools/clippy/tests/ui/entry.fixed +++ b/src/tools/clippy/tests/ui/entry.fixed @@ -273,3 +273,13 @@ mod issue_16173 { } fn main() {} + +fn issue15781(m: &mut std::collections::HashMap, k: i32, v: i32) { + fn very_important_fn() {} + m.entry(k).or_insert_with(|| { + //~^ map_entry + #[cfg(test)] + very_important_fn(); + v + }); +} diff --git a/src/tools/clippy/tests/ui/entry.rs b/src/tools/clippy/tests/ui/entry.rs index b3da0ef3ffd6..7e3308c87356 100644 --- a/src/tools/clippy/tests/ui/entry.rs +++ b/src/tools/clippy/tests/ui/entry.rs @@ -279,3 +279,13 @@ mod issue_16173 { } fn main() {} + +fn issue15781(m: &mut std::collections::HashMap, k: i32, v: i32) { + fn very_important_fn() {} + if !m.contains_key(&k) { + //~^ map_entry + #[cfg(test)] + very_important_fn(); + m.insert(k, v); + } +} diff --git a/src/tools/clippy/tests/ui/entry.stderr b/src/tools/clippy/tests/ui/entry.stderr index 009b78d29073..4a29b3860e89 100644 --- a/src/tools/clippy/tests/ui/entry.stderr +++ b/src/tools/clippy/tests/ui/entry.stderr @@ -246,5 +246,26 @@ LL + e.insert(42); LL + } | -error: aborting due to 11 previous errors +error: usage of `contains_key` followed by `insert` on a `HashMap` + --> tests/ui/entry.rs:285:5 + | +LL | / if !m.contains_key(&k) { +LL | | +LL | | #[cfg(test)] +LL | | very_important_fn(); +LL | | m.insert(k, v); +LL | | } + | |_____^ + | +help: try + | +LL ~ m.entry(k).or_insert_with(|| { +LL + +LL + #[cfg(test)] +LL + very_important_fn(); +LL + v +LL + }); + | + +error: aborting due to 12 previous errors diff --git a/src/tools/clippy/tests/ui/format_push_string.fixed b/src/tools/clippy/tests/ui/format_push_string.fixed new file mode 100644 index 000000000000..f6396d9982a3 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string.fixed @@ -0,0 +1,132 @@ +#![warn(clippy::format_push_string)] + +fn main() { + use std::fmt::Write; + + let mut string = String::new(); + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + + let _ = write!(string, "{:?}", 5678); + //~^ format_push_string + + macro_rules! string { + () => { + String::new() + }; + } + let _ = write!(string!(), "{:?}", 5678); + //~^ format_push_string +} + +// TODO: recognize the already imported `fmt::Write`, and don't add a note suggesting to import it +// again +mod import_write { + mod push_str { + mod imported_anonymously { + fn main(string: &mut String) { + use std::fmt::Write as _; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported { + fn main(string: &mut String) { + use std::fmt::Write; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported_anonymously_in_module { + use std::fmt::Write as _; + + fn main(string: &mut String) { + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported_in_module { + use std::fmt::Write; + + fn main(string: &mut String) { + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported_and_imported { + fn foo(string: &mut String) { + use std::fmt::Write; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + + fn bar(string: &mut String) { + use std::fmt::Write; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + } + + mod add_assign { + mod imported_anonymously { + fn main(string: &mut String) { + use std::fmt::Write as _; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported { + fn main(string: &mut String) { + use std::fmt::Write; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported_anonymously_in_module { + use std::fmt::Write as _; + + fn main(string: &mut String) { + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported_in_module { + use std::fmt::Write; + + fn main(string: &mut String) { + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + + mod imported_and_imported { + fn foo(string: &mut String) { + use std::fmt::Write; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + + fn bar(string: &mut String) { + use std::fmt::Write; + + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string + } + } + } +} diff --git a/src/tools/clippy/tests/ui/format_push_string.rs b/src/tools/clippy/tests/ui/format_push_string.rs index 056ef59ff0e2..1ed0f5b3ac59 100644 --- a/src/tools/clippy/tests/ui/format_push_string.rs +++ b/src/tools/clippy/tests/ui/format_push_string.rs @@ -1,44 +1,132 @@ #![warn(clippy::format_push_string)] fn main() { + use std::fmt::Write; + let mut string = String::new(); string += &format!("{:?}", 1234); //~^ format_push_string string.push_str(&format!("{:?}", 5678)); //~^ format_push_string + + macro_rules! string { + () => { + String::new() + }; + } + string!().push_str(&format!("{:?}", 5678)); + //~^ format_push_string } -mod issue9493 { - pub fn u8vec_to_hex(vector: &Vec, upper: bool) -> String { - let mut hex = String::with_capacity(vector.len() * 2); - for byte in vector { - hex += &(if upper { +// TODO: recognize the already imported `fmt::Write`, and don't add a note suggesting to import it +// again +mod import_write { + mod push_str { + mod imported_anonymously { + fn main(string: &mut String) { + use std::fmt::Write as _; + + string.push_str(&format!("{:?}", 1234)); //~^ format_push_string - - format!("{byte:02X}") - } else { - format!("{byte:02x}") - }); + } + } + + mod imported { + fn main(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported_anonymously_in_module { + use std::fmt::Write as _; + + fn main(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported_in_module { + use std::fmt::Write; + + fn main(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported_and_imported { + fn foo(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } } - hex } - pub fn other_cases() { - let mut s = String::new(); - // if let - s += &(if let Some(_a) = Some(1234) { - //~^ format_push_string + mod add_assign { + mod imported_anonymously { + fn main(string: &mut String) { + use std::fmt::Write as _; - format!("{}", 1234) - } else { - format!("{}", 1234) - }); - // match - s += &(match Some(1234) { - //~^ format_push_string - Some(_) => format!("{}", 1234), - None => format!("{}", 1234), - }); + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported { + fn main(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported_anonymously_in_module { + use std::fmt::Write as _; + + fn main(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported_in_module { + use std::fmt::Write; + + fn main(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + mod imported_and_imported { + fn foo(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } } } diff --git a/src/tools/clippy/tests/ui/format_push_string.stderr b/src/tools/clippy/tests/ui/format_push_string.stderr index bba2a8947c43..05e26fcbfc2b 100644 --- a/src/tools/clippy/tests/ui/format_push_string.stderr +++ b/src/tools/clippy/tests/ui/format_push_string.stderr @@ -1,60 +1,199 @@ error: `format!(..)` appended to existing `String` - --> tests/ui/format_push_string.rs:5:5 + --> tests/ui/format_push_string.rs:7:5 | LL | string += &format!("{:?}", 1234); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: consider using `write!` to avoid the extra allocation + = note: you may need to import the `std::fmt::Write` trait = note: `-D clippy::format-push-string` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::format_push_string)]` +help: consider using `write!` to avoid the extra allocation + | +LL - string += &format!("{:?}", 1234); +LL + let _ = write!(string, "{:?}", 1234); + | error: `format!(..)` appended to existing `String` - --> tests/ui/format_push_string.rs:8:5 + --> tests/ui/format_push_string.rs:10:5 | LL | string.push_str(&format!("{:?}", 5678)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: consider using `write!` to avoid the extra allocation + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 5678)); +LL + let _ = write!(string, "{:?}", 5678); + | error: `format!(..)` appended to existing `String` - --> tests/ui/format_push_string.rs:16:13 + --> tests/ui/format_push_string.rs:18:5 | -LL | / hex += &(if upper { -LL | | -LL | | -LL | | format!("{byte:02X}") -LL | | } else { -LL | | format!("{byte:02x}") -LL | | }); - | |______________^ +LL | string!().push_str(&format!("{:?}", 5678)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string!().push_str(&format!("{:?}", 5678)); +LL + let _ = write!(string!(), "{:?}", 5678); | - = help: consider using `write!` to avoid the extra allocation error: `format!(..)` appended to existing `String` - --> tests/ui/format_push_string.rs:30:9 + --> tests/ui/format_push_string.rs:30:17 | -LL | / s += &(if let Some(_a) = Some(1234) { -LL | | -LL | | -LL | | format!("{}", 1234) -LL | | } else { -LL | | format!("{}", 1234) -LL | | }); - | |__________^ +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); | - = help: consider using `write!` to avoid the extra allocation error: `format!(..)` appended to existing `String` - --> tests/ui/format_push_string.rs:38:9 + --> tests/ui/format_push_string.rs:39:17 | -LL | / s += &(match Some(1234) { -LL | | -LL | | Some(_) => format!("{}", 1234), -LL | | None => format!("{}", 1234), -LL | | }); - | |__________^ +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); | - = help: consider using `write!` to avoid the extra allocation -error: aborting due to 5 previous errors +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:48:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:57:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:66:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:73:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:84:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:93:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:102:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:111:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:120:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string.rs:127:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: aborting due to 15 previous errors diff --git a/src/tools/clippy/tests/ui/format_push_string_no_core.rs b/src/tools/clippy/tests/ui/format_push_string_no_core.rs new file mode 100644 index 000000000000..4bc45906fa78 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_no_core.rs @@ -0,0 +1,15 @@ +//@check-pass +#![warn(clippy::format_push_string)] +#![no_std] +#![feature(no_core)] +#![no_core] + +extern crate alloc; + +use alloc::format; +use alloc::string::String; + +fn foo(string: &mut String) { + // can't suggest even `core::fmt::Write` because of `#![no_core]` + string.push_str(&format!("{:?}", 1234)); +} diff --git a/src/tools/clippy/tests/ui/format_push_string_no_std.fixed b/src/tools/clippy/tests/ui/format_push_string_no_std.fixed new file mode 100644 index 000000000000..32d8659dcbd5 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_no_std.fixed @@ -0,0 +1,15 @@ +#![warn(clippy::format_push_string)] +#![no_std] + +extern crate alloc; + +use alloc::format; +use alloc::string::String; + +fn foo(string: &mut String) { + use core::fmt::Write; + + // TODO: recognize the already imported `fmt::Write`, and don't suggest importing it again + let _ = write!(string, "{:?}", 1234); + //~^ format_push_string +} diff --git a/src/tools/clippy/tests/ui/format_push_string_no_std.rs b/src/tools/clippy/tests/ui/format_push_string_no_std.rs new file mode 100644 index 000000000000..a74189abe528 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_no_std.rs @@ -0,0 +1,15 @@ +#![warn(clippy::format_push_string)] +#![no_std] + +extern crate alloc; + +use alloc::format; +use alloc::string::String; + +fn foo(string: &mut String) { + use core::fmt::Write; + + // TODO: recognize the already imported `fmt::Write`, and don't suggest importing it again + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string +} diff --git a/src/tools/clippy/tests/ui/format_push_string_no_std.stderr b/src/tools/clippy/tests/ui/format_push_string_no_std.stderr new file mode 100644 index 000000000000..30fd42ac71b2 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_no_std.stderr @@ -0,0 +1,17 @@ +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_no_std.rs:13:5 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `core::fmt::Write` trait + = note: `-D clippy::format-push-string` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::format_push_string)]` +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: aborting due to 1 previous error + diff --git a/src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.rs b/src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.rs new file mode 100644 index 000000000000..f5ed5e435b5a --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.rs @@ -0,0 +1,13 @@ +//@no-rustfix +#![warn(clippy::format_push_string)] +#![no_std] + +extern crate alloc; + +use alloc::format; +use alloc::string::String; + +fn foo(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string +} diff --git a/src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.stderr b/src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.stderr new file mode 100644 index 000000000000..cc716c84efe2 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.stderr @@ -0,0 +1,17 @@ +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_no_std_unfixable.rs:11:5 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `core::fmt::Write` trait + = note: `-D clippy::format-push-string` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::format_push_string)]` +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: aborting due to 1 previous error + diff --git a/src/tools/clippy/tests/ui/format_push_string_unfixable.rs b/src/tools/clippy/tests/ui/format_push_string_unfixable.rs new file mode 100644 index 000000000000..ff6c13fe4a49 --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_unfixable.rs @@ -0,0 +1,144 @@ +//@no-rustfix +#![warn(clippy::format_push_string)] + +mod issue9493 { + pub fn u8vec_to_hex(vector: &Vec, upper: bool) -> String { + let mut hex = String::with_capacity(vector.len() * 2); + for byte in vector { + hex += &(if upper { + format!("{byte:02X}") + //~^ format_push_string + } else { + format!("{byte:02x}") + }); + } + hex + } + + pub fn other_cases() { + let mut s = String::new(); + // if let + s += &(if let Some(_a) = Some(1234) { + format!("{}", 1234) + //~^ format_push_string + } else { + format!("{}", 1234) + }); + // match + s += &(match Some(1234) { + Some(_) => format!("{}", 1234), + //~^ format_push_string + None => format!("{}", 1234), + }); + } +} + +mod import_write { + mod push_str { + // TODO: suggest importing `std::fmt::Write`; + mod not_imported { + fn main(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + // TODO: suggest importing the first time, but not again + mod not_imported_and_not_imported { + fn foo(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + // TODO: suggest importing the first time, but not again + mod not_imported_and_imported { + fn foo(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + // TODO: suggest importing, but only for `bar` + mod imported_and_not_imported { + fn foo(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + } + + mod add_assign { + // TODO: suggest importing `std::fmt::Write`; + mod not_imported { + fn main(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + // TODO: suggest importing the first time, but not again + mod not_imported_and_not_imported { + fn foo(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + // TODO: suggest importing the first time, but not again + mod not_imported_and_imported { + fn foo(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + + // TODO: suggest importing, but only for `bar` + mod imported_and_not_imported { + fn foo(string: &mut String) { + use std::fmt::Write; + + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + + fn bar(string: &mut String) { + string.push_str(&format!("{:?}", 1234)); + //~^ format_push_string + } + } + } +} + +fn main() {} diff --git a/src/tools/clippy/tests/ui/format_push_string_unfixable.stderr b/src/tools/clippy/tests/ui/format_push_string_unfixable.stderr new file mode 100644 index 000000000000..145e7fcc440d --- /dev/null +++ b/src/tools/clippy/tests/ui/format_push_string_unfixable.stderr @@ -0,0 +1,233 @@ +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:8:13 + | +LL | / hex += &(if upper { +LL | | format!("{byte:02X}") + | | --------------------- `format!` used here +LL | | +LL | | } else { +LL | | format!("{byte:02x}") + | | --------------------- `format!` used here +LL | | }); + | |______________^ + | + = help: consider using `write!` to avoid the extra allocation + = note: you may need to import the `std::fmt::Write` trait + = note: `-D clippy::format-push-string` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::format_push_string)]` + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:21:9 + | +LL | / s += &(if let Some(_a) = Some(1234) { +LL | | format!("{}", 1234) + | | ------------------- `format!` used here +LL | | +LL | | } else { +LL | | format!("{}", 1234) + | | ------------------- `format!` used here +LL | | }); + | |__________^ + | + = help: consider using `write!` to avoid the extra allocation + = note: you may need to import the `std::fmt::Write` trait + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:28:9 + | +LL | / s += &(match Some(1234) { +LL | | Some(_) => format!("{}", 1234), + | | ------------------- `format!` used here +LL | | +LL | | None => format!("{}", 1234), + | | ------------------- `format!` used here +LL | | }); + | |__________^ + | + = help: consider using `write!` to avoid the extra allocation + = note: you may need to import the `std::fmt::Write` trait + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:41:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:49:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:54:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:62:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:69:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:79:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:84:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:94:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:102:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:107:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:115:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:122:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:132:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: `format!(..)` appended to existing `String` + --> tests/ui/format_push_string_unfixable.rs:137:17 + | +LL | string.push_str(&format!("{:?}", 1234)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you may need to import the `std::fmt::Write` trait +help: consider using `write!` to avoid the extra allocation + | +LL - string.push_str(&format!("{:?}", 1234)); +LL + let _ = write!(string, "{:?}", 1234); + | + +error: aborting due to 17 previous errors + diff --git a/src/tools/clippy/tests/ui/if_not_else.fixed b/src/tools/clippy/tests/ui/if_not_else.fixed index 4e6f43e5671e..a29847f0cf97 100644 --- a/src/tools/clippy/tests/ui/if_not_else.fixed +++ b/src/tools/clippy/tests/ui/if_not_else.fixed @@ -76,3 +76,20 @@ fn with_annotations() { println!("foo is false"); } } + +fn issue15924() { + let x = 0; + if matches!(x, 0..10) { + println!(":("); + } else { + //~^ if_not_else + println!(":)"); + } + + if dbg!(x) == 1 { + println!(":("); + } else { + //~^ if_not_else + println!(":)"); + } +} diff --git a/src/tools/clippy/tests/ui/if_not_else.rs b/src/tools/clippy/tests/ui/if_not_else.rs index 6cd2e3bd63fe..4ae11d6ad90e 100644 --- a/src/tools/clippy/tests/ui/if_not_else.rs +++ b/src/tools/clippy/tests/ui/if_not_else.rs @@ -76,3 +76,20 @@ fn with_annotations() { println!("foo"); /* foo */ } } + +fn issue15924() { + let x = 0; + if !matches!(x, 0..10) { + //~^ if_not_else + println!(":)"); + } else { + println!(":("); + } + + if dbg!(x) != 1 { + //~^ if_not_else + println!(":)"); + } else { + println!(":("); + } +} diff --git a/src/tools/clippy/tests/ui/if_not_else.stderr b/src/tools/clippy/tests/ui/if_not_else.stderr index 824837bd52bb..0682bf80da55 100644 --- a/src/tools/clippy/tests/ui/if_not_else.stderr +++ b/src/tools/clippy/tests/ui/if_not_else.stderr @@ -147,5 +147,47 @@ LL + println!("foo is false"); LL + } | -error: aborting due to 6 previous errors +error: unnecessary boolean `not` operation + --> tests/ui/if_not_else.rs:82:5 + | +LL | / if !matches!(x, 0..10) { +LL | | +LL | | println!(":)"); +LL | | } else { +LL | | println!(":("); +LL | | } + | |_____^ + | +help: try + | +LL ~ if matches!(x, 0..10) { +LL + println!(":("); +LL + } else { +LL + +LL + println!(":)"); +LL + } + | + +error: unnecessary `!=` operation + --> tests/ui/if_not_else.rs:89:5 + | +LL | / if dbg!(x) != 1 { +LL | | +LL | | println!(":)"); +LL | | } else { +LL | | println!(":("); +LL | | } + | |_____^ + | +help: try + | +LL ~ if dbg!(x) == 1 { +LL + println!(":("); +LL + } else { +LL + +LL + println!(":)"); +LL + } + | + +error: aborting due to 8 previous errors diff --git a/src/tools/clippy/tests/ui/if_then_some_else_none.fixed b/src/tools/clippy/tests/ui/if_then_some_else_none.fixed index 7da9401a308f..ce122ac69b12 100644 --- a/src/tools/clippy/tests/ui/if_then_some_else_none.fixed +++ b/src/tools/clippy/tests/ui/if_then_some_else_none.fixed @@ -3,10 +3,20 @@ fn main() { // Should issue an error. - let _ = foo().then(|| { println!("true!"); "foo" }); + let _ = foo().then(|| { + //~^ if_then_some_else_none + + println!("true!"); + "foo" + }); // Should issue an error when macros are used. - let _ = matches!(true, true).then(|| { println!("true!"); matches!(true, false) }); + let _ = matches!(true, true).then(|| { + //~^ if_then_some_else_none + + println!("true!"); + matches!(true, false) + }); // Should issue an error. Binary expression `o < 32` should be parenthesized. let x = Some(5); @@ -71,7 +81,12 @@ fn _msrv_1_49() { #[clippy::msrv = "1.50"] fn _msrv_1_50() { - let _ = foo().then(|| { println!("true!"); 150 }); + let _ = foo().then(|| { + //~^ if_then_some_else_none + + println!("true!"); + 150 + }); } fn foo() -> bool { @@ -182,7 +197,10 @@ fn issue15005() { fn next(&mut self) -> Option { //~v if_then_some_else_none - (self.count < 5).then(|| { self.count += 1; self.count }) + (self.count < 5).then(|| { + self.count += 1; + self.count + }) } } } @@ -195,7 +213,10 @@ fn statements_from_macro() { }; } //~v if_then_some_else_none - let _ = true.then(|| { mac!(); 42 }); + let _ = true.then(|| { + mac!(); + 42 + }); } fn dont_lint_inside_macros() { @@ -218,3 +239,24 @@ mod issue15770 { Ok(()) } } + +mod issue16176 { + pub async fn foo() -> u32 { + todo!() + } + + pub async fn bar(cond: bool) -> Option { + if cond { Some(foo().await) } else { None } // OK + } +} + +fn issue16269() -> Option { + use std::cell::UnsafeCell; + + //~v if_then_some_else_none + (1 <= 3).then(|| { + let a = UnsafeCell::new(1); + // SAFETY: `bytes` bytes starting at `new_end` were just reserved. + unsafe { *a.get() } + }) +} diff --git a/src/tools/clippy/tests/ui/if_then_some_else_none.rs b/src/tools/clippy/tests/ui/if_then_some_else_none.rs index 02962f83ce8a..1d6c86d94492 100644 --- a/src/tools/clippy/tests/ui/if_then_some_else_none.rs +++ b/src/tools/clippy/tests/ui/if_then_some_else_none.rs @@ -274,3 +274,26 @@ mod issue15770 { Ok(()) } } + +mod issue16176 { + pub async fn foo() -> u32 { + todo!() + } + + pub async fn bar(cond: bool) -> Option { + if cond { Some(foo().await) } else { None } // OK + } +} + +fn issue16269() -> Option { + use std::cell::UnsafeCell; + + //~v if_then_some_else_none + if 1 <= 3 { + let a = UnsafeCell::new(1); + // SAFETY: `bytes` bytes starting at `new_end` were just reserved. + Some(unsafe { *a.get() }) + } else { + None + } +} diff --git a/src/tools/clippy/tests/ui/if_then_some_else_none.stderr b/src/tools/clippy/tests/ui/if_then_some_else_none.stderr index 58651a055942..eff5f8c82dcb 100644 --- a/src/tools/clippy/tests/ui/if_then_some_else_none.stderr +++ b/src/tools/clippy/tests/ui/if_then_some_else_none.stderr @@ -9,10 +9,19 @@ LL | | println!("true!"); ... | LL | | None LL | | }; - | |_____^ help: try: `foo().then(|| { println!("true!"); "foo" })` + | |_____^ | = note: `-D clippy::if-then-some-else-none` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::if_then_some_else_none)]` +help: try + | +LL ~ let _ = foo().then(|| { +LL + +LL + +LL + println!("true!"); +LL + "foo" +LL ~ }); + | error: this could be simplified with `bool::then` --> tests/ui/if_then_some_else_none.rs:16:13 @@ -25,7 +34,17 @@ LL | | println!("true!"); ... | LL | | None LL | | }; - | |_____^ help: try: `matches!(true, true).then(|| { println!("true!"); matches!(true, false) })` + | |_____^ + | +help: try + | +LL ~ let _ = matches!(true, true).then(|| { +LL + +LL + +LL + println!("true!"); +LL + matches!(true, false) +LL ~ }); + | error: this could be simplified with `bool::then_some` --> tests/ui/if_then_some_else_none.rs:27:28 @@ -50,7 +69,17 @@ LL | | println!("true!"); ... | LL | | None LL | | }; - | |_____^ help: try: `foo().then(|| { println!("true!"); 150 })` + | |_____^ + | +help: try + | +LL ~ let _ = foo().then(|| { +LL + +LL + +LL + println!("true!"); +LL + 150 +LL ~ }); + | error: this could be simplified with `bool::then` --> tests/ui/if_then_some_else_none.rs:138:5 @@ -125,7 +154,15 @@ LL | | Some(self.count) LL | | } else { LL | | None LL | | } - | |_____________^ help: try: `(self.count < 5).then(|| { self.count += 1; self.count })` + | |_____________^ + | +help: try + | +LL ~ (self.count < 5).then(|| { +LL + self.count += 1; +LL + self.count +LL + }) + | error: this could be simplified with `bool::then` --> tests/ui/if_then_some_else_none.rs:249:13 @@ -137,7 +174,36 @@ LL | | Some(42) LL | | } else { LL | | None LL | | }; - | |_____^ help: try: `true.then(|| { mac!(); 42 })` + | |_____^ + | +help: try + | +LL ~ let _ = true.then(|| { +LL + mac!(); +LL + 42 +LL ~ }); + | -error: aborting due to 13 previous errors +error: this could be simplified with `bool::then` + --> tests/ui/if_then_some_else_none.rs:292:5 + | +LL | / if 1 <= 3 { +LL | | let a = UnsafeCell::new(1); +LL | | // SAFETY: `bytes` bytes starting at `new_end` were just reserved. +LL | | Some(unsafe { *a.get() }) +LL | | } else { +LL | | None +LL | | } + | |_____^ + | +help: try + | +LL ~ (1 <= 3).then(|| { +LL + let a = UnsafeCell::new(1); +LL + // SAFETY: `bytes` bytes starting at `new_end` were just reserved. +LL + unsafe { *a.get() } +LL + }) + | + +error: aborting due to 14 previous errors diff --git a/src/tools/clippy/tests/ui/manual_instant_elapsed.fixed b/src/tools/clippy/tests/ui/manual_instant_elapsed.fixed index a04c601e08c1..2fa5702f8a04 100644 --- a/src/tools/clippy/tests/ui/manual_instant_elapsed.fixed +++ b/src/tools/clippy/tests/ui/manual_instant_elapsed.fixed @@ -28,3 +28,19 @@ fn main() { // //~^^ manual_instant_elapsed } + +fn issue16236() { + use std::ops::Sub as _; + macro_rules! deref { + ($e:expr) => { + *$e + }; + } + + let start = &Instant::now(); + let _ = deref!(start).elapsed(); + //~^ manual_instant_elapsed + + deref!(start).elapsed(); + //~^ manual_instant_elapsed +} diff --git a/src/tools/clippy/tests/ui/manual_instant_elapsed.rs b/src/tools/clippy/tests/ui/manual_instant_elapsed.rs index 7c67f6acf85d..e7a0e6499e74 100644 --- a/src/tools/clippy/tests/ui/manual_instant_elapsed.rs +++ b/src/tools/clippy/tests/ui/manual_instant_elapsed.rs @@ -28,3 +28,19 @@ fn main() { // //~^^ manual_instant_elapsed } + +fn issue16236() { + use std::ops::Sub as _; + macro_rules! deref { + ($e:expr) => { + *$e + }; + } + + let start = &Instant::now(); + let _ = Instant::now().sub(deref!(start)); + //~^ manual_instant_elapsed + + Instant::now() - deref!(start); + //~^ manual_instant_elapsed +} diff --git a/src/tools/clippy/tests/ui/manual_instant_elapsed.stderr b/src/tools/clippy/tests/ui/manual_instant_elapsed.stderr index e84f3126f707..e42ac5739a29 100644 --- a/src/tools/clippy/tests/ui/manual_instant_elapsed.stderr +++ b/src/tools/clippy/tests/ui/manual_instant_elapsed.stderr @@ -13,5 +13,17 @@ error: manual implementation of `Instant::elapsed` LL | Instant::now() - *ref_to_instant; // to ensure parens are added correctly | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*ref_to_instant).elapsed()` -error: aborting due to 2 previous errors +error: manual implementation of `Instant::elapsed` + --> tests/ui/manual_instant_elapsed.rs:41:13 + | +LL | let _ = Instant::now().sub(deref!(start)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `deref!(start).elapsed()` + +error: manual implementation of `Instant::elapsed` + --> tests/ui/manual_instant_elapsed.rs:44:5 + | +LL | Instant::now() - deref!(start); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `deref!(start).elapsed()` + +error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui/map_unwrap_or.stderr b/src/tools/clippy/tests/ui/map_unwrap_or.stderr index b0b02f3f8d6b..df0207c420e6 100644 --- a/src/tools/clippy/tests/ui/map_unwrap_or.stderr +++ b/src/tools/clippy/tests/ui/map_unwrap_or.stderr @@ -127,6 +127,14 @@ LL | | x + 1 LL | | } LL | | ).unwrap_or_else(|| 0); | |__________________________^ + | +help: try + | +LL ~ let _ = opt.map_or_else(|| 0, |x| { +LL + +LL + x + 1 +LL ~ }); + | error: called `map().unwrap_or_else()` on an `Option` value --> tests/ui/map_unwrap_or.rs:63:13 @@ -138,6 +146,12 @@ LL | | .unwrap_or_else(|| LL | | 0 LL | | ); | |_________^ + | +help: try + | +LL ~ let _ = opt.map_or_else(|| +LL ~ 0, |x| x + 1); + | error: called `map().unwrap_or(false)` on an `Option` value --> tests/ui/map_unwrap_or.rs:70:13 @@ -161,6 +175,14 @@ LL | | x + 1 LL | | } LL | | ).unwrap_or_else(|_e| 0); | |____________________________^ + | +help: try + | +LL ~ let _ = res.map_or_else(|_e| 0, |x| { +LL + +LL + x + 1 +LL ~ }); + | error: called `map().unwrap_or_else()` on a `Result` value --> tests/ui/map_unwrap_or.rs:86:13 @@ -172,6 +194,13 @@ LL | | .unwrap_or_else(|_e| { LL | | 0 LL | | }); | |__________^ + | +help: try + | +LL ~ let _ = res.map_or_else(|_e| { +LL + 0 +LL ~ }, |x| x + 1); + | error: called `map().unwrap_or_else()` on a `Result` value --> tests/ui/map_unwrap_or.rs:111:13 diff --git a/src/tools/clippy/tests/ui/match_like_matches_macro.fixed b/src/tools/clippy/tests/ui/match_like_matches_macro.fixed index dad59c1ce6e4..045ee32bd8bb 100644 --- a/src/tools/clippy/tests/ui/match_like_matches_macro.fixed +++ b/src/tools/clippy/tests/ui/match_like_matches_macro.fixed @@ -1,6 +1,7 @@ #![warn(clippy::match_like_matches_macro)] #![allow( unreachable_patterns, + irrefutable_let_patterns, clippy::equatable_if_let, clippy::needless_borrowed_reference, clippy::redundant_guards @@ -230,3 +231,24 @@ fn issue15841(opt: Option>>, value: i32) { let _ = matches!(opt, Some(first) if (if let Some(second) = first { true } else { todo!() })); //~^^^^ match_like_matches_macro } + +fn issue16015() -> bool { + use std::any::{TypeId, type_name}; + pub struct GetTypeId(T); + + impl GetTypeId { + pub const VALUE: TypeId = TypeId::of::(); + } + + macro_rules! typeid { + ($t:ty) => { + GetTypeId::<$t>::VALUE + }; + } + + matches!(typeid!(T), _); + //~^^^^ match_like_matches_macro + + matches!(typeid!(U), _) + //~^ match_like_matches_macro +} diff --git a/src/tools/clippy/tests/ui/match_like_matches_macro.rs b/src/tools/clippy/tests/ui/match_like_matches_macro.rs index 94bc6433e5cb..231e1ae98f86 100644 --- a/src/tools/clippy/tests/ui/match_like_matches_macro.rs +++ b/src/tools/clippy/tests/ui/match_like_matches_macro.rs @@ -1,6 +1,7 @@ #![warn(clippy::match_like_matches_macro)] #![allow( unreachable_patterns, + irrefutable_let_patterns, clippy::equatable_if_let, clippy::needless_borrowed_reference, clippy::redundant_guards @@ -277,3 +278,27 @@ fn issue15841(opt: Option>>, value: i32) { }; //~^^^^ match_like_matches_macro } + +fn issue16015() -> bool { + use std::any::{TypeId, type_name}; + pub struct GetTypeId(T); + + impl GetTypeId { + pub const VALUE: TypeId = TypeId::of::(); + } + + macro_rules! typeid { + ($t:ty) => { + GetTypeId::<$t>::VALUE + }; + } + + match typeid!(T) { + _ => true, + _ => false, + }; + //~^^^^ match_like_matches_macro + + if let _ = typeid!(U) { true } else { false } + //~^ match_like_matches_macro +} diff --git a/src/tools/clippy/tests/ui/match_like_matches_macro.stderr b/src/tools/clippy/tests/ui/match_like_matches_macro.stderr index a8e352461dbb..bc3e3584938e 100644 --- a/src/tools/clippy/tests/ui/match_like_matches_macro.stderr +++ b/src/tools/clippy/tests/ui/match_like_matches_macro.stderr @@ -1,5 +1,5 @@ error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:13:14 + --> tests/ui/match_like_matches_macro.rs:14:14 | LL | let _y = match x { | ______________^ @@ -20,7 +20,7 @@ LL + let _y = matches!(x, Some(0)); | error: redundant pattern matching, consider using `is_some()` - --> tests/ui/match_like_matches_macro.rs:20:14 + --> tests/ui/match_like_matches_macro.rs:21:14 | LL | let _w = match x { | ______________^ @@ -33,7 +33,7 @@ LL | | }; = help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]` error: redundant pattern matching, consider using `is_none()` - --> tests/ui/match_like_matches_macro.rs:27:14 + --> tests/ui/match_like_matches_macro.rs:28:14 | LL | let _z = match x { | ______________^ @@ -43,7 +43,7 @@ LL | | }; | |_____^ help: try: `x.is_none()` error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:34:15 + --> tests/ui/match_like_matches_macro.rs:35:15 | LL | let _zz = match x { | _______________^ @@ -62,7 +62,7 @@ LL + let _zz = !matches!(x, Some(r) if r == 0); | error: `if let .. else` expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:41:16 + --> tests/ui/match_like_matches_macro.rs:42:16 | LL | let _zzz = if let Some(5) = x { true } else { false }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -74,7 +74,7 @@ LL + let _zzz = matches!(x, Some(5)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:66:20 + --> tests/ui/match_like_matches_macro.rs:67:20 | LL | let _ans = match x { | ____________________^ @@ -95,7 +95,7 @@ LL + let _ans = matches!(x, E::A(_) | E::B(_)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:77:20 + --> tests/ui/match_like_matches_macro.rs:78:20 | LL | let _ans = match x { | ____________________^ @@ -119,7 +119,7 @@ LL + let _ans = matches!(x, E::A(_) | E::B(_)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:88:20 + --> tests/ui/match_like_matches_macro.rs:89:20 | LL | let _ans = match x { | ____________________^ @@ -140,7 +140,7 @@ LL + let _ans = !matches!(x, E::B(_) | E::C); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:149:18 + --> tests/ui/match_like_matches_macro.rs:150:18 | LL | let _z = match &z { | __________________^ @@ -159,7 +159,7 @@ LL + let _z = matches!(z, Some(3)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:159:18 + --> tests/ui/match_like_matches_macro.rs:160:18 | LL | let _z = match &z { | __________________^ @@ -178,7 +178,7 @@ LL + let _z = matches!(&z, Some(3)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:177:21 + --> tests/ui/match_like_matches_macro.rs:178:21 | LL | let _ = match &z { | _____________________^ @@ -197,7 +197,7 @@ LL + let _ = matches!(&z, AnEnum::X); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:192:20 + --> tests/ui/match_like_matches_macro.rs:193:20 | LL | let _res = match &val { | ____________________^ @@ -216,7 +216,7 @@ LL + let _res = matches!(&val, &Some(ref _a)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:205:20 + --> tests/ui/match_like_matches_macro.rs:206:20 | LL | let _res = match &val { | ____________________^ @@ -235,7 +235,7 @@ LL + let _res = matches!(&val, &Some(ref _a)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:264:14 + --> tests/ui/match_like_matches_macro.rs:265:14 | LL | let _y = match Some(5) { | ______________^ @@ -254,7 +254,7 @@ LL + let _y = matches!(Some(5), Some(0)); | error: match expression looks like `matches!` macro - --> tests/ui/match_like_matches_macro.rs:274:13 + --> tests/ui/match_like_matches_macro.rs:275:13 | LL | let _ = match opt { | _____________^ @@ -272,5 +272,35 @@ LL - }; LL + let _ = matches!(opt, Some(first) if (if let Some(second) = first { true } else { todo!() })); | -error: aborting due to 15 previous errors +error: match expression looks like `matches!` macro + --> tests/ui/match_like_matches_macro.rs:296:5 + | +LL | / match typeid!(T) { +LL | | _ => true, +LL | | _ => false, +LL | | }; + | |_____^ + | +help: use `matches!` directly + | +LL - match typeid!(T) { +LL - _ => true, +LL - _ => false, +LL - }; +LL + matches!(typeid!(T), _); + | + +error: `if let .. else` expression looks like `matches!` macro + --> tests/ui/match_like_matches_macro.rs:302:5 + | +LL | if let _ = typeid!(U) { true } else { false } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: use `matches!` directly + | +LL - if let _ = typeid!(U) { true } else { false } +LL + matches!(typeid!(U), _) + | + +error: aborting due to 17 previous errors diff --git a/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.rs b/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.rs index c1512ba3e269..0ff881472cbb 100644 --- a/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.rs +++ b/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.rs @@ -312,4 +312,137 @@ fn check_closures() { } } +fn issue16116() { + unsafe fn foo() -> u32 { + 0 + } + + // Do not lint even though `format!` expansion + // contains unsafe calls. + unsafe { + let _ = format!("{}", foo()); + } + + unsafe { + //~^ multiple_unsafe_ops_per_block + let _ = format!("{}", foo()); + let _ = format!("{}", foo()); + } + + // Do not lint: only one `assert!()` argument is unsafe + unsafe { + assert_eq!(foo(), 0, "{}", 1 + 2); + } + + // Each argument of a macro call may count as an unsafe operation. + unsafe { + //~^ multiple_unsafe_ops_per_block + assert_eq!(foo(), 0, "{}", foo()); // One unsafe operation + } + + macro_rules! twice { + ($e:expr) => {{ + $e; + $e; + }}; + } + + // Do not lint, a repeated argument used twice by a macro counts + // as at most one unsafe operation. + unsafe { + twice!(foo()); + } + + unsafe { + //~^ multiple_unsafe_ops_per_block + twice!(foo()); + twice!(foo()); + } + + unsafe { + //~^ multiple_unsafe_ops_per_block + assert_eq!(foo(), 0, "{}", 1 + 2); + assert_eq!(foo(), 0, "{}", 1 + 2); + } + + macro_rules! unsafe_twice { + ($e:expr) => { + unsafe { + $e; + $e; + } + }; + }; + + // A macro whose expansion contains unsafe blocks will not + // check inside the blocks. + unsafe { + unsafe_twice!(foo()); + } + + macro_rules! double_non_arg_unsafe { + () => {{ + _ = str::from_utf8_unchecked(&[]); + _ = str::from_utf8_unchecked(&[]); + }}; + } + + // Do not lint: each unsafe expression contained in the + // macro expansion will count towards the macro call. + unsafe { + double_non_arg_unsafe!(); + } + + unsafe { + //~^ multiple_unsafe_ops_per_block + double_non_arg_unsafe!(); + double_non_arg_unsafe!(); + } + + // Do not lint: the inner macro call counts as one unsafe op. + unsafe { + assert_eq!(double_non_arg_unsafe!(), ()); + } + + unsafe { + //~^ multiple_unsafe_ops_per_block + assert_eq!(double_non_arg_unsafe!(), ()); + assert_eq!(double_non_arg_unsafe!(), ()); + } + + unsafe { + //~^ multiple_unsafe_ops_per_block + assert_eq!((double_non_arg_unsafe!(), double_non_arg_unsafe!()), ((), ())); + } + + macro_rules! unsafe_with_arg { + ($e:expr) => {{ + _ = str::from_utf8_unchecked(&[]); + $e; + }}; + } + + // A confusing situation: the macro call counts towards two unsafe calls, + // one coming from inside the macro itself, and one coming from its argument. + // The error message may seem a bit strange as both the macro call and its + // argument will be marked as counting as unsafe ops, but a short investigation + // in those rare situations should sort it out easily. + unsafe { + //~^ multiple_unsafe_ops_per_block + unsafe_with_arg!(foo()); + } + + macro_rules! ignore { + ($e: expr) => {}; + } + + // Another surprising case is when the macro argument is not + // used in the expansion, but in this case we won't see the + // unsafe operation at all. + unsafe { + ignore!(foo()); + ignore!(foo()); + } +} + fn main() {} diff --git a/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.stderr b/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.stderr index 63f7742b734b..185225bd28c8 100644 --- a/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.stderr +++ b/src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.stderr @@ -31,16 +31,16 @@ LL | | *raw_ptr(); LL | | } | |_____^ | -note: union field access occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:50:14 - | -LL | drop(u.u); - | ^^^ note: raw pointer dereference occurs here --> tests/ui/multiple_unsafe_ops_per_block.rs:51:9 | LL | *raw_ptr(); | ^^^^^^^^^^ +note: union field access occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:50:14 + | +LL | drop(u.u); + | ^^^ error: this `unsafe` block contains 3 unsafe operations, expected only one --> tests/ui/multiple_unsafe_ops_per_block.rs:56:5 @@ -58,16 +58,16 @@ note: inline assembly used here | LL | asm!("nop"); | ^^^^^^^^^^^ -note: unsafe method call occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:59:9 - | -LL | sample.not_very_safe(); - | ^^^^^^^^^^^^^^^^^^^^^^ note: modification of a mutable static occurs here --> tests/ui/multiple_unsafe_ops_per_block.rs:60:9 | LL | STATIC = 0; | ^^^^^^^^^^ +note: unsafe method call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:59:9 + | +LL | sample.not_very_safe(); + | ^^^^^^^^^^^^^^^^^^^^^^ error: this `unsafe` block contains 6 unsafe operations, expected only one --> tests/ui/multiple_unsafe_ops_per_block.rs:66:5 @@ -81,36 +81,36 @@ LL | | asm!("nop"); LL | | } | |_____^ | -note: union field access occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:68:14 - | -LL | drop(u.u); - | ^^^ note: access of a mutable static occurs here --> tests/ui/multiple_unsafe_ops_per_block.rs:69:14 | LL | drop(STATIC); | ^^^^^^ -note: unsafe method call occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:70:9 - | -LL | sample.not_very_safe(); - | ^^^^^^^^^^^^^^^^^^^^^^ -note: unsafe function call occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:71:9 - | -LL | not_very_safe(); - | ^^^^^^^^^^^^^^^ -note: raw pointer dereference occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:72:9 - | -LL | *raw_ptr(); - | ^^^^^^^^^^ note: inline assembly used here --> tests/ui/multiple_unsafe_ops_per_block.rs:73:9 | LL | asm!("nop"); | ^^^^^^^^^^^ +note: raw pointer dereference occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:72:9 + | +LL | *raw_ptr(); + | ^^^^^^^^^^ +note: union field access occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:68:14 + | +LL | drop(u.u); + | ^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:71:9 + | +LL | not_very_safe(); + | ^^^^^^^^^^^^^^^ +note: unsafe method call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:70:9 + | +LL | sample.not_very_safe(); + | ^^^^^^^^^^^^^^^^^^^^^^ error: this `unsafe` block contains 2 unsafe operations, expected only one --> tests/ui/multiple_unsafe_ops_per_block.rs:109:5 @@ -139,16 +139,16 @@ error: this `unsafe` block contains 2 unsafe operations, expected only one LL | unsafe { char::from_u32_unchecked(*ptr.cast::()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: unsafe function call occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:118:18 - | -LL | unsafe { char::from_u32_unchecked(*ptr.cast::()) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: raw pointer dereference occurs here --> tests/ui/multiple_unsafe_ops_per_block.rs:118:43 | LL | unsafe { char::from_u32_unchecked(*ptr.cast::()) } | ^^^^^^^^^^^^^^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:118:18 + | +LL | unsafe { char::from_u32_unchecked(*ptr.cast::()) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: this `unsafe` block contains 2 unsafe operations, expected only one --> tests/ui/multiple_unsafe_ops_per_block.rs:139:9 @@ -224,16 +224,16 @@ LL | | foo().await; LL | | } | |_____^ | -note: unsafe function call occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:194:9 - | -LL | not_very_safe(); - | ^^^^^^^^^^^^^^^ note: modification of a mutable static occurs here --> tests/ui/multiple_unsafe_ops_per_block.rs:195:9 | LL | STATIC += 1; | ^^^^^^^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:194:9 + | +LL | not_very_safe(); + | ^^^^^^^^^^^^^^^ error: this `unsafe` block contains 2 unsafe operations, expected only one --> tests/ui/multiple_unsafe_ops_per_block.rs:207:5 @@ -265,16 +265,16 @@ LL | | Some(foo_unchecked()).unwrap_unchecked().await; LL | | } | |_____^ | -note: unsafe method call occurs here - --> tests/ui/multiple_unsafe_ops_per_block.rs:216:9 - | -LL | Some(foo_unchecked()).unwrap_unchecked().await; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: unsafe function call occurs here --> tests/ui/multiple_unsafe_ops_per_block.rs:216:14 | LL | Some(foo_unchecked()).unwrap_unchecked().await; | ^^^^^^^^^^^^^^^ +note: unsafe method call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:216:9 + | +LL | Some(foo_unchecked()).unwrap_unchecked().await; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: this `unsafe` block contains 2 unsafe operations, expected only one --> tests/ui/multiple_unsafe_ops_per_block.rs:236:5 @@ -359,5 +359,170 @@ note: unsafe function call occurs here LL | apply(|| f(0)); | ^^^^ -error: aborting due to 16 previous errors +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:326:5 + | +LL | / unsafe { +LL | | +LL | | let _ = format!("{}", foo()); +LL | | let _ = format!("{}", foo()); +LL | | } + | |_____^ + | +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:328:31 + | +LL | let _ = format!("{}", foo()); + | ^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:329:31 + | +LL | let _ = format!("{}", foo()); + | ^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:338:5 + | +LL | / unsafe { +LL | | +LL | | assert_eq!(foo(), 0, "{}", foo()); // One unsafe operation +LL | | } + | |_____^ + | +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:340:20 + | +LL | assert_eq!(foo(), 0, "{}", foo()); // One unsafe operation + | ^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:340:36 + | +LL | assert_eq!(foo(), 0, "{}", foo()); // One unsafe operation + | ^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:356:5 + | +LL | / unsafe { +LL | | +LL | | twice!(foo()); +LL | | twice!(foo()); +LL | | } + | |_____^ + | +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:358:16 + | +LL | twice!(foo()); + | ^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:359:16 + | +LL | twice!(foo()); + | ^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:362:5 + | +LL | / unsafe { +LL | | +LL | | assert_eq!(foo(), 0, "{}", 1 + 2); +LL | | assert_eq!(foo(), 0, "{}", 1 + 2); +LL | | } + | |_____^ + | +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:364:20 + | +LL | assert_eq!(foo(), 0, "{}", 1 + 2); + | ^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:365:20 + | +LL | assert_eq!(foo(), 0, "{}", 1 + 2); + | ^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:396:5 + | +LL | / unsafe { +LL | | +LL | | double_non_arg_unsafe!(); +LL | | double_non_arg_unsafe!(); +LL | | } + | |_____^ + | +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:398:9 + | +LL | double_non_arg_unsafe!(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:399:9 + | +LL | double_non_arg_unsafe!(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:407:5 + | +LL | / unsafe { +LL | | +LL | | assert_eq!(double_non_arg_unsafe!(), ()); +LL | | assert_eq!(double_non_arg_unsafe!(), ()); +LL | | } + | |_____^ + | +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:409:20 + | +LL | assert_eq!(double_non_arg_unsafe!(), ()); + | ^^^^^^^^^^^^^^^^^^^^^^^^ +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:410:20 + | +LL | assert_eq!(double_non_arg_unsafe!(), ()); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:413:5 + | +LL | / unsafe { +LL | | +LL | | assert_eq!((double_non_arg_unsafe!(), double_non_arg_unsafe!()), ((), ())); +LL | | } + | |_____^ + | +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:415:21 + | +LL | assert_eq!((double_non_arg_unsafe!(), double_non_arg_unsafe!()), ((), ())); + | ^^^^^^^^^^^^^^^^^^^^^^^^ +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:415:47 + | +LL | assert_eq!((double_non_arg_unsafe!(), double_non_arg_unsafe!()), ((), ())); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this `unsafe` block contains 2 unsafe operations, expected only one + --> tests/ui/multiple_unsafe_ops_per_block.rs:430:5 + | +LL | / unsafe { +LL | | +LL | | unsafe_with_arg!(foo()); +LL | | } + | |_____^ + | +note: this macro call expands into one or more unsafe operations + --> tests/ui/multiple_unsafe_ops_per_block.rs:432:9 + | +LL | unsafe_with_arg!(foo()); + | ^^^^^^^^^^^^^^^^^^^^^^^ +note: unsafe function call occurs here + --> tests/ui/multiple_unsafe_ops_per_block.rs:432:26 + | +LL | unsafe_with_arg!(foo()); + | ^^^^^ + +error: aborting due to 24 previous errors diff --git a/src/tools/clippy/tests/ui/needless_collect.fixed b/src/tools/clippy/tests/ui/needless_collect.fixed index ba1451bf9704..99027e79b664 100644 --- a/src/tools/clippy/tests/ui/needless_collect.fixed +++ b/src/tools/clippy/tests/ui/needless_collect.fixed @@ -214,3 +214,8 @@ mod issue8055_regression { .len(); } } + +fn issue16270() { + // Do not lint, `..` implements `Index` but is not `usize` + _ = &(1..3).collect::>()[..]; +} diff --git a/src/tools/clippy/tests/ui/needless_collect.rs b/src/tools/clippy/tests/ui/needless_collect.rs index e054cd01e6f5..683cc49c9af3 100644 --- a/src/tools/clippy/tests/ui/needless_collect.rs +++ b/src/tools/clippy/tests/ui/needless_collect.rs @@ -214,3 +214,8 @@ mod issue8055_regression { .len(); } } + +fn issue16270() { + // Do not lint, `..` implements `Index` but is not `usize` + _ = &(1..3).collect::>()[..]; +} diff --git a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut.stderr b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut.stderr index 94d98f0e9b12..c427f4c3e42c 100644 --- a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut.stderr +++ b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut.stderr @@ -1,213 +1,281 @@ -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:12:11 | LL | fn foo(s: &mut Vec, b: &u32, x: &mut u32) { - | ^^^^^^^^^^^^^ help: consider changing to: `&Vec` + | ^----^^^^^^^^ + | | + | help: consider removing this `mut` | = note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_ref_mut)]` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:38:12 | LL | fn foo6(s: &mut Vec) { - | ^^^^^^^^^^^^^ help: consider changing to: `&Vec` + | ^----^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:49:12 | LL | fn bar(&mut self) {} - | ^^^^^^^^^ help: consider changing to: `&self` + | ^----^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:52:29 | LL | fn mushroom(&self, vec: &mut Vec) -> usize { - | ^^^^^^^^^^^^^ help: consider changing to: `&Vec` + | ^----^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:130:16 | LL | async fn a1(x: &mut i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:135:16 | LL | async fn a2(x: &mut i32, y: String) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:140:16 | LL | async fn a3(x: &mut i32, y: String, z: String) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:145:16 | LL | async fn a4(x: &mut i32, y: i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:150:24 | LL | async fn a5(x: i32, y: &mut i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:155:24 | LL | async fn a6(x: i32, y: &mut i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:160:32 | LL | async fn a7(x: i32, y: i32, z: &mut i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:165:24 | LL | async fn a8(x: i32, a: &mut i32, y: i32, z: &mut i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:165:45 | LL | async fn a8(x: i32, a: &mut i32, y: i32, z: &mut i32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:201:16 | LL | fn cfg_warn(s: &mut u32) {} - | ^^^^^^^^ help: consider changing to: `&u32` + | ^----^^^ + | | + | help: consider removing this `mut` | = note: this is cfg-gated and may require further changes -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:206:20 | LL | fn cfg_warn(s: &mut u32) {} - | ^^^^^^^^ help: consider changing to: `&u32` + | ^----^^^ + | | + | help: consider removing this `mut` | = note: this is cfg-gated and may require further changes -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:219:39 | LL | async fn inner_async2(x: &mut i32, y: &mut u32) { - | ^^^^^^^^ help: consider changing to: `&u32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:228:26 | LL | async fn inner_async3(x: &mut i32, y: &mut u32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:248:30 | LL | async fn call_in_closure1(n: &mut str) { - | ^^^^^^^^ help: consider changing to: `&str` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:268:16 | LL | fn closure2(n: &mut usize) -> impl '_ + FnMut() -> usize { - | ^^^^^^^^^^ help: consider changing to: `&usize` + | ^----^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:280:22 | LL | async fn closure4(n: &mut usize) { - | ^^^^^^^^^^ help: consider changing to: `&usize` + | ^----^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:335:12 | LL | fn bar(&mut self) {} - | ^^^^^^^^^ help: consider changing to: `&self` + | ^----^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:338:18 | LL | async fn foo(&mut self, u: &mut i32, v: &mut u32) { - | ^^^^^^^^^ help: consider changing to: `&self` + | ^----^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:338:45 | LL | async fn foo(&mut self, u: &mut i32, v: &mut u32) { - | ^^^^^^^^ help: consider changing to: `&u32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:347:46 | LL | async fn foo2(&mut self, u: &mut i32, v: &mut u32) { - | ^^^^^^^^ help: consider changing to: `&u32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:364:18 | LL | fn _empty_tup(x: &mut (())) {} - | ^^^^^^^^^ help: consider changing to: `&()` + | ^^----^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:366:19 | LL | fn _single_tup(x: &mut ((i32,))) {} - | ^^^^^^^^^^^^^ help: consider changing to: `&(i32,)` + | ^^----^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:368:18 | LL | fn _multi_tup(x: &mut ((i32, u32))) {} - | ^^^^^^^^^^^^^^^^^ help: consider changing to: `&(i32, u32)` + | ^^----^^^^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:370:11 | LL | fn _fn(x: &mut (fn())) {} - | ^^^^^^^^^^^ help: consider changing to: `&fn()` + | ^^----^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:373:23 | LL | fn _extern_rust_fn(x: &mut extern "Rust" fn()) {} - | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&extern "Rust" fn()` + | ^----^^^^^^^^^^^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:375:20 | LL | fn _extern_c_fn(x: &mut extern "C" fn()) {} - | ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&extern "C" fn()` + | ^----^^^^^^^^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:377:18 | LL | fn _unsafe_fn(x: &mut unsafe fn()) {} - | ^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe fn()` + | ^----^^^^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:379:25 | LL | fn _unsafe_extern_fn(x: &mut unsafe extern "C" fn()) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn()` + | ^----^^^^^^^^^^^^^^^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:381:20 | LL | fn _fn_with_arg(x: &mut unsafe extern "C" fn(i32)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn(i32)` + | ^----^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | help: consider removing this `mut` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut.rs:383:20 | LL | fn _fn_with_ret(x: &mut unsafe extern "C" fn() -> (i32)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn() -> (i32)` + | ^----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | help: consider removing this `mut` error: aborting due to 34 previous errors diff --git a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.fixed b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.fixed index 0e2ac0202364..c462f1cc8d87 100644 --- a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.fixed +++ b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.fixed @@ -24,3 +24,9 @@ async fn inner_async4(u: &mut i32, v: &u32) { } fn main() {} + +//~v needless_pass_by_ref_mut +fn issue16267<'a>(msg: &str, slice: &'a [i32]) -> &'a [i32] { + println!("{msg}"); + &slice[0..5] +} diff --git a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.rs b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.rs index 9201d9a27298..b00f294c57f0 100644 --- a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.rs +++ b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.rs @@ -24,3 +24,9 @@ async fn inner_async4(u: &mut i32, v: &mut u32) { } fn main() {} + +//~v needless_pass_by_ref_mut +fn issue16267<'a>(msg: &str, slice: &'a mut [i32]) -> &'a [i32] { + println!("{msg}"); + &slice[0..5] +} diff --git a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.stderr b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.stderr index 9876a6b50718..aa5c412adb4d 100644 --- a/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.stderr +++ b/src/tools/clippy/tests/ui/needless_pass_by_ref_mut2.stderr @@ -1,17 +1,29 @@ -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut2.rs:8:26 | LL | async fn inner_async3(x: &mut i32, y: &mut u32) { - | ^^^^^^^^ help: consider changing to: `&i32` + | ^----^^^ + | | + | help: consider removing this `mut` | = note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_ref_mut)]` -error: this argument is a mutable reference, but not used mutably +error: this parameter is a mutable reference but is not used mutably --> tests/ui/needless_pass_by_ref_mut2.rs:17:39 | LL | async fn inner_async4(u: &mut i32, v: &mut u32) { - | ^^^^^^^^ help: consider changing to: `&u32` + | ^----^^^ + | | + | help: consider removing this `mut` -error: aborting due to 2 previous errors +error: this parameter is a mutable reference but is not used mutably + --> tests/ui/needless_pass_by_ref_mut2.rs:29:37 + | +LL | fn issue16267<'a>(msg: &str, slice: &'a mut [i32]) -> &'a [i32] { + | ^^^^----^^^^^ + | | + | help: consider removing this `mut` + +error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui/needless_type_cast.fixed b/src/tools/clippy/tests/ui/needless_type_cast.fixed index 32c348d3ca3a..72eed32c4d73 100644 --- a/src/tools/clippy/tests/ui/needless_type_cast.fixed +++ b/src/tools/clippy/tests/ui/needless_type_cast.fixed @@ -9,6 +9,10 @@ fn generic(x: T) -> T { x } +fn returns_u8() -> u8 { + 10 +} + fn main() { let a: i32 = 10; //~^ needless_type_cast @@ -180,3 +184,86 @@ fn test_loop_with_generic() { }; let _ = x as i32; } + +fn test_size_of_cast() { + use std::mem::size_of; + // Should lint: suggest casting the initializer + let size: u64 = size_of::() as u64; + //~^ needless_type_cast + let _ = size as u64; + let _ = size as u64; +} + +fn test_suffixed_literal_cast() { + // Should lint: suggest casting the initializer + let a: i32 = 10u8 as i32; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_negative_literal() { + // Negative literal - should just change type, not add cast + let a: i32 = -10; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_suffixed_negative_literal() { + // Suffixed negative - needs cast + let a: i32 = -10i8 as i32; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_binary_op() { + // Binary op needs parens in cast + let a: i32 = 10 + 5; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_fn_return_as_init() { + let a: i32 = returns_u8() as i32; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_method_as_init() { + let a: i32 = 2u8.saturating_add(3) as i32; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_const_as_init() { + const X: u8 = 10; + let a: i32 = X as i32; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_single_use_fn_call() { + // Should not lint: only one use, and fixing would just move the cast + // to the initializer rather than eliminating it + let a: u8 = returns_u8(); + let _ = a as i32; +} + +fn test_single_use_suffixed_literal() { + // Should not lint: only one use with a suffixed literal + let a: u8 = 10u8; + let _ = a as i32; +} + +fn test_single_use_binary_op() { + // Should lint: binary op of unsuffixed literals can be coerced + let a: i32 = 10 + 5; + //~^ needless_type_cast + let _ = a as i32; +} diff --git a/src/tools/clippy/tests/ui/needless_type_cast.rs b/src/tools/clippy/tests/ui/needless_type_cast.rs index e28f620e035f..31337575fcc3 100644 --- a/src/tools/clippy/tests/ui/needless_type_cast.rs +++ b/src/tools/clippy/tests/ui/needless_type_cast.rs @@ -9,6 +9,10 @@ fn generic(x: T) -> T { x } +fn returns_u8() -> u8 { + 10 +} + fn main() { let a: u8 = 10; //~^ needless_type_cast @@ -180,3 +184,86 @@ fn test_loop_with_generic() { }; let _ = x as i32; } + +fn test_size_of_cast() { + use std::mem::size_of; + // Should lint: suggest casting the initializer + let size: usize = size_of::(); + //~^ needless_type_cast + let _ = size as u64; + let _ = size as u64; +} + +fn test_suffixed_literal_cast() { + // Should lint: suggest casting the initializer + let a: u8 = 10u8; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_negative_literal() { + // Negative literal - should just change type, not add cast + let a: i8 = -10; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_suffixed_negative_literal() { + // Suffixed negative - needs cast + let a: i8 = -10i8; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_binary_op() { + // Binary op needs parens in cast + let a: u8 = 10 + 5; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_fn_return_as_init() { + let a: u8 = returns_u8(); + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_method_as_init() { + let a: u8 = 2u8.saturating_add(3); + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_const_as_init() { + const X: u8 = 10; + let a: u8 = X; + //~^ needless_type_cast + let _ = a as i32; + let _ = a as i32; +} + +fn test_single_use_fn_call() { + // Should not lint: only one use, and fixing would just move the cast + // to the initializer rather than eliminating it + let a: u8 = returns_u8(); + let _ = a as i32; +} + +fn test_single_use_suffixed_literal() { + // Should not lint: only one use with a suffixed literal + let a: u8 = 10u8; + let _ = a as i32; +} + +fn test_single_use_binary_op() { + // Should lint: binary op of unsuffixed literals can be coerced + let a: u8 = 10 + 5; + //~^ needless_type_cast + let _ = a as i32; +} diff --git a/src/tools/clippy/tests/ui/needless_type_cast.stderr b/src/tools/clippy/tests/ui/needless_type_cast.stderr index 3ee9df1043e7..56d9e978d05c 100644 --- a/src/tools/clippy/tests/ui/needless_type_cast.stderr +++ b/src/tools/clippy/tests/ui/needless_type_cast.stderr @@ -1,5 +1,5 @@ error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:13:12 + --> tests/ui/needless_type_cast.rs:17:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` @@ -8,64 +8,154 @@ LL | let a: u8 = 10; = help: to override `-D warnings` add `#[allow(clippy::needless_type_cast)]` error: this binding is defined as `u8` but is always cast to `usize` - --> tests/ui/needless_type_cast.rs:33:12 + --> tests/ui/needless_type_cast.rs:37:12 | LL | let f: u8 = 1; | ^^ help: consider defining it as: `usize` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:39:12 + --> tests/ui/needless_type_cast.rs:43:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:52:12 + --> tests/ui/needless_type_cast.rs:56:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:59:12 + --> tests/ui/needless_type_cast.rs:63:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:66:12 + --> tests/ui/needless_type_cast.rs:70:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:77:12 + --> tests/ui/needless_type_cast.rs:81:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:99:16 + --> tests/ui/needless_type_cast.rs:103:16 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:107:12 + --> tests/ui/needless_type_cast.rs:111:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:116:12 + --> tests/ui/needless_type_cast.rs:120:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` error: this binding is defined as `u8` but is always cast to `i32` - --> tests/ui/needless_type_cast.rs:122:12 + --> tests/ui/needless_type_cast.rs:126:12 | LL | let a: u8 = 10; | ^^ help: consider defining it as: `i32` -error: aborting due to 11 previous errors +error: this binding is defined as `usize` but is always cast to `u64` + --> tests/ui/needless_type_cast.rs:191:15 + | +LL | let size: usize = size_of::(); + | ^^^^^ + | +help: consider defining it as `u64` and casting the initializer + | +LL - let size: usize = size_of::(); +LL + let size: u64 = size_of::() as u64; + | + +error: this binding is defined as `u8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:199:12 + | +LL | let a: u8 = 10u8; + | ^^ + | +help: consider defining it as `i32` and casting the initializer + | +LL - let a: u8 = 10u8; +LL + let a: i32 = 10u8 as i32; + | + +error: this binding is defined as `i8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:207:12 + | +LL | let a: i8 = -10; + | ^^ help: consider defining it as: `i32` + +error: this binding is defined as `i8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:215:12 + | +LL | let a: i8 = -10i8; + | ^^ + | +help: consider defining it as `i32` and casting the initializer + | +LL - let a: i8 = -10i8; +LL + let a: i32 = -10i8 as i32; + | + +error: this binding is defined as `u8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:223:12 + | +LL | let a: u8 = 10 + 5; + | ^^ help: consider defining it as: `i32` + +error: this binding is defined as `u8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:230:12 + | +LL | let a: u8 = returns_u8(); + | ^^ + | +help: consider defining it as `i32` and casting the initializer + | +LL - let a: u8 = returns_u8(); +LL + let a: i32 = returns_u8() as i32; + | + +error: this binding is defined as `u8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:237:12 + | +LL | let a: u8 = 2u8.saturating_add(3); + | ^^ + | +help: consider defining it as `i32` and casting the initializer + | +LL - let a: u8 = 2u8.saturating_add(3); +LL + let a: i32 = 2u8.saturating_add(3) as i32; + | + +error: this binding is defined as `u8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:245:12 + | +LL | let a: u8 = X; + | ^^ + | +help: consider defining it as `i32` and casting the initializer + | +LL - let a: u8 = X; +LL + let a: i32 = X as i32; + | + +error: this binding is defined as `u8` but is always cast to `i32` + --> tests/ui/needless_type_cast.rs:266:12 + | +LL | let a: u8 = 10 + 5; + | ^^ help: consider defining it as: `i32` + +error: aborting due to 20 previous errors diff --git a/src/tools/clippy/tests/ui/needless_type_cast_unfixable.rs b/src/tools/clippy/tests/ui/needless_type_cast_unfixable.rs new file mode 100644 index 000000000000..bbea9bd24296 --- /dev/null +++ b/src/tools/clippy/tests/ui/needless_type_cast_unfixable.rs @@ -0,0 +1,20 @@ +//@no-rustfix +#![warn(clippy::needless_type_cast)] + +struct Foo(*mut core::ffi::c_void); + +enum Bar { + Variant(*mut core::ffi::c_void), +} + +// Suggestions will not compile directly, as `123` is a literal which +// is not compatible with the suggested `*mut core::ffi::c_void` type +fn issue_16243() { + let underlying: isize = 123; + //~^ needless_type_cast + let handle: Foo = Foo(underlying as _); + + let underlying: isize = 123; + //~^ needless_type_cast + let handle: Bar = Bar::Variant(underlying as _); +} diff --git a/src/tools/clippy/tests/ui/needless_type_cast_unfixable.stderr b/src/tools/clippy/tests/ui/needless_type_cast_unfixable.stderr new file mode 100644 index 000000000000..b71f8a09c40f --- /dev/null +++ b/src/tools/clippy/tests/ui/needless_type_cast_unfixable.stderr @@ -0,0 +1,17 @@ +error: this binding is defined as `isize` but is always cast to `*mut std::ffi::c_void` + --> tests/ui/needless_type_cast_unfixable.rs:13:21 + | +LL | let underlying: isize = 123; + | ^^^^^ help: consider defining it as: `*mut std::ffi::c_void` + | + = note: `-D clippy::needless-type-cast` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::needless_type_cast)]` + +error: this binding is defined as `isize` but is always cast to `*mut std::ffi::c_void` + --> tests/ui/needless_type_cast_unfixable.rs:17:21 + | +LL | let underlying: isize = 123; + | ^^^^^ help: consider defining it as: `*mut std::ffi::c_void` + +error: aborting due to 2 previous errors + diff --git a/src/tools/clippy/tests/ui/never_loop_iterator_reduction.rs b/src/tools/clippy/tests/ui/never_loop_iterator_reduction.rs new file mode 100644 index 000000000000..6b07b91db29a --- /dev/null +++ b/src/tools/clippy/tests/ui/never_loop_iterator_reduction.rs @@ -0,0 +1,17 @@ +//@no-rustfix +#![warn(clippy::never_loop)] + +fn main() { + // diverging closure: should trigger + [0, 1].into_iter().for_each(|x| { + //~^ never_loop + + let _ = x; + panic!("boom"); + }); + + // benign closure: should NOT trigger + [0, 1].into_iter().for_each(|x| { + let _ = x + 1; + }); +} diff --git a/src/tools/clippy/tests/ui/never_loop_iterator_reduction.stderr b/src/tools/clippy/tests/ui/never_loop_iterator_reduction.stderr new file mode 100644 index 000000000000..b76ee283146c --- /dev/null +++ b/src/tools/clippy/tests/ui/never_loop_iterator_reduction.stderr @@ -0,0 +1,27 @@ +error: this iterator reduction never loops (closure always diverges) + --> tests/ui/never_loop_iterator_reduction.rs:6:5 + | +LL | / [0, 1].into_iter().for_each(|x| { +LL | | +LL | | +LL | | let _ = x; +LL | | panic!("boom"); +LL | | }); + | |______^ + | + = note: if you only need one element, `if let Some(x) = iter.next()` is clearer + = note: `-D clippy::never-loop` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::never_loop)]` +help: consider this pattern + | +LL - [0, 1].into_iter().for_each(|x| { +LL - +LL - +LL - let _ = x; +LL - panic!("boom"); +LL - }); +LL + if let Some(x) = [0, 1].into_iter().next() { ... }; + | + +error: aborting due to 1 previous error + diff --git a/src/tools/clippy/tests/ui/obfuscated_if_else.fixed b/src/tools/clippy/tests/ui/obfuscated_if_else.fixed index 70ae090626b9..6bdb170a4aa9 100644 --- a/src/tools/clippy/tests/ui/obfuscated_if_else.fixed +++ b/src/tools/clippy/tests/ui/obfuscated_if_else.fixed @@ -87,3 +87,9 @@ fn issue11141() { let _ = *if true { &42 } else { &17 } as u8; //~^ obfuscated_if_else } + +#[allow(clippy::useless_format)] +fn issue16288() { + if true { format!("this is a test") } else { Default::default() }; + //~^ obfuscated_if_else +} diff --git a/src/tools/clippy/tests/ui/obfuscated_if_else.rs b/src/tools/clippy/tests/ui/obfuscated_if_else.rs index 8e1f57ca2c02..f7b5ea8c0135 100644 --- a/src/tools/clippy/tests/ui/obfuscated_if_else.rs +++ b/src/tools/clippy/tests/ui/obfuscated_if_else.rs @@ -87,3 +87,9 @@ fn issue11141() { let _ = *true.then_some(&42).unwrap_or(&17) as u8; //~^ obfuscated_if_else } + +#[allow(clippy::useless_format)] +fn issue16288() { + true.then(|| format!("this is a test")).unwrap_or_default(); + //~^ obfuscated_if_else +} diff --git a/src/tools/clippy/tests/ui/obfuscated_if_else.stderr b/src/tools/clippy/tests/ui/obfuscated_if_else.stderr index 0de7259d8bb8..865dca56b97a 100644 --- a/src/tools/clippy/tests/ui/obfuscated_if_else.stderr +++ b/src/tools/clippy/tests/ui/obfuscated_if_else.stderr @@ -139,5 +139,11 @@ error: this method chain can be written more clearly with `if .. else ..` LL | let _ = *true.then_some(&42).unwrap_or(&17) as u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { &42 } else { &17 }` -error: aborting due to 23 previous errors +error: this method chain can be written more clearly with `if .. else ..` + --> tests/ui/obfuscated_if_else.rs:93:5 + | +LL | true.then(|| format!("this is a test")).unwrap_or_default(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { format!("this is a test") } else { Default::default() }` + +error: aborting due to 24 previous errors diff --git a/src/tools/clippy/tests/ui/println_empty_string.fixed b/src/tools/clippy/tests/ui/println_empty_string.fixed index 05e262ec7786..6b1039ee8020 100644 --- a/src/tools/clippy/tests/ui/println_empty_string.fixed +++ b/src/tools/clippy/tests/ui/println_empty_string.fixed @@ -19,3 +19,23 @@ fn main() { //~^ println_empty_string } } + +#[rustfmt::skip] +fn issue_16167() { + //~v println_empty_string + println!( + ); + + match "a" { + _ => println!(), // there is a space between "" and comma + //~^ println_empty_string + } + + eprintln!(); // there is a tab between "" and comma + //~^ println_empty_string + + match "a" { + _ => eprintln!(), // tab and space between "" and comma + //~^ println_empty_string + } +} diff --git a/src/tools/clippy/tests/ui/println_empty_string.rs b/src/tools/clippy/tests/ui/println_empty_string.rs index 028ddb60dbce..db3b8e1a0eac 100644 --- a/src/tools/clippy/tests/ui/println_empty_string.rs +++ b/src/tools/clippy/tests/ui/println_empty_string.rs @@ -19,3 +19,27 @@ fn main() { //~^ println_empty_string } } + +#[rustfmt::skip] +fn issue_16167() { + //~v println_empty_string + println!( + "\ + \ + " + , + ); + + match "a" { + _ => println!("" ,), // there is a space between "" and comma + //~^ println_empty_string + } + + eprintln!("" ,); // there is a tab between "" and comma + //~^ println_empty_string + + match "a" { + _ => eprintln!("" ,), // tab and space between "" and comma + //~^ println_empty_string + } +} diff --git a/src/tools/clippy/tests/ui/println_empty_string.stderr b/src/tools/clippy/tests/ui/println_empty_string.stderr index 8b997aef9069..bdac1bb3b8ef 100644 --- a/src/tools/clippy/tests/ui/println_empty_string.stderr +++ b/src/tools/clippy/tests/ui/println_empty_string.stderr @@ -33,5 +33,42 @@ LL | _ => eprintln!(""), | | | help: remove the empty string -error: aborting due to 4 previous errors +error: empty string literal in `println!` + --> tests/ui/println_empty_string.rs:26:5 + | +LL | / println!( +LL | |/ "\ +LL | || \ +LL | || " +LL | || , +LL | || ); + | ||____-^ + | |____| + | help: remove the empty string + +error: empty string literal in `println!` + --> tests/ui/println_empty_string.rs:34:14 + | +LL | _ => println!("" ,), // there is a space between "" and comma + | ^^^^^^^^^----^ + | | + | help: remove the empty string + +error: empty string literal in `eprintln!` + --> tests/ui/println_empty_string.rs:38:5 + | +LL | eprintln!("" ,); // there is a tab between "" and comma + | ^^^^^^^^^^-------^ + | | + | help: remove the empty string + +error: empty string literal in `eprintln!` + --> tests/ui/println_empty_string.rs:42:14 + | +LL | _ => eprintln!("" ,), // tab and space between "" and comma + | ^^^^^^^^^^--------^ + | | + | help: remove the empty string + +error: aborting due to 8 previous errors diff --git a/src/tools/clippy/tests/ui/println_empty_string_unfixable.rs b/src/tools/clippy/tests/ui/println_empty_string_unfixable.rs new file mode 100644 index 000000000000..d6c30f627a58 --- /dev/null +++ b/src/tools/clippy/tests/ui/println_empty_string_unfixable.rs @@ -0,0 +1,30 @@ +#![allow(clippy::match_single_binding)] + +// If there is a comment in the span of macro call, we don't provide an auto-fix suggestion. +#[rustfmt::skip] +fn issue_16167() { + //~v println_empty_string + println!("" /* comment */); + //~v println_empty_string + eprintln!("" /* comment */); + + //~v println_empty_string + println!( // comment + ""); + //~v println_empty_string + eprintln!( // comment + ""); + + //~v println_empty_string + println!("", /* comment */); + + //~v println_empty_string + println!( + "\ + \ + ", + + // there is a comment in the macro span regardless of its position + + ); +} diff --git a/src/tools/clippy/tests/ui/println_empty_string_unfixable.stderr b/src/tools/clippy/tests/ui/println_empty_string_unfixable.stderr new file mode 100644 index 000000000000..648fd7cdbccd --- /dev/null +++ b/src/tools/clippy/tests/ui/println_empty_string_unfixable.stderr @@ -0,0 +1,85 @@ +error: empty string literal in `println!` + --> tests/ui/println_empty_string_unfixable.rs:7:5 + | +LL | println!("" /* comment */); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: remove the empty string + --> tests/ui/println_empty_string_unfixable.rs:7:14 + | +LL | println!("" /* comment */); + | ^^ + = note: `-D clippy::println-empty-string` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::println_empty_string)]` + +error: empty string literal in `eprintln!` + --> tests/ui/println_empty_string_unfixable.rs:9:5 + | +LL | eprintln!("" /* comment */); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: remove the empty string + --> tests/ui/println_empty_string_unfixable.rs:9:15 + | +LL | eprintln!("" /* comment */); + | ^^ + +error: empty string literal in `println!` + --> tests/ui/println_empty_string_unfixable.rs:12:5 + | +LL | / println!( // comment +LL | | ""); + | |___________________^ + | +note: remove the empty string + --> tests/ui/println_empty_string_unfixable.rs:13:17 + | +LL | ""); + | ^^ + +error: empty string literal in `eprintln!` + --> tests/ui/println_empty_string_unfixable.rs:15:5 + | +LL | / eprintln!( // comment +LL | | ""); + | |___________________^ + | +note: remove the empty string + --> tests/ui/println_empty_string_unfixable.rs:16:17 + | +LL | ""); + | ^^ + +error: empty string literal in `println!` + --> tests/ui/println_empty_string_unfixable.rs:19:5 + | +LL | println!("", /* comment */); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: remove the empty string + --> tests/ui/println_empty_string_unfixable.rs:19:14 + | +LL | println!("", /* comment */); + | ^^ + +error: empty string literal in `println!` + --> tests/ui/println_empty_string_unfixable.rs:22:5 + | +LL | / println!( +LL | | "\ +LL | | \ +LL | | ", +... | +LL | | ); + | |_____^ + | +note: remove the empty string + --> tests/ui/println_empty_string_unfixable.rs:23:9 + | +LL | / "\ +LL | | \ +LL | | ", + | |_____________^ + +error: aborting due to 6 previous errors + diff --git a/src/tools/clippy/tests/ui/ref_as_ptr.fixed b/src/tools/clippy/tests/ui/ref_as_ptr.fixed index ce144508581e..eadbb7c36415 100644 --- a/src/tools/clippy/tests/ui/ref_as_ptr.fixed +++ b/src/tools/clippy/tests/ui/ref_as_ptr.fixed @@ -86,6 +86,16 @@ fn main() { f(std::ptr::from_mut::<[usize; 9]>(&mut std::array::from_fn(|i| i * i))); //~^ ref_as_ptr + let x = (10, 20); + let _ = std::ptr::from_ref(&x); + //~^ ref_as_ptr + let _ = std::ptr::from_ref(&x.0); + //~^ ref_as_ptr + + let x = Box::new(10); + let _ = std::ptr::from_ref(&*x); + //~^ ref_as_ptr + let _ = &String::new() as *const _; let _ = &mut String::new() as *mut _; const FOO: *const String = &String::new() as *const _; diff --git a/src/tools/clippy/tests/ui/ref_as_ptr.rs b/src/tools/clippy/tests/ui/ref_as_ptr.rs index acdff2c2ba29..ef96a3ff5693 100644 --- a/src/tools/clippy/tests/ui/ref_as_ptr.rs +++ b/src/tools/clippy/tests/ui/ref_as_ptr.rs @@ -86,6 +86,16 @@ fn main() { f(&mut std::array::from_fn(|i| i * i) as *mut [usize; 9]); //~^ ref_as_ptr + let x = (10, 20); + let _ = &x as *const _; + //~^ ref_as_ptr + let _ = &x.0 as *const _; + //~^ ref_as_ptr + + let x = Box::new(10); + let _ = &*x as *const _; + //~^ ref_as_ptr + let _ = &String::new() as *const _; let _ = &mut String::new() as *mut _; const FOO: *const String = &String::new() as *const _; diff --git a/src/tools/clippy/tests/ui/ref_as_ptr.stderr b/src/tools/clippy/tests/ui/ref_as_ptr.stderr index 79db29e596bd..587e4fb809cd 100644 --- a/src/tools/clippy/tests/ui/ref_as_ptr.stderr +++ b/src/tools/clippy/tests/ui/ref_as_ptr.stderr @@ -200,61 +200,67 @@ LL | f(&mut std::array::from_fn(|i| i * i) as *mut [usize; 9]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::<[usize; 9]>(&mut std::array::from_fn(|i| i * i))` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:109:7 + --> tests/ui/ref_as_ptr.rs:90:13 + | +LL | let _ = &x as *const _; + | ^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&x)` + +error: reference as raw pointer + --> tests/ui/ref_as_ptr.rs:92:13 + | +LL | let _ = &x.0 as *const _; + | ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&x.0)` + +error: reference as raw pointer + --> tests/ui/ref_as_ptr.rs:96:13 + | +LL | let _ = &*x as *const _; + | ^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(&*x)` + +error: reference as raw pointer + --> tests/ui/ref_as_ptr.rs:119:7 | LL | f(val as *const i32); | ^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::(val)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:111:7 + --> tests/ui/ref_as_ptr.rs:121:7 | LL | f(mut_val as *mut i32); | ^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::(mut_val)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:116:7 + --> tests/ui/ref_as_ptr.rs:126:7 | LL | f(val as *const _); | ^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(val)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:118:7 + --> tests/ui/ref_as_ptr.rs:128:7 | LL | f(val as *const [u8]); | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref::<[u8]>(val)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:123:7 + --> tests/ui/ref_as_ptr.rs:133:7 | LL | f(val as *mut _); | ^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(val)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:125:7 + --> tests/ui/ref_as_ptr.rs:135:7 | LL | f(val as *mut str); | ^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut::(val)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:133:9 + --> tests/ui/ref_as_ptr.rs:143:9 | LL | self.0 as *const _ as *const _ | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)` error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:138:9 - | -LL | self.0 as *const _ as *const _ - | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)` - -error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:147:9 - | -LL | self.0 as *const _ as *const _ - | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)` - -error: reference as raw pointer - --> tests/ui/ref_as_ptr.rs:152:9 + --> tests/ui/ref_as_ptr.rs:148:9 | LL | self.0 as *const _ as *const _ | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)` @@ -262,8 +268,20 @@ LL | self.0 as *const _ as *const _ error: reference as raw pointer --> tests/ui/ref_as_ptr.rs:157:9 | +LL | self.0 as *const _ as *const _ + | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)` + +error: reference as raw pointer + --> tests/ui/ref_as_ptr.rs:162:9 + | +LL | self.0 as *const _ as *const _ + | ^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_ref(self.0)` + +error: reference as raw pointer + --> tests/ui/ref_as_ptr.rs:167:9 + | LL | self.0 as *mut _ as *mut _ | ^^^^^^^^^^^^^^^^ help: try: `std::ptr::from_mut(self.0)` -error: aborting due to 44 previous errors +error: aborting due to 47 previous errors diff --git a/src/tools/clippy/tests/ui/renamed_builtin_attr.stderr b/src/tools/clippy/tests/ui/renamed_builtin_attr.stderr index fb51313dab69..0ebc43739d6b 100644 --- a/src/tools/clippy/tests/ui/renamed_builtin_attr.stderr +++ b/src/tools/clippy/tests/ui/renamed_builtin_attr.stderr @@ -1,8 +1,8 @@ error: usage of deprecated attribute - --> tests/ui/renamed_builtin_attr.rs:3:11 + --> tests/ui/renamed_builtin_attr.rs:3:3 | LL | #[clippy::cyclomatic_complexity = "1"] - | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `cognitive_complexity` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `clippy::cognitive_complexity` error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/result_large_err.rs b/src/tools/clippy/tests/ui/result_large_err.rs index fa57b3f553fc..b4ad050df3b7 100644 --- a/src/tools/clippy/tests/ui/result_large_err.rs +++ b/src/tools/clippy/tests/ui/result_large_err.rs @@ -141,3 +141,12 @@ fn _empty_error() -> Result<(), Empty> { } fn main() {} + +fn issue16249() { + type Large = [u8; 1024]; + + let closure = || -> Result<(), Large> { Ok(()) }; + //~^ result_large_err + let closure = || Ok::<(), Large>(()); + //~^ result_large_err +} diff --git a/src/tools/clippy/tests/ui/result_large_err.stderr b/src/tools/clippy/tests/ui/result_large_err.stderr index 72fbc3f58961..fd39179c61cb 100644 --- a/src/tools/clippy/tests/ui/result_large_err.stderr +++ b/src/tools/clippy/tests/ui/result_large_err.stderr @@ -104,5 +104,21 @@ LL | pub fn array_error() -> Result<(), ArrayError<(i32, T), U>> { | = help: try reducing the size of `ArrayError<(i32, T), U>`, for example by boxing large elements or replacing it with `Box>` -error: aborting due to 12 previous errors +error: the `Err`-variant returned from this closure is very large + --> tests/ui/result_large_err.rs:148:25 + | +LL | let closure = || -> Result<(), Large> { Ok(()) }; + | ^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 1024 bytes + | + = help: try reducing the size of `[u8; 1024]`, for example by boxing large elements or replacing it with `Box<[u8; 1024]>` + +error: the `Err`-variant returned from this closure is very large + --> tests/ui/result_large_err.rs:150:19 + | +LL | let closure = || Ok::<(), Large>(()); + | ^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 1024 bytes + | + = help: try reducing the size of `[u8; 1024]`, for example by boxing large elements or replacing it with `Box<[u8; 1024]>` + +error: aborting due to 14 previous errors diff --git a/src/tools/clippy/tests/ui/same_length_and_capacity.rs b/src/tools/clippy/tests/ui/same_length_and_capacity.rs new file mode 100644 index 000000000000..999fcf89881d --- /dev/null +++ b/src/tools/clippy/tests/ui/same_length_and_capacity.rs @@ -0,0 +1,27 @@ +#![warn(clippy::same_length_and_capacity)] + +fn main() { + let mut my_vec: Vec = Vec::with_capacity(20); + my_vec.extend([1, 2, 3, 4, 5]); + let (ptr, mut len, cap) = my_vec.into_raw_parts(); + len = 8; + + let _reconstructed_vec = unsafe { Vec::from_raw_parts(ptr, len, len) }; + //~^ same_length_and_capacity + + // Don't want to lint different expressions for len and cap + let _properly_reconstructed_vec = unsafe { Vec::from_raw_parts(ptr, len, cap) }; + + // Don't want to lint if len and cap are distinct variables but happen to be equal + let len_from_cap = cap; + let _another_properly_reconstructed_vec = unsafe { Vec::from_raw_parts(ptr, len_from_cap, cap) }; + + let my_string = String::from("hello"); + let (string_ptr, string_len, string_cap) = my_string.into_raw_parts(); + + let _reconstructed_string = unsafe { String::from_raw_parts(string_ptr, string_len, string_len) }; + //~^ same_length_and_capacity + + // Don't want to lint different expressions for len and cap + let _properly_reconstructed_string = unsafe { String::from_raw_parts(string_ptr, string_len, string_cap) }; +} diff --git a/src/tools/clippy/tests/ui/same_length_and_capacity.stderr b/src/tools/clippy/tests/ui/same_length_and_capacity.stderr new file mode 100644 index 000000000000..6fc852831269 --- /dev/null +++ b/src/tools/clippy/tests/ui/same_length_and_capacity.stderr @@ -0,0 +1,20 @@ +error: usage of `Vec::from_raw_parts` with the same expression for length and capacity + --> tests/ui/same_length_and_capacity.rs:9:39 + | +LL | let _reconstructed_vec = unsafe { Vec::from_raw_parts(ptr, len, len) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try `Box::from(slice::from_raw_parts(...)).into::>()` + = note: `-D clippy::same-length-and-capacity` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::same_length_and_capacity)]` + +error: usage of `String::from_raw_parts` with the same expression for length and capacity + --> tests/ui/same_length_and_capacity.rs:22:42 + | +LL | let _reconstructed_string = unsafe { String::from_raw_parts(string_ptr, string_len, string_len) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try `String::from(str::from_utf8_unchecked(slice::from_raw_parts(...)))` + +error: aborting due to 2 previous errors + diff --git a/src/tools/clippy/tests/ui/set_contains_or_insert.rs b/src/tools/clippy/tests/ui/set_contains_or_insert.rs index 575cfda139a4..ac1d74f8afa4 100644 --- a/src/tools/clippy/tests/ui/set_contains_or_insert.rs +++ b/src/tools/clippy/tests/ui/set_contains_or_insert.rs @@ -164,3 +164,24 @@ fn main() { should_not_warn_hashset(); should_not_warn_btreeset(); } + +fn issue15990(s: &mut HashSet, v: usize) { + if !s.contains(&v) { + s.clear(); + s.insert(v); + } + + fn borrow_as_mut(v: usize, s: &mut HashSet) { + s.clear(); + } + if !s.contains(&v) { + borrow_as_mut(v, s); + s.insert(v); + } + + if !s.contains(&v) { + //~^ set_contains_or_insert + let _readonly_access = s.contains(&v); + s.insert(v); + } +} diff --git a/src/tools/clippy/tests/ui/set_contains_or_insert.stderr b/src/tools/clippy/tests/ui/set_contains_or_insert.stderr index 3152b1136458..3b06b63182ab 100644 --- a/src/tools/clippy/tests/ui/set_contains_or_insert.stderr +++ b/src/tools/clippy/tests/ui/set_contains_or_insert.stderr @@ -127,5 +127,14 @@ LL | LL | borrow_set.insert(value); | ^^^^^^^^^^^^^ -error: aborting due to 14 previous errors +error: usage of `HashSet::insert` after `HashSet::contains` + --> tests/ui/set_contains_or_insert.rs:182:11 + | +LL | if !s.contains(&v) { + | ^^^^^^^^^^^^ +... +LL | s.insert(v); + | ^^^^^^^^^ + +error: aborting due to 15 previous errors diff --git a/src/tools/clippy/tests/ui/track-diagnostics.rs b/src/tools/clippy/tests/ui/track-diagnostics.rs index 0fbde867390d..1cd37e0570d7 100644 --- a/src/tools/clippy/tests/ui/track-diagnostics.rs +++ b/src/tools/clippy/tests/ui/track-diagnostics.rs @@ -3,6 +3,7 @@ // Normalize the emitted location so this doesn't need // updating everytime someone adds or removes a line. //@normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:CC" +//@normalize-stderr-test: "/rustc-dev/[0-9a-f]+/" -> "" struct A; struct B; diff --git a/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.fixed b/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.fixed index f2bd306a99e4..f8be3331317c 100644 --- a/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.fixed +++ b/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.fixed @@ -1,6 +1,6 @@ #![deny(clippy::trait_duplication_in_bounds)] #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] trait AssocConstTrait { #[type_const] diff --git a/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.rs b/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.rs index 8e7d843a44c0..a0d7a653993f 100644 --- a/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.rs +++ b/src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.rs @@ -1,6 +1,6 @@ #![deny(clippy::trait_duplication_in_bounds)] #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] trait AssocConstTrait { #[type_const] diff --git a/src/tools/clippy/tests/ui/transmuting_null.rs b/src/tools/clippy/tests/ui/transmuting_null.rs index f3eb5060cd0d..0d3b26673452 100644 --- a/src/tools/clippy/tests/ui/transmuting_null.rs +++ b/src/tools/clippy/tests/ui/transmuting_null.rs @@ -30,7 +30,15 @@ fn transmute_const() { } } +fn transmute_const_int() { + unsafe { + let _: &u64 = std::mem::transmute(u64::MIN as *const u64); + //~^ transmuting_null + } +} + fn main() { one_liners(); transmute_const(); + transmute_const_int(); } diff --git a/src/tools/clippy/tests/ui/transmuting_null.stderr b/src/tools/clippy/tests/ui/transmuting_null.stderr index c68e4102e405..ed7c3396a243 100644 --- a/src/tools/clippy/tests/ui/transmuting_null.stderr +++ b/src/tools/clippy/tests/ui/transmuting_null.stderr @@ -19,5 +19,11 @@ error: transmuting a known null pointer into a reference LL | let _: &u64 = std::mem::transmute(ZPTR); | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: transmuting a known null pointer into a reference + --> tests/ui/transmuting_null.rs:35:23 + | +LL | let _: &u64 = std::mem::transmute(u64::MIN as *const u64); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui/unchecked_time_subtraction.fixed b/src/tools/clippy/tests/ui/unchecked_time_subtraction.fixed index 2f923fef4c25..830b737f18e7 100644 --- a/src/tools/clippy/tests/ui/unchecked_time_subtraction.fixed +++ b/src/tools/clippy/tests/ui/unchecked_time_subtraction.fixed @@ -35,3 +35,28 @@ fn main() { let _ = (2 * dur1).checked_sub(dur2).unwrap(); //~^ unchecked_time_subtraction } + +fn issue16230() { + use std::ops::Sub as _; + + Duration::ZERO.checked_sub(Duration::MAX).unwrap(); + //~^ unchecked_time_subtraction + + let _ = Duration::ZERO.checked_sub(Duration::MAX).unwrap(); + //~^ unchecked_time_subtraction +} + +fn issue16234() { + use std::ops::Sub as _; + + macro_rules! duration { + ($secs:expr) => { + Duration::from_secs($secs) + }; + } + + duration!(0).checked_sub(duration!(1)).unwrap(); + //~^ unchecked_time_subtraction + let _ = duration!(0).checked_sub(duration!(1)).unwrap(); + //~^ unchecked_time_subtraction +} diff --git a/src/tools/clippy/tests/ui/unchecked_time_subtraction.rs b/src/tools/clippy/tests/ui/unchecked_time_subtraction.rs index cf727f62aafa..e41860157c41 100644 --- a/src/tools/clippy/tests/ui/unchecked_time_subtraction.rs +++ b/src/tools/clippy/tests/ui/unchecked_time_subtraction.rs @@ -35,3 +35,28 @@ fn main() { let _ = 2 * dur1 - dur2; //~^ unchecked_time_subtraction } + +fn issue16230() { + use std::ops::Sub as _; + + Duration::ZERO.sub(Duration::MAX); + //~^ unchecked_time_subtraction + + let _ = Duration::ZERO - Duration::MAX; + //~^ unchecked_time_subtraction +} + +fn issue16234() { + use std::ops::Sub as _; + + macro_rules! duration { + ($secs:expr) => { + Duration::from_secs($secs) + }; + } + + duration!(0).sub(duration!(1)); + //~^ unchecked_time_subtraction + let _ = duration!(0) - duration!(1); + //~^ unchecked_time_subtraction +} diff --git a/src/tools/clippy/tests/ui/unchecked_time_subtraction.stderr b/src/tools/clippy/tests/ui/unchecked_time_subtraction.stderr index c129497447fc..fa4bd1db81ae 100644 --- a/src/tools/clippy/tests/ui/unchecked_time_subtraction.stderr +++ b/src/tools/clippy/tests/ui/unchecked_time_subtraction.stderr @@ -49,5 +49,29 @@ error: unchecked subtraction of a `Duration` LL | let _ = 2 * dur1 - dur2; | ^^^^^^^^^^^^^^^ help: try: `(2 * dur1).checked_sub(dur2).unwrap()` -error: aborting due to 8 previous errors +error: unchecked subtraction of a `Duration` + --> tests/ui/unchecked_time_subtraction.rs:42:5 + | +LL | Duration::ZERO.sub(Duration::MAX); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Duration::ZERO.checked_sub(Duration::MAX).unwrap()` + +error: unchecked subtraction of a `Duration` + --> tests/ui/unchecked_time_subtraction.rs:45:13 + | +LL | let _ = Duration::ZERO - Duration::MAX; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Duration::ZERO.checked_sub(Duration::MAX).unwrap()` + +error: unchecked subtraction of a `Duration` + --> tests/ui/unchecked_time_subtraction.rs:58:5 + | +LL | duration!(0).sub(duration!(1)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `duration!(0).checked_sub(duration!(1)).unwrap()` + +error: unchecked subtraction of a `Duration` + --> tests/ui/unchecked_time_subtraction.rs:60:13 + | +LL | let _ = duration!(0) - duration!(1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `duration!(0).checked_sub(duration!(1)).unwrap()` + +error: aborting due to 12 previous errors diff --git a/src/tools/clippy/tests/ui/unknown_attribute.stderr b/src/tools/clippy/tests/ui/unknown_attribute.stderr index b306abe0a9d1..1d4d50ffc02a 100644 --- a/src/tools/clippy/tests/ui/unknown_attribute.stderr +++ b/src/tools/clippy/tests/ui/unknown_attribute.stderr @@ -1,8 +1,8 @@ error: usage of unknown attribute - --> tests/ui/unknown_attribute.rs:3:11 + --> tests/ui/unknown_attribute.rs:3:3 | LL | #[clippy::unknown] - | ^^^^^^^ + | ^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/unnecessary_fold.fixed b/src/tools/clippy/tests/ui/unnecessary_fold.fixed index 1c331be75094..c3eeafbc39cd 100644 --- a/src/tools/clippy/tests/ui/unnecessary_fold.fixed +++ b/src/tools/clippy/tests/ui/unnecessary_fold.fixed @@ -6,21 +6,35 @@ fn is_any(acc: bool, x: usize) -> bool { /// Calls which should trigger the `UNNECESSARY_FOLD` lint fn unnecessary_fold() { + use std::ops::{Add, Mul}; + // Can be replaced by .any let _ = (0..3).any(|x| x > 2); //~^ unnecessary_fold + // Can be replaced by .any (checking suggestion) let _ = (0..3).fold(false, is_any); //~^ redundant_closure + // Can be replaced by .all let _ = (0..3).all(|x| x > 2); //~^ unnecessary_fold + // Can be replaced by .sum let _: i32 = (0..3).sum(); //~^ unnecessary_fold + let _: i32 = (0..3).sum(); + //~^ unnecessary_fold + let _: i32 = (0..3).sum(); + //~^ unnecessary_fold + // Can be replaced by .product let _: i32 = (0..3).product(); //~^ unnecessary_fold + let _: i32 = (0..3).product(); + //~^ unnecessary_fold + let _: i32 = (0..3).product(); + //~^ unnecessary_fold } /// Should trigger the `UNNECESSARY_FOLD` lint, with an error span including exactly `.fold(...)` @@ -37,6 +51,43 @@ fn unnecessary_fold_should_ignore() { let _ = (0..3).fold(0, |acc, x| acc * x); let _ = (0..3).fold(0, |acc, x| 1 + acc + x); + struct Adder; + impl Adder { + fn add(lhs: i32, rhs: i32) -> i32 { + unimplemented!() + } + fn mul(lhs: i32, rhs: i32) -> i32 { + unimplemented!() + } + } + // `add`/`mul` are inherent methods + let _: i32 = (0..3).fold(0, Adder::add); + let _: i32 = (0..3).fold(1, Adder::mul); + + trait FakeAdd { + type Output; + fn add(self, other: Rhs) -> Self::Output; + } + impl FakeAdd for i32 { + type Output = Self; + fn add(self, other: i32) -> Self::Output { + self + other + } + } + trait FakeMul { + type Output; + fn mul(self, other: Rhs) -> Self::Output; + } + impl FakeMul for i32 { + type Output = Self; + fn mul(self, other: i32) -> Self::Output { + self * other + } + } + // `add`/`mul` come from an unrelated trait + let _: i32 = (0..3).fold(0, FakeAdd::add); + let _: i32 = (0..3).fold(1, FakeMul::mul); + // We only match against an accumulator on the left // hand side. We could lint for .sum and .product when // it's on the right, but don't for now (and this wouldn't @@ -63,6 +114,7 @@ fn unnecessary_fold_over_multiple_lines() { fn issue10000() { use std::collections::HashMap; use std::hash::BuildHasher; + use std::ops::{Add, Mul}; fn anything(_: T) {} fn num(_: i32) {} @@ -74,23 +126,56 @@ fn issue10000() { // more cases: let _ = map.values().sum::(); //~^ unnecessary_fold + let _ = map.values().sum::(); + //~^ unnecessary_fold let _ = map.values().product::(); //~^ unnecessary_fold + let _ = map.values().product::(); + //~^ unnecessary_fold + let _: i32 = map.values().sum(); + //~^ unnecessary_fold let _: i32 = map.values().sum(); //~^ unnecessary_fold let _: i32 = map.values().product(); //~^ unnecessary_fold + let _: i32 = map.values().product(); + //~^ unnecessary_fold + anything(map.values().sum::()); + //~^ unnecessary_fold anything(map.values().sum::()); //~^ unnecessary_fold anything(map.values().product::()); //~^ unnecessary_fold + anything(map.values().product::()); + //~^ unnecessary_fold num(map.values().sum()); //~^ unnecessary_fold + num(map.values().sum()); + //~^ unnecessary_fold + num(map.values().product()); + //~^ unnecessary_fold num(map.values().product()); //~^ unnecessary_fold } smoketest_map(HashMap::new()); + + fn add_turbofish_not_necessary() -> i32 { + (0..3).sum() + //~^ unnecessary_fold + } + fn mul_turbofish_not_necessary() -> i32 { + (0..3).product() + //~^ unnecessary_fold + } + fn add_turbofish_necessary() -> impl Add { + (0..3).sum::() + //~^ unnecessary_fold + } + fn mul_turbofish_necessary() -> impl Mul { + (0..3).product::() + //~^ unnecessary_fold + } } fn main() {} diff --git a/src/tools/clippy/tests/ui/unnecessary_fold.rs b/src/tools/clippy/tests/ui/unnecessary_fold.rs index e2050e37e3b1..6ab41a942625 100644 --- a/src/tools/clippy/tests/ui/unnecessary_fold.rs +++ b/src/tools/clippy/tests/ui/unnecessary_fold.rs @@ -6,21 +6,35 @@ fn is_any(acc: bool, x: usize) -> bool { /// Calls which should trigger the `UNNECESSARY_FOLD` lint fn unnecessary_fold() { + use std::ops::{Add, Mul}; + // Can be replaced by .any let _ = (0..3).fold(false, |acc, x| acc || x > 2); //~^ unnecessary_fold + // Can be replaced by .any (checking suggestion) let _ = (0..3).fold(false, |acc, x| is_any(acc, x)); //~^ redundant_closure + // Can be replaced by .all let _ = (0..3).fold(true, |acc, x| acc && x > 2); //~^ unnecessary_fold + // Can be replaced by .sum let _: i32 = (0..3).fold(0, |acc, x| acc + x); //~^ unnecessary_fold + let _: i32 = (0..3).fold(0, Add::add); + //~^ unnecessary_fold + let _: i32 = (0..3).fold(0, i32::add); + //~^ unnecessary_fold + // Can be replaced by .product let _: i32 = (0..3).fold(1, |acc, x| acc * x); //~^ unnecessary_fold + let _: i32 = (0..3).fold(1, Mul::mul); + //~^ unnecessary_fold + let _: i32 = (0..3).fold(1, i32::mul); + //~^ unnecessary_fold } /// Should trigger the `UNNECESSARY_FOLD` lint, with an error span including exactly `.fold(...)` @@ -37,6 +51,43 @@ fn unnecessary_fold_should_ignore() { let _ = (0..3).fold(0, |acc, x| acc * x); let _ = (0..3).fold(0, |acc, x| 1 + acc + x); + struct Adder; + impl Adder { + fn add(lhs: i32, rhs: i32) -> i32 { + unimplemented!() + } + fn mul(lhs: i32, rhs: i32) -> i32 { + unimplemented!() + } + } + // `add`/`mul` are inherent methods + let _: i32 = (0..3).fold(0, Adder::add); + let _: i32 = (0..3).fold(1, Adder::mul); + + trait FakeAdd { + type Output; + fn add(self, other: Rhs) -> Self::Output; + } + impl FakeAdd for i32 { + type Output = Self; + fn add(self, other: i32) -> Self::Output { + self + other + } + } + trait FakeMul { + type Output; + fn mul(self, other: Rhs) -> Self::Output; + } + impl FakeMul for i32 { + type Output = Self; + fn mul(self, other: i32) -> Self::Output { + self * other + } + } + // `add`/`mul` come from an unrelated trait + let _: i32 = (0..3).fold(0, FakeAdd::add); + let _: i32 = (0..3).fold(1, FakeMul::mul); + // We only match against an accumulator on the left // hand side. We could lint for .sum and .product when // it's on the right, but don't for now (and this wouldn't @@ -63,6 +114,7 @@ fn unnecessary_fold_over_multiple_lines() { fn issue10000() { use std::collections::HashMap; use std::hash::BuildHasher; + use std::ops::{Add, Mul}; fn anything(_: T) {} fn num(_: i32) {} @@ -74,23 +126,56 @@ fn issue10000() { // more cases: let _ = map.values().fold(0, |x, y| x + y); //~^ unnecessary_fold + let _ = map.values().fold(0, Add::add); + //~^ unnecessary_fold let _ = map.values().fold(1, |x, y| x * y); //~^ unnecessary_fold + let _ = map.values().fold(1, Mul::mul); + //~^ unnecessary_fold let _: i32 = map.values().fold(0, |x, y| x + y); //~^ unnecessary_fold + let _: i32 = map.values().fold(0, Add::add); + //~^ unnecessary_fold let _: i32 = map.values().fold(1, |x, y| x * y); //~^ unnecessary_fold + let _: i32 = map.values().fold(1, Mul::mul); + //~^ unnecessary_fold anything(map.values().fold(0, |x, y| x + y)); //~^ unnecessary_fold + anything(map.values().fold(0, Add::add)); + //~^ unnecessary_fold anything(map.values().fold(1, |x, y| x * y)); //~^ unnecessary_fold + anything(map.values().fold(1, Mul::mul)); + //~^ unnecessary_fold num(map.values().fold(0, |x, y| x + y)); //~^ unnecessary_fold + num(map.values().fold(0, Add::add)); + //~^ unnecessary_fold num(map.values().fold(1, |x, y| x * y)); //~^ unnecessary_fold + num(map.values().fold(1, Mul::mul)); + //~^ unnecessary_fold } smoketest_map(HashMap::new()); + + fn add_turbofish_not_necessary() -> i32 { + (0..3).fold(0, |acc, x| acc + x) + //~^ unnecessary_fold + } + fn mul_turbofish_not_necessary() -> i32 { + (0..3).fold(1, |acc, x| acc * x) + //~^ unnecessary_fold + } + fn add_turbofish_necessary() -> impl Add { + (0..3).fold(0, |acc, x| acc + x) + //~^ unnecessary_fold + } + fn mul_turbofish_necessary() -> impl Mul { + (0..3).fold(1, |acc, x| acc * x) + //~^ unnecessary_fold + } } fn main() {} diff --git a/src/tools/clippy/tests/ui/unnecessary_fold.stderr b/src/tools/clippy/tests/ui/unnecessary_fold.stderr index d82b1f39b48b..bb8aa7e18d34 100644 --- a/src/tools/clippy/tests/ui/unnecessary_fold.stderr +++ b/src/tools/clippy/tests/ui/unnecessary_fold.stderr @@ -1,5 +1,5 @@ error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:10:20 + --> tests/ui/unnecessary_fold.rs:12:20 | LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)` @@ -8,7 +8,7 @@ LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2); = help: to override `-D warnings` add `#[allow(clippy::unnecessary_fold)]` error: redundant closure - --> tests/ui/unnecessary_fold.rs:13:32 + --> tests/ui/unnecessary_fold.rs:16:32 | LL | let _ = (0..3).fold(false, |acc, x| is_any(acc, x)); | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_any` @@ -17,88 +17,184 @@ LL | let _ = (0..3).fold(false, |acc, x| is_any(acc, x)); = help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:16:20 + --> tests/ui/unnecessary_fold.rs:20:20 | LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|x| x > 2)` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:19:25 + --> tests/ui/unnecessary_fold.rs:24:25 | LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x); | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:22:25 + --> tests/ui/unnecessary_fold.rs:26:25 + | +LL | let _: i32 = (0..3).fold(0, Add::add); + | ^^^^^^^^^^^^^^^^^ help: try: `sum()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:28:25 + | +LL | let _: i32 = (0..3).fold(0, i32::add); + | ^^^^^^^^^^^^^^^^^ help: try: `sum()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:32:25 | LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x); | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:28:41 + --> tests/ui/unnecessary_fold.rs:34:25 + | +LL | let _: i32 = (0..3).fold(1, Mul::mul); + | ^^^^^^^^^^^^^^^^^ help: try: `product()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:36:25 + | +LL | let _: i32 = (0..3).fold(1, i32::mul); + | ^^^^^^^^^^^^^^^^^ help: try: `product()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:42:41 | LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:59:10 + --> tests/ui/unnecessary_fold.rs:110:10 | LL | .fold(false, |acc, x| acc || x > 2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:71:33 + --> tests/ui/unnecessary_fold.rs:123:33 | LL | assert_eq!(map.values().fold(0, |x, y| x + y), 0); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:75:30 + --> tests/ui/unnecessary_fold.rs:127:30 | LL | let _ = map.values().fold(0, |x, y| x + y); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:77:30 + --> tests/ui/unnecessary_fold.rs:129:30 + | +LL | let _ = map.values().fold(0, Add::add); + | ^^^^^^^^^^^^^^^^^ help: try: `sum::()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:131:30 | LL | let _ = map.values().fold(1, |x, y| x * y); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:79:35 + --> tests/ui/unnecessary_fold.rs:133:30 + | +LL | let _ = map.values().fold(1, Mul::mul); + | ^^^^^^^^^^^^^^^^^ help: try: `product::()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:135:35 | LL | let _: i32 = map.values().fold(0, |x, y| x + y); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:81:35 + --> tests/ui/unnecessary_fold.rs:137:35 + | +LL | let _: i32 = map.values().fold(0, Add::add); + | ^^^^^^^^^^^^^^^^^ help: try: `sum()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:139:35 | LL | let _: i32 = map.values().fold(1, |x, y| x * y); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:83:31 + --> tests/ui/unnecessary_fold.rs:141:35 + | +LL | let _: i32 = map.values().fold(1, Mul::mul); + | ^^^^^^^^^^^^^^^^^ help: try: `product()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:143:31 | LL | anything(map.values().fold(0, |x, y| x + y)); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:85:31 + --> tests/ui/unnecessary_fold.rs:145:31 + | +LL | anything(map.values().fold(0, Add::add)); + | ^^^^^^^^^^^^^^^^^ help: try: `sum::()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:147:31 | LL | anything(map.values().fold(1, |x, y| x * y)); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:87:26 + --> tests/ui/unnecessary_fold.rs:149:31 + | +LL | anything(map.values().fold(1, Mul::mul)); + | ^^^^^^^^^^^^^^^^^ help: try: `product::()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:151:26 | LL | num(map.values().fold(0, |x, y| x + y)); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` error: this `.fold` can be written more succinctly using another method - --> tests/ui/unnecessary_fold.rs:89:26 + --> tests/ui/unnecessary_fold.rs:153:26 + | +LL | num(map.values().fold(0, Add::add)); + | ^^^^^^^^^^^^^^^^^ help: try: `sum()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:155:26 | LL | num(map.values().fold(1, |x, y| x * y)); | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` -error: aborting due to 16 previous errors +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:157:26 + | +LL | num(map.values().fold(1, Mul::mul)); + | ^^^^^^^^^^^^^^^^^ help: try: `product()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:164:16 + | +LL | (0..3).fold(0, |acc, x| acc + x) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:168:16 + | +LL | (0..3).fold(1, |acc, x| acc * x) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:172:16 + | +LL | (0..3).fold(0, |acc, x| acc + x) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` + +error: this `.fold` can be written more succinctly using another method + --> tests/ui/unnecessary_fold.rs:176:16 + | +LL | (0..3).fold(1, |acc, x| acc * x) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` + +error: aborting due to 32 previous errors diff --git a/src/tools/clippy/tests/ui/use_self.fixed b/src/tools/clippy/tests/ui/use_self.fixed index 075e31d202b0..37559f9a2367 100644 --- a/src/tools/clippy/tests/ui/use_self.fixed +++ b/src/tools/clippy/tests/ui/use_self.fixed @@ -10,6 +10,9 @@ clippy::needless_lifetimes, clippy::missing_transmute_annotations )] +#![allow(incomplete_features)] +#![feature(adt_const_params)] +#![feature(unsized_const_params)] #[macro_use] extern crate proc_macro_derive; @@ -769,3 +772,25 @@ mod issue_13277 { type Item<'foo> = Option>; } } + +mod issue16164 { + trait Bits { + fn bit(self) -> bool; + } + + impl Bits for u8 { + fn bit(self) -> bool { + todo!() + } + } + + trait T { + fn f(self) -> bool; + } + + impl T for u8 { + fn f(self) -> bool { + todo!() + } + } +} diff --git a/src/tools/clippy/tests/ui/use_self.rs b/src/tools/clippy/tests/ui/use_self.rs index 6fbba0bbc550..74abd2f61bf9 100644 --- a/src/tools/clippy/tests/ui/use_self.rs +++ b/src/tools/clippy/tests/ui/use_self.rs @@ -10,6 +10,9 @@ clippy::needless_lifetimes, clippy::missing_transmute_annotations )] +#![allow(incomplete_features)] +#![feature(adt_const_params)] +#![feature(unsized_const_params)] #[macro_use] extern crate proc_macro_derive; @@ -769,3 +772,25 @@ mod issue_13277 { type Item<'foo> = Option>; } } + +mod issue16164 { + trait Bits { + fn bit(self) -> bool; + } + + impl Bits for u8 { + fn bit(self) -> bool { + todo!() + } + } + + trait T { + fn f(self) -> bool; + } + + impl T for u8 { + fn f(self) -> bool { + todo!() + } + } +} diff --git a/src/tools/clippy/tests/ui/use_self.stderr b/src/tools/clippy/tests/ui/use_self.stderr index 5f65c53ea25c..8ce341d22d4f 100644 --- a/src/tools/clippy/tests/ui/use_self.stderr +++ b/src/tools/clippy/tests/ui/use_self.stderr @@ -1,5 +1,5 @@ error: unnecessary structure name repetition - --> tests/ui/use_self.rs:23:21 + --> tests/ui/use_self.rs:26:21 | LL | fn new() -> Foo { | ^^^ help: use the applicable keyword: `Self` @@ -8,247 +8,247 @@ LL | fn new() -> Foo { = help: to override `-D warnings` add `#[allow(clippy::use_self)]` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:25:13 + --> tests/ui/use_self.rs:28:13 | LL | Foo {} | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:28:22 + --> tests/ui/use_self.rs:31:22 | LL | fn test() -> Foo { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:30:13 + --> tests/ui/use_self.rs:33:13 | LL | Foo::new() | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:36:25 + --> tests/ui/use_self.rs:39:25 | LL | fn default() -> Foo { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:38:13 + --> tests/ui/use_self.rs:41:13 | LL | Foo::new() | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:80:28 + --> tests/ui/use_self.rs:83:28 | LL | fn clone(&self) -> Foo<'a> { | ^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:114:24 + --> tests/ui/use_self.rs:117:24 | LL | fn bad(foos: &[Foo]) -> impl Iterator { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:114:55 + --> tests/ui/use_self.rs:117:55 | LL | fn bad(foos: &[Foo]) -> impl Iterator { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:131:13 + --> tests/ui/use_self.rs:134:13 | LL | TS(0) | ^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:167:29 + --> tests/ui/use_self.rs:170:29 | LL | fn bar() -> Bar { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:169:21 + --> tests/ui/use_self.rs:172:21 | LL | Bar { foo: Foo {} } | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:181:21 + --> tests/ui/use_self.rs:184:21 | LL | fn baz() -> Foo { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:183:13 + --> tests/ui/use_self.rs:186:13 | LL | Foo {} | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:201:21 + --> tests/ui/use_self.rs:204:21 | LL | let _ = Enum::B(42); | ^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:203:21 + --> tests/ui/use_self.rs:206:21 | LL | let _ = Enum::C { field: true }; | ^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:205:21 + --> tests/ui/use_self.rs:208:21 | LL | let _ = Enum::A; | ^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:248:13 + --> tests/ui/use_self.rs:251:13 | LL | nested::A::fun_1(); | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:250:13 + --> tests/ui/use_self.rs:253:13 | LL | nested::A::A; | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:253:13 + --> tests/ui/use_self.rs:256:13 | LL | nested::A {}; | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:273:13 + --> tests/ui/use_self.rs:276:13 | LL | TestStruct::from_something() | ^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:288:25 + --> tests/ui/use_self.rs:291:25 | LL | async fn g() -> S { | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:290:13 + --> tests/ui/use_self.rs:293:13 | LL | S {} | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:295:16 + --> tests/ui/use_self.rs:298:16 | LL | &p[S::A..S::B] | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:295:22 + --> tests/ui/use_self.rs:298:22 | LL | &p[S::A..S::B] | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:320:29 + --> tests/ui/use_self.rs:323:29 | LL | fn foo(value: T) -> Foo { | ^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:322:13 + --> tests/ui/use_self.rs:325:13 | LL | Foo:: { value } | ^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:495:13 + --> tests/ui/use_self.rs:498:13 | LL | A::new::(submod::B {}) | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:571:17 + --> tests/ui/use_self.rs:574:17 | LL | Foo::Bar => unimplemented!(), | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:573:17 + --> tests/ui/use_self.rs:576:17 | LL | Foo::Baz => unimplemented!(), | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:580:20 + --> tests/ui/use_self.rs:583:20 | LL | if let Foo::Bar = self { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:605:17 + --> tests/ui/use_self.rs:608:17 | LL | Something::Num(n) => *n, | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:607:17 + --> tests/ui/use_self.rs:610:17 | LL | Something::TupleNums(n, _m) => *n, | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:609:17 + --> tests/ui/use_self.rs:612:17 | LL | Something::StructNums { one, two: _ } => *one, | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:616:17 + --> tests/ui/use_self.rs:619:17 | LL | crate::issue8845::Something::Num(n) => *n, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:618:17 + --> tests/ui/use_self.rs:621:17 | LL | crate::issue8845::Something::TupleNums(n, _m) => *n, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:620:17 + --> tests/ui/use_self.rs:623:17 | LL | crate::issue8845::Something::StructNums { one, two: _ } => *one, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:637:17 + --> tests/ui/use_self.rs:640:17 | LL | let Foo(x) = self; | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:643:17 + --> tests/ui/use_self.rs:646:17 | LL | let crate::issue8845::Foo(x) = self; | ^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:651:17 + --> tests/ui/use_self.rs:654:17 | LL | let Bar { x, .. } = self; | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:657:17 + --> tests/ui/use_self.rs:660:17 | LL | let crate::issue8845::Bar { x, .. } = self; | ^^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:697:17 + --> tests/ui/use_self.rs:700:17 | LL | E::A => {}, | ^ help: use the applicable keyword: `Self` diff --git a/src/tools/clippy/tests/ui/writeln_empty_string_unfixable.rs b/src/tools/clippy/tests/ui/writeln_empty_string_unfixable.rs new file mode 100644 index 000000000000..ca570fd1fc7b --- /dev/null +++ b/src/tools/clippy/tests/ui/writeln_empty_string_unfixable.rs @@ -0,0 +1,26 @@ +#![allow(unused_must_use)] +#![warn(clippy::writeln_empty_string)] + +use std::io::Write; + +// If there is a comment in the span of macro call, we don't provide an auto-fix suggestion. +#[rustfmt::skip] +fn issue_16251() { + let mut v = Vec::new(); + + writeln!(v, /* comment */ ""); + //~^ writeln_empty_string + + writeln!(v, "" /* comment */); + //~^ writeln_empty_string + + //~v writeln_empty_string + writeln!(v, + "\ + \ + " + + // there is a comment in the macro span regardless of its position + + ); +} diff --git a/src/tools/clippy/tests/ui/writeln_empty_string_unfixable.stderr b/src/tools/clippy/tests/ui/writeln_empty_string_unfixable.stderr new file mode 100644 index 000000000000..0ed802ba84ba --- /dev/null +++ b/src/tools/clippy/tests/ui/writeln_empty_string_unfixable.stderr @@ -0,0 +1,47 @@ +error: empty string literal in `writeln!` + --> tests/ui/writeln_empty_string_unfixable.rs:11:5 + | +LL | writeln!(v, /* comment */ ""); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: remove the empty string + --> tests/ui/writeln_empty_string_unfixable.rs:11:31 + | +LL | writeln!(v, /* comment */ ""); + | ^^ + = note: `-D clippy::writeln-empty-string` implied by `-D warnings` + = help: to override `-D warnings` add `#[allow(clippy::writeln_empty_string)]` + +error: empty string literal in `writeln!` + --> tests/ui/writeln_empty_string_unfixable.rs:14:5 + | +LL | writeln!(v, "" /* comment */); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: remove the empty string + --> tests/ui/writeln_empty_string_unfixable.rs:14:17 + | +LL | writeln!(v, "" /* comment */); + | ^^ + +error: empty string literal in `writeln!` + --> tests/ui/writeln_empty_string_unfixable.rs:18:5 + | +LL | / writeln!(v, +LL | | "\ +LL | | \ +LL | | " +... | +LL | | ); + | |_____^ + | +note: remove the empty string + --> tests/ui/writeln_empty_string_unfixable.rs:19:9 + | +LL | / "\ +LL | | \ +LL | | " + | |_____________^ + +error: aborting due to 3 previous errors + diff --git a/src/tools/clippy/triagebot.toml b/src/tools/clippy/triagebot.toml index 09dec7675e7e..5f637205fa65 100644 --- a/src/tools/clippy/triagebot.toml +++ b/src/tools/clippy/triagebot.toml @@ -63,6 +63,7 @@ users_on_vacation = [ "Alexendoo", "y21", "blyxyas", + "samueltardieu", ] [assign.owners] diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 9473e51688cb..450fde3bbc38 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -18,7 +18,7 @@ string_enum! { Pretty => "pretty", DebugInfo => "debuginfo", Codegen => "codegen", - Rustdoc => "rustdoc", + RustdocHtml => "rustdoc-html", RustdocJson => "rustdoc-json", CodegenUnits => "codegen-units", Incremental => "incremental", @@ -69,7 +69,7 @@ string_enum! { Pretty => "pretty", RunMake => "run-make", RunMakeCargo => "run-make-cargo", - Rustdoc => "rustdoc", + RustdocHtml => "rustdoc-html", RustdocGui => "rustdoc-gui", RustdocJs => "rustdoc-js", RustdocJsStd=> "rustdoc-js-std", @@ -625,6 +625,9 @@ pub struct Config { /// Whether to run `enzyme` autodiff tests. pub has_enzyme: bool, + /// Whether to run `offload` autodiff tests. + pub has_offload: bool, + /// The current Rust channel info. /// /// FIXME: treat this more carefully; "stable", "beta" and "nightly" are definitely valid, but diff --git a/src/tools/compiletest/src/directives.rs b/src/tools/compiletest/src/directives.rs index d1e0c5d95001..624f4dd7c2b1 100644 --- a/src/tools/compiletest/src/directives.rs +++ b/src/tools/compiletest/src/directives.rs @@ -15,7 +15,7 @@ use crate::directives::directive_names::{ }; pub(crate) use crate::directives::file::FileDirectives; use crate::directives::handlers::DIRECTIVE_HANDLERS_MAP; -use crate::directives::line::{DirectiveLine, line_directive}; +use crate::directives::line::DirectiveLine; use crate::directives::needs::CachedNeedsConditions; use crate::edition::{Edition, parse_edition}; use crate::errors::ErrorKind; @@ -29,6 +29,7 @@ mod directive_names; mod file; mod handlers; mod line; +pub(crate) use line::line_directive; mod line_number; pub(crate) use line_number::LineNumber; mod needs; @@ -551,7 +552,7 @@ fn check_directive<'a>( let is_known_directive = KNOWN_DIRECTIVE_NAMES_SET.contains(&directive_name) || match mode { - TestMode::Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name), + TestMode::RustdocHtml => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name), TestMode::RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES.contains(&directive_name), _ => false, }; diff --git a/src/tools/compiletest/src/directives/cfg.rs b/src/tools/compiletest/src/directives/cfg.rs index e89c1330f467..6431eb6b090b 100644 --- a/src/tools/compiletest/src/directives/cfg.rs +++ b/src/tools/compiletest/src/directives/cfg.rs @@ -164,6 +164,7 @@ pub(crate) fn prepare_conditions(config: &Config) -> PreparedConditions { // FIXME(Zalathar): Support all known binary formats, not just ELF? builder.cond("elf", current.binary_format == "elf", "when the target binary format is ELF"); builder.cond("enzyme", config.has_enzyme, "when rustc is built with LLVM Enzyme"); + builder.cond("offload", config.has_offload, "when rustc is built with LLVM Offload"); // Technically the locally built compiler uses the "dev" channel rather than the "nightly" // channel, even though most people don't know or won't care about it. To avoid confusion, we diff --git a/src/tools/compiletest/src/directives/directive_names.rs b/src/tools/compiletest/src/directives/directive_names.rs index 282e2a131d93..9813ac7ff500 100644 --- a/src/tools/compiletest/src/directives/directive_names.rs +++ b/src/tools/compiletest/src/directives/directive_names.rs @@ -165,6 +165,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "needs-git-hash", "needs-llvm-components", "needs-llvm-zstd", + "needs-offload", "needs-profiler-runtime", "needs-relocation-model-pic", "needs-run-enabled", diff --git a/src/tools/compiletest/src/directives/needs.rs b/src/tools/compiletest/src/directives/needs.rs index 36c2ca62cd87..32ce6cf7b989 100644 --- a/src/tools/compiletest/src/directives/needs.rs +++ b/src/tools/compiletest/src/directives/needs.rs @@ -91,6 +91,11 @@ pub(super) fn handle_needs( condition: config.has_enzyme && config.default_codegen_backend.is_llvm(), ignore_reason: "ignored when LLVM Enzyme is disabled or LLVM is not the default codegen backend", }, + Need { + name: "needs-offload", + condition: config.has_offload && config.default_codegen_backend.is_llvm(), + ignore_reason: "ignored when LLVM Offload is disabled or LLVM is not the default codegen backend", + }, Need { name: "needs-run-enabled", condition: config.run_enabled(), diff --git a/src/tools/compiletest/src/directives/tests.rs b/src/tools/compiletest/src/directives/tests.rs index 0d3777b8e60c..2dc878fa2a20 100644 --- a/src/tools/compiletest/src/directives/tests.rs +++ b/src/tools/compiletest/src/directives/tests.rs @@ -630,7 +630,7 @@ fn test_forbidden_revisions_allowed_in_non_filecheck_dir() { let modes = [ "pretty", "debuginfo", - "rustdoc", + "rustdoc-html", "rustdoc-json", "codegen-units", "incremental", diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 83aee865e010..c219a8887f8f 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -85,7 +85,7 @@ fn parse_config(args: Vec) -> Config { "", "mode", "which sort of compile tests to run", - "pretty | debug-info | codegen | rustdoc \ + "pretty | debug-info | codegen | rustdoc-html \ | rustdoc-json | codegen-units | incremental | run-make | ui \ | rustdoc-js | mir-opt | assembly | crashes", ) @@ -104,6 +104,7 @@ fn parse_config(args: Vec) -> Config { .optopt("", "run", "whether to execute run-* tests", "auto | always | never") .optflag("", "ignored", "run tests marked as ignored") .optflag("", "has-enzyme", "run tests that require enzyme") + .optflag("", "has-offload", "run tests that require offload") .optflag("", "with-rustc-debug-assertions", "whether rustc was built with debug assertions") .optflag("", "with-std-debug-assertions", "whether std was built with debug assertions") .optflag("", "with-std-remap-debuginfo", "whether std was built with remapping") @@ -299,6 +300,7 @@ fn parse_config(args: Vec) -> Config { let with_std_remap_debuginfo = matches.opt_present("with-std-remap-debuginfo"); let mode = matches.opt_str("mode").unwrap().parse().expect("invalid mode"); let has_enzyme = matches.opt_present("has-enzyme"); + let has_offload = matches.opt_present("has-offload"); let filters = if mode == TestMode::RunMake { matches .free @@ -444,6 +446,7 @@ fn parse_config(args: Vec) -> Config { compare_mode, rustfix_coverage: matches.opt_present("rustfix-coverage"), has_enzyme, + has_offload, channel: matches.opt_str("channel").unwrap(), git_hash: matches.opt_present("git-hash"), edition: matches.opt_str("edition").as_deref().map(parse_edition), @@ -1091,8 +1094,8 @@ fn make_test_name_and_filterable_path( /// of some other tests's name. /// /// For example, suppose the test suite contains these two test files: -/// - `tests/rustdoc/primitive.rs` -/// - `tests/rustdoc/primitive/no_std.rs` +/// - `tests/rustdoc-html/primitive.rs` +/// - `tests/rustdoc-html/primitive/no_std.rs` /// /// The test runner might put the output from those tests in these directories: /// - `$build/test/rustdoc/primitive/` diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 1216ba888328..6efdb5a99ee2 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -269,7 +269,7 @@ impl<'test> TestCx<'test> { TestMode::Pretty => self.run_pretty_test(), TestMode::DebugInfo => self.run_debuginfo_test(), TestMode::Codegen => self.run_codegen_test(), - TestMode::Rustdoc => self.run_rustdoc_test(), + TestMode::RustdocHtml => self.run_rustdoc_html_test(), TestMode::RustdocJson => self.run_rustdoc_json_test(), TestMode::CodegenUnits => self.run_codegen_units_test(), TestMode::Incremental => self.run_incremental_test(), @@ -1758,7 +1758,7 @@ impl<'test> TestCx<'test> { } TestMode::Pretty | TestMode::DebugInfo - | TestMode::Rustdoc + | TestMode::RustdocHtml | TestMode::RustdocJson | TestMode::RunMake | TestMode::RustdocJs => { diff --git a/src/tools/compiletest/src/runtest/debugger.rs b/src/tools/compiletest/src/runtest/debugger.rs index c83e00c1006e..70996004a336 100644 --- a/src/tools/compiletest/src/runtest/debugger.rs +++ b/src/tools/compiletest/src/runtest/debugger.rs @@ -4,7 +4,7 @@ use std::io::{BufRead, BufReader}; use camino::{Utf8Path, Utf8PathBuf}; -use crate::directives::LineNumber; +use crate::directives::{LineNumber, line_directive}; use crate::runtest::ProcRes; /// Representation of information to invoke a debugger and check its output @@ -17,10 +17,16 @@ pub(super) struct DebuggerCommands { check_lines: Vec<(LineNumber, String)>, /// Source file name file: Utf8PathBuf, + /// The revision being tested, if any + revision: Option, } impl DebuggerCommands { - pub fn parse_from(file: &Utf8Path, debugger_prefix: &str) -> Result { + pub fn parse_from( + file: &Utf8Path, + debugger_prefix: &str, + test_revision: Option<&str>, + ) -> Result { let command_directive = format!("{debugger_prefix}-command"); let check_directive = format!("{debugger_prefix}-check"); @@ -37,19 +43,33 @@ impl DebuggerCommands { continue; } - let Some(line) = line.trim_start().strip_prefix("//@").map(str::trim_start) else { + let Some(directive) = line_directive(file, line_number, &line) else { continue; }; - if let Some(command) = parse_name_value(&line, &command_directive) { - commands.push(command); + if !directive.applies_to_test_revision(test_revision) { + continue; } - if let Some(pattern) = parse_name_value(&line, &check_directive) { - check_lines.push((line_number, pattern)); + + if directive.name == command_directive + && let Some(command) = directive.value_after_colon() + { + commands.push(command.to_string()); + } + if directive.name == check_directive + && let Some(pattern) = directive.value_after_colon() + { + check_lines.push((line_number, pattern.to_string())); } } - Ok(Self { commands, breakpoint_lines, check_lines, file: file.to_path_buf() }) + Ok(Self { + commands, + breakpoint_lines, + check_lines, + file: file.to_path_buf(), + revision: test_revision.map(str::to_owned), + }) } /// Given debugger output and lines to check, ensure that every line is @@ -81,9 +101,11 @@ impl DebuggerCommands { Ok(()) } else { let fname = self.file.file_name().unwrap(); + let revision_suffix = + self.revision.as_ref().map_or(String::new(), |r| format!("#{}", r)); let mut msg = format!( - "check directive(s) from `{}` not found in debugger output. errors:", - self.file + "check directive(s) from `{}{}` not found in debugger output. errors:", + self.file, revision_suffix ); for (src_lineno, err_line) in missing { @@ -103,18 +125,6 @@ impl DebuggerCommands { } } -/// Split off from the main `parse_name_value_directive`, so that improvements -/// to directive handling aren't held back by debuginfo test commands. -fn parse_name_value(line: &str, name: &str) -> Option { - if let Some(after_name) = line.strip_prefix(name) - && let Some(value) = after_name.strip_prefix(':') - { - Some(value.to_owned()) - } else { - None - } -} - /// Check that the pattern in `check_line` applies to `line`. Returns `true` if they do match. fn check_single_line(line: &str, check_line: &str) -> bool { // Allow check lines to leave parts unspecified (e.g., uninitialized diff --git a/src/tools/compiletest/src/runtest/debuginfo.rs b/src/tools/compiletest/src/runtest/debuginfo.rs index 83b61b9be57d..9d6edaddc1b7 100644 --- a/src/tools/compiletest/src/runtest/debuginfo.rs +++ b/src/tools/compiletest/src/runtest/debuginfo.rs @@ -46,7 +46,7 @@ impl TestCx<'_> { } // Parse debugger commands etc from test files - let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "cdb") + let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "cdb", self.revision) .unwrap_or_else(|e| self.fatal(&e)); // https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-commands @@ -105,7 +105,7 @@ impl TestCx<'_> { } fn run_debuginfo_gdb_test(&self) { - let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "gdb") + let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "gdb", self.revision) .unwrap_or_else(|e| self.fatal(&e)); let mut cmds = dbg_cmds.commands.join("\n"); @@ -366,7 +366,7 @@ impl TestCx<'_> { } // Parse debugger commands etc from test files - let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "lldb") + let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "lldb", self.revision) .unwrap_or_else(|e| self.fatal(&e)); // Write debugger script: diff --git a/src/tools/compiletest/src/runtest/rustdoc.rs b/src/tools/compiletest/src/runtest/rustdoc.rs index 3c80521e51ec..8907848e0ca5 100644 --- a/src/tools/compiletest/src/runtest/rustdoc.rs +++ b/src/tools/compiletest/src/runtest/rustdoc.rs @@ -3,7 +3,7 @@ use std::process::Command; use super::{DocKind, TestCx, remove_and_create_dir_all}; impl TestCx<'_> { - pub(super) fn run_rustdoc_test(&self) { + pub(super) fn run_rustdoc_html_test(&self) { assert!(self.revision.is_none(), "revisions not supported in this test suite"); let out_dir = self.output_base_dir(); diff --git a/src/tools/compiletest/src/rustdoc_gui_test.rs b/src/tools/compiletest/src/rustdoc_gui_test.rs index 2b057bb35519..bacc8061d209 100644 --- a/src/tools/compiletest/src/rustdoc_gui_test.rs +++ b/src/tools/compiletest/src/rustdoc_gui_test.rs @@ -50,7 +50,7 @@ fn incomplete_config_for_rustdoc_gui_test() -> Config { // // For instance, `//@ ignore-stage1` will not work at all. Config { - mode: TestMode::Rustdoc, + mode: TestMode::RustdocHtml, // E.g. this has no sensible default tbh. suite: TestSuite::Ui, @@ -113,6 +113,7 @@ fn incomplete_config_for_rustdoc_gui_test() -> Config { compare_mode: Default::default(), rustfix_coverage: Default::default(), has_enzyme: Default::default(), + has_offload: Default::default(), channel: Default::default(), git_hash: Default::default(), cc: Default::default(), diff --git a/src/tools/generate-copyright/Cargo.toml b/src/tools/generate-copyright/Cargo.toml index bcb3165de458..66b9f394409b 100644 --- a/src/tools/generate-copyright/Cargo.toml +++ b/src/tools/generate-copyright/Cargo.toml @@ -8,7 +8,7 @@ description = "Produces a manifest of all the copyrighted materials in the Rust [dependencies] anyhow = "1.0.65" -askama = "0.14.0" +askama = "0.15.1" cargo_metadata = "0.21" serde = { version = "1.0.147", features = ["derive"] } serde_json = "1.0.85" diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index 395c37e9ade8..b314aaafbdf0 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -123,22 +123,21 @@ dependencies = [ [[package]] name = "capstone" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015ef5d5ca1743e3f94af9509ba6bd2886523cfee46e48d15c2ef5216fd4ac9a" +checksum = "f442ae0f2f3f1b923334b4a5386c95c69c1cfa072bafa23d6fae6d9682eb1dd4" dependencies = [ "capstone-sys", - "libc", + "static_assertions", ] [[package]] name = "capstone-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2267cb8d16a1e4197863ec4284ffd1aec26fe7e57c58af46b02590a0235809a0" +checksum = "a4e8087cab6731295f5a2a2bd82989ba4f41d3a428aab2e7c98d8f4db38aac05" dependencies = [ "cc", - "libc", ] [[package]] @@ -786,9 +785,9 @@ checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libffi" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0444124f3ffd67e1b0b0c661a7f81a278a135eb54aaad4078e79fbc8be50c8a5" +checksum = "0498fe5655f857803e156523e644dcdcdc3b3c7edda42ea2afdae2e09b2db87b" dependencies = [ "libc", "libffi-sys", @@ -796,9 +795,9 @@ dependencies = [ [[package]] name = "libffi-sys" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d722da8817ea580d0669da6babe2262d7b86a1af1103da24102b8bb9c101ce7" +checksum = "71d4f1d4ce15091955144350b75db16a96d4a63728500122706fb4d29a26afbb" dependencies = [ "cc", ] @@ -1404,6 +1403,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.11.1" diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 4a54a7e0eb71..e7c90e45eba5 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -32,14 +32,14 @@ serde_json = { version = "1.0", optional = true } [target.'cfg(unix)'.dependencies] libc = "0.2" # native-lib dependencies -libffi = { version = "5.0.0", optional = true } +libffi = { version = "5.1.0", optional = true } libloading = { version = "0.9", optional = true } serde = { version = "1.0.219", features = ["derive"], optional = true } [target.'cfg(target_os = "linux")'.dependencies] nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true } ipc-channel = { version = "0.20.0", optional = true } -capstone = { version = "0.13", optional = true } +capstone = { version = "0.14", optional = true } [target.'cfg(all(target_os = "linux", target_pointer_width = "64", target_endian = "little"))'.dependencies] genmc-sys = { path = "./genmc-sys/", version = "0.1.0", optional = true } @@ -68,6 +68,7 @@ expensive-consistency-checks = ["stack-cache"] tracing = ["serde_json"] native-lib = ["dep:libffi", "dep:libloading", "dep:capstone", "dep:ipc-channel", "dep:nix", "dep:serde"] jemalloc = [] +check_only = ["libffi?/check_only", "capstone?/check_only", "genmc-sys?/check_only"] [lints.rust.unexpected_cfgs] level = "warn" diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index 2832ef50adef..d5ef9c767414 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -219,7 +219,7 @@ degree documented below): - We have unofficial support (not maintained by the Miri team itself) for some further operating systems. - `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite. - `freebsd`: maintained by @YohDeadfall and @LorrensP-2158466. Supports the entire test suite. - - `android`: **maintainer wanted**. Basic OS APIs and concurrency work, but file system access is not supported. + - `android`: **maintainer wanted**. Supports the entire test suite. - For targets on other operating systems, Miri might fail before even reaching the `main` function. However, even for targets that we do support, the degree of support for accessing platform APIs diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 2d27f0274999..c8e359cf2385 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -30,14 +30,15 @@ export CARGO_INCREMENTAL=0 export CARGO_EXTRA_FLAGS="--locked" # Determine configuration for installed build (used by test-cargo-miri and `./miri bench`). +# We use the default set of features for this. echo "Installing release version of Miri" time ./miri install # Prepare debug build for direct `./miri` invocations. -# We enable all features to make sure the Stacked Borrows consistency check runs. +# Here we enable some more features and checks. echo "Building debug version of Miri" -export CARGO_EXTRA_FLAGS="$CARGO_EXTRA_FLAGS --all-features" -time ./miri build # the build that all the `./miri test` below will use +export FEATURES="--features=expensive-consistency-checks,genmc" +time ./miri build $FEATURES # the build that all the `./miri test` below will use endgroup @@ -63,7 +64,7 @@ function run_tests { if [ -n "${GC_STRESS-}" ]; then time MIRIFLAGS="${MIRIFLAGS-} -Zmiri-provenance-gc=1" ./miri test $TARGET_FLAG else - time ./miri test $TARGET_FLAG + time ./miri test $FEATURES $TARGET_FLAG fi ## advanced tests @@ -74,20 +75,20 @@ function run_tests { # them. Also error locations change so we don't run the failing tests. # We explicitly enable debug-assertions here, they are disabled by -O but we have tests # which exist to check that we panic on debug assertion failures. - time MIRIFLAGS="${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test $TARGET_FLAG tests/{pass,panic} + time MIRIFLAGS="${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test $FEATURES $TARGET_FLAG tests/{pass,panic} fi if [ -n "${MANY_SEEDS-}" ]; then # Run many-seeds tests. (Also tests `./miri run`.) time for FILE in tests/many-seeds/*.rs; do - ./miri run "-Zmiri-many-seeds=0..$MANY_SEEDS" $TARGET_FLAG "$FILE" + ./miri run $FEATURES "-Zmiri-many-seeds=0..$MANY_SEEDS" $TARGET_FLAG "$FILE" done + # Smoke-test `./miri run --dep`. + ./miri run $FEATURES $TARGET_FLAG --dep tests/pass-dep/getrandom.rs fi if [ -n "${TEST_BENCH-}" ]; then # Check that the benchmarks build and run, but only once. time HYPERFINE="hyperfine -w0 -r1 --show-output" ./miri bench $TARGET_FLAG --no-install fi - # Smoke-test `./miri run --dep`. - ./miri run $TARGET_FLAG --dep tests/pass-dep/getrandom.rs ## test-cargo-miri # On Windows, there is always "python", not "python3" or "python2". @@ -149,10 +150,11 @@ case $HOST_TARGET in i686-unknown-linux-gnu) # Host MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests + # Fully, but not officially, supported tier 2 + MANY_SEEDS=16 TEST_TARGET=aarch64-linux-android run_tests # Partially supported targets (tier 2) BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there - TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std ;; diff --git a/src/tools/miri/etc/rust_analyzer_helix.toml b/src/tools/miri/etc/rust_analyzer_helix.toml index dd222c50431a..1015b4baa6b0 100644 --- a/src/tools/miri/etc/rust_analyzer_helix.toml +++ b/src/tools/miri/etc/rust_analyzer_helix.toml @@ -27,7 +27,6 @@ invocationStrategy = "once" overrideCommand = [ "./miri", "check", - "--no-default-features", "-Zunstable-options", "--compile-time-deps", "--message-format=json", diff --git a/src/tools/miri/etc/rust_analyzer_vscode.json b/src/tools/miri/etc/rust_analyzer_vscode.json index 97ba212f8ef9..e82c648f59ab 100644 --- a/src/tools/miri/etc/rust_analyzer_vscode.json +++ b/src/tools/miri/etc/rust_analyzer_vscode.json @@ -21,7 +21,6 @@ "rust-analyzer.cargo.buildScripts.overrideCommand": [ "./miri", "check", - "--no-default-features", "-Zunstable-options", "--compile-time-deps", "--message-format=json", diff --git a/src/tools/miri/etc/rust_analyzer_zed.json b/src/tools/miri/etc/rust_analyzer_zed.json index 7f60a931c46f..e5ff400e989e 100644 --- a/src/tools/miri/etc/rust_analyzer_zed.json +++ b/src/tools/miri/etc/rust_analyzer_zed.json @@ -30,7 +30,6 @@ "overrideCommand": [ "./miri", "check", - "--no-default-features", "-Zunstable-options", "--compile-time-deps", "--message-format=json" diff --git a/src/tools/miri/genmc-sys/Cargo.toml b/src/tools/miri/genmc-sys/Cargo.toml index 6443ecd969df..37fcc58070a3 100644 --- a/src/tools/miri/genmc-sys/Cargo.toml +++ b/src/tools/miri/genmc-sys/Cargo.toml @@ -13,3 +13,6 @@ cc = "1.2.16" cmake = "0.1.54" git2 = { version = "0.20.2", default-features = false, features = ["https"] } cxx-build = { version = "1.0.173", features = ["parallel"] } + +[features] +check_only = [] diff --git a/src/tools/miri/genmc-sys/build.rs b/src/tools/miri/genmc-sys/build.rs index a22e3341d67a..4fc3ce94fb8b 100644 --- a/src/tools/miri/genmc-sys/build.rs +++ b/src/tools/miri/genmc-sys/build.rs @@ -202,6 +202,11 @@ fn compile_cpp_dependencies(genmc_path: &Path, always_configure: bool) { } fn main() { + // For check-only builds, we don't need to do anything. + if cfg!(feature = "check_only") { + return; + } + // Select which path to use for the GenMC repo: let (genmc_path, always_configure) = if let Some(genmc_src_path) = option_env!("GENMC_SRC_PATH") { diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index 5a8bf76befd6..86f6253d4558 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -391,7 +391,8 @@ impl Command { Ok(()) } - fn check(features: Vec, flags: Vec) -> Result<()> { + fn check(mut features: Vec, flags: Vec) -> Result<()> { + features.push("check_only".into()); let e = MiriEnv::new()?; e.check(".", &features, &flags)?; e.check("cargo-miri", &[], &flags)?; @@ -405,7 +406,8 @@ impl Command { Ok(()) } - fn clippy(features: Vec, flags: Vec) -> Result<()> { + fn clippy(mut features: Vec, flags: Vec) -> Result<()> { + features.push("check_only".into()); let e = MiriEnv::new()?; e.clippy(".", &features, &flags)?; e.clippy("cargo-miri", &[], &flags)?; diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 024cbd285207..c44422d758c5 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -cb79c42008b970269f6a06b257e5f04b93f24d03 +f57b9e6f565a1847e83a63f3e90faa3870536c1f diff --git a/src/tools/miri/src/alloc_addresses/mod.rs b/src/tools/miri/src/alloc_addresses/mod.rs index 05d3444a4eb1..fed51ed86433 100644 --- a/src/tools/miri/src/alloc_addresses/mod.rs +++ b/src/tools/miri/src/alloc_addresses/mod.rs @@ -12,6 +12,7 @@ use rustc_middle::ty::TyCtxt; pub use self::address_generator::AddressGenerator; use self::reuse_pool::ReusePool; +use crate::alloc::MiriAllocParams; use crate::concurrency::VClock; use crate::diagnostics::SpanDedupDiagnostic; use crate::*; @@ -162,18 +163,28 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { this.get_alloc_bytes_unchecked_raw(alloc_id)? } } - AllocKind::Function | AllocKind::VTable => { - // Allocate some dummy memory to get a unique address for this function/vtable. - let alloc_bytes = MiriAllocBytes::from_bytes( - &[0u8; 1], - Align::from_bytes(1).unwrap(), - params, - ); - let ptr = alloc_bytes.as_ptr(); - // Leak the underlying memory to ensure it remains unique. - std::mem::forget(alloc_bytes); - ptr + #[cfg(all(unix, feature = "native-lib"))] + AllocKind::Function => { + if let Some(GlobalAlloc::Function { instance, .. }) = + this.tcx.try_get_global_alloc(alloc_id) + { + let fn_sig = this.tcx.fn_sig(instance.def_id()).skip_binder().skip_binder(); + let fn_ptr = crate::shims::native_lib::build_libffi_closure(this, fn_sig)?; + + #[expect( + clippy::as_conversions, + reason = "No better way to cast a function ptr to a ptr" + )] + { + fn_ptr as *const _ + } + } else { + dummy_alloc(params) + } } + #[cfg(not(all(unix, feature = "native-lib")))] + AllocKind::Function => dummy_alloc(params), + AllocKind::VTable => dummy_alloc(params), AllocKind::TypeId | AllocKind::Dead => unreachable!(), }; // We don't have to expose this pointer yet, we do that in `prepare_for_native_call`. @@ -205,6 +216,15 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { } } +fn dummy_alloc(params: MiriAllocParams) -> *const u8 { + // Allocate some dummy memory to get a unique address for this function/vtable. + let alloc_bytes = MiriAllocBytes::from_bytes(&[0u8; 1], Align::from_bytes(1).unwrap(), params); + let ptr = alloc_bytes.as_ptr(); + // Leak the underlying memory to ensure it remains unique. + std::mem::forget(alloc_bytes); + ptr +} + impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Returns the `AllocId` that corresponds to the specified addr, diff --git a/src/tools/miri/src/bin/log/tracing_chrome_instant.rs b/src/tools/miri/src/bin/log/tracing_chrome_instant.rs index f400bc20a7b5..b5f00852b82f 100644 --- a/src/tools/miri/src/bin/log/tracing_chrome_instant.rs +++ b/src/tools/miri/src/bin/log/tracing_chrome_instant.rs @@ -151,7 +151,7 @@ mod tsc { // implemented like https://docs.rs/raw-cpuid/latest/src/raw_cpuid/extended.rs.html#965-967 const LEAF: u32 = 0x80000007; // this is the leaf for "advanced power management info" - let cpuid = unsafe { __cpuid(LEAF) }; + let cpuid = __cpuid(LEAF); (cpuid.edx & (1 << 8)) != 0 // EDX bit 8 indicates invariant TSC } diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index efe707156c40..19fbf90246c9 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -710,20 +710,18 @@ fn main() { if !miri_config.native_lib.is_empty() && miri_config.provenance_mode == ProvenanceMode::Strict { fatal_error!("strict provenance is not compatible with calling native functions"); } + // Native calls and many-seeds are an "intersting" combination. + if !miri_config.native_lib.is_empty() && many_seeds.is_some() { + eprintln!( + "warning: `-Zmiri-many-seeds` runs multiple instances of the program in the same address space, \ + so if the native library has global state, it will leak across execution bundaries" + ); + } // You can set either one seed or many. if many_seeds.is_some() && miri_config.seed.is_some() { fatal_error!("Only one of `-Zmiri-seed` and `-Zmiri-many-seeds can be set"); } - - // Ensure we have parallelism for many-seeds mode. - if many_seeds.is_some() && !rustc_args.iter().any(|arg| arg.starts_with("-Zthreads=")) { - // Clamp to 20 threads; things get a less efficient beyond that due to lock contention. - let threads = std::thread::available_parallelism().map_or(1, |n| n.get()).min(20); - rustc_args.push(format!("-Zthreads={threads}")); - } - let many_seeds = - many_seeds.map(|seeds| ManySeedsConfig { seeds, keep_going: many_seeds_keep_going }); - + // We cannot emulate weak memory without the data race detector. if miri_config.weak_memory_emulation && !miri_config.data_race_detector { fatal_error!( "Weak memory emulation cannot be enabled when the data race detector is disabled" @@ -737,6 +735,15 @@ fn main() { fatal_error!("Invalid settings: {err}"); } + // Ensure we have parallelism for many-seeds mode. + if many_seeds.is_some() && !rustc_args.iter().any(|arg| arg.starts_with("-Zthreads=")) { + // Clamp to 20 threads; things get a less efficient beyond that due to lock contention. + let threads = std::thread::available_parallelism().map_or(1, |n| n.get()).min(20); + rustc_args.push(format!("-Zthreads={threads}")); + } + let many_seeds = + many_seeds.map(|seeds| ManySeedsConfig { seeds, keep_going: many_seeds_keep_going }); + debug!("rustc arguments: {:?}", rustc_args); debug!("crate arguments: {:?}", miri_config.args); if !miri_config.native_lib.is_empty() && miri_config.native_lib_enable_tracing { diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs index c8e27ebf0ff3..2c6be522837c 100644 --- a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs +++ b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs @@ -661,6 +661,7 @@ impl<'tcx> Tree { global, ChildrenVisitMode::VisitChildrenOfAccessed, &diagnostics, + /* min_exposed_child */ None, // only matters for protector end access, )?; } interp_ok(()) @@ -686,6 +687,13 @@ impl<'tcx> Tree { let source_idx = self.tag_mapping.get(&tag).unwrap(); + let min_exposed_child = if self.roots.len() > 1 { + LocationTree::get_min_exposed_child(source_idx, &self.nodes) + } else { + // There's no point in computing this when there is just one tree. + None + }; + // This is a special access through the entire allocation. // It actually only affects `accessed` locations, so we need // to filter on those before initiating the traversal. @@ -716,6 +724,7 @@ impl<'tcx> Tree { global, ChildrenVisitMode::SkipChildrenOfAccessed, &diagnostics, + min_exposed_child, )?; } } @@ -876,9 +885,36 @@ impl Tree { } impl<'tcx> LocationTree { + /// Returns the smallest exposed tag, if any, that is a transitive child of `root`. + fn get_min_exposed_child(root: UniIndex, nodes: &UniValMap) -> Option { + // We cannot use the wildcard datastructure to improve this lookup. This is because + // the datastructure only tracks enabled nodes and we need to also consider disabled ones. + let mut stack = vec![root]; + let mut min_tag = None; + while let Some(idx) = stack.pop() { + let node = nodes.get(idx).unwrap(); + if min_tag.is_some_and(|min| min < node.tag) { + // The minimum we found before is bigger than this tag, and therefore + // also bigger than all its children, so we can skip this subtree. + continue; + } + stack.extend_from_slice(node.children.as_slice()); + if node.is_exposed { + min_tag = match min_tag { + Some(prev) if prev < node.tag => Some(prev), + _ => Some(node.tag), + }; + } + } + min_tag + } + /// Performs an access on this location. /// * `access_source`: The index, if any, where the access came from. /// * `visit_children`: Whether to skip updating the children of `access_source`. + /// * `min_exposed_child`: The tag of the smallest exposed (transitive) child of the accessed node. + /// This is only used with `visit_children == SkipChildrenOfAccessed`, where we need to skip children + /// of the accessed node. fn perform_access( &mut self, roots: impl Iterator, @@ -888,6 +924,7 @@ impl<'tcx> LocationTree { global: &GlobalState, visit_children: ChildrenVisitMode, diagnostics: &DiagnosticInfo, + min_exposed_child: Option, ) -> InterpResult<'tcx> { let accessed_root = if let Some(idx) = access_source { Some(self.perform_normal_access( @@ -906,11 +943,22 @@ impl<'tcx> LocationTree { }; let accessed_root_tag = accessed_root.map(|idx| nodes.get(idx).unwrap().tag); - if matches!(visit_children, ChildrenVisitMode::SkipChildrenOfAccessed) { - // FIXME: approximate which roots could be children of the accessed node and only skip them instead of all other trees. - return interp_ok(()); - } for root in roots { + let tag = nodes.get(root).unwrap().tag; + // On a protector release access we have to skip the children of the accessed tag. + // However, if the tag has exposed children then some of the wildcard subtrees could + // also be children of the accessed node and would also need to be skipped. We can + // narrow down which wildcard trees might be children by comparing their root tag to the + // minimum exposed child of the accessed node. As the parent tag is always smaller + // than the child tag this means we only need to skip subtrees with a root tag larger + // than `min_exposed_child`. Once we find such a root, we can leave the loop because roots + // are sorted by tag. + if matches!(visit_children, ChildrenVisitMode::SkipChildrenOfAccessed) + && let Some(min_exposed_child) = min_exposed_child + && tag > min_exposed_child + { + break; + } // We don't perform a wildcard access on the tree we already performed a // normal access on. if Some(root) == accessed_root { diff --git a/src/tools/miri/src/concurrency/data_race.rs b/src/tools/miri/src/concurrency/data_race.rs index 75c1d0f6a798..c18b78099860 100644 --- a/src/tools/miri/src/concurrency/data_race.rs +++ b/src/tools/miri/src/concurrency/data_race.rs @@ -1116,6 +1116,7 @@ impl VClockAlloc { { (AccessType::AtomicStore, idx, &atomic.write_vector) } else if !access.is_atomic() && + !access.is_read() && let Some(atomic) = mem_clocks.atomic() && let Some(idx) = Self::find_gt_index(&atomic.read_vector, &active_clocks.clock) { @@ -1124,7 +1125,7 @@ impl VClockAlloc { } else if mem_clocks.write.1 > active_clocks.clock[mem_clocks.write.0] { write_clock = mem_clocks.write(); (AccessType::NaWrite(mem_clocks.write_type), mem_clocks.write.0, &write_clock) - } else if let Some(idx) = Self::find_gt_index(&mem_clocks.read, &active_clocks.clock) { + } else if !access.is_read() && let Some(idx) = Self::find_gt_index(&mem_clocks.read, &active_clocks.clock) { (AccessType::NaRead(mem_clocks.read[idx].read_type()), idx, &mem_clocks.read) // Finally, mixed-size races. } else if access.is_atomic() && let Some(atomic) = mem_clocks.atomic() && atomic.size != Some(access_size) { @@ -1157,7 +1158,9 @@ impl VClockAlloc { assert!(!involves_non_atomic); Some("overlapping unsynchronized atomic accesses must use the same access size") } else if access.is_read() && other_access.is_read() { - panic!("there should be no same-size read-read races") + panic!( + "there should be no same-size read-read races\naccess: {access:?}\nother_access: {other_access:?}" + ) } else { None }; diff --git a/src/tools/miri/src/concurrency/vector_clock.rs b/src/tools/miri/src/concurrency/vector_clock.rs index 494e7922d2b2..d7ea3b0c6ce3 100644 --- a/src/tools/miri/src/concurrency/vector_clock.rs +++ b/src/tools/miri/src/concurrency/vector_clock.rs @@ -48,7 +48,7 @@ const SMALL_VECTOR: usize = 4; /// The time-stamps recorded in the data-race detector consist of both /// a 32-bit unsigned integer which is the actual timestamp, and a `Span` /// so that diagnostics can report what code was responsible for an operation. -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy)] pub(super) struct VTimestamp { /// The lowest bit indicates read type, the rest is the time. /// `1` indicates a retag read, `0` a regular read. @@ -56,6 +56,16 @@ pub(super) struct VTimestamp { pub span: Span, } +impl Debug for VTimestamp { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("VTimestamp") + .field("time", &self.time()) + .field("read_type", &self.read_type()) + .field("span", &self.span) + .finish() + } +} + impl VTimestamp { pub const ZERO: VTimestamp = VTimestamp::new(0, NaReadType::Read, DUMMY_SP); diff --git a/src/tools/miri/src/diagnostics.rs b/src/tools/miri/src/diagnostics.rs index 189f493a5ed8..64c7096fc5c2 100644 --- a/src/tools/miri/src/diagnostics.rs +++ b/src/tools/miri/src/diagnostics.rs @@ -138,7 +138,6 @@ pub enum NonHaltingDiagnostic { NativeCallSharedMem { tracing: bool, }, - NativeCallFnPtr, WeakMemoryOutdatedLoad { ptr: Pointer, }, @@ -250,7 +249,7 @@ pub fn report_result<'tcx>( StackedBorrowsUb { .. } | TreeBorrowsUb { .. } | DataRace { .. } => Some("Undefined Behavior"), LocalDeadlock => { - labels.push(format!("this thread got stuck here")); + labels.push(format!("thread got stuck here")); None } GlobalDeadlock => { @@ -264,10 +263,7 @@ pub fn report_result<'tcx>( report_msg( DiagLevel::Error, format!("the evaluated program deadlocked"), - vec![format!( - "thread `{}` got stuck here", - ecx.machine.threads.get_thread_display_name(thread) - )], + vec![format!("thread got stuck here")], vec![], vec![], &stacktrace, @@ -548,7 +544,7 @@ pub fn report_leaks<'tcx>( /// We want to present a multi-line span message for some errors. Diagnostics do not support this /// directly, so we pass the lines as a `Vec` and display each line after the first with an /// additional `span_label` or `note` call. -pub fn report_msg<'tcx>( +fn report_msg<'tcx>( diag_level: DiagLevel, title: String, span_msg: Vec, @@ -558,42 +554,30 @@ pub fn report_msg<'tcx>( thread: Option, machine: &MiriMachine<'tcx>, ) { - let span = match stacktrace.first() { - Some(fi) => fi.span, - None => - match thread { - Some(thread_id) => machine.threads.thread_ref(thread_id).origin_span, - None => DUMMY_SP, - }, - }; - let sess = machine.tcx.sess; + let origin_span = thread.map(|t| machine.threads.thread_ref(t).origin_span).unwrap_or(DUMMY_SP); + let span = stacktrace.first().map(|fi| fi.span).unwrap_or(origin_span); + // The only time we do not have an origin span is for `main`, and there we check the signature + // upfront. So we should always have a span here. + assert!(!span.is_dummy()); + + let tcx = machine.tcx; let level = match diag_level { DiagLevel::Error => Level::Error, DiagLevel::Warning => Level::Warning, DiagLevel::Note => Level::Note, }; - let mut err = Diag::<()>::new(sess.dcx(), level, title); + let mut err = Diag::<()>::new(tcx.sess.dcx(), level, title); err.span(span); // Show main message. - if !span.is_dummy() { - for line in span_msg { - err.span_label(span, line); - } - } else { - // Make sure we show the message even when it is a dummy span. - for line in span_msg { - err.note(line); - } - err.note("(no span available)"); + for line in span_msg { + err.span_label(span, line); } // Show note and help messages. - let mut extra_span = false; for (span_data, note) in notes { if let Some(span_data) = span_data { err.span_note(span_data.span(), note); - extra_span = true; } else { err.note(note); } @@ -601,43 +585,44 @@ pub fn report_msg<'tcx>( for (span_data, help) in helps { if let Some(span_data) = span_data { err.span_help(span_data.span(), help); - extra_span = true; } else { err.help(help); } } + // Only print thread name if there are multiple threads. + if let Some(thread) = thread + && machine.threads.get_total_thread_count() > 1 + { + err.note(format!( + "this is on thread `{}`", + machine.threads.get_thread_display_name(thread) + )); + } // Add backtrace - if stacktrace.len() > 1 { - let mut backtrace_title = String::from("BACKTRACE"); - if extra_span { - write!(backtrace_title, " (of the first span)").unwrap(); - } - if let Some(thread) = thread { - let thread_name = machine.threads.get_thread_display_name(thread); - if thread_name != "main" { - // Only print thread name if it is not `main`. - write!(backtrace_title, " on thread `{thread_name}`").unwrap(); - }; - } - write!(backtrace_title, ":").unwrap(); - err.note(backtrace_title); - for (idx, frame_info) in stacktrace.iter().enumerate() { - let is_local = machine.is_local(frame_info.instance); - // No span for non-local frames and the first frame (which is the error site). - if is_local && idx > 0 { - err.subdiagnostic(frame_info.as_note(machine.tcx)); - } else { - let sm = sess.source_map(); + if stacktrace.len() > 0 { + // Skip it if we'd only shpw the span we have already shown + if stacktrace.len() > 1 { + let sm = tcx.sess.source_map(); + let mut out = format!("stack backtrace:"); + for (idx, frame_info) in stacktrace.iter().enumerate() { let span = sm.span_to_diagnostic_string(frame_info.span); - err.note(format!("{frame_info} at {span}")); + write!(out, "\n{idx}: {}", frame_info.instance).unwrap(); + write!(out, "\n at {span}").unwrap(); } + err.note(out); } - } else if stacktrace.len() == 0 && !span.is_dummy() { - err.note(format!( - "this {} occurred while pushing a call frame onto an empty stack", - level.to_str() - )); + // For TLS dtors and non-main threads, show the "origin" + if !origin_span.is_dummy() { + let what = if stacktrace.len() > 1 { + "the last function in that backtrace" + } else { + "the current function" + }; + err.span_note(origin_span, format!("{what} got called indirectly due to this code")); + } + } else if !span.is_dummy() { + err.note(format!("this {level} occurred while pushing a call frame onto an empty stack")); err.note("the span indicates which code caused the function to be called, but may not be the literal call site"); } @@ -657,11 +642,6 @@ impl<'tcx> MiriMachine<'tcx> { Int2Ptr { .. } => ("integer-to-pointer cast".to_string(), DiagLevel::Warning), NativeCallSharedMem { .. } => ("sharing memory with a native function".to_string(), DiagLevel::Warning), - NativeCallFnPtr => - ( - "sharing a function pointer with a native function".to_string(), - DiagLevel::Warning, - ), ExternTypeReborrow => ("reborrow of reference to `extern type`".to_string(), DiagLevel::Warning), GenmcCompareExchangeWeak | GenmcCompareExchangeOrderingMismatch { .. } => @@ -700,8 +680,6 @@ impl<'tcx> MiriMachine<'tcx> { Int2Ptr { .. } => format!("integer-to-pointer cast"), NativeCallSharedMem { .. } => format!("sharing memory with a native function called via FFI"), - NativeCallFnPtr => - format!("sharing a function pointer with a native function called via FFI"), WeakMemoryOutdatedLoad { ptr } => format!("weak memory emulation: outdated value returned from load at {ptr}"), ExternTypeReborrow => @@ -799,11 +777,6 @@ impl<'tcx> MiriMachine<'tcx> { ), ] }, - NativeCallFnPtr => { - vec![note!( - "calling Rust functions from C is not supported and will, in the best case, crash the program" - )] - } ExternTypeReborrow => { assert!(self.borrow_tracker.as_ref().is_some_and(|b| { matches!( diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index 502cdbdc57b3..f17bd5ac4319 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -599,6 +599,9 @@ pub struct MiriMachine<'tcx> { pub native_lib: Vec<(libloading::Library, std::path::PathBuf)>, #[cfg(not(all(unix, feature = "native-lib")))] pub native_lib: Vec, + /// A memory location for exchanging the current `ecx` pointer with native code. + #[cfg(all(unix, feature = "native-lib"))] + pub native_lib_ecx_interchange: &'static Cell, /// Run a garbage collector for BorTags every N basic blocks. pub(crate) gc_interval: u32, @@ -790,6 +793,8 @@ impl<'tcx> MiriMachine<'tcx> { lib_file_path.clone(), ) }).collect(), + #[cfg(all(unix, feature = "native-lib"))] + native_lib_ecx_interchange: Box::leak(Box::new(Cell::new(0))), #[cfg(not(all(unix, feature = "native-lib")))] native_lib: config.native_lib.iter().map(|_| { panic!("calling functions from native libraries via FFI is not supported in this build of Miri") @@ -1026,6 +1031,8 @@ impl VisitProvenance for MiriMachine<'_> { report_progress: _, basic_block_count: _, native_lib: _, + #[cfg(all(unix, feature = "native-lib"))] + native_lib_ecx_interchange: _, gc_interval: _, since_gc: _, num_cpus: _, diff --git a/src/tools/miri/src/shims/env.rs b/src/tools/miri/src/shims/env.rs index 6915924f2a48..7c463983320b 100644 --- a/src/tools/miri/src/shims/env.rs +++ b/src/tools/miri/src/shims/env.rs @@ -119,9 +119,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let this = self.eval_context_ref(); let index = thread.to_u32(); let target_os = &this.tcx.sess.target.os; - if matches!(target_os, Os::Linux | Os::NetBsd) { - // On Linux, the main thread has PID == TID so we uphold this. NetBSD also appears - // to exhibit the same behavior, though I can't find a citation. + if matches!(target_os, Os::Linux | Os::Android) { + // On Linux, the main thread has PID == TID so we uphold this. this.get_pid().strict_add(index) } else { // Other platforms do not display any relationship between PID and TID. diff --git a/src/tools/miri/src/shims/mod.rs b/src/tools/miri/src/shims/mod.rs index e51ace2fd907..345e16b8da71 100644 --- a/src/tools/miri/src/shims/mod.rs +++ b/src/tools/miri/src/shims/mod.rs @@ -6,7 +6,7 @@ mod backtrace; mod files; mod math; #[cfg(all(unix, feature = "native-lib"))] -mod native_lib; +pub mod native_lib; mod unix; mod windows; mod x86; diff --git a/src/tools/miri/src/shims/native_lib/ffi.rs b/src/tools/miri/src/shims/native_lib/ffi.rs deleted file mode 100644 index 196f43c6f6a6..000000000000 --- a/src/tools/miri/src/shims/native_lib/ffi.rs +++ /dev/null @@ -1,32 +0,0 @@ -//! Support code for dealing with libffi. - -use libffi::low::CodePtr; -use libffi::middle::{Arg as ArgPtr, Cif, Type as FfiType}; - -/// Perform the actual FFI call. -/// -/// # Safety -/// -/// The safety invariants of the foreign function being called must be upheld (if any). -pub unsafe fn call(fun: CodePtr, args: &mut [OwnedArg]) -> R { - let cif = Cif::new(args.iter_mut().map(|arg| arg.ty.take().unwrap()), R::reify().into_middle()); - let arg_ptrs: Vec<_> = args.iter().map(|arg| ArgPtr::new(&*arg.bytes)).collect(); - // SAFETY: Caller upholds that the function is safe to call. - unsafe { cif.call(fun, &arg_ptrs) } -} - -/// An argument for an FFI call. -#[derive(Debug, Clone)] -pub struct OwnedArg { - /// The type descriptor for this argument. - ty: Option, - /// Corresponding bytes for the value. - bytes: Box<[u8]>, -} - -impl OwnedArg { - /// Instantiates an argument from a type descriptor and bytes. - pub fn new(ty: FfiType, bytes: Box<[u8]>) -> Self { - Self { ty: Some(ty), bytes } - } -} diff --git a/src/tools/miri/src/shims/native_lib/mod.rs b/src/tools/miri/src/shims/native_lib/mod.rs index 12abe841c052..8a761855c432 100644 --- a/src/tools/miri/src/shims/native_lib/mod.rs +++ b/src/tools/miri/src/shims/native_lib/mod.rs @@ -1,20 +1,22 @@ //! Implements calling functions from a native library. +use std::cell::Cell; +use std::marker::PhantomData; use std::ops::Deref; +use std::os::raw::c_void; +use std::ptr; use std::sync::atomic::AtomicBool; use libffi::low::CodePtr; use libffi::middle::Type as FfiType; use rustc_abi::{HasDataLayout, Size}; use rustc_data_structures::either; -use rustc_middle::ty::layout::{HasTypingEnv, TyAndLayout}; -use rustc_middle::ty::{self, FloatTy, IntTy, Ty, UintTy}; +use rustc_middle::ty::layout::TyAndLayout; +use rustc_middle::ty::{self, Ty}; use rustc_span::Symbol; use serde::{Deserialize, Serialize}; -use self::helpers::ToSoft; - -mod ffi; +use crate::*; #[cfg_attr( not(all( @@ -26,8 +28,21 @@ mod ffi; )] pub mod trace; -use self::ffi::OwnedArg; -use crate::*; +/// An argument for an FFI call. +#[derive(Debug, Clone)] +pub struct OwnedArg { + /// The type descriptor for this argument. + ty: Option, + /// Corresponding bytes for the value. + bytes: Box<[u8]>, +} + +impl OwnedArg { + /// Instantiates an argument from a type descriptor and bytes. + pub fn new(ty: FfiType, bytes: Box<[u8]>) -> Self { + Self { ty: Some(ty), bytes } + } +} /// The final results of an FFI trace, containing every relevant event detected /// by the tracer. @@ -76,98 +91,38 @@ impl AccessRange { impl<'tcx> EvalContextExtPriv<'tcx> for crate::MiriInterpCx<'tcx> {} trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { - /// Call native host function and return the output as an immediate. - fn call_native_with_args( + /// Call native host function and return the output and the memory accesses + /// that occurred during the call. + fn call_native_raw( &mut self, - link_name: Symbol, - dest: &MPlaceTy<'tcx>, fun: CodePtr, - libffi_args: &mut [OwnedArg], - ) -> InterpResult<'tcx, (crate::ImmTy<'tcx>, Option)> { + args: &mut [OwnedArg], + ret: (FfiType, Size), + ) -> InterpResult<'tcx, (Box<[u8]>, Option)> { let this = self.eval_context_mut(); #[cfg(target_os = "linux")] - let alloc = this.machine.allocator.as_ref().unwrap(); + let alloc = this.machine.allocator.as_ref().unwrap().clone(); #[cfg(not(target_os = "linux"))] // Placeholder value. let alloc = (); - trace::Supervisor::do_ffi(alloc, || { - // Call the function (`ptr`) with arguments `libffi_args`, and obtain the return value - // as the specified primitive integer type - let scalar = match dest.layout.ty.kind() { - // ints - ty::Int(IntTy::I8) => { - // Unsafe because of the call to native code. - // Because this is calling a C function it is not necessarily sound, - // but there is no way around this and we've checked as much as we can. - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_i8(x) - } - ty::Int(IntTy::I16) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_i16(x) - } - ty::Int(IntTy::I32) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_i32(x) - } - ty::Int(IntTy::I64) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_i64(x) - } - ty::Int(IntTy::Isize) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_target_isize(x.try_into().unwrap(), this) - } - // uints - ty::Uint(UintTy::U8) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_u8(x) - } - ty::Uint(UintTy::U16) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_u16(x) - } - ty::Uint(UintTy::U32) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_u32(x) - } - ty::Uint(UintTy::U64) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_u64(x) - } - ty::Uint(UintTy::Usize) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_target_usize(x.try_into().unwrap(), this) - } - ty::Float(FloatTy::F32) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_f32(x.to_soft()) - } - ty::Float(FloatTy::F64) => { - let x = unsafe { ffi::call::(fun, libffi_args) }; - Scalar::from_f64(x.to_soft()) - } - // Functions with no declared return type (i.e., the default return) - // have the output_type `Tuple([])`. - ty::Tuple(t_list) if (*t_list).deref().is_empty() => { - unsafe { ffi::call::<()>(fun, libffi_args) }; - return interp_ok(ImmTy::uninit(dest.layout)); - } - ty::RawPtr(ty, ..) if ty.is_sized(*this.tcx, this.typing_env()) => { - let x = unsafe { ffi::call::<*const ()>(fun, libffi_args) }; - let ptr = StrictPointer::new(Provenance::Wildcard, Size::from_bytes(x.addr())); - Scalar::from_pointer(ptr, this) - } - _ => - return Err(err_unsup_format!( - "unsupported return type for native call: {:?}", - link_name - )) - .into(), - }; - interp_ok(ImmTy::from_scalar(scalar, dest.layout)) - }) + // Expose InterpCx for use by closure callbacks. + this.machine.native_lib_ecx_interchange.set(ptr::from_mut(this).expose_provenance()); + + let res = trace::Supervisor::do_ffi(&alloc, || { + use libffi::middle::{Arg, Cif, Ret}; + + let cif = Cif::new(args.iter_mut().map(|arg| arg.ty.take().unwrap()), ret.0); + let arg_ptrs: Vec<_> = args.iter().map(|arg| Arg::new(&*arg.bytes)).collect(); + let mut ret = vec![0u8; ret.1.bytes_usize()]; + + unsafe { cif.call_return_into(fun, &arg_ptrs, Ret::new::<[u8]>(&mut *ret)) }; + ret.into() + }); + + this.machine.native_lib_ecx_interchange.set(0); + + res } /// Get the pointer to the function of the specified name in the shared object file, @@ -381,6 +336,30 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { interp_ok(OwnedArg::new(ty, bytes)) } + fn ffi_ret_to_mem(&mut self, v: Box<[u8]>, dest: &MPlaceTy<'tcx>) -> InterpResult<'tcx> { + let this = self.eval_context_mut(); + let len = v.len(); + this.write_bytes_ptr(dest.ptr(), v)?; + if len == 0 { + return interp_ok(()); + } + // We have no idea which provenance these bytes have, so we reset it to wildcard. + let tcx = this.tcx; + let (alloc_id, offset, _) = this.ptr_try_get_alloc_id(dest.ptr(), 0).unwrap(); + let alloc = this.get_alloc_raw_mut(alloc_id)?.0; + alloc.process_native_write(&tcx, Some(alloc_range(offset, dest.layout.size))); + // Run the validation that would usually be part of `return`, also to reset + // any provenance and padding that would not survive the return. + if MiriMachine::enforce_validity(this, dest.layout) { + this.validate_operand( + &dest.clone().into(), + MiriMachine::enforce_validity_recursively(this, dest.layout), + /*reset_provenance_and_padding*/ true, + )?; + } + interp_ok(()) + } + /// Parses an ADT to construct the matching libffi type. fn adt_to_ffitype( &self, @@ -388,6 +367,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { adt_def: ty::AdtDef<'tcx>, args: &'tcx ty::List>, ) -> InterpResult<'tcx, FfiType> { + let this = self.eval_context_ref(); // TODO: unions, etc. if !adt_def.is_struct() { throw_unsup_format!("passing an enum or union over FFI: {orig_ty}"); @@ -397,7 +377,6 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { throw_unsup_format!("passing a non-#[repr(C)] {} over FFI: {orig_ty}", adt_def.descr()) } - let this = self.eval_context_ref(); let mut fields = vec![]; for field in &adt_def.non_enum_variant().fields { let layout = this.layout_of(field.ty(*this.tcx, args))?; @@ -429,21 +408,92 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { Primitive::Float(Float::F32) => FfiType::f32(), Primitive::Float(Float::F64) => FfiType::f64(), Primitive::Pointer(AddressSpace::ZERO) => FfiType::pointer(), - _ => - throw_unsup_format!( - "unsupported scalar argument type for native call: {}", - layout.ty - ), + _ => throw_unsup_format!("unsupported scalar type for native call: {}", layout.ty), }); } interp_ok(match layout.ty.kind() { // Scalar types have already been handled above. ty::Adt(adt_def, args) => self.adt_to_ffitype(layout.ty, *adt_def, args)?, - _ => throw_unsup_format!("unsupported argument type for native call: {}", layout.ty), + // Rust uses `()` as return type for `void` function, which becomes `Tuple([])`. + ty::Tuple(t_list) if t_list.len() == 0 => FfiType::void(), + _ => { + throw_unsup_format!("unsupported type for native call: {}", layout.ty) + } }) } } +/// The data passed to the closure shim function used to intercept function pointer calls from +/// native code. +struct LibffiClosureData<'tcx> { + ecx_interchange: &'static Cell, + marker: PhantomData>, +} + +/// This function sets up a new libffi closure to intercept +/// calls to rust code via function pointers passed to native code. +/// +/// Calling this function leaks the data passed into the libffi closure as +/// these need to be available until the execution terminates as the native +/// code side could store a function pointer and only call it at a later point. +pub fn build_libffi_closure<'tcx, 'this>( + this: &'this MiriInterpCx<'tcx>, + fn_sig: rustc_middle::ty::FnSig<'tcx>, +) -> InterpResult<'tcx, unsafe extern "C" fn()> { + // Compute argument and return types in libffi representation. + let mut args = Vec::new(); + for input in fn_sig.inputs().iter() { + let layout = this.layout_of(*input)?; + let ty = this.ty_to_ffitype(layout)?; + args.push(ty); + } + let res_type = fn_sig.output(); + let res_type = { + let layout = this.layout_of(res_type)?; + this.ty_to_ffitype(layout)? + }; + + // Build the actual closure. + let closure_builder = libffi::middle::Builder::new().args(args).res(res_type); + let data = LibffiClosureData { + ecx_interchange: this.machine.native_lib_ecx_interchange, + marker: PhantomData, + }; + let data = Box::leak(Box::new(data)); + let closure = closure_builder.into_closure(libffi_closure_callback, data); + let closure = Box::leak(Box::new(closure)); + + // The actual argument/return type doesn't matter. + let fn_ptr = unsafe { closure.instantiate_code_ptr::() }; + // Libffi returns a **reference** to a function ptr here. + // Therefore we need to dereference the reference to get the actual function pointer. + interp_ok(*fn_ptr) +} + +/// A shim function to intercept calls back from native code into the interpreter +/// via function pointers passed to the native code. +/// +/// For now this shim only reports that such constructs are not supported by miri. +/// As future improvement we might continue execution in the interpreter here. +unsafe extern "C" fn libffi_closure_callback<'tcx>( + _cif: &libffi::low::ffi_cif, + _result: &mut c_void, + _args: *const *const c_void, + data: &LibffiClosureData<'tcx>, +) { + let ecx = unsafe { + ptr::with_exposed_provenance_mut::>(data.ecx_interchange.get()) + .as_mut() + .expect("libffi closure called while no FFI call is active") + }; + let err = err_unsup_format!("calling a function pointer through the FFI boundary"); + + crate::diagnostics::report_result(ecx, err.into()); + // We abort the execution at this point as we cannot return the + // expected value here. + std::process::exit(1); +} + impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {} pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { /// Call the native host function, with supplied arguments. @@ -451,6 +501,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { /// a native form (through `libffi` call). /// Then, convert the return value from the native form into something that /// can be stored in Miri's internal memory. + /// + /// Returns `true` if a call has been made, `false` if no functions of this name was found. fn call_native_fn( &mut self, link_name: Symbol, @@ -472,18 +524,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { for arg in args.iter() { libffi_args.push(this.op_to_ffi_arg(arg, tracing)?); } + let ret_ty = this.ty_to_ffitype(dest.layout)?; // Prepare all exposed memory (both previously exposed, and just newly exposed since a // pointer was passed as argument). Uninitialised memory is left as-is, but any data // exposed this way is garbage anyway. this.visit_reachable_allocs(this.exposed_allocs(), |this, alloc_id, info| { - if matches!(info.kind, AllocKind::Function) { - static DEDUP: AtomicBool = AtomicBool::new(false); - if !DEDUP.swap(true, std::sync::atomic::Ordering::Relaxed) { - // Newly set, so first time we get here. - this.emit_diagnostic(NonHaltingDiagnostic::NativeCallFnPtr); - } - } // If there is no data behind this pointer, skip this. if !matches!(info.kind, AllocKind::LiveData) { return interp_ok(()); @@ -521,15 +567,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { interp_ok(()) })?; - // Call the function and store output, depending on return type in the function signature. + // Call the function and store its output. let (ret, maybe_memevents) = - this.call_native_with_args(link_name, dest, code_ptr, &mut libffi_args)?; - + this.call_native_raw(code_ptr, &mut libffi_args, (ret_ty, dest.layout.size))?; if tracing { this.tracing_apply_accesses(maybe_memevents.unwrap())?; } - - this.write_immediate(*ret, dest)?; + this.ffi_ret_to_mem(ret, dest)?; interp_ok(true) } } diff --git a/src/tools/miri/src/shims/native_lib/trace/child.rs b/src/tools/miri/src/shims/native_lib/trace/child.rs index 795ad4a32076..021ec2e9aeb3 100644 --- a/src/tools/miri/src/shims/native_lib/trace/child.rs +++ b/src/tools/miri/src/shims/native_lib/trace/child.rs @@ -5,7 +5,7 @@ use std::rc::Rc; use ipc_channel::ipc; use nix::sys::{mman, ptrace, signal}; use nix::unistd; -use rustc_const_eval::interpret::InterpResult; +use rustc_const_eval::interpret::{InterpResult, interp_ok}; use super::CALLBACK_STACK_SIZE; use super::messages::{Confirmation, StartFfiInfo, TraceRequest}; @@ -58,16 +58,16 @@ impl Supervisor { /// Performs an arbitrary FFI call, enabling tracing from the supervisor. /// As this locks the supervisor via a mutex, no other threads may enter FFI /// until this function returns. - pub fn do_ffi<'tcx>( + pub fn do_ffi<'tcx, T>( alloc: &Rc>, - f: impl FnOnce() -> InterpResult<'tcx, crate::ImmTy<'tcx>>, - ) -> InterpResult<'tcx, (crate::ImmTy<'tcx>, Option)> { + f: impl FnOnce() -> T, + ) -> InterpResult<'tcx, (T, Option)> { let mut sv_guard = SUPERVISOR.lock().unwrap(); // If the supervisor is not initialised for whatever reason, fast-return. // As a side-effect, even on platforms where ptracing // is not implemented, we enforce that only one FFI call // happens at a time. - let Some(sv) = sv_guard.as_mut() else { return f().map(|v| (v, None)) }; + let Some(sv) = sv_guard.as_mut() else { return interp_ok((f(), None)) }; // Get pointers to all the pages the supervisor must allow accesses in // and prepare the callback stack. @@ -147,7 +147,7 @@ impl Supervisor { }) .ok(); - res.map(|v| (v, events)) + interp_ok((res, events)) } } diff --git a/src/tools/miri/src/shims/native_lib/trace/stub.rs b/src/tools/miri/src/shims/native_lib/trace/stub.rs index 22787a6f6fa7..a3f6c616301c 100644 --- a/src/tools/miri/src/shims/native_lib/trace/stub.rs +++ b/src/tools/miri/src/shims/native_lib/trace/stub.rs @@ -1,4 +1,4 @@ -use rustc_const_eval::interpret::InterpResult; +use rustc_const_eval::interpret::{InterpResult, interp_ok}; static SUPERVISOR: std::sync::Mutex<()> = std::sync::Mutex::new(()); @@ -13,13 +13,13 @@ impl Supervisor { false } - pub fn do_ffi<'tcx, T>( + pub fn do_ffi<'tcx, T, U>( _: T, - f: impl FnOnce() -> InterpResult<'tcx, crate::ImmTy<'tcx>>, - ) -> InterpResult<'tcx, (crate::ImmTy<'tcx>, Option)> { + f: impl FnOnce() -> U, + ) -> InterpResult<'tcx, (U, Option)> { // We acquire the lock to ensure that no two FFI calls run concurrently. let _g = SUPERVISOR.lock().unwrap(); - f().map(|v| (v, None)) + interp_ok((f(), None)) } } diff --git a/src/tools/miri/src/shims/unix/android/foreign_items.rs b/src/tools/miri/src/shims/unix/android/foreign_items.rs index 6cb0d221fc03..2b290b68c78c 100644 --- a/src/tools/miri/src/shims/unix/android/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/android/foreign_items.rs @@ -8,6 +8,7 @@ use crate::shims::unix::env::EvalContextExt as _; use crate::shims::unix::linux_like::epoll::EvalContextExt as _; use crate::shims::unix::linux_like::eventfd::EvalContextExt as _; use crate::shims::unix::linux_like::syscall::syscall; +use crate::shims::unix::*; use crate::*; pub fn is_dyn_sym(name: &str) -> bool { @@ -25,6 +26,74 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { ) -> InterpResult<'tcx, EmulateItemResult> { let this = self.eval_context_mut(); match link_name.as_str() { + // File related shims + "stat" => { + let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; + let result = this.stat(path, buf)?; + this.write_scalar(result, dest)?; + } + "lstat" => { + let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; + let result = this.lstat(path, buf)?; + this.write_scalar(result, dest)?; + } + "readdir" => { + let [dirp] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; + let result = this.readdir64("dirent", dirp)?; + this.write_scalar(result, dest)?; + } + "pread64" => { + let [fd, buf, count, offset] = this.check_shim_sig( + shim_sig!(extern "C" fn(i32, *mut _, usize, libc::off64_t) -> isize), + link_name, + abi, + args, + )?; + let fd = this.read_scalar(fd)?.to_i32()?; + let buf = this.read_pointer(buf)?; + let count = this.read_target_usize(count)?; + let offset = this.read_scalar(offset)?.to_int(offset.layout.size)?; + this.read(fd, buf, count, Some(offset), dest)?; + } + "pwrite64" => { + let [fd, buf, n, offset] = this.check_shim_sig( + shim_sig!(extern "C" fn(i32, *const _, usize, libc::off64_t) -> isize), + link_name, + abi, + args, + )?; + let fd = this.read_scalar(fd)?.to_i32()?; + let buf = this.read_pointer(buf)?; + let count = this.read_target_usize(n)?; + let offset = this.read_scalar(offset)?.to_int(offset.layout.size)?; + trace!("Called pwrite64({:?}, {:?}, {:?}, {:?})", fd, buf, count, offset); + this.write(fd, buf, count, Some(offset), dest)?; + } + "lseek64" => { + let [fd, offset, whence] = this.check_shim_sig( + shim_sig!(extern "C" fn(i32, libc::off64_t, i32) -> libc::off64_t), + link_name, + abi, + args, + )?; + let fd = this.read_scalar(fd)?.to_i32()?; + let offset = this.read_scalar(offset)?.to_int(offset.layout.size)?; + let whence = this.read_scalar(whence)?.to_i32()?; + this.lseek64(fd, offset, whence, dest)?; + } + "ftruncate64" => { + let [fd, length] = this.check_shim_sig( + shim_sig!(extern "C" fn(i32, libc::off64_t) -> i32), + link_name, + abi, + args, + )?; + let fd = this.read_scalar(fd)?.to_i32()?; + let length = this.read_scalar(length)?.to_int(length.layout.size)?; + let result = this.ftruncate64(fd, length)?; + this.write_scalar(result, dest)?; + } + // epoll, eventfd "epoll_create1" => { let [flag] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; diff --git a/src/tools/miri/src/shims/unix/foreign_items.rs b/src/tools/miri/src/shims/unix/foreign_items.rs index 64b8376ff4aa..8eacdc3583d4 100644 --- a/src/tools/miri/src/shims/unix/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/foreign_items.rs @@ -510,7 +510,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { "pipe2" => { // Currently this function does not exist on all Unixes, e.g. on macOS. this.check_target_os( - &[Os::Linux, Os::FreeBsd, Os::Solaris, Os::Illumos], + &[Os::Linux, Os::Android, Os::FreeBsd, Os::Solaris, Os::Illumos], link_name, )?; let [pipefd, flags] = this.check_shim_sig( diff --git a/src/tools/miri/src/shims/unix/freebsd/foreign_items.rs b/src/tools/miri/src/shims/unix/freebsd/foreign_items.rs index c48301c72416..fb2d3f758420 100644 --- a/src/tools/miri/src/shims/unix/freebsd/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/freebsd/foreign_items.rs @@ -140,12 +140,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // since freebsd 12 the former form can be expected. "stat" | "stat@FBSD_1.0" => { let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; - let result = this.macos_fbsd_solarish_stat(path, buf)?; + let result = this.stat(path, buf)?; this.write_scalar(result, dest)?; } "lstat" | "lstat@FBSD_1.0" => { let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; - let result = this.macos_fbsd_solarish_lstat(path, buf)?; + let result = this.lstat(path, buf)?; this.write_scalar(result, dest)?; } "fstat@FBSD_1.0" => { diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs index e17456c3bc0e..f43fd3fe2d18 100644 --- a/src/tools/miri/src/shims/unix/fs.rs +++ b/src/tools/miri/src/shims/unix/fs.rs @@ -527,15 +527,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { interp_ok(Scalar::from_i32(this.try_unwrap_io_result(result)?)) } - fn macos_fbsd_solarish_stat( - &mut self, - path_op: &OpTy<'tcx>, - buf_op: &OpTy<'tcx>, - ) -> InterpResult<'tcx, Scalar> { + fn stat(&mut self, path_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - if !matches!(&this.tcx.sess.target.os, Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos) - { + if !matches!( + &this.tcx.sess.target.os, + Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos | Os::Android + ) { panic!("`macos_fbsd_solaris_stat` should not be called on {}", this.tcx.sess.target.os); } @@ -558,15 +556,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { } // `lstat` is used to get symlink metadata. - fn macos_fbsd_solarish_lstat( - &mut self, - path_op: &OpTy<'tcx>, - buf_op: &OpTy<'tcx>, - ) -> InterpResult<'tcx, Scalar> { + fn lstat(&mut self, path_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - if !matches!(&this.tcx.sess.target.os, Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos) - { + if !matches!( + &this.tcx.sess.target.os, + Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos | Os::Android + ) { panic!( "`macos_fbsd_solaris_lstat` should not be called on {}", this.tcx.sess.target.os @@ -595,7 +591,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { if !matches!( &this.tcx.sess.target.os, - Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos | Os::Linux + Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos | Os::Linux | Os::Android ) { panic!("`fstat` should not be called on {}", this.tcx.sess.target.os); } @@ -906,9 +902,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { fn readdir64(&mut self, dirent_type: &str, dirp_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { let this = self.eval_context_mut(); - if !matches!(&this.tcx.sess.target.os, Os::Linux | Os::Solaris | Os::Illumos | Os::FreeBsd) - { - panic!("`linux_solaris_readdir64` should not be called on {}", this.tcx.sess.target.os); + if !matches!( + &this.tcx.sess.target.os, + Os::Linux | Os::Android | Os::Solaris | Os::Illumos | Os::FreeBsd + ) { + panic!("`readdir64` should not be called on {}", this.tcx.sess.target.os); } let dirp = this.read_target_usize(dirp_op)?; diff --git a/src/tools/miri/src/shims/unix/macos/foreign_items.rs b/src/tools/miri/src/shims/unix/macos/foreign_items.rs index dd7b95bdc82b..f798f64441b1 100644 --- a/src/tools/miri/src/shims/unix/macos/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/macos/foreign_items.rs @@ -48,12 +48,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { } "stat" | "stat$INODE64" => { let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; - let result = this.macos_fbsd_solarish_stat(path, buf)?; + let result = this.stat(path, buf)?; this.write_scalar(result, dest)?; } "lstat" | "lstat$INODE64" => { let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; - let result = this.macos_fbsd_solarish_lstat(path, buf)?; + let result = this.lstat(path, buf)?; this.write_scalar(result, dest)?; } "fstat$INODE64" => { diff --git a/src/tools/miri/src/shims/unix/solarish/foreign_items.rs b/src/tools/miri/src/shims/unix/solarish/foreign_items.rs index ae7230877a71..fa8c86b025a7 100644 --- a/src/tools/miri/src/shims/unix/solarish/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/solarish/foreign_items.rs @@ -92,12 +92,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // File related shims "stat" => { let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; - let result = this.macos_fbsd_solarish_stat(path, buf)?; + let result = this.stat(path, buf)?; this.write_scalar(result, dest)?; } "lstat" => { let [path, buf] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; - let result = this.macos_fbsd_solarish_lstat(path, buf)?; + let result = this.lstat(path, buf)?; this.write_scalar(result, dest)?; } "readdir" => { diff --git a/src/tools/miri/src/shims/unix/unnamed_socket.rs b/src/tools/miri/src/shims/unix/unnamed_socket.rs index a320ac131689..cc371b43a681 100644 --- a/src/tools/miri/src/shims/unix/unnamed_socket.rs +++ b/src/tools/miri/src/shims/unix/unnamed_socket.rs @@ -459,7 +459,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Interpret the flag. Every flag we recognize is "subtracted" from `flags`, so // if there is anything left at the end, that's an unsupported flag. - if this.tcx.sess.target.os == Os::Linux { + if matches!(this.tcx.sess.target.os, Os::Linux | Os::Android) { // SOCK_NONBLOCK only exists on Linux. let sock_nonblock = this.eval_libc_i32("SOCK_NONBLOCK"); let sock_cloexec = this.eval_libc_i32("SOCK_CLOEXEC"); diff --git a/src/tools/miri/src/shims/x86/avx2.rs b/src/tools/miri/src/shims/x86/avx2.rs index b089a0249bd7..97b9f649c158 100644 --- a/src/tools/miri/src/shims/x86/avx2.rs +++ b/src/tools/miri/src/shims/x86/avx2.rs @@ -224,6 +224,42 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { shift_simd_by_scalar(this, left, right, which, dest)?; } + // Used to implement the _mm256_madd_epi16 function. + // Multiplies packed signed 16-bit integers in `left` and `right`, producing + // intermediate signed 32-bit integers. Horizontally add adjacent pairs of + // intermediate 32-bit integers, and pack the results in `dest`. + "pmadd.wd" => { + let [left, right] = + this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; + + let (left, left_len) = this.project_to_simd(left)?; + let (right, right_len) = this.project_to_simd(right)?; + let (dest, dest_len) = this.project_to_simd(dest)?; + + assert_eq!(left_len, right_len); + assert_eq!(dest_len.strict_mul(2), left_len); + + for i in 0..dest_len { + let j1 = i.strict_mul(2); + let left1 = this.read_scalar(&this.project_index(&left, j1)?)?.to_i16()?; + let right1 = this.read_scalar(&this.project_index(&right, j1)?)?.to_i16()?; + + let j2 = j1.strict_add(1); + let left2 = this.read_scalar(&this.project_index(&left, j2)?)?.to_i16()?; + let right2 = this.read_scalar(&this.project_index(&right, j2)?)?.to_i16()?; + + let dest = this.project_index(&dest, i)?; + + // Multiplications are i16*i16->i32, which will not overflow. + let mul1 = i32::from(left1).strict_mul(right1.into()); + let mul2 = i32::from(left2).strict_mul(right2.into()); + // However, this addition can overflow in the most extreme case + // (-0x8000)*(-0x8000)+(-0x8000)*(-0x8000) = 0x80000000 + let res = mul1.wrapping_add(mul2); + + this.write_scalar(Scalar::from_i32(res), &dest)?; + } + } _ => return interp_ok(EmulateItemResult::NotSupported), } interp_ok(EmulateItemResult::NeedsReturn) diff --git a/src/tools/miri/src/shims/x86/avx512.rs b/src/tools/miri/src/shims/x86/avx512.rs index a886f5622ced..0466ba1bd6c0 100644 --- a/src/tools/miri/src/shims/x86/avx512.rs +++ b/src/tools/miri/src/shims/x86/avx512.rs @@ -109,8 +109,66 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { pshufb(this, left, right, dest)?; } + + // Used to implement the _mm512_dpbusd_epi32 function. + "vpdpbusd.512" | "vpdpbusd.256" | "vpdpbusd.128" => { + this.expect_target_feature_for_intrinsic(link_name, "avx512vnni")?; + if matches!(unprefixed_name, "vpdpbusd.128" | "vpdpbusd.256") { + this.expect_target_feature_for_intrinsic(link_name, "avx512vl")?; + } + + let [src, a, b] = this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; + + vpdpbusd(this, src, a, b, dest)?; + } _ => return interp_ok(EmulateItemResult::NotSupported), } interp_ok(EmulateItemResult::NeedsReturn) } } + +/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in `a` with corresponding signed +/// 8-bit integers in `b`, producing 4 intermediate signed 16-bit results. Sum these 4 results with +/// the corresponding 32-bit integer in `src` (using wrapping arighmetic), and store the packed +/// 32-bit results in `dst`. +/// +/// +/// +/// +fn vpdpbusd<'tcx>( + ecx: &mut crate::MiriInterpCx<'tcx>, + src: &OpTy<'tcx>, + a: &OpTy<'tcx>, + b: &OpTy<'tcx>, + dest: &MPlaceTy<'tcx>, +) -> InterpResult<'tcx, ()> { + let (src, src_len) = ecx.project_to_simd(src)?; + let (a, a_len) = ecx.project_to_simd(a)?; + let (b, b_len) = ecx.project_to_simd(b)?; + let (dest, dest_len) = ecx.project_to_simd(dest)?; + + // fn vpdpbusd(src: i32x16, a: i32x16, b: i32x16) -> i32x16; + // fn vpdpbusd256(src: i32x8, a: i32x8, b: i32x8) -> i32x8; + // fn vpdpbusd128(src: i32x4, a: i32x4, b: i32x4) -> i32x4; + assert_eq!(dest_len, src_len); + assert_eq!(dest_len, a_len); + assert_eq!(dest_len, b_len); + + for i in 0..dest_len { + let src = ecx.read_scalar(&ecx.project_index(&src, i)?)?.to_i32()?; + let a = ecx.read_scalar(&ecx.project_index(&a, i)?)?.to_u32()?; + let b = ecx.read_scalar(&ecx.project_index(&b, i)?)?.to_u32()?; + let dest = ecx.project_index(&dest, i)?; + + let zipped = a.to_le_bytes().into_iter().zip(b.to_le_bytes()); + let intermediate_sum: i32 = zipped + .map(|(a, b)| i32::from(a).strict_mul(i32::from(b.cast_signed()))) + .fold(0, |x, y| x.strict_add(y)); + + // Use `wrapping_add` because `src` is an arbitrary i32 and the addition can overflow. + let res = Scalar::from_i32(intermediate_sum.wrapping_add(src)); + ecx.write_scalar(res, &dest)?; + } + + interp_ok(()) +} diff --git a/src/tools/miri/src/shims/x86/sse2.rs b/src/tools/miri/src/shims/x86/sse2.rs index 838981390307..3fbab9ba789e 100644 --- a/src/tools/miri/src/shims/x86/sse2.rs +++ b/src/tools/miri/src/shims/x86/sse2.rs @@ -278,6 +278,42 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.copy_op(&this.project_index(&left, i)?, &this.project_index(&dest, i)?)?; } } + // Used to implement the _mm_madd_epi16 function. + // Multiplies packed signed 16-bit integers in `left` and `right`, producing + // intermediate signed 32-bit integers. Horizontally add adjacent pairs of + // intermediate 32-bit integers, and pack the results in `dest`. + "pmadd.wd" => { + let [left, right] = + this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?; + + let (left, left_len) = this.project_to_simd(left)?; + let (right, right_len) = this.project_to_simd(right)?; + let (dest, dest_len) = this.project_to_simd(dest)?; + + assert_eq!(left_len, right_len); + assert_eq!(dest_len.strict_mul(2), left_len); + + for i in 0..dest_len { + let j1 = i.strict_mul(2); + let left1 = this.read_scalar(&this.project_index(&left, j1)?)?.to_i16()?; + let right1 = this.read_scalar(&this.project_index(&right, j1)?)?.to_i16()?; + + let j2 = j1.strict_add(1); + let left2 = this.read_scalar(&this.project_index(&left, j2)?)?.to_i16()?; + let right2 = this.read_scalar(&this.project_index(&right, j2)?)?.to_i16()?; + + let dest = this.project_index(&dest, i)?; + + // Multiplications are i16*i16->i32, which will not overflow. + let mul1 = i32::from(left1).strict_mul(right1.into()); + let mul2 = i32::from(left2).strict_mul(right2.into()); + // However, this addition can overflow in the most extreme case + // (-0x8000)*(-0x8000)+(-0x8000)*(-0x8000) = 0x80000000 + let res = mul1.wrapping_add(mul2); + + this.write_scalar(Scalar::from_i32(res), &dest)?; + } + } _ => return interp_ok(EmulateItemResult::NotSupported), } interp_ok(EmulateItemResult::NeedsReturn) diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.rs index 1c31236a2f80..f1389dd0821f 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.rs +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.rs @@ -1,4 +1,5 @@ //@only-target: darwin +//@compile-flags: -Zmiri-fixed-schedule #![feature(sync_unsafe_cell)] use std::cell::SyncUnsafeCell; diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.stderr index 003ddb9b287d..b4d2d2be6530 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.stderr @@ -6,6 +6,15 @@ LL | let _val = atomic_ref.load(Ordering::Relaxed); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/apple_os_unfair_lock_move_with_queue.rs:LL:CC + | +LL | / ... s.spawn(|| { +LL | | ... let atomic_ref = unsafe { &*lock.get().cast::() }; +LL | | ... let _val = atomic_ref.load(Ordering::Relaxed); +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr index f3f64a60a89b..4e494e1d2a2c 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr @@ -6,13 +6,11 @@ LL | libc::pthread_cond_destroy(cond2.as_mut_ptr()); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC - | -LL | check() - | ^^^^^^^ + = note: stack backtrace: + 0: check + at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC + 1: main + at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr index 4056f7d9d41b..8b8ead3976f9 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr @@ -6,13 +6,11 @@ LL | libc::pthread_cond_destroy(&mut cond2 as *mut _); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC - | -LL | check() - | ^^^^^^^ + = note: stack backtrace: + 0: check + at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC + 1: main + at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.stderr index fef91e85470d..979a1a8337b5 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.stderr @@ -6,6 +6,7 @@ LL | libc::pthread_create(&mut native, ptr::null(), thread_start, pt | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` = note: this error occurred while pushing a call frame onto an empty stack = note: the span indicates which code caused the function to be called, but may not be the literal call site diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.stderr index 4d70576d784c..e8ad65a74ac8 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.stderr @@ -6,6 +6,7 @@ LL | libc::pthread_create(&mut native, ptr::null(), thread_start, pt | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` = note: this error occurred while pushing a call frame onto an empty stack = note: the span indicates which code caused the function to be called, but may not be the literal call site diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr index 618584a117e4..60c4bd7f0589 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr @@ -6,6 +6,7 @@ LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr index a9f16a96adc2..87eed26bcaa3 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr @@ -6,6 +6,7 @@ LL | ... assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr index 46c9c5d3d714..0d07c2bfa351 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr @@ -6,6 +6,17 @@ LL | ... assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC + | +LL | let handle = thread::spawn(move || { + | __________________^ +LL | | unsafe { +LL | | assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0); +LL | | } +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr index 8a16f82a9307..8754aaecef94 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr @@ -6,6 +6,15 @@ LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC + | +LL | ... let handle = thread::spawn(move || { + | ____________________^ +LL | | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0); +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr index dec0139bd89a..ffc7f2fe4cac 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr @@ -6,6 +6,18 @@ LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC + | +LL | let handle = thread::spawn(|| { + | __________________^ +LL | | unsafe { +LL | | let native: libc::pthread_t = libc::pthread_self(); +LL | | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); +LL | | } +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr index e3b0036c9aa9..468c0e63cc34 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr @@ -2,26 +2,33 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC - | -LL | / thread::spawn(move || { -LL | | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0); -LL | | }) -LL | | .join() - | |_______________^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC | LL | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0); - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC + | +LL | / thread::spawn(move || { +LL | | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0); +LL | | }) + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_free_while_queued.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_free_while_queued.stderr index 7b6e05828cea..96be3f5764a3 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_free_while_queued.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_free_while_queued.stderr @@ -6,15 +6,25 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main::{closure#0}::{closure#2} + at tests/fail-dep/concurrency/libc_pthread_mutex_free_while_queued.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/fail-dep/concurrency/libc_pthread_mutex_free_while_queued.rs:LL:CC | -LL | drop(unsafe { Box::from_raw(m.get().cast::()) }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | / s.spawn(|| { +LL | | // Ensure we happen-after the initialization write. +LL | | assert!(initialized.load(Ordering::Acquire)); +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr index a7cba0f00fe9..389b014ed647 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr @@ -6,13 +6,11 @@ LL | libc::pthread_mutex_lock(&mut m2 as *mut _); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC - | -LL | check(); - | ^^^^^^^ + = note: stack backtrace: + 0: check + at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC + 1: main + at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr index 71f71efa0d96..ba281a548c24 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr @@ -6,13 +6,11 @@ LL | libc::pthread_mutex_unlock(&mut m2 as *mut _); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC - | -LL | check(); - | ^^^^^^^ + = note: stack backtrace: + 0: check + at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC + 1: main + at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.stderr index 782322d5c32b..d7c69e088461 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.stderr @@ -2,7 +2,7 @@ error: a thread deadlocked --> tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.rs:LL:CC | LL | libc::pthread_mutex_lock(&mut mutex as *mut _); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this thread got stuck here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ thread got stuck here note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_read_while_queued.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_read_while_queued.stderr index 42dbd5f02cb3..a8d9679eb959 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_read_while_queued.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_read_while_queued.stderr @@ -6,6 +6,15 @@ LL | ... let _val = atomic_ref.load(Ordering::Relaxed); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_mutex_read_while_queued.rs:LL:CC + | +LL | / ... s.spawn(|| { +LL | | ... let atomic_ref = unsafe { &*m.get().byte_add(OFFSET).cast::() }; +LL | | ... let _val = atomic_ref.load(Ordering::Relaxed); +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_write_while_queued.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_write_while_queued.stderr index 4705f9a1b5f0..9bc413fe8d53 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_write_while_queued.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_write_while_queued.stderr @@ -6,6 +6,15 @@ LL | atomic_ref.store(0, Ordering::Relaxed); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_mutex_write_while_queued.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | let atomic_ref = unsafe { &*m.get().byte_add(OFFSET).cast::() }; +LL | | atomic_ref.store(0, Ordering::Relaxed); +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr index c7d858a444cc..0a1de6332562 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr @@ -6,6 +6,14 @@ LL | ... assert_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0 | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs:LL:CC + | +LL | / ... thread::spawn(move || { +LL | | ... assert_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0); +LL | | ... }) + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr index ea8cbcada970..57bd956dd3aa 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr @@ -2,7 +2,7 @@ error: the evaluated program deadlocked --> tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC | LL | libc::pthread_rwlock_wrlock(rw.get()); - | ^ thread `main` got stuck here + | ^ thread got stuck here note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr index f1f5c50baf47..d077c6a552ae 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr @@ -6,6 +6,14 @@ LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC + | +LL | / ... thread::spawn(move || { +LL | | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0); +LL | | ... }) + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr index 255632870efc..e00c297a9b29 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr @@ -2,26 +2,33 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC - | -LL | / thread::spawn(move || { -LL | | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); -LL | | }) -LL | | .join() - | |_______________^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC | LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC + | +LL | / thread::spawn(move || { +LL | | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); +LL | | }) + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr index 0208a5bae4f5..e6b692623590 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr @@ -2,7 +2,7 @@ error: the evaluated program deadlocked --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC | LL | libc::pthread_rwlock_rdlock(rw.get()); - | ^ thread `main` got stuck here + | ^ thread got stuck here note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr index 6891b989d05f..21fa8dcbd18d 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr @@ -2,26 +2,33 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC - | -LL | / thread::spawn(move || { -LL | | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); -LL | | }) -LL | | .join() - | |_______________^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC | LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC + | +LL | / thread::spawn(move || { +LL | | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0); +LL | | }) + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr index 314e60b02360..25435eadd735 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr @@ -2,7 +2,7 @@ error: the evaluated program deadlocked --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC | LL | libc::pthread_rwlock_wrlock(rw.get()); - | ^ thread `main` got stuck here + | ^ thread got stuck here note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr index fdf4297c56ae..ceba695ce5fb 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr @@ -6,6 +6,14 @@ LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC + | +LL | / ... thread::spawn(move || { +LL | | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0); +LL | | ... }) + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr index 52affb767db5..73e79852d63a 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr @@ -6,15 +6,16 @@ LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle( | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/windows_join_detached.rs:LL:CC - | -LL | thread.join().unwrap(); - | ^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/concurrency/windows_join_detached.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr index d9cc93d0fc49..3d324ad0bdef 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr @@ -2,28 +2,35 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(), c::INFINITE) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC - | -LL | / thread::spawn(|| { -LL | | unsafe { -LL | | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0); -... | -LL | | .join() - | |___________^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/concurrency/windows_join_main.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC | LL | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ thread `unnamed-ID` got stuck here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ thread got stuck here | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC + | +LL | / thread::spawn(|| { +LL | | unsafe { +LL | | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0); +LL | | } +LL | | }) + | |______^ = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr index f5515983da2b..8f28324363b3 100644 --- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr +++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr @@ -2,13 +2,27 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(), c::INFINITE) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/concurrency/windows_join_self.rs:LL:CC + +error: the evaluated program deadlocked + --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC + | +LL | assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0); + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC | LL | / thread::spawn(|| { @@ -17,14 +31,7 @@ LL | | let native = GetCurrentThread(); LL | | assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0); LL | | } LL | | }) -LL | | .join() - | |___________^ - -error: the evaluated program deadlocked - --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC - | -LL | assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0); - | ^ thread `unnamed-ID` got stuck here + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr index 2b10a322b0be..635091cc0173 100644 --- a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr +++ b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr @@ -11,6 +11,17 @@ LL | env::set_var("MY_RUST_VAR", "Ferris"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC + | +LL | let t = thread::spawn(|| unsafe { + | _____________^ +LL | | // Access the environment in another thread without taking the env lock. +LL | | // This represents some C code that queries the environment. +LL | | libc::getenv(b"TZ/0".as_ptr().cast()); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/eventfd_block_read_twice.stderr b/src/tools/miri/tests/fail-dep/libc/eventfd_block_read_twice.stderr index 53ae7ea82bd9..f5cfd35847af 100644 --- a/src/tools/miri/tests/fail-dep/libc/eventfd_block_read_twice.stderr +++ b/src/tools/miri/tests/fail-dep/libc/eventfd_block_read_twice.stderr @@ -2,23 +2,36 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/eventfd_block_read_twice.rs:LL:CC - | -LL | thread2.join().unwrap(); - | ^^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/libc/eventfd_block_read_twice.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/libc/eventfd_block_read_twice.rs:LL:CC | LL | let res: i64 = unsafe { libc::read(fd, buf.as_mut_ptr().cast(), 8).try_into().unwrap() }; - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/eventfd_block_read_twice.rs:LL:CC + | +LL | let thread2 = thread::spawn(move || { + | ___________________^ +LL | | let mut buf: [u8; 8] = [0; 8]; +... | +LL | | assert_eq!(counter, 1_u64); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/eventfd_block_write_twice.stderr b/src/tools/miri/tests/fail-dep/libc/eventfd_block_write_twice.stderr index 62810f17be88..92c3fc47c4fd 100644 --- a/src/tools/miri/tests/fail-dep/libc/eventfd_block_write_twice.stderr +++ b/src/tools/miri/tests/fail-dep/libc/eventfd_block_write_twice.stderr @@ -2,23 +2,38 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/eventfd_block_write_twice.rs:LL:CC - | -LL | thread2.join().unwrap(); - | ^^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/libc/eventfd_block_write_twice.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/libc/eventfd_block_write_twice.rs:LL:CC | LL | libc::write(fd, sized_8_data.as_ptr() as *const libc::c_void, 8).try_into().unwrap() - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/eventfd_block_write_twice.rs:LL:CC + | +LL | let thread2 = thread::spawn(move || { + | ___________________^ +LL | | let sized_8_data = (u64::MAX - 1).to_ne_bytes(); +LL | | // Write u64::MAX - 1, so that all subsequent writes will block. +LL | | let res: i64 = unsafe { +... | +LL | | assert_eq!(res, 8); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fcntl_fsetfl_while_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/fcntl_fsetfl_while_blocking.stderr index 307762fb12c6..f2f6f373a2a7 100644 --- a/src/tools/miri/tests/fail-dep/libc/fcntl_fsetfl_while_blocking.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fcntl_fsetfl_while_blocking.stderr @@ -2,7 +2,9 @@ error: the evaluated program deadlocked --> tests/fail-dep/libc/fcntl_fsetfl_while_blocking.rs:LL:CC | LL | let _res = unsafe { libc::read(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr index 981f055e1294..edf428ae8dda 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr @@ -6,13 +6,11 @@ LL | let _fd = unsafe { libc::mkstemp(s) }; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `test_mkstemp_immutable_arg` at tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC - | -LL | test_mkstemp_immutable_arg(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test_mkstemp_immutable_arg + at tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC + 1: main + at tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr index 298e67f1468b..a85fae9c7dd2 100644 --- a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr +++ b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr @@ -6,13 +6,11 @@ LL | let _fd = unsafe { libc::open(name_ptr, libc::O_CREAT) }; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `test_file_open_missing_needed_mode` at tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC - | -LL | test_file_open_missing_needed_mode(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test_file_open_missing_needed_mode + at tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC + 1: main + at tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/libc-epoll-data-race.stderr b/src/tools/miri/tests/fail-dep/libc/libc-epoll-data-race.stderr index a322de74b510..e606a03e46fa 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc-epoll-data-race.stderr +++ b/src/tools/miri/tests/fail-dep/libc/libc-epoll-data-race.stderr @@ -11,6 +11,7 @@ LL | unsafe { VAL_TWO = 51 }; | ^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/libc_epoll_block_two_thread.stderr b/src/tools/miri/tests/fail-dep/libc/libc_epoll_block_two_thread.stderr index dba12d190317..af6578357a59 100644 --- a/src/tools/miri/tests/fail-dep/libc/libc_epoll_block_two_thread.stderr +++ b/src/tools/miri/tests/fail-dep/libc/libc_epoll_block_two_thread.stderr @@ -2,23 +2,35 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/libc_epoll_block_two_thread.rs:LL:CC - | -LL | thread2.join().unwrap(); - | ^^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/libc/libc_epoll_block_two_thread.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/libc/libc_epoll_block_two_thread.rs:LL:CC | LL | check_epoll_wait::(epfd, &expected, -1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ thread `unnamed-ID` got stuck here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/libc_epoll_block_two_thread.rs:LL:CC + | +LL | let thread2 = thread::spawn(move || { + | ___________________^ +LL | | check_epoll_wait::(epfd, &expected, -1); +LL | | +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.rs b/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.rs index 4b731866aca1..d923667d8741 100644 --- a/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.rs +++ b/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.rs @@ -5,6 +5,6 @@ fn main() { let mut buf = vec![0u8; 15]; unsafe { - libc::prctl(libc::PR_GET_NAME, buf.as_mut_ptr().cast::()); //~ ERROR: memory access failed: expected a pointer to 16 bytes of memory, but got alloc952 which is only 15 bytes from the end of the allocation + libc::prctl(libc::PR_GET_NAME, buf.as_mut_ptr().cast::()); //~ ERROR: memory access failed } } diff --git a/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.stderr b/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.stderr index 275a38e593c8..cc50564a43f5 100644 --- a/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.stderr +++ b/src/tools/miri/tests/fail-dep/libc/prctl-get-name-buffer-too-small.stderr @@ -1,18 +1,16 @@ -error: Undefined Behavior: memory access failed: expected a pointer to 16 bytes of memory, but got ALLOC which is only 15 bytes from the end of the allocation - --> tests/fail-dep/libc/prctl-threadname.rs:LL:CC +error: Undefined Behavior: memory access failed: attempting to access 16 bytes, but got ALLOC which is only 15 bytes from the end of the allocation + --> tests/fail-dep/libc/prctl-get-name-buffer-too-small.rs:LL:CC | LL | libc::prctl(libc::PR_GET_NAME, buf.as_mut_ptr().cast::()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 16 bytes of memory, but got ALLOC which is only 15 bytes from the end of the allocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information help: ALLOC was allocated here: - --> tests/fail-dep/libc/prctl-threadname.rs:LL:CC + --> tests/fail-dep/libc/prctl-get-name-buffer-too-small.rs:LL:CC | LL | let mut buf = vec![0u8; 15]; | ^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `main` at tests/fail-dep/libc/prctl-threadname.rs:LL:CC = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair-close-while-blocked.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair-close-while-blocked.stderr index a7c660e1adcc..b40c35d6d266 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair-close-while-blocked.stderr +++ b/src/tools/miri/tests/fail-dep/libc/socketpair-close-while-blocked.stderr @@ -2,23 +2,38 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/socketpair-close-while-blocked.rs:LL:CC - | -LL | thread1.join().unwrap(); - | ^^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/libc/socketpair-close-while-blocked.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/libc/socketpair-close-while-blocked.rs:LL:CC | LL | libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/socketpair-close-while-blocked.rs:LL:CC + | +LL | let thread1 = thread::spawn(move || { + | ___________________^ +LL | | let mut buf: [u8; 1] = [0; 1]; +LL | | let _res: i32 = unsafe { +LL | | libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) +... | +LL | | }; +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair-data-race.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair-data-race.stderr index 7cee4b83ba90..fa7e45bccdc5 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair-data-race.stderr +++ b/src/tools/miri/tests/fail-dep/libc/socketpair-data-race.stderr @@ -11,6 +11,7 @@ LL | unsafe { VAL = 1 }; | ^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_block_read_twice.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_block_read_twice.stderr index faab75f7840b..d649076374f5 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_block_read_twice.stderr +++ b/src/tools/miri/tests/fail-dep/libc/socketpair_block_read_twice.stderr @@ -2,23 +2,38 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/socketpair_block_read_twice.rs:LL:CC - | -LL | thread2.join().unwrap(); - | ^^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/libc/socketpair_block_read_twice.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/libc/socketpair_block_read_twice.rs:LL:CC | LL | libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/socketpair_block_read_twice.rs:LL:CC + | +LL | let thread2 = thread::spawn(move || { + | ___________________^ +LL | | // Let this thread block on read. +LL | | let mut buf: [u8; 1] = [0; 1]; +LL | | let res = unsafe { +... | +LL | | assert_eq!(&buf, "a".as_bytes()); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_block_write_twice.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_block_write_twice.stderr index 9f95d98beb6f..66f3359a1292 100644 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_block_write_twice.stderr +++ b/src/tools/miri/tests/fail-dep/libc/socketpair_block_write_twice.stderr @@ -2,23 +2,38 @@ error: the evaluated program deadlocked --> RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC | LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) }; - | ^ thread `main` got stuck here + | ^ thread got stuck here | - = note: BACKTRACE: - = note: inside `std::sys::thread::PLATFORM::Thread::join` at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC - = note: inside `std::thread::lifecycle::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC - = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/join_handle.rs:LL:CC -note: inside `main` - --> tests/fail-dep/libc/socketpair_block_write_twice.rs:LL:CC - | -LL | thread2.join().unwrap(); - | ^^^^^^^^^^^^^^ + = note: this is on thread `main` + = note: stack backtrace: + 0: std::sys::thread::PLATFORM::Thread::join + at RUSTLIB/std/src/sys/thread/PLATFORM.rs:LL:CC + 1: std::thread::lifecycle::JoinInner::join + at RUSTLIB/std/src/thread/lifecycle.rs:LL:CC + 2: std::thread::JoinHandle::join + at RUSTLIB/std/src/thread/join_handle.rs:LL:CC + 3: main + at tests/fail-dep/libc/socketpair_block_write_twice.rs:LL:CC error: the evaluated program deadlocked --> tests/fail-dep/libc/socketpair_block_write_twice.rs:LL:CC | LL | let res = unsafe { libc::write(fds[0], data.as_ptr() as *const libc::c_void, data.len()) }; - | ^ thread `unnamed-ID` got stuck here + | ^ thread got stuck here + | + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail-dep/libc/socketpair_block_write_twice.rs:LL:CC + | +LL | let thread2 = thread::spawn(move || { + | ___________________^ +LL | | let data = "a".as_bytes(); +LL | | // The write below will be blocked because the buffer is already full. +LL | | let res = unsafe { libc::write(fds[0], data.as_ptr() as *const libc::c_void, data.len()) }; +LL | | +LL | | assert_eq!(res, data.len().cast_signed()); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr deleted file mode 100644 index caf23da1150f..000000000000 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: deadlock: the evaluated program deadlocked - --> tests/fail-dep/libc/socketpair_read_blocking.rs:LL:CC - | -LL | let _res = unsafe { libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) }; - | ^ the evaluated program deadlocked - | - = note: BACKTRACE: - = note: inside `main` at tests/fail-dep/libc/socketpair_read_blocking.rs:LL:CC - -note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace - -error: aborting due to 1 previous error - diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr deleted file mode 100644 index 2dc420d5f1ef..000000000000 --- a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: deadlock: the evaluated program deadlocked - --> tests/fail-dep/libc/socketpair_write_blocking.rs:LL:CC - | -LL | let _ = unsafe { libc::write(fds[0], data as *const libc::c_void, 3) }; - | ^ the evaluated program deadlocked - | - = note: BACKTRACE: - = note: inside `main` at tests/fail-dep/libc/socketpair_write_blocking.rs:LL:CC - -note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace - -error: aborting due to 1 previous error - diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr index b85a23e3c7db..ed9b7ad18b0f 100644 --- a/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr +++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr @@ -7,18 +7,21 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort() | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside closure at RUSTLIB/std/src/alloc.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::alloc::rust_oom::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::alloc::rust_oom` at RUSTLIB/std/src/alloc.rs:LL:CC - = note: inside `std::alloc::_::__rust_alloc_error_handler` at RUSTLIB/std/src/alloc.rs:LL:CC - = note: inside `std::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC - = note: inside `std::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC -note: inside `main` - --> tests/fail/alloc/alloc_error_handler.rs:LL:CC - | -LL | handle_alloc_error(Layout::for_value(&0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::alloc::rust_oom::{closure#0} + at RUSTLIB/std/src/alloc.rs:LL:CC + 1: std::sys::backtrace::__rust_end_short_backtrace + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + 2: std::alloc::rust_oom + at RUSTLIB/std/src/alloc.rs:LL:CC + 3: std::alloc::_::__rust_alloc_error_handler + at RUSTLIB/std/src/alloc.rs:LL:CC + 4: std::alloc::handle_alloc_error::rt_error + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 5: std::alloc::handle_alloc_error + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 6: main + at tests/fail/alloc/alloc_error_handler.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr index f8a96758aa2d..677fa1b1bb9c 100644 --- a/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr +++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr @@ -5,22 +5,17 @@ error: abnormal termination: the program aborted execution LL | core::intrinsics::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `alloc_error_handler` at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC -note: inside `_::__rust_alloc_error_handler` - --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC - | -LL | #[alloc_error_handler] - | ---------------------- in this attribute macro expansion -LL | fn alloc_error_handler(layout: Layout) -> ! { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC - = note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC -note: inside `miri_start` - --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC - | -LL | handle_alloc_error(Layout::for_value(&0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: alloc_error_handler + at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC + 1: _::__rust_alloc_error_handler + at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC + 2: alloc::alloc::handle_alloc_error::rt_error + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 3: alloc::alloc::handle_alloc_error + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 4: miri_start + at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC error: aborting due to 1 previous error diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr index 488b1d879e87..386e7cdc2bd8 100644 --- a/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr +++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr @@ -7,16 +7,17 @@ error: abnormal termination: the program aborted execution LL | core::intrinsics::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `panic_handler` at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC - = note: inside `alloc::alloc::__alloc_error_handler::__rdl_alloc_error_handler` at RUSTLIB/alloc/src/alloc.rs:LL:CC - = note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC - = note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC -note: inside `miri_start` - --> tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC - | -LL | handle_alloc_error(Layout::for_value(&0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: panic_handler + at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC + 1: alloc::alloc::__alloc_error_handler::__rdl_alloc_error_handler + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 2: alloc::alloc::handle_alloc_error::rt_error + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 3: alloc::alloc::handle_alloc_error + at RUSTLIB/alloc/src/alloc.rs:LL:CC + 4: miri_start + at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr b/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr index 5a5f7496237c..4214e3e7675b 100644 --- a/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr +++ b/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr @@ -6,14 +6,13 @@ LL | FREE(); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `std::sys::alloc::PLATFORM::::dealloc` at RUSTLIB/std/src/sys/alloc/PLATFORM.rs:LL:CC - = note: inside `::deallocate` at RUSTLIB/std/src/alloc.rs:LL:CC -note: inside `main` - --> tests/fail/alloc/global_system_mixup.rs:LL:CC - | -LL | unsafe { System.deallocate(ptr, l) }; - | ^ + = note: stack backtrace: + 0: std::sys::alloc::PLATFORM::dealloc + at RUSTLIB/std/src/sys/alloc/PLATFORM.rs:LL:CC + 1: ::deallocate + at RUSTLIB/std/src/alloc.rs:LL:CC + 2: main + at tests/fail/alloc/global_system_mixup.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/alloc/stack_free.stderr b/src/tools/miri/tests/fail/alloc/stack_free.stderr index 6e98a7abc760..deb42c098679 100644 --- a/src/tools/miri/tests/fail/alloc/stack_free.stderr +++ b/src/tools/miri/tests/fail/alloc/stack_free.stderr @@ -6,15 +6,15 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside `main` - --> tests/fail/alloc/stack_free.rs:LL:CC - | -LL | drop(bad_box); - | ^^^^^^^^^^^^^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main + at tests/fail/alloc/stack_free.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr b/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr index bc3db8c6801b..7cedb24a2564 100644 --- a/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr +++ b/src/tools/miri/tests/fail/async-shared-mutable.stack.stderr @@ -20,19 +20,15 @@ help: was later invalidated at offsets [OFFSET] by a SharedReadOnly retag | LL | let _: Pin<&_> = f.as_ref(); // Or: `f.as_mut().into_ref()`. | ^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside closure at tests/fail/async-shared-mutable.rs:LL:CC - = note: inside ` as std::future::Future>::poll` at RUSTLIB/core/src/future/poll_fn.rs:LL:CC -note: inside closure - --> tests/fail/async-shared-mutable.rs:LL:CC - | -LL | .await - | ^^^^^ -note: inside `main` - --> tests/fail/async-shared-mutable.rs:LL:CC - | -LL | assert_eq!(f.as_mut().poll(&mut cx), Poll::Pending); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::{closure#0}::{closure#0} + at tests/fail/async-shared-mutable.rs:LL:CC + 1: as std::future::Future>::poll + at RUSTLIB/core/src/future/poll_fn.rs:LL:CC + 2: main::{closure#0} + at tests/fail/async-shared-mutable.rs:LL:CC + 3: main + at tests/fail/async-shared-mutable.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr b/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr index dc8b4f6665a0..fb6816183768 100644 --- a/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr +++ b/src/tools/miri/tests/fail/async-shared-mutable.tree.stderr @@ -28,19 +28,15 @@ help: the accessed tag later transitioned to Frozen due to a reborrow (act LL | let _: Pin<&_> = f.as_ref(); // Or: `f.as_mut().into_ref()`. | ^^^^^^^^^^ = help: this transition corresponds to a loss of write permissions - = note: BACKTRACE (of the first span): - = note: inside closure at tests/fail/async-shared-mutable.rs:LL:CC - = note: inside ` as std::future::Future>::poll` at RUSTLIB/core/src/future/poll_fn.rs:LL:CC -note: inside closure - --> tests/fail/async-shared-mutable.rs:LL:CC - | -LL | .await - | ^^^^^ -note: inside `main` - --> tests/fail/async-shared-mutable.rs:LL:CC - | -LL | assert_eq!(f.as_mut().poll(&mut cx), Poll::Pending); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::{closure#0}::{closure#0} + at tests/fail/async-shared-mutable.rs:LL:CC + 1: as std::future::Future>::poll + at RUSTLIB/core/src/future/poll_fn.rs:LL:CC + 2: main::{closure#0} + at tests/fail/async-shared-mutable.rs:LL:CC + 3: main + at tests/fail/async-shared-mutable.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr index 196eaeb3fb6c..cdd668f1f633 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn safe(x: &mut i32, y: &mut i32) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC - | -LL | safe_raw(xraw, xraw); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr index b9e6e2547806..d26a0fc0586e 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Reserved (conflicted) due to LL | fn safe(x: &mut i32, y: &mut i32) { | ^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC - | -LL | safe_raw(xraw, xraw); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr index e70e5b10793c..c050dbb792b5 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn safe(x: &i32, y: &mut i32) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC - | -LL | safe_raw(xshr, xraw); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr index aed59b21f137..77597e4aa831 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Reserved (conflicted) due to LL | let _v = *x; | ^^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC - | -LL | safe_raw(xshr, xraw); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr index 9980d14e1054..49087d472255 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr @@ -16,13 +16,11 @@ help: was later invalidated at offsets [0x0..0x4] by a Unique function-ent | LL | safe_raw(xraw, xshr); | ^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC - | -LL | safe_raw(xraw, xshr); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr index 357d7d220192..32f980da6f7e 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Reserved (conflicted) due to LL | fn safe(x: &mut i32, y: &i32) { | ^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC - | -LL | safe_raw(xraw, xshr); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr index eb2514df588a..f56270f48bea 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn safe(x: &i32, y: &mut Cell) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `safe` at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC - | -LL | safe_raw(xshr, xraw as *mut _); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe + at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC + 1: main + at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr index c06ae0e92138..11eb1ae7ddee 100644 --- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr @@ -19,20 +19,17 @@ help: the protected tag was created here, in the initial state Frozen | LL | fn safe(x: &i32, y: &mut Cell) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `std::mem::replace::` at RUSTLIB/core/src/mem/mod.rs:LL:CC - = note: inside `std::cell::Cell::::replace` at RUSTLIB/core/src/cell.rs:LL:CC - = note: inside `std::cell::Cell::::set` at RUSTLIB/core/src/cell.rs:LL:CC -note: inside `safe` - --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC - | -LL | y.set(1); - | ^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC - | -LL | safe_raw(xshr, xraw as *mut _); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::mem::replace + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 1: std::cell::Cell::replace + at RUSTLIB/core/src/cell.rs:LL:CC + 2: std::cell::Cell::set + at RUSTLIB/core/src/cell.rs:LL:CC + 3: safe + at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC + 4: main + at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr index 009ec2dd4aaa..69f7c908119f 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr @@ -16,18 +16,13 @@ help: was later invalidated at offsets [0x0..0x4] by a write access | LL | *our = 5; | ^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC -note: inside `demo_box_advanced_unique` - --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC - | -LL | unknown_code_2(); - | ^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC - | -LL | demo_box_advanced_unique(Box::new(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: unknown_code_2 + at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC + 1: demo_box_advanced_unique + at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC + 2: main + at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr index d4cfab024bae..b4def1008f7d 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr @@ -18,18 +18,13 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | *our = 5; | ^^^^^^^^ = help: this transition corresponds to a loss of read permissions - = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC -note: inside `demo_box_advanced_unique` - --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC - | -LL | unknown_code_2(); - | ^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC - | -LL | demo_box_advanced_unique(Box::new(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: unknown_code_2 + at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC + 1: demo_box_advanced_unique + at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC + 2: main + at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr index cc6633eb24f9..7bf29bfdcb58 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | unsafe fn test(mut x: Box, y: *const i32) -> i32 { | ^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `test` at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC - | -LL | test(Box::from_raw(ptr), ptr); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test + at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC + 1: main + at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr index 6a1f7761a410..0744b0e9499b 100644 --- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr @@ -25,13 +25,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | *x = 5; | ^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `test` at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC - | -LL | test(Box::from_raw(ptr), ptr); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test + at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC + 1: main + at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr index c4cb2c7ae4d6..ef7d54b0b19d 100644 --- a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr @@ -22,13 +22,11 @@ help: was later invalidated at offsets [0x0..0x10] by a Unique retag | LL | from_raw_parts_mut(ptr.offset(mid as isize), len - mid), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `safe::split_at_mut::` at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC - | -LL | let (a, b) = safe::split_at_mut(&mut array, 0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: safe::split_at_mut + at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC + 1: main + at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr index 40b44d77e3df..21d1504b03b1 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn foo(a: &mut u32, y: *mut u32) -> u32 { | ^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/illegal_write6.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/illegal_write6.rs:LL:CC - | -LL | foo(x, p); - | ^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/illegal_write6.rs:LL:CC + 1: main + at tests/fail/both_borrows/illegal_write6.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr index 1547a6ca73a0..923dd33a0a17 100644 --- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr @@ -25,13 +25,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | *a = 1; | ^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/illegal_write6.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/illegal_write6.rs:LL:CC - | -LL | foo(x, p); - | ^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/illegal_write6.rs:LL:CC + 1: main + at tests/fail/both_borrows/illegal_write6.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr index ef531be496af..12de173519ac 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC - | -LL | inner(xraw, xref); - | ^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: inner + at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC + 1: main + at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr index 90a89e48e61b..26882ae08024 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr @@ -19,13 +19,11 @@ help: the protected tag was created here, in the initial state Frozen | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC - | -LL | inner(xraw, xref); - | ^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: inner + at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC + 1: main + at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr index caf2b702fec6..b1215852a35f 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC - | -LL | inner(ptr, &*ptr); - | ^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: inner + at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC + 1: main + at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr index 8bac71dcd468..ae2dc93fd109 100644 --- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr @@ -19,13 +19,11 @@ help: the protected tag was created here, in the initial state Frozen | LL | fn inner(x: *mut i32, _y: &i32) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC - | -LL | inner(ptr, &*ptr); - | ^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: inner + at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC + 1: main + at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr index 9927d90c6469..14a4065c1f0a 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr @@ -11,14 +11,13 @@ help: ALLOC was allocated here: | LL | let ptr = Box::into_raw(Box::new(0u16)); | ^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC - | -LL | drop(Box::from_raw(ptr as *mut u32)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::boxed::Box::from_raw_in + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::boxed::Box::from_raw + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: main + at tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr index 9927d90c6469..14a4065c1f0a 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr @@ -11,14 +11,13 @@ help: ALLOC was allocated here: | LL | let ptr = Box::into_raw(Box::new(0u16)); | ^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC - | -LL | drop(Box::from_raw(ptr as *mut u32)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::boxed::Box::from_raw_in + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::boxed::Box::from_raw + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: main + at tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr index c704085f9583..beb712388f91 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr @@ -6,14 +6,13 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC - | -LL | drop(Box::from_raw(ptr.as_ptr())); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::boxed::Box::from_raw_in + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::boxed::Box::from_raw + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: main + at tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr index c704085f9583..beb712388f91 100644 --- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr @@ -6,14 +6,13 @@ LL | Box(unsafe { Unique::new_unchecked(raw) }, alloc) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC - | -LL | drop(Box::from_raw(ptr.as_ptr())); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::boxed::Box::from_raw_in + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::boxed::Box::from_raw + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: main + at tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr index 3c8316ca5bc1..772e7c03bf6e 100644 --- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr @@ -16,18 +16,13 @@ help: was later invalidated at offsets [0x0..0x4] by a write access | LL | *our = 5; | ^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC -note: inside `demo_mut_advanced_unique` - --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC - | -LL | unknown_code_2(); - | ^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC - | -LL | demo_mut_advanced_unique(&mut 0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: unknown_code_2 + at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC + 1: demo_mut_advanced_unique + at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC + 2: main + at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr index f5c1dea69f02..97400d479d32 100644 --- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr @@ -18,18 +18,13 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | *our = 5; | ^^^^^^^^ = help: this transition corresponds to a loss of read permissions - = note: BACKTRACE (of the first span): - = note: inside `unknown_code_2` at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC -note: inside `demo_mut_advanced_unique` - --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC - | -LL | unknown_code_2(); - | ^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC - | -LL | demo_mut_advanced_unique(&mut 0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: unknown_code_2 + at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC + 1: demo_mut_advanced_unique + at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC + 2: main + at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr index 7cee5fb1369d..d7688680e7da 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr @@ -16,27 +16,17 @@ help: is this argument | LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside closure - --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC - | -LL | || drop(Box::from_raw(ptr)), - | ^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC}>` - --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC - | -LL | dealloc(); - | ^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC - | -LL | / dealloc_while_running( -LL | | Newtype(&mut *ptr, 0), -LL | | || drop(Box::from_raw(ptr)), -LL | | ) - | |_________^ + = note: stack backtrace: + 0: std::boxed::Box::from_raw_in + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::boxed::Box::from_raw + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: main::{closure#0} + at tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC + 3: dealloc_while_running + at tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC + 4: main + at tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr index aa07ef53b315..68b9d1c86d1a 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr @@ -25,28 +25,19 @@ help: the protected tag later transitioned to Reserved (conflicted) due to LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span): - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure - --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC - | -LL | || drop(Box::from_raw(ptr)), - | ^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC}>` - --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC - | -LL | dealloc(); - | ^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC - | -LL | / dealloc_while_running( -LL | | Newtype(&mut *ptr, 0), -LL | | || drop(Box::from_raw(ptr)), -LL | | ) - | |_________^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main::{closure#0} + at tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC + 4: dealloc_while_running + at tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC + 5: main + at tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr index 7bd42fc20ce7..b7b0f2812669 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr @@ -16,27 +16,17 @@ help: is this argument | LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `std::boxed::Box::::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::boxed::Box::::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside closure - --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC - | -LL | || drop(Box::from_raw(ptr)), - | ^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_retagging.rs:LL:CC}>` - --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC - | -LL | dealloc(); - | ^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC - | -LL | / dealloc_while_running( -LL | | Newtype(&mut *ptr), -LL | | || drop(Box::from_raw(ptr)), -LL | | ) - | |_________^ + = note: stack backtrace: + 0: std::boxed::Box::from_raw_in + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::boxed::Box::from_raw + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: main::{closure#0} + at tests/fail/both_borrows/newtype_retagging.rs:LL:CC + 3: dealloc_while_running + at tests/fail/both_borrows/newtype_retagging.rs:LL:CC + 4: main + at tests/fail/both_borrows/newtype_retagging.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr index c8a72c591762..5069b1d01cd2 100644 --- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr @@ -25,28 +25,19 @@ help: the protected tag later transitioned to Reserved (conflicted) due to LL | || drop(Box::from_raw(ptr)), | ^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span): - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure - --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC - | -LL | || drop(Box::from_raw(ptr)), - | ^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_retagging.rs:LL:CC}>` - --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC - | -LL | dealloc(); - | ^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC - | -LL | / dealloc_while_running( -LL | | Newtype(&mut *ptr), -LL | | || drop(Box::from_raw(ptr)), -LL | | ) - | |_________^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main::{closure#0} + at tests/fail/both_borrows/newtype_retagging.rs:LL:CC + 4: dealloc_while_running + at tests/fail/both_borrows/newtype_retagging.rs:LL:CC + 5: main + at tests/fail/both_borrows/newtype_retagging.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr index d97850d7a444..f0d98ee6f20f 100644 --- a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr @@ -14,13 +14,17 @@ LL | let _r = &mut *p; = help: therefore from the perspective of data races, a retag has the same implications as a read or write = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `thread_2` at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC -note: inside closure + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: thread_2 + at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC + 1: main::{closure#1} + at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | let t2 = std::thread::spawn(move || thread_2(p)); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr index c1b37f8a9bfc..bf8b2f8690fe 100644 --- a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr @@ -14,13 +14,17 @@ LL | let _r = &mut *p; = help: therefore from the perspective of data races, a retag has the same implications as a read or write = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `thread_2` at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC -note: inside closure + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: thread_2 + at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC + 1: main::{closure#1} + at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC | LL | let t2 = std::thread::spawn(move || thread_2(p)); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr index 7c4fe7487012..8ca0cd4bda43 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr @@ -16,13 +16,11 @@ help: was later invalidated at offsets [0x4..0x8] by a write access | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC - | -LL | foo(&mut (1, 2)); - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC + 1: main + at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr index a8e3553aae2c..0147769bb949 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC - | -LL | foo(&mut (1, 2)); - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC + 1: main + at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr index 8411437ea4c9..94d538072ae0 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr @@ -19,13 +19,11 @@ help: was later invalidated at offsets [0x4..0x8] by a write access | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC - | -LL | match foo(&mut (1, 2)) { - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC + 1: main + at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr index 39da45ad6db4..f66798c43586 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC - | -LL | match foo(&mut (1, 2)) { - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC + 1: main + at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr index a7c422aa73f2..ffe673e1bcf9 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr @@ -19,13 +19,11 @@ help: was later invalidated at offsets [0x4..0x8] by a write access | LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC - | -LL | foo(&mut (1, 2)).0; - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC + 1: main + at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr index 66b03e57905e..1eee9ed338ec 100644 --- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | unsafe { *xraw = (42, 23) }; // unfreeze | ^^^^^^^^^^^^^^^^ = help: this transition corresponds to a loss of read permissions - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC -note: inside `main` - --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC - | -LL | foo(&mut (1, 2)).0; - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC + 1: main + at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr index eed8c0273ab1..aae9f8efbe9f 100644 --- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr +++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr @@ -11,18 +11,13 @@ help: was created by a SharedReadOnly retag at offsets [0x0..0x4] | LL | *(x as *const i32 as *mut i32) = 7; | ^ - = note: BACKTRACE (of the first span): - = note: inside `unknown_code` at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC -note: inside `foo` - --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC - | -LL | unknown_code(&*x); - | ^^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC - | -LL | println!("{}", foo(&mut 0)); - | ^^^^^^^^^^^ + = note: stack backtrace: + 0: unknown_code + at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC + 1: foo + at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC + 2: main + at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr index d9b75f65f752..274d5becddfd 100644 --- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr +++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr @@ -12,18 +12,13 @@ help: the accessed tag was created here, in the initial state Frozen | LL | fn unknown_code(x: &i32) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `unknown_code` at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC -note: inside `foo` - --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC - | -LL | unknown_code(&*x); - | ^^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC - | -LL | println!("{}", foo(&mut 0)); - | ^^^^^^^^^^^ + = note: stack backtrace: + 0: unknown_code + at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC + 1: foo + at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC + 2: main + at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/box-cell-alias.stderr b/src/tools/miri/tests/fail/box-cell-alias.stderr index 8e1e9370c707..63cdc98d3054 100644 --- a/src/tools/miri/tests/fail/box-cell-alias.stderr +++ b/src/tools/miri/tests/fail/box-cell-alias.stderr @@ -16,13 +16,11 @@ help: was later invalidated at offsets [0x0..0x1] by a Unique retag | LL | let res = helper(val, ptr); | ^^^ - = note: BACKTRACE (of the first span): - = note: inside `helper` at tests/fail/box-cell-alias.rs:LL:CC -note: inside `main` - --> tests/fail/box-cell-alias.rs:LL:CC - | -LL | let res = helper(val, ptr); - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: helper + at tests/fail/box-cell-alias.rs:LL:CC + 1: main + at tests/fail/box-cell-alias.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/closures/uninhabited-variant.stderr b/src/tools/miri/tests/fail/closures/uninhabited-variant.stderr index 995a5e3eac14..aea878660115 100644 --- a/src/tools/miri/tests/fail/closures/uninhabited-variant.stderr +++ b/src/tools/miri/tests/fail/closures/uninhabited-variant.stderr @@ -6,13 +6,11 @@ LL | match r { | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside closure at tests/fail/closures/uninhabited-variant.rs:LL:CC -note: inside `main` - --> tests/fail/closures/uninhabited-variant.rs:LL:CC - | -LL | f(); - | ^^^ + = note: stack backtrace: + 0: main::{closure#0} + at tests/fail/closures/uninhabited-variant.rs:LL:CC + 1: main + at tests/fail/closures/uninhabited-variant.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.rs b/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.rs index 9c73f6c03edd..6d8bd3d3f2a4 100644 --- a/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.rs +++ b/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.rs @@ -3,8 +3,9 @@ //@normalize-stderr-test: "LL \| .*" -> "LL | $$CODE" //@normalize-stderr-test: "\| +\^+" -> "| ^" //@normalize-stderr-test: "\n *= note:.*" -> "" +//@normalize-stderr-test: "\n *\d+:.*\n *at .*" -> "" // On macOS we use chekced pthread mutexes which changes the error -//@normalize-stderr-test: "this thread got stuck here" -> "thread `main` got stuck here" +//@normalize-stderr-test: "a thread got stuck here" -> "thread `main` got stuck here" //@normalize-stderr-test: "a thread deadlocked" -> "the evaluated program deadlocked" use std::mem; use std::sync::Mutex; diff --git a/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.stderr b/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.stderr index 7784132a54ce..b036141bb267 100644 --- a/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.stderr +++ b/src/tools/miri/tests/fail/concurrency/mutex-leak-move-deadlock.stderr @@ -2,13 +2,8 @@ error: the evaluated program deadlocked --> RUSTLIB/std/$FILE:LL:CC | LL | $CODE - | ^ thread `main` got stuck here + | ^ thread got stuck here | -note: inside `main` - --> tests/fail/concurrency/mutex-leak-move-deadlock.rs:LL:CC - | -LL | $CODE - | ^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr b/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr index 70ecfa9379a7..0c57c6894a08 100644 --- a/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr +++ b/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr @@ -16,19 +16,15 @@ help: ALLOC was deallocated here: | LL | }; // *deallocate* coroutine_iterator | ^ - = note: BACKTRACE (of the first span): - = note: inside closure at tests/fail/coroutine-pinned-moved.rs:LL:CC -note: inside ` as std::iter::Iterator>::next` - --> tests/fail/coroutine-pinned-moved.rs:LL:CC - | -LL | match me.resume(()) { - | ^^^^^^^^^^^^^ - = note: inside `std::boxed::iter::>>::next` at RUSTLIB/alloc/src/boxed/iter.rs:LL:CC -note: inside `main` - --> tests/fail/coroutine-pinned-moved.rs:LL:CC - | -LL | coroutine_iterator_2.next(); // and use moved value - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: firstn::{closure#0} + at tests/fail/coroutine-pinned-moved.rs:LL:CC + 1: as std::iter::Iterator>::next + at tests/fail/coroutine-pinned-moved.rs:LL:CC + 2: std::boxed::iter::next + at RUSTLIB/alloc/src/boxed/iter.rs:LL:CC + 3: main + at tests/fail/coroutine-pinned-moved.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr index df2b227c8097..feff143cba66 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr @@ -6,13 +6,11 @@ LL | unsafe { &(*x).0 as *const i32 } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `via_ref` at tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC -note: inside `main` - --> tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC - | -LL | via_ref(ptr); // this is not - | ^^^^^^^^^^^^ + = note: stack backtrace: + 0: via_ref + at tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC + 1: main + at tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr b/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr index 3a3133049b21..67b60e6bca41 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr @@ -6,13 +6,11 @@ LL | let _ref = unsafe { &mut *(LEAK as *mut i32) }; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `evil` at tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC -note: inside `main` - --> tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC - | -LL | evil(); - | ^^^^^^ + = note: stack backtrace: + 0: evil + at tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC + 1: main + at tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr b/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr index d4933db2ed57..ddb2edc68d48 100644 --- a/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr +++ b/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr @@ -11,6 +11,18 @@ LL | pointer.store(Box::into_raw(Box::new_uninit()), Ordering::Relax | ^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/alloc_read_race.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let ptr = ptr; // avoid field capturing +LL | | ... let pointer = &*ptr.0; +... | +LL | | ... *pointer.load(Ordering::Relaxed) +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr b/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr index da7f5ed869db..93fe9ff5539a 100644 --- a/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr @@ -11,6 +11,17 @@ LL | .store(Box::into_raw(Box::::new_uninit()) as *mut us | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/alloc_write_race.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let ptr = ptr; // avoid field capturing +LL | | ... let pointer = &*ptr.0; +LL | | ... *pointer.load(Ordering::Relaxed) = 2; +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr index 203e6a10e497..aa8a48461208 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr @@ -11,6 +11,16 @@ LL | *(c.0 as *mut usize) = 32; | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... (&*c.0).load(Ordering::SeqCst) +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr index 791dc71f9930..1d1dc68784d9 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr @@ -11,6 +11,17 @@ LL | atomic_ref.load(Ordering::SeqCst) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... let atomic_ref = &mut *c.0; +LL | | ... *atomic_ref.get_mut() = 32; +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr index 73d963875fb1..b65e4e3609e7 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr @@ -11,6 +11,17 @@ LL | atomic_ref.store(32, Ordering::SeqCst) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... let atomic_ref = &mut *c.0; +LL | | ... *atomic_ref.get_mut() +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr index 066fff5e3d36..444d73d46b3c 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr @@ -11,6 +11,16 @@ LL | let _val = *(c.0 as *mut usize); | ^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... (&*c.0).store(32, Ordering::SeqCst); +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr index 10b7d8398d9d..ca67861b47ce 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr @@ -11,6 +11,16 @@ LL | *(c.0 as *mut usize) = 32; | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... (&*c.0).store(64, Ordering::SeqCst); +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr index bb854bc4235c..b67a2bac102d 100644 --- a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr @@ -11,6 +11,17 @@ LL | atomic_ref.store(64, Ordering::SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... let atomic_ref = &mut *c.0; +LL | | ... *atomic_ref.get_mut() = 32; +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr b/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr index 8cecfbee9d95..d90b8f528f3c 100644 --- a/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr +++ b/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr @@ -11,6 +11,15 @@ LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dangling_thread_async_race.rs:LL:CC + | +LL | / ... spawn(move || { +LL | | ... let c = c; // capture `c`, not just its field. +LL | | ... *c.0 = 64; +LL | | ... }) + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr b/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr index 7260776043ea..67b254c265da 100644 --- a/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr +++ b/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr @@ -11,6 +11,7 @@ LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr index c4200ea96153..feb35ddcd34c 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr @@ -16,6 +16,18 @@ LL | let _val = *ptr.0; | ^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dealloc_read_race1.rs:LL:CC + | +LL | let j2 = spawn(move || { + | __________________^ +LL | | let ptr = ptr; // avoid field capturing +LL | | __rust_dealloc( +... | +LL | | ); +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr index 5ab5c9655d78..f1bd657cc5a8 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr @@ -20,6 +20,16 @@ LL | | std::mem::size_of::(), LL | | std::mem::align_of::(), LL | | ) | |_____________^ + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC + | +LL | let j2 = spawn(move || { + | __________________^ +LL | | let ptr = ptr; // avoid field capturing +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr index b52e48827b4b..a07dd0a1a1da 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr @@ -11,6 +11,18 @@ LL | *pointer.load(Ordering::Acquire) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC + | +LL | ... let j1 = spawn(move || { + | ________________^ +LL | | ... let ptr = ptr; // avoid field capturing +LL | | ... let pointer = &*ptr.0; +... | +LL | | ... } +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr index 0a574068d4e7..f24830d73fb1 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr @@ -16,6 +16,18 @@ LL | *ptr.0 = 2; | ^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dealloc_write_race1.rs:LL:CC + | +LL | let j2 = spawn(move || { + | __________________^ +LL | | let ptr = ptr; // avoid field capturing +LL | | __rust_dealloc( +... | +LL | | ); +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr index 9fbae21eb891..a4712554a087 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr @@ -20,6 +20,16 @@ LL | | std::mem::size_of::(), LL | | std::mem::align_of::(), LL | | ); | |_____________^ + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC + | +LL | let j2 = spawn(move || { + | __________________^ +LL | | let ptr = ptr; // avoid field capturing +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr index 0c853ccb8cc1..cc23bc0f611f 100644 --- a/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr @@ -11,6 +11,18 @@ LL | *pointer.load(Ordering::Acquire) = 3; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC + | +LL | ... let j1 = spawn(move || { + | ________________^ +LL | | ... let ptr = ptr; // avoid field capturing +LL | | ... let pointer = &*ptr.0; +... | +LL | | ... } +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr b/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr index a8eee1241b65..1cbca79e04a8 100644 --- a/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr +++ b/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr @@ -11,6 +11,16 @@ LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/enable_after_join_to_main.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... *c.0 = 64; +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/fence_after_load.stderr b/src/tools/miri/tests/fail/data_race/fence_after_load.stderr index bf2ac30a1e3f..f2098e1d3e2d 100644 --- a/src/tools/miri/tests/fail/data_race/fence_after_load.stderr +++ b/src/tools/miri/tests/fail/data_race/fence_after_load.stderr @@ -11,6 +11,7 @@ LL | unsafe { V = 1 } | ^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr index 52bd7721ef22..7f97fc775ca9 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr +++ b/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr @@ -11,6 +11,16 @@ LL | StorageLive(val); | ^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/local_variable_alloc_race.rs:LL:CC + | +LL | / std::thread::spawn(|| { +LL | | while P.load(Relaxed).is_null() { +LL | | std::hint::spin_loop(); +... | +LL | | }) + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr index 969b6faadbe1..e9173feb61dd 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr +++ b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr @@ -11,6 +11,17 @@ LL | let _val = val; | ^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/local_variable_read_race.rs:LL:CC + | +LL | let t1 = std::thread::spawn(|| { + | ______________^ +LL | | while P.load(Relaxed).is_null() { +LL | | std::hint::spin_loop(); +... | +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr index 0bf7dd28c0f9..859ade5fb65d 100644 --- a/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr @@ -11,6 +11,17 @@ LL | let mut val: u8 = 0; | ^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/local_variable_write_race.rs:LL:CC + | +LL | let t1 = std::thread::spawn(|| { + | ______________^ +LL | | while P.load(Relaxed).is_null() { +LL | | std::hint::spin_loop(); +... | +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_first_load.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_first_load.stderr index 087f326053b5..b74351a5f296 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_first_load.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_first_load.stderr @@ -13,6 +13,17 @@ LL | a16.load(Ordering::SeqCst); = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_read_read_write.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | thread::yield_now(); // make sure this happens last +LL | | if cfg!(match_first_load) { +LL | | a16.store(0, Ordering::SeqCst); +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_second_load.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_second_load.stderr index 66aee703e4f3..be78189a695d 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_second_load.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read_read_write.match_second_load.stderr @@ -13,6 +13,17 @@ LL | a16.load(Ordering::SeqCst); = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_read_read_write.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | thread::yield_now(); // make sure this happens last +LL | | if cfg!(match_first_load) { +LL | | a16.store(0, Ordering::SeqCst); +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read_write.read_write.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read_write.read_write.stderr index 967fd45c5b36..736509cd3a9e 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_read_write.read_write.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read_write.read_write.stderr @@ -13,6 +13,17 @@ LL | a8[0].load(Ordering::SeqCst); = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_read_write.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | if cfg!(read_write) { +LL | | // Let the other one go first. +LL | | thread::yield_now(); +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read_write.write_read.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read_write.write_read.stderr index 7664c3f13e3d..f4aa4cbd933f 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_read_write.write_read.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read_write.write_read.stderr @@ -13,6 +13,17 @@ LL | a16.store(1, Ordering::SeqCst); = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_read_write.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | if cfg!(write_read) { +LL | | // Let the other one go first. +LL | | thread::yield_now(); +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read_write_read.rs b/src/tools/miri/tests/fail/data_race/mixed_size_read_write_read.rs new file mode 100644 index 000000000000..c84895799b69 --- /dev/null +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read_write_read.rs @@ -0,0 +1,27 @@ +//@compile-flags: -Zmiri-deterministic-concurrency +// A case that is not covered by `mixed_size_read_write`. +#![feature(ptr_as_ref_unchecked)] + +use std::sync::atomic::*; +use std::thread; + +fn main() { + let data = AtomicI32::new(0); + + thread::scope(|s| { + s.spawn(|| unsafe { + let _val = (&raw const data).read(); + let _val = (&raw const data).cast::().as_ref_unchecked().compare_exchange( + 0, + 1, + Ordering::Relaxed, + Ordering::Relaxed, + ); + thread::yield_now(); + unreachable!(); + }); + s.spawn(|| { + let _val = data.load(Ordering::Relaxed); //~ERROR: /Race condition detected between \(1\) 1-byte atomic store .* and \(2\) 4-byte atomic load/ + }); + }); +} diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read_write_read.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read_write_read.stderr new file mode 100644 index 000000000000..10356419dc1e --- /dev/null +++ b/src/tools/miri/tests/fail/data_race/mixed_size_read_write_read.stderr @@ -0,0 +1,34 @@ +error: Undefined Behavior: Race condition detected between (1) 1-byte atomic store on thread `unnamed-ID` and (2) 4-byte atomic load on thread `unnamed-ID` at ALLOC + --> tests/fail/data_race/mixed_size_read_write_read.rs:LL:CC + | +LL | ... let _val = data.load(Ordering::Relaxed); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (2) just happened here + | +help: and (1) occurred earlier here + --> tests/fail/data_race/mixed_size_read_write_read.rs:LL:CC + | +LL | let _val = (&raw const data).cast::().as_ref_unchecked().compare_exchange( + | ________________________^ +LL | | 0, +LL | | 1, +LL | | Ordering::Relaxed, +LL | | Ordering::Relaxed, +LL | | ); + | |_____________^ + = help: overlapping unsynchronized atomic accesses must use the same access size + = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_read_write_read.rs:LL:CC + | +LL | / ... s.spawn(|| { +LL | | ... let _val = data.load(Ordering::Relaxed); +LL | | ... }); + | |________^ + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_write_write.fst.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_write_write.fst.stderr index 7e30cf6856de..6c5ac0ca2118 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_write_write.fst.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_write_write.fst.stderr @@ -13,6 +13,16 @@ LL | a16.store(1, Ordering::SeqCst); = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_write_write.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | let idx = if cfg!(fst) { 0 } else { 1 }; +LL | | a8[idx].store(1, Ordering::SeqCst); +LL | | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_write_write.snd.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_write_write.snd.stderr index 74bb72b986af..7e7461a7a4f6 100644 --- a/src/tools/miri/tests/fail/data_race/mixed_size_write_write.snd.stderr +++ b/src/tools/miri/tests/fail/data_race/mixed_size_write_write.snd.stderr @@ -13,6 +13,16 @@ LL | a16.store(1, Ordering::SeqCst); = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/mixed_size_write_write.rs:LL:CC + | +LL | / s.spawn(|| { +LL | | let idx = if cfg!(fst) { 0 } else { 1 }; +LL | | a8[idx].store(1, Ordering::SeqCst); +LL | | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_write_write.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_write_write.stderr deleted file mode 100644 index 1f22413bc5f9..000000000000 --- a/src/tools/miri/tests/fail/data_race/mixed_size_write_write.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error: Undefined Behavior: Race condition detected between (1) 2-byte atomic store on thread `unnamed-ID` and (2) 1-byte atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here - --> tests/fail/data_race/mixed_size_write_write.rs:LL:CC - | -LL | a8[0].store(1, Ordering::SeqCst); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 2-byte atomic store on thread `unnamed-ID` and (2) 1-byte atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here - | -help: and (1) occurred earlier here - --> tests/fail/data_race/mixed_size_write_write.rs:LL:CC - | -LL | a16.store(1, Ordering::SeqCst); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: overlapping unsynchronized atomic accesses must use the same access size - = help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model - = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior - = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at tests/fail/data_race/mixed_size_write_write.rs:LL:CC - -note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace - -error: aborting due to 1 previous error - diff --git a/src/tools/miri/tests/fail/data_race/read_write_race.stderr b/src/tools/miri/tests/fail/data_race/read_write_race.stderr index ce063d8c532f..f0eae9841bee 100644 --- a/src/tools/miri/tests/fail/data_race/read_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/read_write_race.stderr @@ -11,6 +11,16 @@ LL | let _val = *c.0; | ^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/read_write_race.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... *c.0 = 64; +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr index 5ac78a2ecf6b..703a02508727 100644 --- a/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr @@ -11,6 +11,17 @@ LL | *pointer.load(Ordering::Acquire) = 3; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/read_write_race_stack.rs:LL:CC + | +LL | ... let j1 = spawn(move || { + | ________________^ +LL | | ... let ptr = ptr; // avoid field capturing +... | +LL | | ... stack_var +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr b/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr index fffde0370a2a..1fb793912b72 100644 --- a/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr +++ b/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr @@ -11,6 +11,18 @@ LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/relax_acquire_race.rs:LL:CC + | +LL | ... let j3 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... if SYNC.load(Ordering::Acquire) == 2 { +LL | | ... *c.0 +... | +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/release_seq_race.stderr b/src/tools/miri/tests/fail/data_race/release_seq_race.stderr index 61f5501434b8..8f01b7cdad51 100644 --- a/src/tools/miri/tests/fail/data_race/release_seq_race.stderr +++ b/src/tools/miri/tests/fail/data_race/release_seq_race.stderr @@ -11,6 +11,18 @@ LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/release_seq_race.rs:LL:CC + | +LL | let j3 = spawn(move || { + | __________________^ +LL | | let c = c; // avoid field capturing +LL | | sleep(Duration::from_millis(500)); +LL | | if SYNC.load(Ordering::Acquire) == 3 { +... | +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr b/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr index 2c28ee03e786..a7fdf8e219f5 100644 --- a/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr +++ b/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr @@ -11,6 +11,18 @@ LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... if SYNC.load(Ordering::Acquire) == 2 { +LL | | ... *c.0 +... | +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/rmw_race.stderr b/src/tools/miri/tests/fail/data_race/rmw_race.stderr index 04621ff07b81..8bbd9929517e 100644 --- a/src/tools/miri/tests/fail/data_race/rmw_race.stderr +++ b/src/tools/miri/tests/fail/data_race/rmw_race.stderr @@ -11,6 +11,18 @@ LL | *c.0 = 1; | ^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/rmw_race.rs:LL:CC + | +LL | ... let j3 = spawn(move || { + | ________________^ +LL | | ... let c = c; // capture `c`, not just its field. +LL | | ... if SYNC.load(Ordering::Acquire) == 3 { +LL | | ... *c.0 +... | +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr b/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr index 130a31ebeef0..c543bcf11150 100644 --- a/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr +++ b/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr @@ -11,6 +11,7 @@ LL | let _val = unsafe { *ptr.0 }; | ^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/write_write_race.stderr b/src/tools/miri/tests/fail/data_race/write_write_race.stderr index 03bee0060a4e..33352a5ded58 100644 --- a/src/tools/miri/tests/fail/data_race/write_write_race.stderr +++ b/src/tools/miri/tests/fail/data_race/write_write_race.stderr @@ -11,6 +11,16 @@ LL | *c.0 = 32; | ^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/write_write_race.rs:LL:CC + | +LL | ... let j2 = spawn(move || { + | ________________^ +LL | | ... let c = c; // avoid field capturing +LL | | ... *c.0 = 64; +LL | | ... }); + | |________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr index cb2faf4ac274..a439be859015 100644 --- a/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr +++ b/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr @@ -11,6 +11,17 @@ LL | *pointer.load(Ordering::Acquire) = 3; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/data_race/write_write_race_stack.rs:LL:CC + | +LL | let j1 = spawn(move || { + | __________________^ +LL | | let ptr = ptr; // avoid field capturing +... | +LL | | stack_var +LL | | }); + | |__________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr b/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr index f3ec20837d37..a9a8deb05aae 100644 --- a/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr +++ b/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr @@ -6,13 +6,11 @@ LL | SetDiscriminant(*ptr, 1); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `set_discriminant` at tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC -note: inside `main` - --> tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC - | -LL | set_discriminant(&mut v); - | ^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: set_discriminant + at tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC + 1: main + at tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr index 8a454bedb281..952f2272f3bf 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr @@ -21,13 +21,11 @@ help: is this argument | LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `callee` at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC - | -LL | Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: callee + at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC + 1: main + at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr index 74706d6b9f6b..095dc7e1a1fb 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr @@ -30,13 +30,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | unsafe { ptr.write(S(0)) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `callee` at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC - | -LL | Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: callee + at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC + 1: main + at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr index 09a5b9a64961..22077345243f 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr @@ -6,13 +6,11 @@ LL | unsafe { ptr.read() }; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC - | -LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: change_arg + at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC + 1: main + at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation: ALLOC (stack variable, size: 4, align: 4) { diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr index 609599ef6ca8..d625d1d1d034 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr @@ -21,13 +21,11 @@ help: is this argument | LL | x.0 = 0; | ^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC - | -LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: change_arg + at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC + 1: main + at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr index c8c0e5c37efe..a01c040fe6f8 100644 --- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr @@ -30,13 +30,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | x.0 = 0; | ^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC - | -LL | Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: change_arg + at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC + 1: main + at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr index 95f79aae6c17..3c71934ac63e 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr @@ -14,25 +14,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC -note: inside `nounwind` - --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC - | -LL | / extern "C-unwind" fn nounwind() { -LL | | panic!(); -LL | | } - | |_^ -note: inside `main` - --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC - | -LL | unsafe { nounwind() } - | ^^^^^^^^^^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr index 95f79aae6c17..3c71934ac63e 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr @@ -14,25 +14,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC -note: inside `nounwind` - --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC - | -LL | / extern "C-unwind" fn nounwind() { -LL | | panic!(); -LL | | } - | |_^ -note: inside `main` - --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC - | -LL | unsafe { nounwind() } - | ^^^^^^^^^^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr index d478568ceaeb..016849a6a336 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr @@ -6,13 +6,11 @@ LL | unsafe { ptr.read() }; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun + at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation: ALLOC (stack variable, size: 4, align: 4) { diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr index 86adbab353b4..73c562c94e95 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr @@ -21,13 +21,11 @@ help: was later invalidated at offsets [0x0..0x4] by a Unique in-place fun | LL | unsafe { ptr.read() }; | ^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun + at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr index b43e19c3905c..0dc137843c91 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr @@ -30,13 +30,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | unsafe { ptr.read() }; | ^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun + at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr index faae6172d751..6654ddc12c29 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr @@ -21,13 +21,11 @@ help: was later invalidated at offsets [0x0..0x4] by a Unique in-place fun | LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun + at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr index deefb24b7850..6472dfd4f995 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr @@ -30,13 +30,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun + at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr index 1a18857bb175..79f4d2c69f3c 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr @@ -21,13 +21,11 @@ help: was later invalidated at offsets [0x0..0x4] by a Unique in-place fun | LL | become myfun2(ptr) | ^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `myfun2` at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun2 + at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr index 76ccf39744d9..82b898df45b2 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr @@ -30,13 +30,11 @@ help: the protected tag later transitioned to Unique due to a child write LL | unsafe { ptr.write(0) }; | ^^^^^^^^^^^^^^^^^^^^^^^ = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference - = note: BACKTRACE (of the first span): - = note: inside `myfun2` at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC - | -LL | Call(_x = myfun(ptr), ReturnTo(after_call), UnwindContinue()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: myfun2 + at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC + 1: main + at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr index 755bc3e7c2c0..db7fb1a68790 100644 --- a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr +++ b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr @@ -6,13 +6,11 @@ LL | unsafe { foo(0.0, x) } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `bar` at tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC -note: inside `main` - --> tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC - | -LL | let copy = bar(input); - | ^^^^^^^^^^ + = note: stack backtrace: + 0: bar + at tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC + 1: main + at tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr index 1e7f500edb2d..249eba76c83d 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr @@ -6,13 +6,11 @@ LL | RET = PtrMetadata(*p); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC -note: inside `main` - --> tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC - | -LL | let _meta = deref_meta(p.as_ptr().cast()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: deref_meta + at tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC + 1: main + at tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC Uninitialized memory occurred at ALLOC[0xX..0xY], in this allocation: ALLOC DUMP diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr index d284a6f6d019..371802a7bcf2 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr @@ -18,13 +18,11 @@ LL | RET = PtrMetadata(*p); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC -note: inside `main` - --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC - | -LL | let _meta = deref_meta(p.as_ptr().cast()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: deref_meta + at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC + 1: main + at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC Uninitialized memory occurred at ALLOC[0xX..0xY], in this allocation: ALLOC DUMP diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr index 7a1f3d6ea84f..207e7983aab4 100644 --- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr +++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr @@ -6,13 +6,11 @@ LL | RET = PtrMetadata(*p); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC -note: inside `main` - --> tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC - | -LL | let _meta = deref_meta(p.as_ptr()); - | ^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: deref_meta + at tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC + 1: main + at tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC Uninitialized memory occurred at ALLOC[0xX..0xY], in this allocation: ALLOC DUMP diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr index 7db795829925..6cdcd114d5cf 100644 --- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr +++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr @@ -6,13 +6,11 @@ LL | typed_swap_nonoverlapping(a, b); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `invalid_array` at tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC -note: inside `main` - --> tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC - | -LL | invalid_array(); - | ^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: invalid_array + at tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC + 1: main + at tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.left.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.left.stderr index 7edf72205d9e..223f7430b60a 100644 --- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.left.stderr +++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.left.stderr @@ -6,13 +6,11 @@ LL | typed_swap_nonoverlapping(a, b); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `invalid_scalar` at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC -note: inside `main` - --> tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC - | -LL | invalid_scalar(); - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: invalid_scalar + at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC + 1: main + at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.right.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.right.stderr index aece0b6cb98a..59e392085001 100644 --- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.right.stderr +++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.right.stderr @@ -6,13 +6,11 @@ LL | typed_swap_nonoverlapping(a, b); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `invalid_scalar` at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC -note: inside `main` - --> tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC - | -LL | invalid_scalar(); - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: invalid_scalar + at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC + 1: main + at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/issue-miri-1112.stderr b/src/tools/miri/tests/fail/issue-miri-1112.stderr index 98f04ff1af65..0c5c6a94baf2 100644 --- a/src/tools/miri/tests/fail/issue-miri-1112.stderr +++ b/src/tools/miri/tests/fail/issue-miri-1112.stderr @@ -6,13 +6,11 @@ LL | let obj = std::mem::transmute::(obj) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `FunnyPointer::from_data_ptr` at tests/fail/issue-miri-1112.rs:LL:CC -note: inside `main` - --> tests/fail/issue-miri-1112.rs:LL:CC - | -LL | let _raw: &FunnyPointer = FunnyPointer::from_data_ptr(&hello, &meta as *const _); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: FunnyPointer::from_data_ptr + at tests/fail/issue-miri-1112.rs:LL:CC + 1: main + at tests/fail/issue-miri-1112.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/memleak_rc.stderr b/src/tools/miri/tests/fail/memleak_rc.stderr index df12eeed6ac6..91097a99117f 100644 --- a/src/tools/miri/tests/fail/memleak_rc.stderr +++ b/src/tools/miri/tests/fail/memleak_rc.stderr @@ -4,13 +4,11 @@ error: memory leaked: ALLOC (Rust heap, SIZE, ALIGN), allocated here: LL | Box::leak(Box::new(RcInner { strong: Cell::new(1), weak: Cell::new(1), value })) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: BACKTRACE: - = note: inside `std::rc::Rc::>>::new` at RUSTLIB/alloc/src/rc.rs:LL:CC -note: inside `main` - --> tests/fail/memleak_rc.rs:LL:CC - | -LL | let x = Dummy(Rc::new(RefCell::new(None))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::rc::Rc::new + at RUSTLIB/alloc/src/rc.rs:LL:CC + 1: main + at tests/fail/memleak_rc.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/never_transmute_void.rs b/src/tools/miri/tests/fail/never_transmute_void.rs index ad67b4446165..a2db2ca9db61 100644 --- a/src/tools/miri/tests/fail/never_transmute_void.rs +++ b/src/tools/miri/tests/fail/never_transmute_void.rs @@ -1,6 +1,5 @@ // This should fail even without validation //@compile-flags: -Zmiri-disable-validation -//@require-annotations-for-level: ERROR #![feature(never_type)] #![allow(unused, invalid_value)] @@ -18,5 +17,4 @@ mod m { fn main() { let v = unsafe { std::mem::transmute::<(), m::Void>(()) }; m::f(v); - //~^ NOTE: inside `main` } diff --git a/src/tools/miri/tests/fail/never_transmute_void.stderr b/src/tools/miri/tests/fail/never_transmute_void.stderr index 10ef783f2201..ce65be6ef1b4 100644 --- a/src/tools/miri/tests/fail/never_transmute_void.stderr +++ b/src/tools/miri/tests/fail/never_transmute_void.stderr @@ -6,13 +6,11 @@ LL | match v.0 {} | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `m::f` at tests/fail/never_transmute_void.rs:LL:CC -note: inside `main` - --> tests/fail/never_transmute_void.rs:LL:CC - | -LL | m::f(v); - | ^^^^^^^ + = note: stack backtrace: + 0: m::f + at tests/fail/never_transmute_void.rs:LL:CC + 1: main + at tests/fail/never_transmute_void.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/overlapping_assignment.stderr b/src/tools/miri/tests/fail/overlapping_assignment.stderr index a479e8be6481..43e767e97555 100644 --- a/src/tools/miri/tests/fail/overlapping_assignment.stderr +++ b/src/tools/miri/tests/fail/overlapping_assignment.stderr @@ -6,13 +6,11 @@ LL | *ptr1 = *ptr2; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `self_copy` at tests/fail/overlapping_assignment.rs:LL:CC -note: inside `main` - --> tests/fail/overlapping_assignment.rs:LL:CC - | -LL | self_copy(ptr, ptr); - | ^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: self_copy + at tests/fail/overlapping_assignment.rs:LL:CC + 1: main + at tests/fail/overlapping_assignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/abort_unwind.stderr b/src/tools/miri/tests/fail/panic/abort_unwind.stderr index 23dbc2fb8f39..d5699fc41dfe 100644 --- a/src/tools/miri/tests/fail/panic/abort_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/abort_unwind.stderr @@ -14,19 +14,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:LL:CC}, ()>` at RUSTLIB/core/src/panic.rs:LL:CC -note: inside `main` - --> tests/fail/panic/abort_unwind.rs:LL:CC - | -LL | std::panic::abort_unwind(|| panic!("PANIC!!!")); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr index b0a8492b6a61..d47f7b5b10c1 100644 --- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr @@ -11,16 +11,17 @@ LL | std::panic::catch_unwind(|| unwind()).unwrap_err(); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside closure at tests/fail/panic/bad_unwind.rs:LL:CC - = note: inside `std::panicking::catch_unwind::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::catch_unwind::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panic::catch_unwind::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC -note: inside `main` - --> tests/fail/panic/bad_unwind.rs:LL:CC - | -LL | std::panic::catch_unwind(|| unwind()).unwrap_err(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::{closure#0} + at tests/fail/panic/bad_unwind.rs:LL:CC + 1: std::panicking::catch_unwind::do_call + at RUSTLIB/std/src/panicking.rs:LL:CC + 2: std::panicking::catch_unwind + at RUSTLIB/std/src/panicking.rs:LL:CC + 3: std::panic::catch_unwind + at RUSTLIB/std/src/panic.rs:LL:CC + 4: main + at tests/fail/panic/bad_unwind.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr index edbc0d8fc571..34a62a09cc3e 100644 --- a/src/tools/miri/tests/fail/panic/double_panic.stderr +++ b/src/tools/miri/tests/fail/panic/double_panic.stderr @@ -17,21 +17,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_nounwind_nobacktrace` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_in_cleanup` at RUSTLIB/core/src/panicking.rs:LL:CC -note: inside `main` - --> tests/fail/panic/double_panic.rs:LL:CC - | -LL | / fn main() { -LL | | let _foo = Foo; -LL | | panic!("first"); -LL | | } - | |_^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/no_std.stderr b/src/tools/miri/tests/fail/panic/no_std.stderr index dbd29e43069e..87adb18a7ab9 100644 --- a/src/tools/miri/tests/fail/panic/no_std.stderr +++ b/src/tools/miri/tests/fail/panic/no_std.stderr @@ -6,13 +6,11 @@ error: abnormal termination: the program aborted execution LL | core::intrinsics::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `panic_handler` at tests/fail/panic/no_std.rs:LL:CC -note: inside `miri_start` - --> tests/fail/panic/no_std.rs:LL:CC - | -LL | panic!("blarg I am dead") - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: panic_handler + at tests/fail/panic/no_std.rs:LL:CC + 1: miri_start + at RUSTLIB/core/src/panic.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr index c389a9bc0750..4135ceadc539 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr @@ -9,19 +9,23 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC - = note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC -note: inside `main` - --> tests/fail/panic/panic_abort1.rs:LL:CC - | -LL | std::panic!("panicking from libstd"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::rt::__rust_abort + at RUSTLIB/std/src/rt.rs:LL:CC + 1: panic_abort::__rust_start_panic + at RUSTLIB/panic_abort/src/lib.rs:LL:CC + 2: std::panicking::rust_panic + at RUSTLIB/std/src/panicking.rs:LL:CC + 3: std::panicking::panic_with_hook + at RUSTLIB/std/src/panicking.rs:LL:CC + 4: std::panicking::panic_handler::{closure#0} + at RUSTLIB/std/src/panicking.rs:LL:CC + 5: std::sys::backtrace::__rust_end_short_backtrace + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + 6: std::panicking::panic_handler + at RUSTLIB/std/src/panicking.rs:LL:CC + 7: main + at RUSTLIB/core/src/panic.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr index 5fe2245cbe00..5b485604037c 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr @@ -9,19 +9,23 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC - = note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC -note: inside `main` - --> tests/fail/panic/panic_abort2.rs:LL:CC - | -LL | std::panic!("{}-panicking from libstd", 42); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::rt::__rust_abort + at RUSTLIB/std/src/rt.rs:LL:CC + 1: panic_abort::__rust_start_panic + at RUSTLIB/panic_abort/src/lib.rs:LL:CC + 2: std::panicking::rust_panic + at RUSTLIB/std/src/panicking.rs:LL:CC + 3: std::panicking::panic_with_hook + at RUSTLIB/std/src/panicking.rs:LL:CC + 4: std::panicking::panic_handler::{closure#0} + at RUSTLIB/std/src/panicking.rs:LL:CC + 5: std::sys::backtrace::__rust_end_short_backtrace + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + 6: std::panicking::panic_handler + at RUSTLIB/std/src/panicking.rs:LL:CC + 7: main + at RUSTLIB/core/src/panic.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr index cac24ca41c71..e4179f93f931 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr @@ -9,19 +9,23 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC - = note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC -note: inside `main` - --> tests/fail/panic/panic_abort3.rs:LL:CC - | -LL | core::panic!("panicking from libcore"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::rt::__rust_abort + at RUSTLIB/std/src/rt.rs:LL:CC + 1: panic_abort::__rust_start_panic + at RUSTLIB/panic_abort/src/lib.rs:LL:CC + 2: std::panicking::rust_panic + at RUSTLIB/std/src/panicking.rs:LL:CC + 3: std::panicking::panic_with_hook + at RUSTLIB/std/src/panicking.rs:LL:CC + 4: std::panicking::panic_handler::{closure#0} + at RUSTLIB/std/src/panicking.rs:LL:CC + 5: std::sys::backtrace::__rust_end_short_backtrace + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + 6: std::panicking::panic_handler + at RUSTLIB/std/src/panicking.rs:LL:CC + 7: main + at RUSTLIB/core/src/panic.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr index 21195729ae82..d2e50b87068f 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr @@ -9,19 +9,23 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::rt::__rust_abort` at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC - = note: inside `std::panicking::rust_panic` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC -note: inside `main` - --> tests/fail/panic/panic_abort4.rs:LL:CC - | -LL | core::panic!("{}-panicking from libcore", 42); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::rt::__rust_abort + at RUSTLIB/std/src/rt.rs:LL:CC + 1: panic_abort::__rust_start_panic + at RUSTLIB/panic_abort/src/lib.rs:LL:CC + 2: std::panicking::rust_panic + at RUSTLIB/std/src/panicking.rs:LL:CC + 3: std::panicking::panic_with_hook + at RUSTLIB/std/src/panicking.rs:LL:CC + 4: std::panicking::panic_handler::{closure#0} + at RUSTLIB/std/src/panicking.rs:LL:CC + 5: std::sys::backtrace::__rust_end_short_backtrace + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + 6: std::panicking::panic_handler + at RUSTLIB/std/src/panicking.rs:LL:CC + 7: main + at RUSTLIB/core/src/panic.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs index 93ad42ea1cce..c25684af5090 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs +++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.rs @@ -4,6 +4,7 @@ //@compile-flags: -Zmiri-backtrace=full //@normalize-stderr-test: "'main'|''" -> "$$NAME" //@normalize-stderr-test: ".*(note|-->|\|).*\n" -> "" +//@normalize-stderr-test: "\n *\d+:.*\n *at .*" -> "" pub struct NoisyDrop {} diff --git a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs index a207d3923124..32fd8318f796 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs @@ -1,7 +1,8 @@ //@error-in-other-file: aborted execution // Backtraces vary wildly between platforms, we have to normalize away almost the entire thing //@normalize-stderr-test: "'main'|''" -> "$$NAME" -//@normalize-stderr-test: ".*(note|-->|:::|\|).*\n" -> "" +//@normalize-stderr-test: ".*(note|-->|\|).*\n" -> "" +//@normalize-stderr-test: "\n *\d+:.*\n *at .*" -> "" pub struct NoisyDrop {} diff --git a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr index 39263a8d61cc..ec243f114af0 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr @@ -3,6 +3,7 @@ thread $NAME ($TID) panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop, aborting error: abnormal termination: the program aborted execution + ::: RUSTLIB/std/src/sys/thread_local/PLATFORM.rs:LL:CC error: aborting due to 1 previous error diff --git a/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr b/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr index 013c39a22462..fc9f394a568c 100644 --- a/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr +++ b/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr @@ -6,13 +6,11 @@ LL | let _val = *left_ptr; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `deref` at tests/fail/provenance/provenance_transmute.rs:LL:CC -note: inside `main` - --> tests/fail/provenance/provenance_transmute.rs:LL:CC - | -LL | deref(ptr1, ptr2.with_addr(ptr1.addr())); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: deref + at tests/fail/provenance/provenance_transmute.rs:LL:CC + 1: main + at tests/fail/provenance/provenance_transmute.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr b/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr index c5f6e62b8690..7275be1343ac 100644 --- a/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr +++ b/src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr @@ -12,16 +12,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC -note: inside `main` - --> tests/fail/ptr_swap_nonoverlapping.rs:LL:CC - | -LL | std::ptr::swap_nonoverlapping(ptr, ptr, 1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/ctor_ub.rs b/src/tools/miri/tests/fail/shims/ctor_ub.rs new file mode 100644 index 000000000000..860f602e69d0 --- /dev/null +++ b/src/tools/miri/tests/fail/shims/ctor_ub.rs @@ -0,0 +1,39 @@ +unsafe extern "C" fn ctor() { + std::hint::unreachable_unchecked() + //~^ERROR: unreachable +} + +#[rustfmt::skip] +macro_rules! ctor { + ($ident:ident = $ctor:ident) => { + #[cfg_attr( + all(any( + target_os = "linux", + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "haiku", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris", + target_os = "none", + target_family = "wasm", + )), + link_section = ".init_array" + )] + #[cfg_attr(windows, link_section = ".CRT$XCU")] + #[cfg_attr( + any(target_os = "macos", target_os = "ios"), + // We do not set the `mod_init_funcs` flag here since ctor/inventory also do not do + // that. See . + link_section = "__DATA,__mod_init_func" + )] + #[used] + static $ident: unsafe extern "C" fn() = $ctor; + }; +} + +ctor! { CTOR = ctor } + +fn main() {} diff --git a/src/tools/miri/tests/fail/shims/ctor_ub.stderr b/src/tools/miri/tests/fail/shims/ctor_ub.stderr new file mode 100644 index 000000000000..e89f3b3c9059 --- /dev/null +++ b/src/tools/miri/tests/fail/shims/ctor_ub.stderr @@ -0,0 +1,22 @@ +error: Undefined Behavior: entering unreachable code + --> tests/fail/shims/ctor_ub.rs:LL:CC + | +LL | std::hint::unreachable_unchecked() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information +note: the current function got called indirectly due to this code + --> tests/fail/shims/ctor_ub.rs:LL:CC + | +LL | static $ident: unsafe extern "C" fn() = $ctor; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | ctor! { CTOR = ctor } + | --------------------- in this macro invocation + = note: this error originates in the macro `ctor` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr b/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr index f08909d44276..09501f98a9aa 100644 --- a/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr +++ b/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr @@ -6,23 +6,31 @@ LL | let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode a | = help: set `MIRIFLAGS=-Zmiri-disable-isolation` to disable isolation; = help: or set `MIRIFLAGS=-Zmiri-isolation-error=warn` to make Miri return an error code from isolated operations (if supported for that operation) and continue with a warning - = note: BACKTRACE: - = note: inside closure at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC - = note: inside `std::sys::pal::PLATFORM::cvt_r::` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC - = note: inside `std::sys::fs::PLATFORM::File::open_c` at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC - = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr_stack::` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC - = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr::` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC - = note: inside `std::sys::pal::PLATFORM::small_c_string::run_path_with_cstr::` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC - = note: inside `std::sys::fs::PLATFORM::File::open` at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC - = note: inside `std::fs::OpenOptions::_open` at RUSTLIB/std/src/fs.rs:LL:CC - = note: inside `std::fs::OpenOptions::open::<&std::path::Path>` at RUSTLIB/std/src/fs.rs:LL:CC - = note: inside `std::fs::File::open::<&str>` at RUSTLIB/std/src/fs.rs:LL:CC -note: inside `main` - --> tests/fail/shims/fs/isolated_file.rs:LL:CC - | -LL | let _file = std::fs::File::open("file.txt").unwrap(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::sys::fs::PLATFORM::File::open_c::{closure#0} + at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC + 1: std::sys::pal::PLATFORM::cvt_r + at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC + 2: std::sys::fs::PLATFORM::File::open_c + at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC + 3: std::sys::fs::PLATFORM::File::open::{closure#0} + at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC + 4: std::sys::helpers::small_c_string::run_with_cstr_stack + at RUSTLIB/std/src/sys/helpers/small_c_string.rs:LL:CC + 5: std::sys::helpers::small_c_string::run_with_cstr + at RUSTLIB/std/src/sys/helpers/small_c_string.rs:LL:CC + 6: std::sys::helpers::small_c_string::run_path_with_cstr + at RUSTLIB/std/src/sys/helpers/small_c_string.rs:LL:CC + 7: std::sys::fs::PLATFORM::File::open + at RUSTLIB/std/src/sys/fs/PLATFORM.rs:LL:CC + 8: std::fs::OpenOptions::_open + at RUSTLIB/std/src/fs.rs:LL:CC + 9: std::fs::OpenOptions::open + at RUSTLIB/std/src/fs.rs:LL:CC + 10: std::fs::File::open + at RUSTLIB/std/src/fs.rs:LL:CC + 11: main + at tests/fail/shims/fs/isolated_file.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/shims/isolated_stdin.stderr b/src/tools/miri/tests/fail/shims/isolated_stdin.stderr index 5fda90b46ef6..c478f1412bbf 100644 --- a/src/tools/miri/tests/fail/shims/isolated_stdin.stderr +++ b/src/tools/miri/tests/fail/shims/isolated_stdin.stderr @@ -5,10 +5,6 @@ error: unsupported operation: `read` from stdin not available when isolation is | = help: set `MIRIFLAGS=-Zmiri-disable-isolation` to disable isolation; = help: or set `MIRIFLAGS=-Zmiri-isolation-error=warn` to make Miri return an error code from isolated operations (if supported for that operation) and continue with a warning -note: inside `main` - --> tests/fail/shims/isolated_stdin.rs:LL:CC - | - | ^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr b/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr index 8d18e5a7d605..266f9247b98d 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr @@ -6,29 +6,21 @@ LL | self.1.deallocate(From::from(ptr.cast()), layout); | = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information - = note: BACKTRACE: - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure - --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC - | -LL | drop(unsafe { Box::from_raw(raw) }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: inside `<{closure@tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC} as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC -note: inside `inner` - --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC - | -LL | f(x) - | ^^^^ -note: inside `main` - --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC - | -LL | / inner(Box::leak(Box::new(0)), |x| { -LL | | let raw = x as *mut _; -LL | | drop(unsafe { Box::from_raw(raw) }); -LL | | }); - | |______^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main::{closure#0} + at tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC + 4: <{closure@tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC} as std::ops::FnOnce<(&mut i32,)>>::call_once - shim + at RUSTLIB/core/src/ops/function.rs:LL:CC + 5: inner + at tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC + 6: main + at tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr index 464c44802ec3..027fe239319a 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr @@ -16,15 +16,15 @@ help: is this argument | LL | core::ptr::drop_in_place(x); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `::drop` at tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC - = note: inside `std::ptr::drop_in_place:: - shim(Some(HasDrop))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::ptr::drop_in_place::<(HasDrop, u8)> - shim(Some((HasDrop, u8)))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC - | -LL | core::ptr::drop_in_place(x); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: ::drop + at tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC + 1: std::ptr::drop_in_place - shim(Some(HasDrop)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::ptr::drop_in_place - shim(Some((HasDrop, u8))) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 3: main + at tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC = note: this error originates in the macro `core::ptr::addr_of_mut` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr index e586d3f03994..cffa17556950 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr @@ -13,13 +13,11 @@ help: was created by a SharedReadOnly retag at offsets [0x0..0x1] | LL | let x = core::ptr::addr_of!(x); | ^^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `std::ptr::drop_in_place:: - shim(None)` at RUSTLIB/core/src/ptr/mod.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/drop_in_place_retag.rs:LL:CC - | -LL | core::ptr::drop_in_place(x.cast_mut()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::ptr::drop_in_place - shim(None) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 1: main + at tests/fail/stacked_borrows/drop_in_place_retag.rs:LL:CC = note: this error originates in the macro `core::ptr::addr_of` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr b/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr index b082abe7b25b..336dff598b42 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr @@ -16,13 +16,11 @@ help: is this argument | LL | fn inner(x: *mut i32, _y: &mut i32) { | ^^ - = note: BACKTRACE (of the first span): - = note: inside `inner` at tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC - | -LL | inner(xraw, xref); - | ^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: inner + at tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC + 1: main + at tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr b/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr index b07599a500ee..4f6045c7c16a 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr @@ -16,13 +16,11 @@ help: was later invalidated at offsets [0x0..0x1] by a write access | LL | *val = 2; // this invalidates any raw ptrs `fun1` might have created. | ^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `fun2` at tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC - | -LL | fun2(); // if they now use a raw ptr they break our reference - | ^^^^^^ + = note: stack backtrace: + 0: fun2 + at tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC + 1: main + at tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr index 5b8f77600cd2..7f112a2e85b6 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr @@ -14,6 +14,18 @@ LL | unsafe { ptr.0.read() }; = help: therefore from the perspective of data races, a retag has the same implications as a read or write = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC + | +LL | let t = thread::spawn(move || { + | _____________^ +LL | | let ptr = ptr; +LL | | // We do a protected mutable retag (but no write!) in this thread. +LL | | fn retag(_x: &mut i32) {} +LL | | retag(unsafe { &mut *ptr.0 }); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stack.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stack.stderr deleted file mode 100644 index 1d7ea18982d1..000000000000 --- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stack.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: Undefined Behavior: Data race detected between (1) Read on thread `unnamed-ID` and (2) Write on thread `unnamed-ID` at ALLOC. (2) just happened here - --> $DIR/retag_data_race_read.rs:LL:CC - | -LL | *p = 5; - | ^^^^^^ Data race detected between (1) Read on thread `unnamed-ID` and (2) Write on thread `unnamed-ID` at ALLOC. (2) just happened here - | -help: and (1) occurred earlier here - --> $DIR/retag_data_race_read.rs:LL:CC - | -LL | let _r = &*p; - | ^^^ - = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior - = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE (of the first span): - = note: inside `thread_2` at $DIR/retag_data_race_read.rs:LL:CC -note: inside closure - --> $DIR/retag_data_race_read.rs:LL:CC - | -LL | let t2 = std::thread::spawn(move || thread_2(p)); - | ^^^^^^^^^^^ - -note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace - -error: aborting due to 1 previous error - diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr index ee82bbbb1ed1..c162bee0a672 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr @@ -14,13 +14,17 @@ LL | let _r = &*p; = help: therefore from the perspective of data races, a retag has the same implications as a read or write = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `thread_2` at tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC -note: inside closure + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: thread_2 + at tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC + 1: main::{closure#1} + at tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC | LL | let t2 = std::thread::spawn(move || thread_2(p)); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.tree.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.tree.stderr deleted file mode 100644 index e6c1745d321c..000000000000 --- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.tree.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: Undefined Behavior: reborrow through (root of the allocation) is forbidden - --> RUSTLIB/std/src/rt.rs:LL:CC - | -LL | panic::catch_unwind(move || unsafe { init(argc, argv, sigpipe) }).map_err(rt_abort)?; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow through (root of the allocation) is forbidden - | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental - = help: the accessed tag (root of the allocation) is foreign to the protected tag (i.e., it is not a child) - = help: this reborrow (acting as a foreign read access) would cause the protected tag (currently Active) to become Disabled - = help: protected tags must never be Disabled -help: the accessed tag was created here - --> RUSTLIB/std/src/rt.rs:LL:CC - | -LL | panic::catch_unwind(move || unsafe { init(argc, argv, sigpipe) }).map_err(rt_abort)?; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: the protected tag was created here, in the initial state Active - --> RUSTLIB/std/src/panic.rs:LL:CC - | -LL | fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { - | ^ - = note: BACKTRACE (of the first span): - = note: inside `std::rt::lang_start_internal` at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC - -error: aborting due to 1 previous error - diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr index 4ac82192a9fb..88dfd1ec9db9 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr @@ -16,13 +16,11 @@ help: was later invalidated at offsets [0x0..0x8] by a read access | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC - | -LL | foo(&mut (1, 2)); - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC + 1: main + at tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr index 7e7670e49f17..5ccb09c7fd84 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr @@ -19,13 +19,11 @@ help: was later invalidated at offsets [0x0..0x8] by a read access | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC - | -LL | match foo(&mut (1, 2)) { - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC + 1: main + at tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr index aeaa694d2923..eb68a637c229 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr @@ -19,13 +19,11 @@ help: was later invalidated at offsets [0x0..0x8] by a read access | LL | let _val = unsafe { *xraw }; // invalidate xref | ^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC -note: inside `main` - --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC - | -LL | foo(&mut (1, 2)).0; - | ^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC + 1: main + at tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr b/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr index 61a57a64116b..c7e471f570c8 100644 --- a/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr +++ b/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr @@ -6,20 +6,33 @@ LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `>::call_once - shim(fn())` at RUSTLIB/core/src/ops/function.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_begin_short_backtrace::` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `std::ops::function::impls:: for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at RUSTLIB/core/src/ops/function.rs:LL:CC - = note: inside `std::panicking::catch_unwind::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panic.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panicking::catch_unwind::` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panic.rs:LL:CC - = note: inside `std::rt::lang_start_internal` at RUSTLIB/std/src/rt.rs:LL:CC - = note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC + = note: stack backtrace: + 0: >::call_once - shim(fn()) + at RUSTLIB/core/src/ops/function.rs:LL:CC + 1: std::sys::backtrace::__rust_begin_short_backtrace + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + 2: std::rt::lang_start::{closure#0} + at RUSTLIB/std/src/rt.rs:LL:CC + 3: std::ops::function::impls::call_once + at RUSTLIB/core/src/ops/function.rs:LL:CC + 4: std::panicking::catch_unwind::do_call + at RUSTLIB/std/src/panicking.rs:LL:CC + 5: std::panicking::catch_unwind + at RUSTLIB/std/src/panicking.rs:LL:CC + 6: std::panic::catch_unwind + at RUSTLIB/std/src/panic.rs:LL:CC + 7: std::rt::lang_start_internal::{closure#0} + at RUSTLIB/std/src/rt.rs:LL:CC + 8: std::panicking::catch_unwind::do_call + at RUSTLIB/std/src/panicking.rs:LL:CC + 9: std::panicking::catch_unwind + at RUSTLIB/std/src/panicking.rs:LL:CC + 10: std::panic::catch_unwind + at RUSTLIB/std/src/panic.rs:LL:CC + 11: std::rt::lang_start_internal + at RUSTLIB/std/src/rt.rs:LL:CC + 12: std::rt::lang_start + at RUSTLIB/std/src/rt.rs:LL:CC error: aborting due to 1 previous error diff --git a/src/tools/miri/tests/fail/tail_calls/dangling-local-var.stderr b/src/tools/miri/tests/fail/tail_calls/dangling-local-var.stderr index 965dd5b399f7..1577cceae594 100644 --- a/src/tools/miri/tests/fail/tail_calls/dangling-local-var.stderr +++ b/src/tools/miri/tests/fail/tail_calls/dangling-local-var.stderr @@ -16,13 +16,11 @@ help: ALLOC was deallocated here: | LL | f(std::ptr::null()); | ^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `g` at tests/fail/tail_calls/dangling-local-var.rs:LL:CC -note: inside `main` - --> tests/fail/tail_calls/dangling-local-var.rs:LL:CC - | -LL | f(std::ptr::null()); - | ^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: g + at tests/fail/tail_calls/dangling-local-var.rs:LL:CC + 1: main + at tests/fail/tail_calls/dangling-local-var.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index 8ae649a392bd..6c38de9b0314 100644 --- a/src/tools/miri/tests/fail/terminate-terminator.stderr +++ b/src/tools/miri/tests/fail/terminate-terminator.stderr @@ -16,31 +16,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC -note: inside `has_cleanup` - --> tests/fail/terminate-terminator.rs:LL:CC - | -LL | / fn has_cleanup() { -LL | | let _f = Foo; -LL | | panic!(); -LL | | } - | |_^ -note: inside `panic_abort` - --> tests/fail/terminate-terminator.rs:LL:CC - | -LL | has_cleanup(); - | ^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/terminate-terminator.rs:LL:CC - | -LL | panic_abort(); - | ^^^^^^^^^^^^^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr index db113b6cf457..efc4bead418e 100644 --- a/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr +++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr @@ -6,6 +6,7 @@ LL | let _val = *dangling_ptr.0; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tls_macro_leak.stderr b/src/tools/miri/tests/fail/tls_macro_leak.stderr index 512932b3cb8a..3f8240f44547 100644 --- a/src/tools/miri/tests/fail/tls_macro_leak.stderr +++ b/src/tools/miri/tests/fail/tls_macro_leak.stderr @@ -4,17 +4,15 @@ error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here: LL | cell.set(Some(Box::leak(Box::new(123)))); | ^^^^^^^^^^^^^ | - = note: BACKTRACE: - = note: inside closure at tests/fail/tls_macro_leak.rs:LL:CC - = note: inside `std::thread::LocalKey::>>::try_with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC - = note: inside `std::thread::LocalKey::>>::with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC -note: inside closure - --> tests/fail/tls_macro_leak.rs:LL:CC - | -LL | / TLS.with(|cell| { -LL | | cell.set(Some(Box::leak(Box::new(123)))); -LL | | }); - | |__________^ + = note: stack backtrace: + 0: main::{closure#0}::{closure#0} + at tests/fail/tls_macro_leak.rs:LL:CC + 1: std::thread::LocalKey::>>::try_with + at RUSTLIB/std/src/thread/local.rs:LL:CC + 2: std::thread::LocalKey::>>::with + at RUSTLIB/std/src/thread/local.rs:LL:CC + 3: main::{closure#0} + at tests/fail/tls_macro_leak.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr index 7960f42faa51..a51cf50640ba 100644 --- a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr @@ -19,13 +19,11 @@ help: the protected tag was created here, in the initial state Reserved | LL | unsafe fn stuff(x: &mut u8, y: *mut u8) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `stuff` at tests/fail/tree_borrows/outside-range.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/outside-range.rs:LL:CC - | -LL | stuff(&mut *raw, raw); - | ^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: stuff + at tests/fail/tree_borrows/outside-range.rs:LL:CC + 1: main + at tests/fail/tree_borrows/outside-range.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr index 9a70d248aa0c..029b0a56f305 100644 --- a/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr @@ -30,13 +30,11 @@ help: the conflicting tag later transitioned to Frozen due to a foreign re LL | let _val = unsafe { *xraw }; // invalidate xref for writing | ^^^^^ = help: this transition corresponds to a loss of write permissions - = note: BACKTRACE (of the first span): - = note: inside `foo` at tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC - | -LL | foo(xref); - | ^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC + 1: main + at tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr b/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr index 012d7caef501..693afb133967 100644 --- a/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr @@ -18,13 +18,11 @@ help: the accessed tag later transitioned to Reserved (conflicted) due to LL | do_something(*orig_ptr); | ^^^^^^^^^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span): - = note: inside `access_after_sub_1` at tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC - | -LL | access_after_sub_1(&mut *(foo as *mut u8).byte_add(1), orig_ptr); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: access_after_sub_1 + at tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC + 1: main + at tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr index b1c3ffe86ef7..29397a8fd0bc 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr @@ -29,13 +29,11 @@ help: the protected tag was created here, in the initial state Reserved | LL | unsafe fn write_second(x: &mut UnsafeCell, y: *mut u8) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `main::write_second` at tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC - | -LL | write_second(x, y); - | ^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::write_second + at tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC + 1: main + at tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr index 5f3129b9dc08..3bddd2ce1de6 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr @@ -29,13 +29,11 @@ help: the protected tag was created here, in the initial state Reserved | LL | unsafe fn write_second(x: &mut u8, y: *mut u8) { | ^ - = note: BACKTRACE (of the first span): - = note: inside `main::write_second` at tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC - | -LL | write_second(x, y); - | ^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::write_second + at tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC + 1: main + at tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr index 15365e5c8bcc..619e707f36f7 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr @@ -32,6 +32,19 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | *x = 64; | ^^^^^^^ = help: this transition corresponds to a loss of read and write permissions + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC + | +LL | let thread_2 = thread::spawn(move || { + | ____________________^ +LL | | let b = (2, by); +LL | | synchronized!(b, "start"); +LL | | let ptr = ptr; +... | +LL | | synchronized!(b, "end"); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr index 4065c822866c..2f14900e43e7 100644 --- a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr @@ -32,6 +32,19 @@ help: the accessed tag later transitioned to Disabled due to a protector r LL | } | ^ = help: this transition corresponds to a loss of read and write permissions + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC + | +LL | let thread_2 = thread::spawn(move || { + | ____________________^ +LL | | let b = (2, by); +LL | | synchronized!(b, "start"); +LL | | let ptr = ptr; +... | +LL | | synchronized!(b, "end"); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr b/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr index 8f2534d6b6e9..12c163aa8754 100644 --- a/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr @@ -31,13 +31,24 @@ help: the accessed tag later transitioned to Reserved (conflicted) due to LL | } | ^ = help: this transition corresponds to a temporary loss of write permissions until function exit - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `retagx_retagy_retx_writey_rety::{closure#1}::as_mut` at tests/fail/tree_borrows/spurious_read.rs:LL:CC -note: inside closure + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: retagx_retagy_retx_writey_rety::{closure#1}::as_mut + at tests/fail/tree_borrows/spurious_read.rs:LL:CC + 1: retagx_retagy_retx_writey_rety::{closure#1} + at tests/fail/tree_borrows/spurious_read.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/fail/tree_borrows/spurious_read.rs:LL:CC | -LL | let _y = as_mut(unsafe { &mut *ptr.0 }, b.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | let thread_y = thread::spawn(move || { + | ____________________^ +LL | | let b = (2, by); +LL | | synchronized!(b, "start"); +LL | | let ptr = ptr; +... | +LL | | synchronized!(b, "end"); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr b/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr index 685abee3292f..4abaeb66e527 100644 --- a/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr @@ -18,28 +18,21 @@ help: the strongly protected tag was created here, in the initial state Re | LL | fn inner(x: &mut i32, f: fn(*mut i32)) { | ^ - = note: BACKTRACE (of the first span): - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure - --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC - | -LL | drop(unsafe { Box::from_raw(raw) }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: inside `<{closure@tests/fail/tree_borrows/strongly-protected.rs:LL:CC} as std::ops::FnOnce<(*mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC -note: inside `inner` - --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC - | -LL | f(x) - | ^^^^ -note: inside `main` - --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC - | -LL | / inner(Box::leak(Box::new(0)), |raw| { -LL | | drop(unsafe { Box::from_raw(raw) }); -LL | | }); - | |______^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main::{closure#0} + at tests/fail/tree_borrows/strongly-protected.rs:LL:CC + 4: <{closure@tests/fail/tree_borrows/strongly-protected.rs:LL:CC} as std::ops::FnOnce<(*mut i32,)>>::call_once - shim + at RUSTLIB/core/src/ops/function.rs:LL:CC + 5: inner + at tests/fail/tree_borrows/strongly-protected.rs:LL:CC + 6: main + at tests/fail/tree_borrows/strongly-protected.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.stderr b/src/tools/miri/tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.stderr index b98d2fafcf4e..c27db19cd3e9 100644 --- a/src/tools/miri/tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.stderr @@ -18,13 +18,11 @@ help: the conflicting tag was created here, in the initial state Frozen | LL | let intermediary = &root; | ^^^^^ - = note: BACKTRACE (of the first span): - = note: inside `write_to_mut` at tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.rs:LL:CC - | -LL | write_to_mut(data, core::ptr::addr_of!(root)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: write_to_mut + at tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.rs:LL:CC + 1: main + at tests/fail/tree_borrows/subtree_traversal_skipping_diagnostics.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/protected_wildcard.stderr b/src/tools/miri/tests/fail/tree_borrows/wildcard/protected_wildcard.stderr index e257a3511f75..28deb09664c7 100644 --- a/src/tools/miri/tests/fail/tree_borrows/wildcard/protected_wildcard.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/protected_wildcard.stderr @@ -23,13 +23,11 @@ help: the protected tag was created here, in the initial state Reserved | LL | let mut protect = |_arg: &mut u32| { | ^^^^ - = note: BACKTRACE (of the first span): - = note: inside closure at tests/fail/tree_borrows/wildcard/protected_wildcard.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/wildcard/protected_wildcard.rs:LL:CC - | -LL | protect(wild_ref); - | ^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::{closure#0} + at tests/fail/tree_borrows/wildcard/protected_wildcard.rs:LL:CC + 1: main + at tests/fail/tree_borrows/wildcard/protected_wildcard.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_conflicted.stderr b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_conflicted.stderr index 5486eee4f063..dce29e63583e 100644 --- a/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_conflicted.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_conflicted.stderr @@ -7,13 +7,11 @@ LL | unsafe { *wild = 4 }; = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information = help: there are no exposed tags which may perform this access here - = note: BACKTRACE: - = note: inside closure at tests/fail/tree_borrows/wildcard/protector_conflicted.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/wildcard/protector_conflicted.rs:LL:CC - | -LL | protect(ref1); - | ^^^^^^^^^^^^^ + = note: stack backtrace: + 0: main::{closure#0} + at tests/fail/tree_borrows/wildcard/protector_conflicted.rs:LL:CC + 1: main + at tests/fail/tree_borrows/wildcard/protector_conflicted.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release.rs b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release.rs new file mode 100644 index 000000000000..d1bb9d781575 --- /dev/null +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release.rs @@ -0,0 +1,79 @@ +//@compile-flags: -Zmiri-tree-borrows -Zmiri-permissive-provenance +use std::cell::UnsafeCell; + +/// This is a variant of the test in `../protector-write-lazy.rs`, but with +/// wildcard references. +/// Checks that a protector release access correctly determines that certain tags +/// cannot be children of the protected tag and that it updates them accordingly. +/// +/// For this version we know the tag is not a child because its wildcard root has +/// a smaller tag then the released reference. +pub fn main() { + // We need two locations so that we can create a new reference + // that is foreign to an already active tag. + let mut x: UnsafeCell<[u32; 2]> = UnsafeCell::new([32, 33]); + let ref1 = &mut x; + let cell_ptr = ref1.get() as *mut u32; + + let int = ref1 as *mut UnsafeCell<[u32; 2]> as usize; + let wild = int as *mut UnsafeCell; + + let ref2 = unsafe { &mut *cell_ptr }; + + // `ref3` gets created before the protected ref `arg4`. + let ref3 = unsafe { &mut *wild.wrapping_add(1) }; + + let protect = |arg4: &mut u32| { + // Activates arg4. This would disable ref3 at [0] if it wasn't a cell. + *arg4 = 41; + + // Creates an exposed child of arg4. + let ref5 = &mut *arg4; + let _int = ref5 as *mut u32 as usize; + + // This creates ref6 from ref3 at [1], so that it doesn't disable arg4 at [0]. + let ref6 = unsafe { &mut *ref3.get() }; + + // ┌───────────┐ + // │ ref1* │ + // │ Cel │ Cel │ * + // └─────┬─────┘ │ + // │ │ + // │ │ + // ▼ ▼ + // ┌───────────┐ ┌───────────┐ + // │ ref2│ │ │ │ ref3│ + // │ Act │ Res │ │ Cel │ Cel │ + // └─────┬─────┘ └─────┬─────┘ + // │ │ + // │ │ + // ▼ ▼ + // ┌───────────┐ ┌───────────┐ + // │ arg4│ │ │ │ ref6│ + // │ Act │ Res │ │ Res │ Res │ + // └─────┬─────┘ └───────────┘ + // │ + // │ + // ▼ + // ┌───────────┐ + // │ref5*| │ + // │ Res │ Res │ + // └───────────┘ + + // Creates a pointer to [0] with the provenance of ref6. + return (ref6 as *mut u32).wrapping_sub(1); + + // Protector release on arg4 happens here. + // This should cause a foreign write on all foreign nodes, + // unless they could be a child of arg4. + // arg4 has an exposed child, so some tags with a wildcard + // ancestor could be its children. + // However, the root of ref6 was created before arg4, so it + // cannot be a child of it. So it should get disabled + // (at location [0]). + }; + // ptr has provenance of ref6 + let ptr = protect(ref2); + // ref6 is disabled at [0]. + let _fail = unsafe { *ptr }; //~ ERROR: /read access through .* is forbidden/ +} diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release.stderr b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release.stderr new file mode 100644 index 000000000000..cd25ef40aad1 --- /dev/null +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release.stderr @@ -0,0 +1,25 @@ +error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden + --> tests/fail/tree_borrows/wildcard/protector_release.rs:LL:CC + | +LL | let _fail = unsafe { *ptr }; + | ^^^^ Undefined Behavior occurred here + | + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental + = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information + = help: the accessed tag has state Disabled which forbids this child read access +help: the accessed tag was created here, in the initial state Reserved + --> tests/fail/tree_borrows/wildcard/protector_release.rs:LL:CC + | +LL | let ref6 = unsafe { &mut *ref3.get() }; + | ^^^^^^^^^^^^^^^^ +help: the accessed tag later transitioned to Disabled due to a protector release (acting as a foreign write access) on every location previously accessed by this tag + --> tests/fail/tree_borrows/wildcard/protector_release.rs:LL:CC + | +LL | }; + | ^ + = help: this transition corresponds to a loss of read and write permissions + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release2.rs b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release2.rs new file mode 100644 index 000000000000..7bef1cb2665e --- /dev/null +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release2.rs @@ -0,0 +1,81 @@ +//@compile-flags: -Zmiri-tree-borrows -Zmiri-permissive-provenance +use std::cell::UnsafeCell; + +/// This is a variant of the test in `../protector-write-lazy.rs`, but with +/// wildcard references. +/// Checks that a protector release access correctly determines that certain tags +/// cannot be children of the protected tag and that it updates them accordingly. +/// +/// For this version we know the tag is not a child because its wildcard root has +/// a smaller tag then the exposed child of the protected tag. +/// So this test checks that we don't just compare with the accessed tag but instead +/// find the smallest exposed child. +pub fn main() { + // We need two locations so that we can create a new reference + // that is foreign to an already active tag. + let mut x: UnsafeCell<[u32; 2]> = UnsafeCell::new([32, 33]); + let ref1 = &mut x; + let cell_ptr = ref1.get() as *mut u32; + + let int = ref1 as *mut UnsafeCell<[u32; 2]> as usize; + let wild = int as *mut UnsafeCell; + + let ref2 = unsafe { &mut *cell_ptr }; + + let protect = |arg3: &mut u32| { + // `ref4` gets created after the protected ref `arg3` but before the exposed `ref5`. + let ref4 = unsafe { &mut *wild.wrapping_add(1) }; + + // Activates arg4. This would disable ref3 at [0] if it wasn't a cell. + *arg3 = 41; + + // Creates an exposed child of arg3. + let ref5 = &mut *arg3; + let _int = ref5 as *mut u32 as usize; + + // This creates ref6 from ref4 at [1], so that it doesn't disable arg3 at [0]. + let ref6 = unsafe { &mut *ref4.get() }; + + // ┌───────────┐ + // │ ref1* │ + // │ Cel │ Cel │ * + // └─────┬─────┘ │ + // │ │ + // │ │ + // ▼ ▼ + // ┌───────────┐ ┌───────────┐ + // │ ref2| │ │ | ref4│ + // │ Act │ Res │ │ Cel │ Cel │ + // └─────┬─────┘ └─────┬─────┘ + // │ │ + // │ │ + // ▼ ▼ + // ┌───────────┐ ┌───────────┐ + // │ arg3| │ │ | ref6│ + // │ Act │ Res │ │ Res │ Res │ + // └─────┬─────┘ └───────────┘ + // │ + // │ + // ▼ + // ┌───────────┐ + // │ref5*| │ + // │ Res │ Res │ + // └───────────┘ + + // Creates a pointer to [0] with the provenance of ref6. + return (ref6 as *mut u32).wrapping_sub(1); + + // Protector release on arg3 happens here. + // This should cause a foreign write on all foreign nodes, + // unless they could be a child of arg3. + // arg3 has an exposed child, so some tags with a wildcard + // ancestor could be its children. + // However, the root of ref6 was created before the exposed + // child ref5, so it cannot be a child of it. So it should + // get disabled (at location [0]). + }; + // ptr has provenance of ref6 + let ptr = protect(ref2); + // ref6 is disabled at [0]. + let _fail = unsafe { *ptr }; //~ ERROR: /read access through .* is forbidden/ +} diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release2.stderr b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release2.stderr new file mode 100644 index 000000000000..cd5f42aa0484 --- /dev/null +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/protector_release2.stderr @@ -0,0 +1,25 @@ +error: Undefined Behavior: read access through at ALLOC[0x0] is forbidden + --> tests/fail/tree_borrows/wildcard/protector_release2.rs:LL:CC + | +LL | let _fail = unsafe { *ptr }; + | ^^^^ Undefined Behavior occurred here + | + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental + = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information + = help: the accessed tag has state Disabled which forbids this child read access +help: the accessed tag was created here, in the initial state Reserved + --> tests/fail/tree_borrows/wildcard/protector_release2.rs:LL:CC + | +LL | let ref6 = unsafe { &mut *ref4.get() }; + | ^^^^^^^^^^^^^^^^ +help: the accessed tag later transitioned to Disabled due to a protector release (acting as a foreign write access) on every location previously accessed by this tag + --> tests/fail/tree_borrows/wildcard/protector_release2.rs:LL:CC + | +LL | }; + | ^ + = help: this transition corresponds to a loss of read and write permissions + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.stderr b/src/tools/miri/tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.stderr index 6e115b22feb1..89d1f8ca556d 100644 --- a/src/tools/miri/tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.stderr @@ -18,28 +18,21 @@ help: the strongly protected tag was created here, in the initial state Re | LL | fn inner(x: &mut i32, f: fn(usize)) { | ^ - = note: BACKTRACE (of the first span): - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::boxed::Box))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure - --> tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC - | -LL | drop(unsafe { Box::from_raw(raw as *mut i32) }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: inside `<{closure@tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC} as std::ops::FnOnce<(usize,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC -note: inside `inner` - --> tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC - | -LL | f(x as *mut i32 as usize) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `main` - --> tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC - | -LL | / inner(Box::leak(Box::new(0)), |raw| { -LL | | drop(unsafe { Box::from_raw(raw as *mut i32) }); -LL | | }); - | |______^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: main::{closure#0} + at tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC + 4: <{closure@tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC} as std::ops::FnOnce<(usize,)>>::call_once - shim + at RUSTLIB/core/src/ops/function.rs:LL:CC + 5: inner + at tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC + 6: main + at tests/fail/tree_borrows/wildcard/strongly_protected_wildcard.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr index 7f55e06a6bb7..e44f306f7fad 100644 --- a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr @@ -18,19 +18,11 @@ help: the accessed tag later transitioned to Disabled due to a foreign wri LL | *alias = 42; | ^^^^^^^^^^^ = help: this transition corresponds to a loss of read and write permissions - = note: BACKTRACE (of the first span): - = note: inside `Foo::add` at tests/fail/tree_borrows/write-during-2phase.rs:LL:CC -note: inside `main` - --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC - | -LL | let res = f.add(unsafe { - | _______________^ -LL | | // This is the access at fault, but it's not immediately apparent because -LL | | // the reference that got invalidated is not under a Protector. -LL | | *alias = 42; -LL | | 0 -LL | | }); - | |______^ + = note: stack backtrace: + 0: Foo::add + at tests/fail/tree_borrows/write-during-2phase.rs:LL:CC + 1: main + at tests/fail/tree_borrows/write-during-2phase.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr b/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr index ea144f206643..2b98a2f99cf9 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr @@ -8,13 +8,11 @@ LL | | T: [const] Destruct, | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `std::ptr::drop_in_place:: - shim(Some(PartialDrop))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC -note: inside `main` - --> tests/fail/unaligned_pointers/drop_in_place.rs:LL:CC - | -LL | core::ptr::drop_in_place(p); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: std::ptr::drop_in_place - shim(Some(PartialDrop)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 1: main + at tests/fail/unaligned_pointers/drop_in_place.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr index d2a5f83a43da..ed5c724a2e2b 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr @@ -6,13 +6,11 @@ LL | unsafe { (*x).x } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `foo` at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC -note: inside `main` - --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC - | -LL | foo(odd_ptr.cast()); - | ^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC + 1: main + at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr index 39540fc8320d..bd44ed1224ec 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr @@ -6,13 +6,11 @@ LL | unsafe { (*x).packed.x } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `foo` at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC -note: inside `main` - --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC - | -LL | foo(odd_ptr.cast()); - | ^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: foo + at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC + 1: main + at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr index a91be376bd16..2f3079383d12 100644 --- a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr +++ b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr @@ -6,13 +6,11 @@ LL | mem::transmute(x) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `raw_to_ref::<'_, i32>` at tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC -note: inside `main` - --> tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC - | -LL | let p: &i32 = unsafe { raw_to_ref(ptr::addr_of!(foo.x)) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: raw_to_ref + at tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC + 1: main + at tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr index 25a9bddb42c7..e0caff6a21a9 100644 --- a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr +++ b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr @@ -6,14 +6,13 @@ LL | let mut order = unsafe { compare_bytes(left, right, len) as isize } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `::compare` at RUSTLIB/core/src/slice/cmp.rs:LL:CC - = note: inside `core::slice::cmp::::cmp` at RUSTLIB/core/src/slice/cmp.rs:LL:CC -note: inside `main` - --> tests/fail/uninit/uninit_alloc_diagnostic.rs:LL:CC - | -LL | drop(slice1.cmp(slice2)); - | ^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: ::compare + at RUSTLIB/core/src/slice/cmp.rs:LL:CC + 1: core::slice::cmp::cmp + at RUSTLIB/core/src/slice/cmp.rs:LL:CC + 2: main + at tests/fail/uninit/uninit_alloc_diagnostic.rs:LL:CC Uninitialized memory occurred at ALLOC[0x4..0x10], in this allocation: ALLOC (Rust heap, size: 32, align: 8) { diff --git a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr index 305d8d4fbede..efad61c14fb8 100644 --- a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr +++ b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr @@ -6,14 +6,13 @@ LL | let mut order = unsafe { compare_bytes(left, right, len) as isize } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `::compare` at RUSTLIB/core/src/slice/cmp.rs:LL:CC - = note: inside `core::slice::cmp::::cmp` at RUSTLIB/core/src/slice/cmp.rs:LL:CC -note: inside `main` - --> tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.rs:LL:CC - | -LL | drop(slice1.cmp(slice2)); - | ^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: ::compare + at RUSTLIB/core/src/slice/cmp.rs:LL:CC + 1: core::slice::cmp::cmp + at RUSTLIB/core/src/slice/cmp.rs:LL:CC + 2: main + at tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.rs:LL:CC Uninitialized memory occurred at ALLOC[0x4..0x8], in this allocation: ALLOC (Rust heap, size: 16, align: 8) { diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr index cf41c88ce377..2295d80f45e8 100644 --- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr +++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr @@ -14,25 +14,7 @@ error: abnormal termination: the program aborted execution LL | crate::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here | - = note: BACKTRACE: - = note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC - = note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC - = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC -note: inside `panic_abort` - --> tests/fail/unwind-action-terminate.rs:LL:CC - | -LL | / extern "C" fn panic_abort() { -LL | | panic!() -LL | | } - | |_^ -note: inside `main` - --> tests/fail/unwind-action-terminate.rs:LL:CC - | -LL | panic_abort(); - | ^^^^^^^^^^^^^ + = note: stack backtrace: note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr index c370e19ef313..c2e647aa18fc 100644 --- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr +++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr @@ -6,13 +6,11 @@ LL | Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue()) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `call` at tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC -note: inside `main` - --> tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC - | -LL | call(f); - | ^^^^^^^ + = note: stack backtrace: + 0: call + at tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC + 1: main + at tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr b/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr index c435e51d6be8..ecccf204cf81 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr @@ -6,13 +6,11 @@ LL | RET = *ptr as u32; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `cast` at tests/fail/validity/invalid_char_cast.rs:LL:CC -note: inside `main` - --> tests/fail/validity/invalid_char_cast.rs:LL:CC - | -LL | cast(&v as *const u32 as *const char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: cast + at tests/fail/validity/invalid_char_cast.rs:LL:CC + 1: main + at tests/fail/validity/invalid_char_cast.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_char_match.stderr b/src/tools/miri/tests/fail/validity/invalid_char_match.stderr index 141305a00170..818b2e26f869 100644 --- a/src/tools/miri/tests/fail/validity/invalid_char_match.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_char_match.stderr @@ -9,13 +9,11 @@ LL | | } | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `switch_int` at tests/fail/validity/invalid_char_match.rs:LL:CC -note: inside `main` - --> tests/fail/validity/invalid_char_match.rs:LL:CC - | -LL | switch_int(&v as *const u32 as *const char); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: switch_int + at tests/fail/validity/invalid_char_match.rs:LL:CC + 1: main + at tests/fail/validity/invalid_char_match.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr index b2d876419034..a02dc678f018 100644 --- a/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr +++ b/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr @@ -6,13 +6,11 @@ LL | let _val = *ptr as u32; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `cast` at tests/fail/validity/invalid_enum_cast.rs:LL:CC -note: inside `main` - --> tests/fail/validity/invalid_enum_cast.rs:LL:CC - | -LL | cast(&v as *const u32 as *const E); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: cast + at tests/fail/validity/invalid_enum_cast.rs:LL:CC + 1: main + at tests/fail/validity/invalid_enum_cast.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr b/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr index 99e06e7febf5..d2d6da49fc1e 100644 --- a/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr +++ b/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr @@ -6,6 +6,12 @@ LL | let j2 = spawn(move || x.load(Ordering::Relaxed)); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/fail/weak_memory/weak_uninit.rs:LL:CC + | +LL | let j2 = spawn(move || x.load(Ordering::Relaxed)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/atomics/atomic_ptr_double_free.stderr b/src/tools/miri/tests/genmc/fail/atomics/atomic_ptr_double_free.stderr index 7d03bd9a8eb8..2ba64ac032a8 100644 --- a/src/tools/miri/tests/genmc/fail/atomics/atomic_ptr_double_free.stderr +++ b/src/tools/miri/tests/genmc/fail/atomics/atomic_ptr_double_free.stderr @@ -17,19 +17,26 @@ help: ALLOC was deallocated here: | LL | dealloc(ptr as *mut u8, Layout::new::()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside `free` at tests/genmc/fail/atomics/atomic_ptr_double_free.rs:LL:CC -note: inside closure - --> tests/genmc/fail/atomics/atomic_ptr_double_free.rs:LL:CC - | -LL | free(b); - | ^^^^^^^ - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/atomics/atomic_ptr_double_free.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: free + at tests/genmc/fail/atomics/atomic_ptr_double_free.rs:LL:CC + 1: miri_start::{closure#1} + at tests/genmc/fail/atomics/atomic_ptr_double_free.rs:LL:CC + 2: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 3: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/atomics/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/atomics/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.dealloc.stderr b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.dealloc.stderr index bde793014bbf..7534eaf8f37e 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.dealloc.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.dealloc.stderr @@ -7,14 +7,24 @@ LL | dealloc(b as *mut u8, Layout::new::()); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/atomic_ptr_alloc_race.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/atomic_ptr_alloc_race.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/atomic_ptr_alloc_race.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.write.stderr b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.write.stderr index 7bfafe0ca086..77e9817a55c7 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.write.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_alloc_race.write.stderr @@ -7,14 +7,24 @@ LL | *b = 42; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/atomic_ptr_alloc_race.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/atomic_ptr_alloc_race.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/atomic_ptr_alloc_race.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.stderr b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.stderr index 0facf6a5d177..47df94404efa 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.stderr @@ -17,14 +17,24 @@ help: ALLOC was deallocated here: | LL | }), | ^ - = note: BACKTRACE (of the first span) on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/atomic_ptr_dealloc_write_race.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.stderr b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.stderr index 8e4ed1aba043..e2c87b2d25e1 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.stderr @@ -7,14 +7,24 @@ LL | }), | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/atomic_ptr_write_dealloc_race.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/data_race/mpu2_rels_rlx.stderr b/src/tools/miri/tests/genmc/fail/data_race/mpu2_rels_rlx.stderr index 1ffb55f22e6e..a3a15a71ce15 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/mpu2_rels_rlx.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/mpu2_rels_rlx.stderr @@ -7,14 +7,24 @@ LL | X = 2; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/mpu2_rels_rlx.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/mpu2_rels_rlx.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/mpu2_rels_rlx.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rel_rlx.stderr b/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rel_rlx.stderr index b0037c211c69..1220c0c09cbe 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rel_rlx.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rel_rlx.stderr @@ -7,14 +7,24 @@ LL | X = 2; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/weak_orderings.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/weak_orderings.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/weak_orderings.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_acq.stderr b/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_acq.stderr index b0037c211c69..1220c0c09cbe 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_acq.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_acq.stderr @@ -7,14 +7,24 @@ LL | X = 2; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/weak_orderings.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/weak_orderings.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/weak_orderings.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_rlx.stderr b/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_rlx.stderr index b0037c211c69..1220c0c09cbe 100644 --- a/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_rlx.stderr +++ b/src/tools/miri/tests/genmc/fail/data_race/weak_orderings.rlx_rlx.stderr @@ -7,14 +7,24 @@ LL | X = 2; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside closure at tests/genmc/fail/data_race/weak_orderings.rs:LL:CC - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/fail/data_race/weak_orderings.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: miri_start::{closure#1} + at tests/genmc/fail/data_race/weak_orderings.rs:LL:CC + 1: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 2: genmc::spawn_pthread_closure::thread_func + at tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/data_race/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/loom/buggy_inc.stderr b/src/tools/miri/tests/genmc/fail/loom/buggy_inc.stderr index ad98ba6aeb9a..abda3e31189e 100644 --- a/src/tools/miri/tests/genmc/fail/loom/buggy_inc.stderr +++ b/src/tools/miri/tests/genmc/fail/loom/buggy_inc.stderr @@ -4,6 +4,8 @@ error: abnormal termination: the program aborted execution | LL | std::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/loom/store_buffering.genmc.stderr b/src/tools/miri/tests/genmc/fail/loom/store_buffering.genmc.stderr index 658914ba088d..176ab6a573c8 100644 --- a/src/tools/miri/tests/genmc/fail/loom/store_buffering.genmc.stderr +++ b/src/tools/miri/tests/genmc/fail/loom/store_buffering.genmc.stderr @@ -4,6 +4,8 @@ error: abnormal termination: the program aborted execution | LL | std::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/loom/store_buffering.non_genmc.stderr b/src/tools/miri/tests/genmc/fail/loom/store_buffering.non_genmc.stderr index d2036d464bb5..487ab21f28b3 100644 --- a/src/tools/miri/tests/genmc/fail/loom/store_buffering.non_genmc.stderr +++ b/src/tools/miri/tests/genmc/fail/loom/store_buffering.non_genmc.stderr @@ -3,6 +3,8 @@ error: abnormal termination: the program aborted execution | LL | std::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/shims/exit.stderr b/src/tools/miri/tests/genmc/fail/shims/exit.stderr index f27860b82fe7..c0d0321defe1 100644 --- a/src/tools/miri/tests/genmc/fail/shims/exit.stderr +++ b/src/tools/miri/tests/genmc/fail/shims/exit.stderr @@ -7,6 +7,14 @@ LL | unsafe { std::hint::unreachable_unchecked() }; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = note: this is on thread `unnamed-ID` +note: the current function got called indirectly due to this code + --> tests/genmc/fail/shims/exit.rs:LL:CC + | +LL | / std::thread::spawn(|| { +LL | | unsafe { std::hint::unreachable_unchecked() }; +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/shims/mutex_diff_thread_unlock.stderr b/src/tools/miri/tests/genmc/fail/shims/mutex_diff_thread_unlock.stderr index db465969cda8..272a52ba7fef 100644 --- a/src/tools/miri/tests/genmc/fail/shims/mutex_diff_thread_unlock.stderr +++ b/src/tools/miri/tests/genmc/fail/shims/mutex_diff_thread_unlock.stderr @@ -7,16 +7,27 @@ LL | self.lock.inner.unlock(); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/std/src/sync/poison/mutex.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::sync::MutexGuard<'_, u64>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::ptr::drop_in_place::>> - shim(Some(EvilSend>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside closure + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/std/src/sync/poison/mutex.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 3: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 4: miri_start::{closure#0} + at tests/genmc/fail/shims/mutex_diff_thread_unlock.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/fail/shims/mutex_diff_thread_unlock.rs:LL:CC | -LL | drop(guard); - | ^^^^^^^^^^^ +LL | let handle = std::thread::spawn(move || { + | __________________^ +LL | | let guard = guard; // avoid field capturing +LL | | drop(guard); +LL | | }); + | |______^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/shims/mutex_double_unlock.stderr b/src/tools/miri/tests/genmc/fail/shims/mutex_double_unlock.stderr index 3ba863668f1e..d668706f7647 100644 --- a/src/tools/miri/tests/genmc/fail/shims/mutex_double_unlock.stderr +++ b/src/tools/miri/tests/genmc/fail/shims/mutex_double_unlock.stderr @@ -7,15 +7,15 @@ LL | self.lock.inner.unlock(); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside ` as std::ops::Drop>::drop` at RUSTLIB/std/src/sync/poison/mutex.rs:LL:CC - = note: inside `std::ptr::drop_in_place::> - shim(Some(std::sync::MutexGuard<'_, u64>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC - = note: inside `std::mem::drop::>` at RUSTLIB/core/src/mem/mod.rs:LL:CC -note: inside `miri_start` - --> tests/genmc/fail/shims/mutex_double_unlock.rs:LL:CC - | -LL | drop(guard); - | ^^^^^^^^^^^ + = note: stack backtrace: + 0: as std::ops::Drop>::drop + at RUSTLIB/std/src/sync/poison/mutex.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: std::mem::drop + at RUSTLIB/core/src/mem/mod.rs:LL:CC + 3: miri_start + at tests/genmc/fail/shims/mutex_double_unlock.rs:LL:CC note: add `-Zmiri-genmc-print-genmc-output` to MIRIFLAGS to see the detailed GenMC error report diff --git a/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.relaxed4.stderr b/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.relaxed4.stderr index d6c66bf8f5c4..f7942d8ff749 100644 --- a/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.relaxed4.stderr +++ b/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.relaxed4.stderr @@ -4,6 +4,8 @@ error: abnormal termination: the program aborted execution | LL | std::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.release4.stderr b/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.release4.stderr index d6c66bf8f5c4..f7942d8ff749 100644 --- a/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.release4.stderr +++ b/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.release4.stderr @@ -4,6 +4,8 @@ error: abnormal termination: the program aborted execution | LL | std::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.sc3_rel1.stderr b/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.sc3_rel1.stderr index d6c66bf8f5c4..f7942d8ff749 100644 --- a/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.sc3_rel1.stderr +++ b/src/tools/miri/tests/genmc/fail/simple/2w2w_weak.sc3_rel1.stderr @@ -4,6 +4,8 @@ error: abnormal termination: the program aborted execution | LL | std::process::abort(); | ^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here + | + = note: this is on thread `main` note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/simple/alloc_large.multiple.stderr b/src/tools/miri/tests/genmc/fail/simple/alloc_large.multiple.stderr index 1d56614c7f03..5ddcce1fa30c 100644 --- a/src/tools/miri/tests/genmc/fail/simple/alloc_large.multiple.stderr +++ b/src/tools/miri/tests/genmc/fail/simple/alloc_large.multiple.stderr @@ -6,17 +6,19 @@ LL | AllocInit::Uninitialized => alloc.allocate(layout), | ^^^^^^^^^^^^^^^^^^^^^^ resource exhaustion occurred here | = help: in GenMC mode, the address space is limited to 4GB per thread, and addresses cannot be reused - = note: BACKTRACE: - = note: inside `alloc::raw_vec::RawVecInner::try_allocate_in` at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC - = note: inside `alloc::raw_vec::RawVecInner::with_capacity_in` at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC - = note: inside `alloc::raw_vec::RawVec::::with_capacity_in` at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC - = note: inside `std::vec::Vec::::with_capacity_in` at RUSTLIB/alloc/src/vec/mod.rs:LL:CC - = note: inside `std::vec::Vec::::with_capacity` at RUSTLIB/alloc/src/vec/mod.rs:LL:CC -note: inside `miri_start` - --> tests/genmc/fail/simple/alloc_large.rs:LL:CC - | -LL | let _v = Vec::::with_capacity(1024 * 1024 * 1024); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: alloc::raw_vec::RawVecInner::try_allocate_in + at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC + 1: alloc::raw_vec::RawVecInner::with_capacity_in + at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC + 2: alloc::raw_vec::RawVec::with_capacity_in + at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC + 3: std::vec::Vec::with_capacity_in + at RUSTLIB/alloc/src/vec/mod.rs:LL:CC + 4: std::vec::Vec::with_capacity + at RUSTLIB/alloc/src/vec/mod.rs:LL:CC + 5: miri_start + at tests/genmc/fail/simple/alloc_large.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/fail/simple/alloc_large.single.stderr b/src/tools/miri/tests/genmc/fail/simple/alloc_large.single.stderr index 8595612811fd..5ddcce1fa30c 100644 --- a/src/tools/miri/tests/genmc/fail/simple/alloc_large.single.stderr +++ b/src/tools/miri/tests/genmc/fail/simple/alloc_large.single.stderr @@ -6,17 +6,19 @@ LL | AllocInit::Uninitialized => alloc.allocate(layout), | ^^^^^^^^^^^^^^^^^^^^^^ resource exhaustion occurred here | = help: in GenMC mode, the address space is limited to 4GB per thread, and addresses cannot be reused - = note: BACKTRACE: - = note: inside `alloc::raw_vec::RawVecInner::try_allocate_in` at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC - = note: inside `alloc::raw_vec::RawVecInner::with_capacity_in` at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC - = note: inside `alloc::raw_vec::RawVec::::with_capacity_in` at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC - = note: inside `std::vec::Vec::::with_capacity_in` at RUSTLIB/alloc/src/vec/mod.rs:LL:CC - = note: inside `std::vec::Vec::::with_capacity` at RUSTLIB/alloc/src/vec/mod.rs:LL:CC -note: inside `miri_start` - --> tests/genmc/fail/simple/alloc_large.rs:LL:CC - | -LL | let _v = Vec::::with_capacity(8 * 1024 * 1024 * 1024); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: alloc::raw_vec::RawVecInner::try_allocate_in + at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC + 1: alloc::raw_vec::RawVecInner::with_capacity_in + at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC + 2: alloc::raw_vec::RawVec::with_capacity_in + at RUSTLIB/alloc/src/raw_vec/mod.rs:LL:CC + 3: std::vec::Vec::with_capacity_in + at RUSTLIB/alloc/src/vec/mod.rs:LL:CC + 4: std::vec::Vec::with_capacity + at RUSTLIB/alloc/src/vec/mod.rs:LL:CC + 5: miri_start + at tests/genmc/fail/simple/alloc_large.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.stderr b/src/tools/miri/tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.stderr index 31438f9352fe..24bde07924d1 100644 --- a/src/tools/miri/tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.stderr +++ b/src/tools/miri/tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.stderr @@ -5,18 +5,25 @@ warning: GenMC currently does not model the failure ordering for `compare_exchan LL | match KEY.compare_exchange(KEY_SENTVAL, key, Release, Acquire) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ GenMC might miss possible behaviors of this code | - = note: BACKTRACE on thread `unnamed-ID`: - = note: inside `get_or_init` at tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.rs:LL:CC -note: inside closure - --> tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.rs:LL:CC - | -LL | let key = get_or_init(0); - | ^^^^^^^^^^^^^^ - = note: inside ` as std::ops::FnOnce<()>>::call_once` at RUSTLIB/alloc/src/boxed.rs:LL:CC -note: inside `genmc::spawn_pthread_closure::thread_func::<{closure@tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.rs:LL:CC}>` + = note: this is on thread `unnamed-ID` + = note: stack backtrace: + 0: get_or_init + at tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.rs:LL:CC + 1: miri_start::{closure#0} + at tests/genmc/pass/atomics/cas_failure_ord_racy_key_init.rs:LL:CC + 2: as std::ops::FnOnce<()>>::call_once + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 3: genmc::spawn_pthread_closure::thread_func + at tests/genmc/pass/atomics/../../../utils/genmc.rs:LL:CC +note: the last function in that backtrace got called indirectly due to this code --> tests/genmc/pass/atomics/../../../utils/genmc.rs:LL:CC | -LL | f(); - | ^^^ +LL | / libc::pthread_create( +LL | | &raw mut thread_id, +LL | | attr, +LL | | thread_func::, +LL | | Box::into_raw(f) as *mut c_void, +LL | | ) + | |_________^ Verification complete with 2 executions. No errors found. diff --git a/src/tools/miri/tests/native-lib/aggregate_arguments.c b/src/tools/miri/tests/native-lib/aggregate_arguments.c index 8ad687f2aec9..e315642c13a9 100644 --- a/src/tools/miri/tests/native-lib/aggregate_arguments.c +++ b/src/tools/miri/tests/native-lib/aggregate_arguments.c @@ -24,6 +24,14 @@ EXPORT int64_t pass_struct(const PassMe pass_me) { return pass_me.value + pass_me.other_value; } +/* Test: test_return_struct */ +EXPORT PassMe return_struct(int32_t value, int64_t other_value) { + struct PassMe ret; + ret.value = value; + ret.other_value = other_value; + return ret; +} + /* Test: test_pass_struct_complex */ typedef struct Part1 { diff --git a/src/tools/miri/tests/native-lib/fail/call_function_ptr.notrace.stderr b/src/tools/miri/tests/native-lib/fail/call_function_ptr.notrace.stderr new file mode 100644 index 000000000000..faabba9ca725 --- /dev/null +++ b/src/tools/miri/tests/native-lib/fail/call_function_ptr.notrace.stderr @@ -0,0 +1,31 @@ +warning: sharing memory with a native function called via FFI + --> tests/native-lib/fail/call_function_ptr.rs:LL:CC + | +LL | call_fn_ptr(Some(nop)); + | ^^^^^^^^^^^^^^^^^^^^^^ sharing memory with a native function + | + = help: when memory is shared with a native function call, Miri stops tracking initialization and provenance for that memory + = help: in particular, Miri assumes that the native call initializes all memory it has access to + = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory + = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free + = note: stack backtrace: + 0: pass_fn_ptr + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + 1: main + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + +error: unsupported operation: calling a function pointer through the FFI boundary + --> tests/native-lib/fail/call_function_ptr.rs:LL:CC + | +LL | call_fn_ptr(Some(nop)); + | ^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here + | + = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support + = note: stack backtrace: + 0: pass_fn_ptr + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + 1: main + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + diff --git a/src/tools/miri/tests/native-lib/fail/call_function_ptr.rs b/src/tools/miri/tests/native-lib/fail/call_function_ptr.rs new file mode 100644 index 000000000000..b68c4d4062b7 --- /dev/null +++ b/src/tools/miri/tests/native-lib/fail/call_function_ptr.rs @@ -0,0 +1,21 @@ +//@revisions: trace notrace +//@[trace] only-target: x86_64-unknown-linux-gnu i686-unknown-linux-gnu +//@[trace] compile-flags: -Zmiri-native-lib-enable-tracing +//@compile-flags: -Zmiri-permissive-provenance + +fn main() { + pass_fn_ptr() +} + +fn pass_fn_ptr() { + extern "C" { + fn call_fn_ptr(s: Option); + } + + extern "C" fn nop() {} + + unsafe { + call_fn_ptr(None); // this one is fine + call_fn_ptr(Some(nop)); //~ ERROR: unsupported operation: calling a function pointer through the FFI boundary + } +} diff --git a/src/tools/miri/tests/native-lib/fail/call_function_ptr.trace.stderr b/src/tools/miri/tests/native-lib/fail/call_function_ptr.trace.stderr new file mode 100644 index 000000000000..e56a5ece782b --- /dev/null +++ b/src/tools/miri/tests/native-lib/fail/call_function_ptr.trace.stderr @@ -0,0 +1,32 @@ +warning: sharing memory with a native function called via FFI + --> tests/native-lib/fail/call_function_ptr.rs:LL:CC + | +LL | call_fn_ptr(Some(nop)); + | ^^^^^^^^^^^^^^^^^^^^^^ sharing memory with a native function + | + = help: when memory is shared with a native function call, Miri can only track initialisation and provenance on a best-effort basis + = help: in particular, Miri assumes that the native call initializes all memory it has written to + = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory + = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free + = help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here + = note: stack backtrace: + 0: pass_fn_ptr + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + 1: main + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + +error: unsupported operation: calling a function pointer through the FFI boundary + --> tests/native-lib/fail/call_function_ptr.rs:LL:CC + | +LL | call_fn_ptr(Some(nop)); + | ^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here + | + = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support + = note: stack backtrace: + 0: pass_fn_ptr + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + 1: main + at tests/native-lib/fail/call_function_ptr.rs:LL:CC + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + diff --git a/src/tools/miri/tests/native-lib/fail/invalid_retval.rs b/src/tools/miri/tests/native-lib/fail/invalid_retval.rs new file mode 100644 index 000000000000..4967866b7e7f --- /dev/null +++ b/src/tools/miri/tests/native-lib/fail/invalid_retval.rs @@ -0,0 +1,14 @@ +// Only works on Unix targets +//@ignore-target: windows wasm +//@only-on-host +//@normalize-stderr-test: "OS `.*`" -> "$$OS" + +extern "C" { + fn u8_id(x: u8) -> bool; +} + +fn main() { + unsafe { + u8_id(2); //~ ERROR: invalid value: encountered 0x02, but expected a boolean + } +} diff --git a/src/tools/miri/tests/native-lib/fail/invalid_retval.stderr b/src/tools/miri/tests/native-lib/fail/invalid_retval.stderr new file mode 100644 index 000000000000..9db29822d4f5 --- /dev/null +++ b/src/tools/miri/tests/native-lib/fail/invalid_retval.stderr @@ -0,0 +1,13 @@ +error: Undefined Behavior: constructing invalid value: encountered 0x02, but expected a boolean + --> tests/native-lib/fail/invalid_retval.rs:LL:CC + | +LL | u8_id(2); + | ^^^^^^^^ Undefined Behavior occurred here + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/native-lib/fail/tracing/partial_init.stderr b/src/tools/miri/tests/native-lib/fail/tracing/partial_init.stderr index 1c0ad2f0dc91..032461b6ed3f 100644 --- a/src/tools/miri/tests/native-lib/fail/tracing/partial_init.stderr +++ b/src/tools/miri/tests/native-lib/fail/tracing/partial_init.stderr @@ -9,13 +9,11 @@ LL | init_n(2, slice_ptr); = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free = help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here - = note: BACKTRACE: - = note: inside `partial_init` at tests/native-lib/fail/tracing/partial_init.rs:LL:CC -note: inside `main` - --> tests/native-lib/fail/tracing/partial_init.rs:LL:CC - | -LL | partial_init(); - | ^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: partial_init + at tests/native-lib/fail/tracing/partial_init.rs:LL:CC + 1: main + at tests/native-lib/fail/tracing/partial_init.rs:LL:CC error: Undefined Behavior: reading memory at ALLOC[0x2..0x3], but memory is uninitialized at [0x2..0x3], and this operation requires initialized memory --> tests/native-lib/fail/tracing/partial_init.rs:LL:CC @@ -25,13 +23,11 @@ LL | let _val = *slice_ptr.offset(2); | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `partial_init` at tests/native-lib/fail/tracing/partial_init.rs:LL:CC -note: inside `main` - --> tests/native-lib/fail/tracing/partial_init.rs:LL:CC - | -LL | partial_init(); - | ^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: partial_init + at tests/native-lib/fail/tracing/partial_init.rs:LL:CC + 1: main + at tests/native-lib/fail/tracing/partial_init.rs:LL:CC Uninitialized memory occurred at ALLOC[0x2..0x3], in this allocation: ALLOC (stack variable, size: 3, align: 1) { diff --git a/src/tools/miri/tests/native-lib/fail/tracing/unexposed_reachable_alloc.stderr b/src/tools/miri/tests/native-lib/fail/tracing/unexposed_reachable_alloc.stderr index 2d34dac1b3ff..773d2dd63c3e 100644 --- a/src/tools/miri/tests/native-lib/fail/tracing/unexposed_reachable_alloc.stderr +++ b/src/tools/miri/tests/native-lib/fail/tracing/unexposed_reachable_alloc.stderr @@ -9,13 +9,11 @@ LL | unsafe { do_one_deref(exposed) }; = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free = help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here - = note: BACKTRACE: - = note: inside `unexposed_reachable_alloc` at tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC -note: inside `main` - --> tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC - | -LL | unexposed_reachable_alloc(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: unexposed_reachable_alloc + at tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC + 1: main + at tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC error: Undefined Behavior: memory access failed: attempting to access 4 bytes, but got $HEX[noalloc] which is a dangling pointer (it has no provenance) --> tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC @@ -25,13 +23,11 @@ LL | let _not_ok = *invalid; | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information - = note: BACKTRACE: - = note: inside `unexposed_reachable_alloc` at tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC -note: inside `main` - --> tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC - | -LL | unexposed_reachable_alloc(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: unexposed_reachable_alloc + at tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC + 1: main + at tests/native-lib/fail/tracing/unexposed_reachable_alloc.rs:LL:CC note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/src/tools/miri/tests/native-lib/pass/aggregate_arguments.rs b/src/tools/miri/tests/native-lib/pass/aggregate_arguments.rs index 55acb240612f..730e9d89441a 100644 --- a/src/tools/miri/tests/native-lib/pass/aggregate_arguments.rs +++ b/src/tools/miri/tests/native-lib/pass/aggregate_arguments.rs @@ -1,6 +1,7 @@ fn main() { test_pass_struct(); test_pass_struct_complex(); + test_return_struct(); } /// Test passing a basic struct as an argument. @@ -20,6 +21,23 @@ fn test_pass_struct() { assert_eq!(unsafe { pass_struct(pass_me) }, 42 + 1337); } +fn test_return_struct() { + // Exactly two fields, so that we hit the ScalarPair case. + #[repr(C)] + struct PassMe { + value: i32, + other_value: i64, + } + + extern "C" { + fn return_struct(v: i32, ov: i64) -> PassMe; + } + + let pass_me = unsafe { return_struct(1, 2) }; + assert_eq!(pass_me.value, 1); + assert_eq!(pass_me.other_value, 2); +} + /// Test passing a more complex struct as an argument. fn test_pass_struct_complex() { #[repr(C)] diff --git a/src/tools/miri/tests/native-lib/pass/ptr_read_access.notrace.stderr b/src/tools/miri/tests/native-lib/pass/ptr_read_access.notrace.stderr index 200eba8050bb..bc2fcac08f01 100644 --- a/src/tools/miri/tests/native-lib/pass/ptr_read_access.notrace.stderr +++ b/src/tools/miri/tests/native-lib/pass/ptr_read_access.notrace.stderr @@ -8,26 +8,9 @@ LL | unsafe { print_pointer(&x) }; = help: in particular, Miri assumes that the native call initializes all memory it has access to = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free - = note: BACKTRACE: - = note: inside `test_access_pointer` at tests/native-lib/pass/ptr_read_access.rs:LL:CC -note: inside `main` - --> tests/native-lib/pass/ptr_read_access.rs:LL:CC - | -LL | test_access_pointer(); - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: sharing a function pointer with a native function called via FFI - --> tests/native-lib/pass/ptr_read_access.rs:LL:CC - | -LL | pass_fn_ptr(Some(nop)); // this one is not - | ^^^^^^^^^^^^^^^^^^^^^^ sharing a function pointer with a native function - | - = help: calling Rust functions from C is not supported and will, in the best case, crash the program - = note: BACKTRACE: - = note: inside `pass_fn_ptr` at tests/native-lib/pass/ptr_read_access.rs:LL:CC -note: inside `main` - --> tests/native-lib/pass/ptr_read_access.rs:LL:CC - | -LL | pass_fn_ptr(); - | ^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test_access_pointer + at tests/native-lib/pass/ptr_read_access.rs:LL:CC + 1: main + at tests/native-lib/pass/ptr_read_access.rs:LL:CC diff --git a/src/tools/miri/tests/native-lib/pass/ptr_read_access.trace.stderr b/src/tools/miri/tests/native-lib/pass/ptr_read_access.trace.stderr index 5c0e954deb9b..c7f30c114f16 100644 --- a/src/tools/miri/tests/native-lib/pass/ptr_read_access.trace.stderr +++ b/src/tools/miri/tests/native-lib/pass/ptr_read_access.trace.stderr @@ -9,26 +9,9 @@ LL | unsafe { print_pointer(&x) }; = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free = help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here - = note: BACKTRACE: - = note: inside `test_access_pointer` at tests/native-lib/pass/ptr_read_access.rs:LL:CC -note: inside `main` - --> tests/native-lib/pass/ptr_read_access.rs:LL:CC - | -LL | test_access_pointer(); - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: sharing a function pointer with a native function called via FFI - --> tests/native-lib/pass/ptr_read_access.rs:LL:CC - | -LL | pass_fn_ptr(Some(nop)); // this one is not - | ^^^^^^^^^^^^^^^^^^^^^^ sharing a function pointer with a native function - | - = help: calling Rust functions from C is not supported and will, in the best case, crash the program - = note: BACKTRACE: - = note: inside `pass_fn_ptr` at tests/native-lib/pass/ptr_read_access.rs:LL:CC -note: inside `main` - --> tests/native-lib/pass/ptr_read_access.rs:LL:CC - | -LL | pass_fn_ptr(); - | ^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test_access_pointer + at tests/native-lib/pass/ptr_read_access.rs:LL:CC + 1: main + at tests/native-lib/pass/ptr_read_access.rs:LL:CC diff --git a/src/tools/miri/tests/native-lib/pass/ptr_write_access.notrace.stderr b/src/tools/miri/tests/native-lib/pass/ptr_write_access.notrace.stderr index c893b0d9f656..15b2bc6df63f 100644 --- a/src/tools/miri/tests/native-lib/pass/ptr_write_access.notrace.stderr +++ b/src/tools/miri/tests/native-lib/pass/ptr_write_access.notrace.stderr @@ -8,11 +8,9 @@ LL | unsafe { increment_int(&mut x) }; = help: in particular, Miri assumes that the native call initializes all memory it has access to = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free - = note: BACKTRACE: - = note: inside `test_increment_int` at tests/native-lib/pass/ptr_write_access.rs:LL:CC -note: inside `main` - --> tests/native-lib/pass/ptr_write_access.rs:LL:CC - | -LL | test_increment_int(); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test_increment_int + at tests/native-lib/pass/ptr_write_access.rs:LL:CC + 1: main + at tests/native-lib/pass/ptr_write_access.rs:LL:CC diff --git a/src/tools/miri/tests/native-lib/pass/ptr_write_access.trace.stderr b/src/tools/miri/tests/native-lib/pass/ptr_write_access.trace.stderr index dbf021b15bec..d12a25f84b37 100644 --- a/src/tools/miri/tests/native-lib/pass/ptr_write_access.trace.stderr +++ b/src/tools/miri/tests/native-lib/pass/ptr_write_access.trace.stderr @@ -9,11 +9,9 @@ LL | unsafe { increment_int(&mut x) }; = help: Miri also assumes that any part of this memory may be a pointer that is permitted to point to arbitrary exposed memory = help: what this means is that Miri will easily miss Undefined Behavior related to incorrect usage of this shared memory, so you should not take a clean Miri run as a signal that your FFI code is UB-free = help: tracing memory accesses in native code is not yet fully implemented, so there can be further imprecisions beyond what is documented here - = note: BACKTRACE: - = note: inside `test_increment_int` at tests/native-lib/pass/ptr_write_access.rs:LL:CC -note: inside `main` - --> tests/native-lib/pass/ptr_write_access.rs:LL:CC - | -LL | test_increment_int(); - | ^^^^^^^^^^^^^^^^^^^^ + = note: stack backtrace: + 0: test_increment_int + at tests/native-lib/pass/ptr_write_access.rs:LL:CC + 1: main + at tests/native-lib/pass/ptr_write_access.rs:LL:CC diff --git a/src/tools/miri/tests/native-lib/ptr_read_access.c b/src/tools/miri/tests/native-lib/ptr_read_access.c index 5f071ca3d424..44ba13aa54a6 100644 --- a/src/tools/miri/tests/native-lib/ptr_read_access.c +++ b/src/tools/miri/tests/native-lib/ptr_read_access.c @@ -68,3 +68,10 @@ EXPORT uintptr_t do_one_deref(const int32_t ***ptr) { EXPORT void pass_fn_ptr(void f(void)) { (void)f; // suppress unused warning } + +/* Test: function_ptrs */ +EXPORT void call_fn_ptr(void f(void)) { + if (f != NULL) { + f(); + } +} diff --git a/src/tools/miri/tests/native-lib/scalar_arguments.c b/src/tools/miri/tests/native-lib/scalar_arguments.c index 10b6244bdeb4..720f1982178c 100644 --- a/src/tools/miri/tests/native-lib/scalar_arguments.c +++ b/src/tools/miri/tests/native-lib/scalar_arguments.c @@ -34,6 +34,10 @@ EXPORT float add_float(float x) { return x + 1.5f; } +EXPORT uint8_t u8_id(uint8_t x) { + return x; +} + // To test that functions not marked with EXPORT cannot be called by Miri. int32_t not_exported(void) { return 0; diff --git a/src/tools/miri/tests/panic/panic1.stderr b/src/tools/miri/tests/panic/panic1.stderr index ff7e287b5a58..d709428f3115 100644 --- a/src/tools/miri/tests/panic/panic1.stderr +++ b/src/tools/miri/tests/panic/panic1.stderr @@ -3,11 +3,11 @@ thread 'main' ($TID) panicked at tests/panic/panic1.rs:LL:CC: panicking from libstd stack backtrace: 0: std::panicking::panic_handler - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 1: std::rt::panic_fmt - at RUSTLIB/core/src/panicking.rs:LL:CC + at RUSTLIB/core/src/panicking.rs:LL:CC 2: main - at tests/panic/panic1.rs:LL:CC + at tests/panic/panic1.rs:LL:CC 3: >::call_once - shim(fn()) - at RUSTLIB/core/src/ops/function.rs:LL:CC + at RUSTLIB/core/src/ops/function.rs:LL:CC note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs index 0500ba05046c..52de8c7104c2 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs @@ -1,5 +1,6 @@ //@ignore-target: windows # File handling is not implemented yet //@ignore-target: solaris # Does not have flock +//@ignore-target: android # Does not (always?) have flock //@compile-flags: -Zmiri-disable-isolation use std::fs::File; diff --git a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs index ffbcf633b987..db68daed5396 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs @@ -5,6 +5,7 @@ use std::thread; #[path = "../../utils/libc.rs"] mod libc_utils; +use libc_utils::*; fn main() { test_pipe(); @@ -13,6 +14,7 @@ fn main() { test_pipe_array(); #[cfg(any( target_os = "linux", + target_os = "android", target_os = "illumos", target_os = "freebsd", target_os = "solaris" @@ -25,69 +27,44 @@ fn main() { fn test_pipe() { let mut fds = [-1, -1]; - let res = unsafe { libc::pipe(fds.as_mut_ptr()) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::pipe(fds.as_mut_ptr()) }); // Read size == data available in buffer. - let data = "12345".as_bytes().as_ptr(); - let res = unsafe { libc_utils::write_all(fds[1], data as *const libc::c_void, 5) }; - assert_eq!(res, 5); - let mut buf3: [u8; 5] = [0; 5]; - let res = unsafe { - libc_utils::read_all(fds[0], buf3.as_mut_ptr().cast(), buf3.len() as libc::size_t) - }; - assert_eq!(res, 5); - assert_eq!(buf3, "12345".as_bytes()); + let data = b"12345"; + write_all_from_slice(fds[1], data).unwrap(); + let buf3 = read_all_into_array::<5>(fds[0]).unwrap(); + assert_eq!(&buf3, data); // Read size > data available in buffer. - let data = "123".as_bytes(); - let res = unsafe { libc_utils::write_all(fds[1], data.as_ptr() as *const libc::c_void, 3) }; - assert_eq!(res, 3); + let data = b"123"; + write_all_from_slice(fds[1], data).unwrap(); let mut buf4: [u8; 5] = [0; 5]; - let res = unsafe { libc::read(fds[0], buf4.as_mut_ptr().cast(), buf4.len() as libc::size_t) }; - assert!(res > 0 && res <= 3); - let res = res as usize; - assert_eq!(buf4[..res], data[..res]); - if res < 3 { - // Drain the rest from the read end. - let res = unsafe { libc_utils::read_all(fds[0], buf4[res..].as_mut_ptr().cast(), 3 - res) }; - assert!(res > 0); - } + let (part1, rest) = read_into_slice(fds[0], &mut buf4).unwrap(); + assert_eq!(part1[..], data[..part1.len()]); + // Write 2 more bytes so we can exactly fill the `rest`. + write_all_from_slice(fds[1], b"34").unwrap(); + read_all_into_slice(fds[0], rest).unwrap(); } fn test_pipe_threaded() { let mut fds = [-1, -1]; - let res = unsafe { libc::pipe(fds.as_mut_ptr()) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::pipe(fds.as_mut_ptr()) }); let thread1 = thread::spawn(move || { - let mut buf: [u8; 5] = [0; 5]; - let res: i64 = unsafe { - libc_utils::read_all(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) - .try_into() - .unwrap() - }; - assert_eq!(res, 5); - assert_eq!(buf, "abcde".as_bytes()); + let buf = read_all_into_array::<5>(fds[0]).unwrap(); + assert_eq!(&buf, b"abcde"); }); thread::yield_now(); - let data = "abcde".as_bytes().as_ptr(); - let res = unsafe { libc_utils::write_all(fds[1], data as *const libc::c_void, 5) }; - assert_eq!(res, 5); + write_all_from_slice(fds[1], b"abcde").unwrap(); thread1.join().unwrap(); // Read and write from different direction let thread2 = thread::spawn(move || { thread::yield_now(); - let data = "12345".as_bytes().as_ptr(); - let res = unsafe { libc_utils::write_all(fds[1], data as *const libc::c_void, 5) }; - assert_eq!(res, 5); + write_all_from_slice(fds[1], b"12345").unwrap(); }); - let mut buf: [u8; 5] = [0; 5]; - let res = - unsafe { libc_utils::read_all(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) }; - assert_eq!(res, 5); - assert_eq!(buf, "12345".as_bytes()); + let buf = read_all_into_array::<5>(fds[0]).unwrap(); + assert_eq!(&buf, b"12345"); thread2.join().unwrap(); } @@ -96,26 +73,17 @@ fn test_pipe_threaded() { fn test_race() { static mut VAL: u8 = 0; let mut fds = [-1, -1]; - let res = unsafe { libc::pipe(fds.as_mut_ptr()) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::pipe(fds.as_mut_ptr()) }); let thread1 = thread::spawn(move || { - let mut buf: [u8; 1] = [0; 1]; // write() from the main thread will occur before the read() here // because preemption is disabled and the main thread yields after write(). - let res: i32 = unsafe { - libc_utils::read_all(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) - .try_into() - .unwrap() - }; - assert_eq!(res, 1); - assert_eq!(buf, "a".as_bytes()); + let buf = read_all_into_array::<1>(fds[0]).unwrap(); + assert_eq!(&buf, b"a"); // The read above establishes a happens-before so it is now safe to access this global variable. unsafe { assert_eq!(VAL, 1) }; }); unsafe { VAL = 1 }; - let data = "a".as_bytes().as_ptr(); - let res = unsafe { libc_utils::write_all(fds[1], data as *const libc::c_void, 1) }; - assert_eq!(res, 1); + write_all_from_slice(fds[1], b"a").unwrap(); thread::yield_now(); thread1.join().unwrap(); } @@ -133,46 +101,53 @@ fn test_pipe_array() { /// Test if pipe2 (including the O_NONBLOCK flag) is supported. #[cfg(any( target_os = "linux", + target_os = "android", target_os = "illumos", target_os = "freebsd", target_os = "solaris" ))] fn test_pipe2() { let mut fds = [-1, -1]; - let res = unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_NONBLOCK) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_NONBLOCK) }); } /// Basic test for pipe fcntl's F_SETFL and F_GETFL flag. fn test_pipe_setfl_getfl() { // Initialise pipe fds. let mut fds = [-1, -1]; - let res = unsafe { libc::pipe(fds.as_mut_ptr()) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::pipe(fds.as_mut_ptr()) }); // Both sides should either have O_RONLY or O_WRONLY. - let res = unsafe { libc::fcntl(fds[0], libc::F_GETFL) }; - assert_eq!(res, libc::O_RDONLY); - let res = unsafe { libc::fcntl(fds[1], libc::F_GETFL) }; - assert_eq!(res, libc::O_WRONLY); + assert_eq!( + errno_result(unsafe { libc::fcntl(fds[0], libc::F_GETFL) }).unwrap(), + libc::O_RDONLY + ); + assert_eq!( + errno_result(unsafe { libc::fcntl(fds[1], libc::F_GETFL) }).unwrap(), + libc::O_WRONLY + ); // Add the O_NONBLOCK flag with F_SETFL. - let res = unsafe { libc::fcntl(fds[0], libc::F_SETFL, libc::O_NONBLOCK) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::fcntl(fds[0], libc::F_SETFL, libc::O_NONBLOCK) }); // Test if the O_NONBLOCK flag is successfully added. - let res = unsafe { libc::fcntl(fds[0], libc::F_GETFL) }; - assert_eq!(res, libc::O_RDONLY | libc::O_NONBLOCK); + assert_eq!( + errno_result(unsafe { libc::fcntl(fds[0], libc::F_GETFL) }).unwrap(), + libc::O_RDONLY | libc::O_NONBLOCK + ); // The other side remains unchanged. - let res = unsafe { libc::fcntl(fds[1], libc::F_GETFL) }; - assert_eq!(res, libc::O_WRONLY); + assert_eq!( + errno_result(unsafe { libc::fcntl(fds[1], libc::F_GETFL) }).unwrap(), + libc::O_WRONLY + ); // Test if O_NONBLOCK flag can be unset. - let res = unsafe { libc::fcntl(fds[0], libc::F_SETFL, 0) }; - assert_eq!(res, 0); - let res = unsafe { libc::fcntl(fds[0], libc::F_GETFL) }; - assert_eq!(res, libc::O_RDONLY); + errno_check(unsafe { libc::fcntl(fds[0], libc::F_SETFL, 0) }); + assert_eq!( + errno_result(unsafe { libc::fcntl(fds[0], libc::F_GETFL) }).unwrap(), + libc::O_RDONLY + ); } /// Test the behaviour of F_SETFL/F_GETFL when a fd is blocking. @@ -183,28 +158,24 @@ fn test_pipe_setfl_getfl() { /// then writes to fds[1] to unblock main thread's `read`. fn test_pipe_fcntl_threaded() { let mut fds = [-1, -1]; - let res = unsafe { libc::pipe(fds.as_mut_ptr()) }; - assert_eq!(res, 0); - let mut buf: [u8; 5] = [0; 5]; + errno_check(unsafe { libc::pipe(fds.as_mut_ptr()) }); let thread1 = thread::spawn(move || { // Add O_NONBLOCK flag while pipe is still blocked on read. - let res = unsafe { libc::fcntl(fds[0], libc::F_SETFL, libc::O_NONBLOCK) }; - assert_eq!(res, 0); + errno_check(unsafe { libc::fcntl(fds[0], libc::F_SETFL, libc::O_NONBLOCK) }); // Check the new flag value while the main thread is still blocked on fds[0]. - let res = unsafe { libc::fcntl(fds[0], libc::F_GETFL) }; - assert_eq!(res, libc::O_NONBLOCK); + assert_eq!( + errno_result(unsafe { libc::fcntl(fds[0], libc::F_GETFL) }).unwrap(), + libc::O_NONBLOCK + ); // The write below will unblock the `read` in main thread: even though // the socket is now "non-blocking", the shim needs to deal correctly // with threads that were blocked before the socket was made non-blocking. - let data = "abcde".as_bytes().as_ptr(); - let res = unsafe { libc_utils::write_all(fds[1], data as *const libc::c_void, 5) }; - assert_eq!(res, 5); + write_all_from_slice(fds[1], b"abcde").unwrap(); }); // The `read` below will block. - let res = - unsafe { libc_utils::read_all(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) }; + let buf = read_all_into_array::<5>(fds[0]).unwrap(); thread1.join().unwrap(); - assert_eq!(res, 5); + assert_eq!(&buf, b"abcde"); } diff --git a/src/tools/miri/tests/pass-dep/shims/gettid.rs b/src/tools/miri/tests/pass-dep/shims/gettid.rs index b7a2fa49ef86..9d5ff0dc5dae 100644 --- a/src/tools/miri/tests/pass-dep/shims/gettid.rs +++ b/src/tools/miri/tests/pass-dep/shims/gettid.rs @@ -165,7 +165,7 @@ fn main() { // The value is not important, we only care that whatever the value is, // won't change from execution to execution. if cfg!(with_isolation) { - if cfg!(target_os = "linux") { + if cfg!(any(target_os = "linux", target_os = "android")) { // Linux starts the TID at the PID, which is 1000. assert_eq!(tid, 1000); } else { @@ -174,8 +174,8 @@ fn main() { } } - // On Linux and NetBSD, the first TID is the PID. - #[cfg(any(target_os = "linux", target_os = "netbsd"))] + // On Linux, the first TID is the PID. + #[cfg(any(target_os = "linux", target_os = "android"))] assert_eq!(tid, unsafe { libc::getpid() } as u64); #[cfg(any(target_vendor = "apple", windows))] diff --git a/src/tools/miri/tests/pass-dep/tempfile.rs b/src/tools/miri/tests/pass-dep/tempfile.rs index a44a7e7d9244..885190bd776a 100644 --- a/src/tools/miri/tests/pass-dep/tempfile.rs +++ b/src/tools/miri/tests/pass-dep/tempfile.rs @@ -7,15 +7,8 @@ mod utils; /// Test that the [`tempfile`] crate is compatible with miri for UNIX hosts and targets fn main() { - test_tempfile(); - test_tempfile_in(); -} - -fn test_tempfile() { - tempfile::tempfile().unwrap(); -} - -fn test_tempfile_in() { + // Only create a file in our own tmp folder; the "host" temp folder + // can be nonsensical for cross-tests. let dir_path = utils::tmp(); tempfile::tempfile_in(dir_path).unwrap(); } diff --git a/src/tools/miri/tests/pass/alloc-access-tracking.stderr b/src/tools/miri/tests/pass/alloc-access-tracking.stderr index 745fd89f9f54..5dfcd0180e4c 100644 --- a/src/tools/miri/tests/pass/alloc-access-tracking.stderr +++ b/src/tools/miri/tests/pass/alloc-access-tracking.stderr @@ -24,12 +24,11 @@ note: freed allocation ALLOC LL | self.1.deallocate(From::from(ptr.cast()), layout); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tracking was triggered here | - = note: BACKTRACE: - = note: inside `> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC - = note: inside `std::ptr::drop_in_place::>> - shim(Some(std::boxed::Box>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC -note: inside `main` - --> tests/pass/alloc-access-tracking.rs:LL:CC - | -LL | } - | ^ + = note: stack backtrace: + 0: > as std::ops::Drop>::drop + at RUSTLIB/alloc/src/boxed.rs:LL:CC + 1: std::ptr::drop_in_place)) + at RUSTLIB/core/src/ptr/mod.rs:LL:CC + 2: main + at tests/pass/alloc-access-tracking.rs:LL:CC diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr index 588bb85f35a4..b4ef3f76c20f 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr @@ -1,28 +1,28 @@ 0: main - at tests/pass/backtrace/backtrace-global-alloc.rs:LL:CC + at tests/pass/backtrace/backtrace-global-alloc.rs:LL:CC 1: >::call_once - shim(fn()) - at RUSTLIB/core/src/ops/function.rs:LL:CC + at RUSTLIB/core/src/ops/function.rs:LL:CC 2: std::sys::backtrace::__rust_begin_short_backtrace - at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC 3: std::rt::lang_start::{closure#0} - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC 4: std::ops::function::impls::call_once - at RUSTLIB/core/src/ops/function.rs:LL:CC + at RUSTLIB/core/src/ops/function.rs:LL:CC 5: std::panicking::catch_unwind::do_call - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 6: std::panicking::catch_unwind - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 7: std::panic::catch_unwind - at RUSTLIB/std/src/panic.rs:LL:CC + at RUSTLIB/std/src/panic.rs:LL:CC 8: std::rt::lang_start_internal::{closure#0} - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC 9: std::panicking::catch_unwind::do_call - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 10: std::panicking::catch_unwind - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 11: std::panic::catch_unwind - at RUSTLIB/std/src/panic.rs:LL:CC + at RUSTLIB/std/src/panic.rs:LL:CC 12: std::rt::lang_start_internal - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC 13: std::rt::lang_start - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr index 9c952755957b..706eacc70fd8 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr @@ -1,36 +1,36 @@ 0: func_d - at tests/pass/backtrace/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 1: func_c - at tests/pass/backtrace/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 2: func_b - at tests/pass/backtrace/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 3: func_a - at tests/pass/backtrace/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 4: main - at tests/pass/backtrace/backtrace-std.rs:LL:CC + at tests/pass/backtrace/backtrace-std.rs:LL:CC 5: >::call_once - shim(fn()) - at RUSTLIB/core/src/ops/function.rs:LL:CC + at RUSTLIB/core/src/ops/function.rs:LL:CC 6: std::sys::backtrace::__rust_begin_short_backtrace - at RUSTLIB/std/src/sys/backtrace.rs:LL:CC + at RUSTLIB/std/src/sys/backtrace.rs:LL:CC 7: std::rt::lang_start::{closure#0} - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC 8: std::ops::function::impls::call_once - at RUSTLIB/core/src/ops/function.rs:LL:CC + at RUSTLIB/core/src/ops/function.rs:LL:CC 9: std::panicking::catch_unwind::do_call - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 10: std::panicking::catch_unwind - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 11: std::panic::catch_unwind - at RUSTLIB/std/src/panic.rs:LL:CC + at RUSTLIB/std/src/panic.rs:LL:CC 12: std::rt::lang_start_internal::{closure#0} - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC 13: std::panicking::catch_unwind::do_call - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 14: std::panicking::catch_unwind - at RUSTLIB/std/src/panicking.rs:LL:CC + at RUSTLIB/std/src/panicking.rs:LL:CC 15: std::panic::catch_unwind - at RUSTLIB/std/src/panic.rs:LL:CC + at RUSTLIB/std/src/panic.rs:LL:CC 16: std::rt::lang_start_internal - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC 17: std::rt::lang_start - at RUSTLIB/std/src/rt.rs:LL:CC + at RUSTLIB/std/src/rt.rs:LL:CC diff --git a/src/tools/miri/tests/pass/issues/issue-miri-4793.rs b/src/tools/miri/tests/pass/issues/issue-miri-4793.rs new file mode 100644 index 000000000000..ccbff462f995 --- /dev/null +++ b/src/tools/miri/tests/pass/issues/issue-miri-4793.rs @@ -0,0 +1,3 @@ +fn main() { + let _ = std::panic::catch_unwind(|| Box::::from("...")); +} diff --git a/src/tools/miri/tests/pass/shims/fs.rs b/src/tools/miri/tests/pass/shims/fs.rs index 648c90b5dd97..50b5dbfba1cd 100644 --- a/src/tools/miri/tests/pass/shims/fs.rs +++ b/src/tools/miri/tests/pass/shims/fs.rs @@ -37,7 +37,7 @@ fn main() { test_canonicalize(); #[cfg(unix)] test_pread_pwrite(); - #[cfg(not(any(target_os = "solaris", target_os = "illumos")))] + #[cfg(not(any(target_os = "solaris", target_os = "android")))] test_flock(); } } @@ -399,8 +399,8 @@ fn test_pread_pwrite() { assert_eq!(&buf1, b" m"); } -// This function does seem to exist on Illumos but std does not expose it there. -#[cfg(not(any(target_os = "solaris", target_os = "illumos")))] +// The standard library does not support this operation on Solaris, Android +#[cfg(not(any(target_os = "solaris", target_os = "android")))] fn test_flock() { let bytes = b"Hello, World!\n"; let path = utils::prepare_with_content("miri_test_fs_flock.txt", bytes); diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs index f95429d59ebe..42acb6c3fb37 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs @@ -1,6 +1,6 @@ // We're testing x86 target specific features //@only-target: x86_64 i686 -//@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq +//@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq,+avx512vnni #[cfg(target_arch = "x86")] use std::arch::x86::*; @@ -13,12 +13,14 @@ fn main() { assert!(is_x86_feature_detected!("avx512vl")); assert!(is_x86_feature_detected!("avx512bitalg")); assert!(is_x86_feature_detected!("avx512vpopcntdq")); + assert!(is_x86_feature_detected!("avx512vnni")); unsafe { test_avx512(); test_avx512bitalg(); test_avx512vpopcntdq(); test_avx512ternarylogic(); + test_avx512vnni(); } } @@ -411,6 +413,101 @@ unsafe fn test_avx512ternarylogic() { test_mm_ternarylogic_epi32(); } +#[target_feature(enable = "avx512vnni")] +unsafe fn test_avx512vnni() { + #[target_feature(enable = "avx512vnni")] + unsafe fn test_mm512_dpbusd_epi32() { + const SRC: [i32; 16] = [ + 1, + // Test that addition with the `src` element uses wrapping arithmetic. + i32::MAX, + i32::MIN, + 0, + 0, + 7, + 12345, + -9876, + 0x01020304, + -1, + 42, + 0, + 1_000_000_000, + -1_000_000_000, + 17, + -17, + ]; + + // The `A` array must be interpreted as a sequence of unsigned 8-bit integers. Setting + // the high bit of a byte tests that this is implemented correctly. + const A: [i32; 16] = [ + 0x01010101, + i32::from_le_bytes([1; 4]), + i32::from_le_bytes([1; 4]), + i32::from_le_bytes([u8::MAX; 4]), + i32::from_le_bytes([u8::MAX; 4]), + 0x02_80_01_FF, + 0x00_FF_00_FF, + 0x7F_80_FF_01, + 0x10_20_30_40, + 0xDE_AD_BE_EFu32 as i32, + 0x00_00_00_FF, + 0x12_34_56_78, + 0xFF_00_FF_00u32 as i32, + 0x01_02_03_04, + 0xAA_55_AA_55u32 as i32, + 0x11_22_33_44, + ]; + + // The `B` array must be interpreted as a sequence of signed 8-bit integers. Setting + // the high bit of a byte tests that this is implemented correctly. + const B: [i32; 16] = [ + 0x01010101, + i32::from_le_bytes([1; 4]), + i32::from_le_bytes([(-1i8).cast_unsigned(); 4]), + i32::from_le_bytes([i8::MAX.cast_unsigned(); 4]), + i32::from_le_bytes([i8::MIN.cast_unsigned(); 4]), + 0xFF_01_80_7Fu32 as i32, + 0x01_FF_01_FF, + 0x80_7F_00_FFu32 as i32, + 0x7F_01_FF_80u32 as i32, + 0x01_02_03_04, + 0xFF_FF_FF_FFu32 as i32, + 0x80_00_7F_FFu32 as i32, + 0x7F_80_7F_80u32 as i32, + 0x40_C0_20_E0u32 as i32, + 0x00_01_02_03, + 0x7F_7E_80_81u32 as i32, + ]; + + const DST: [i32; 16] = [ + 5, + i32::MAX.wrapping_add(4), + i32::MIN.wrapping_add(-4), + 129540, + -130560, + 32390, + 11835, + -9877, + 16902884, + 2093, + -213, + 8498, + 1000064770, + -1000000096, + 697, + -8738, + ]; + + let src = _mm512_loadu_si512(SRC.as_ptr().cast::<__m512i>()); + let a = _mm512_loadu_si512(A.as_ptr().cast::<__m512i>()); + let b = _mm512_loadu_si512(B.as_ptr().cast::<__m512i>()); + let dst = _mm512_loadu_si512(DST.as_ptr().cast::<__m512i>()); + + assert_eq_m512i(_mm512_dpbusd_epi32(src, a, b), dst); + } + test_mm512_dpbusd_epi32(); +} + #[track_caller] unsafe fn assert_eq_m512i(a: __m512i, b: __m512i) { assert_eq!(transmute::<_, [i32; 16]>(a), transmute::<_, [i32; 16]>(b)) diff --git a/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout b/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout index 296339e73845..de7da309271d 100644 --- a/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout +++ b/src/tools/miri/tests/pass/stacked_borrows/stack-printing.stdout @@ -1,6 +1,6 @@ 0..1: [ SharedReadWrite ] 0..1: [ SharedReadWrite ] 0..1: [ SharedReadWrite ] -0..1: [ SharedReadWrite Unique Unique Unique Unique Unique Unique Unique ] -0..1: [ SharedReadWrite Disabled Disabled Disabled Disabled Disabled Disabled Disabled SharedReadOnly ] +0..1: [ SharedReadWrite Unique Unique Unique Unique Unique Unique Unique Unique Unique Unique Unique ] +0..1: [ SharedReadWrite Disabled Disabled Disabled Disabled Disabled Disabled Disabled Disabled Disabled Disabled Disabled SharedReadOnly ] 0..1: [ unknown-bottom(..) ] diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs index 8a3ab658b669..70739eef2883 100644 --- a/src/tools/miri/tests/ui.rs +++ b/src/tools/miri/tests/ui.rs @@ -255,8 +255,6 @@ regexes! { "<[0-9]+=" => " "$1", - // erase whitespace that differs between platforms - r" +at (.*\.rs)" => " at $1", // erase generics in backtraces "([0-9]+: .*)::<.*>" => "$1", // erase long hexadecimals diff --git a/src/tools/miri/tests/utils/libc.rs b/src/tools/miri/tests/utils/libc.rs index e42f39c64eb6..0765bacb6bd8 100644 --- a/src/tools/miri/tests/utils/libc.rs +++ b/src/tools/miri/tests/utils/libc.rs @@ -40,17 +40,35 @@ pub unsafe fn read_all( return read_so_far as libc::ssize_t; } +/// Try to fill the given slice by reading from `fd`. Error if that many bytes could not be read. +#[track_caller] +pub fn read_all_into_slice(fd: libc::c_int, buf: &mut [u8]) -> Result<(), libc::ssize_t> { + let res = unsafe { read_all(fd, buf.as_mut_ptr().cast(), buf.len()) }; + if res >= 0 { + assert_eq!(res as usize, buf.len()); + Ok(()) + } else { + Err(res) + } +} + /// Read exactly `N` bytes from `fd`. Error if that many bytes could not be read. #[track_caller] pub fn read_all_into_array(fd: libc::c_int) -> Result<[u8; N], libc::ssize_t> { let mut buf = [0; N]; - let res = unsafe { read_all(fd, buf.as_mut_ptr().cast(), buf.len()) }; - if res >= 0 { - assert_eq!(res as usize, buf.len()); - Ok(buf) - } else { - Err(res) - } + read_all_into_slice(fd, &mut buf)?; + Ok(buf) +} + +/// Do a single read from `fd` and return the part of the buffer that was written into, +/// and the rest. +#[track_caller] +pub fn read_into_slice( + fd: libc::c_int, + buf: &mut [u8], +) -> Result<(&mut [u8], &mut [u8]), libc::ssize_t> { + let res = unsafe { libc::read(fd, buf.as_mut_ptr().cast(), buf.len()) }; + if res >= 0 { Ok(buf.split_at_mut(res as usize)) } else { Err(res) } } pub unsafe fn write_all( diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs index 48b25f235dd6..5515dbf1940e 100644 --- a/src/tools/opt-dist/src/main.rs +++ b/src/tools/opt-dist/src/main.rs @@ -454,7 +454,6 @@ fn main() -> anyhow::Result<()> { "clippy", "miri", "rustfmt", - "gcc", "generate-copyright", "bootstrap", ] { diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index fa55805bbf21..1aacfeaf538e 100644 --- a/src/tools/opt-dist/src/tests.rs +++ b/src/tools/opt-dist/src/tests.rs @@ -123,6 +123,7 @@ llvm-config = "{llvm_config}" "tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist", "tests/ui", "tests/crashes", + "tests/rustdoc-html", ]; for test_path in env.skipped_tests() { args.extend(["--skip", test_path]); diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/lower.rs b/src/tools/rust-analyzer/crates/hir-ty/src/lower.rs index 9da32464c86f..a97d7687162e 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/lower.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/lower.rs @@ -861,7 +861,7 @@ impl<'db, 'a> TyLoweringContext<'db, 'a> { TermKind::Ty(ty) => { ty.walk().any(|arg| arg == dummy_self_ty.into()) } - // FIXME(associated_const_equality): We should walk the const instead of not doing anything + // FIXME(mgca): We should walk the const instead of not doing anything TermKind::Const(_) => false, }; diff --git a/src/tools/rust-installer/README.md b/src/tools/rust-installer/README.md index 505ffe4093fc..1f71d45a434c 100644 --- a/src/tools/rust-installer/README.md +++ b/src/tools/rust-installer/README.md @@ -49,7 +49,7 @@ To combine installers. # Future work -* Make install.sh not have to be customized, pull it's data from a +* Make install.sh not have to be customized, pull its data from a config file. * Be more resilient to installation failures, particularly if the disk is full. diff --git a/src/tools/rustbook/Cargo.lock b/src/tools/rustbook/Cargo.lock index e7b04260e4a9..941bf2829ef7 100644 --- a/src/tools/rustbook/Cargo.lock +++ b/src/tools/rustbook/Cargo.lock @@ -320,6 +320,10 @@ dependencies = [ "syn", ] +[[package]] +name = "diagnostics" +version = "0.0.0" + [[package]] name = "digest" version = "0.10.7" @@ -464,6 +468,16 @@ dependencies = [ "wasip2", ] +[[package]] +name = "grammar" +version = "0.0.0" +dependencies = [ + "diagnostics", + "pathdiff", + "regex", + "walkdir", +] + [[package]] name = "handlebars" version = "6.3.2" @@ -774,9 +788,11 @@ dependencies = [ [[package]] name = "mdbook-spec" -version = "0.1.2" +version = "0.0.0" dependencies = [ "anyhow", + "diagnostics", + "grammar", "mdbook-markdown", "mdbook-preprocessor", "once_cell", diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index 2815f09105b1..6f28ebe51931 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -11,6 +11,6 @@ edition = "2021" clap = { version = "4.0.32", features = ["cargo"] } mdbook-driver = { version = "0.5.2", features = ["search"] } mdbook-i18n-helpers = "0.4.0" -mdbook-spec = { path = "../../doc/reference/mdbook-spec" } +mdbook-spec = { path = "../../doc/reference/tools/mdbook-spec" } mdbook-trpl = { path = "../../doc/book/packages/mdbook-trpl" } tracing-subscriber = { version = "0.3.20", features = ["env-filter"] } diff --git a/src/tools/rustfmt/src/attr.rs b/src/tools/rustfmt/src/attr.rs index 381c938ae806..d03d33514046 100644 --- a/src/tools/rustfmt/src/attr.rs +++ b/src/tools/rustfmt/src/attr.rs @@ -336,8 +336,8 @@ impl Rewrite for ast::Attribute { rewrite_doc_comment(snippet, shape.comment(context.config), context.config) } else { let should_skip = self - .ident() - .map(|s| context.skip_context.attributes.skip(s.name.as_str())) + .name() + .map(|s| context.skip_context.attributes.skip(s.as_str())) .unwrap_or(false); let prefix = attr_prefix(self); diff --git a/src/tools/rustfmt/src/items.rs b/src/tools/rustfmt/src/items.rs index d1778f324c6a..c9e32492c50b 100644 --- a/src/tools/rustfmt/src/items.rs +++ b/src/tools/rustfmt/src/items.rs @@ -971,7 +971,7 @@ fn format_impl_ref_and_type( result.push_str(format_defaultness(of_trait.defaultness)); result.push_str(format_safety(of_trait.safety)); } else { - result.push_str(format_constness_right(*constness)); + result.push_str(format_constness(*constness)); } let shape = if context.config.style_edition() >= StyleEdition::Edition2024 { diff --git a/src/tools/rustfmt/tests/source/cfg_if/detect/os/x86.rs b/src/tools/rustfmt/tests/source/cfg_if/detect/os/x86.rs index b9adc67221ae..8b45a5bbd269 100644 --- a/src/tools/rustfmt/tests/source/cfg_if/detect/os/x86.rs +++ b/src/tools/rustfmt/tests/source/cfg_if/detect/os/x86.rs @@ -66,13 +66,13 @@ fn detect_features() -> cache::Initializer { ecx: proc_info_ecx, edx: proc_info_edx, .. - } = unsafe { __cpuid(0x0000_0001_u32) }; + } = __cpuid(0x0000_0001_u32); // EAX = 7, ECX = 0: Queries "Extended Features"; // Contains information about bmi,bmi2, and avx2 support. let (extended_features_ebx, extended_features_ecx) = if max_basic_leaf >= 7 { - let CpuidResult { ebx, ecx, .. } = unsafe { __cpuid(0x0000_0007_u32) }; + let CpuidResult { ebx, ecx, .. } = __cpuid(0x0000_0007_u32); (ebx, ecx) } else { (0, 0) // CPUID does not support "Extended Features" @@ -84,12 +84,12 @@ fn detect_features() -> cache::Initializer { let CpuidResult { eax: extended_max_basic_leaf, .. - } = unsafe { __cpuid(0x8000_0000_u32) }; + } = __cpuid(0x8000_0000_u32); // EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature // Bits" let extended_proc_info_ecx = if extended_max_basic_leaf >= 1 { - let CpuidResult { ecx, .. } = unsafe { __cpuid(0x8000_0001_u32) }; + let CpuidResult { ecx, .. } = __cpuid(0x8000_0001_u32); ecx } else { 0 @@ -182,7 +182,7 @@ fn detect_features() -> cache::Initializer { let CpuidResult { eax: proc_extended_state1_eax, .. - } = unsafe { __cpuid_count(0xd_u32, 1) }; + } = __cpuid_count(0xd_u32, 1); enable(proc_extended_state1_eax, 0, Feature::xsaveopt); enable(proc_extended_state1_eax, 1, Feature::xsavec); enable(proc_extended_state1_eax, 3, Feature::xsaves); diff --git a/src/tools/rustfmt/tests/source/const_trait.rs b/src/tools/rustfmt/tests/source/const_trait.rs new file mode 100644 index 000000000000..99414a74f250 --- /dev/null +++ b/src/tools/rustfmt/tests/source/const_trait.rs @@ -0,0 +1,14 @@ +#![feature(trait_alias, const_trait_impl)] + +const trait Bar {} + +const trait Foo = Bar; + +impl const Bar for () {} + +// const impl gets reformatted to impl const.. for now +const impl Bar for u8 {} + +struct X; + +const impl X {} diff --git a/src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs b/src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs index 944b51615f8e..fb7136d83911 100644 --- a/src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs +++ b/src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs @@ -66,12 +66,12 @@ fn detect_features() -> cache::Initializer { ecx: proc_info_ecx, edx: proc_info_edx, .. - } = unsafe { __cpuid(0x0000_0001_u32) }; + } = __cpuid(0x0000_0001_u32); // EAX = 7, ECX = 0: Queries "Extended Features"; // Contains information about bmi,bmi2, and avx2 support. let (extended_features_ebx, extended_features_ecx) = if max_basic_leaf >= 7 { - let CpuidResult { ebx, ecx, .. } = unsafe { __cpuid(0x0000_0007_u32) }; + let CpuidResult { ebx, ecx, .. } = __cpuid(0x0000_0007_u32); (ebx, ecx) } else { (0, 0) // CPUID does not support "Extended Features" @@ -83,12 +83,12 @@ fn detect_features() -> cache::Initializer { let CpuidResult { eax: extended_max_basic_leaf, .. - } = unsafe { __cpuid(0x8000_0000_u32) }; + } = __cpuid(0x8000_0000_u32); // EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature // Bits" let extended_proc_info_ecx = if extended_max_basic_leaf >= 1 { - let CpuidResult { ecx, .. } = unsafe { __cpuid(0x8000_0001_u32) }; + let CpuidResult { ecx, .. } = __cpuid(0x8000_0001_u32); ecx } else { 0 @@ -181,7 +181,7 @@ fn detect_features() -> cache::Initializer { let CpuidResult { eax: proc_extended_state1_eax, .. - } = unsafe { __cpuid_count(0xd_u32, 1) }; + } = __cpuid_count(0xd_u32, 1); enable(proc_extended_state1_eax, 0, Feature::xsaveopt); enable(proc_extended_state1_eax, 1, Feature::xsavec); enable(proc_extended_state1_eax, 3, Feature::xsaves); diff --git a/src/tools/rustfmt/tests/target/const_trait.rs b/src/tools/rustfmt/tests/target/const_trait.rs index c4c88b17fc50..337a4cf4140e 100644 --- a/src/tools/rustfmt/tests/target/const_trait.rs +++ b/src/tools/rustfmt/tests/target/const_trait.rs @@ -3,3 +3,12 @@ const trait Bar {} const trait Foo = Bar; + +impl const Bar for () {} + +// const impl gets reformatted to impl const.. for now +impl const Bar for u8 {} + +struct X; + +const impl X {} diff --git a/src/tools/test-float-parse/README.md b/src/tools/test-float-parse/README.md index 5e2c43d1cad6..ac9cbe5d28a2 100644 --- a/src/tools/test-float-parse/README.md +++ b/src/tools/test-float-parse/README.md @@ -36,7 +36,7 @@ For each test case, the following is done: representation with infinite precision. - The rational value then gets checked that it is within the float's representable values (absolute value greater than the smallest number to round - to zero, but less less than the first value to round to infinity). If these + to zero, but less than the first value to round to infinity). If these limits are exceeded, check that the parsed float reflects that. - For real nonzero numbers, the parsed float is converted into a rational using `significand * 2^exponent`. It is then checked against the actual rational diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml index 47b59543c59c..cbf27ea87a07 100644 --- a/src/tools/tidy/Cargo.toml +++ b/src/tools/tidy/Cargo.toml @@ -8,6 +8,7 @@ autobins = false build_helper = { path = "../../build_helper" } cargo_metadata = "0.21" regex = "1" +globset = "0.4.18" miropt-test-tools = { path = "../miropt-test-tools" } walkdir = "2" ignore = "0.4.18" diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 1a9a3401ab16..24c610b41f3a 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -466,7 +466,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "unicode-script", "unicode-security", "unicode-width", - "unicode-xid", "utf8parse", "valuable", "version_check", diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index 08061bd834e3..43e6c18382af 100644 --- a/src/tools/tidy/src/features.rs +++ b/src/tools/tidy/src/features.rs @@ -107,7 +107,7 @@ pub fn check( &tests_path.join("ui"), &tests_path.join("ui-fulldeps"), &tests_path.join("rustdoc-ui"), - &tests_path.join("rustdoc"), + &tests_path.join("rustdoc-html"), ], |path, _is_dir| { filter_dirs(path) diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs index e5945a72d32a..e6423aeeba99 100644 --- a/src/tools/tidy/src/pal.rs +++ b/src/tools/tidy/src/pal.rs @@ -24,7 +24,6 @@ //! - `sys/` //! - `os/` //! -//! `std/sys_common` should _not_ contain platform-specific code. //! Finally, because std contains tests with platform-specific //! `ignore` attributes, once the parser encounters `mod tests`, //! platform-specific cfgs are allowed. Not sure yet how to deal with diff --git a/src/tools/tidy/src/triagebot.rs b/src/tools/tidy/src/triagebot.rs index 01401c94d730..59cd9d80b07a 100644 --- a/src/tools/tidy/src/triagebot.rs +++ b/src/tools/tidy/src/triagebot.rs @@ -1,5 +1,6 @@ //! Tidy check to ensure paths mentioned in triagebot.toml exist in the project. +use std::collections::HashSet; use std::path::Path; use toml::Value; @@ -22,6 +23,9 @@ pub fn check(path: &Path, tidy_ctx: TidyCtx) { // Check [mentions."*"] sections, i.e. [mentions."compiler/rustc_const_eval/src/"] if let Some(Value::Table(mentions)) = config.get("mentions") { + let mut builder = globset::GlobSetBuilder::new(); + let mut glob_entries = Vec::new(); + for (entry_key, entry_val) in mentions.iter() { // If the type is set to something other than "filename", then this is not a path. if entry_val.get("type").is_some_and(|t| t.as_str().unwrap_or_default() != "filename") { @@ -33,8 +37,37 @@ pub fn check(path: &Path, tidy_ctx: TidyCtx) { let full_path = path.join(clean_path); if !full_path.exists() { + // The full-path doesn't exists, maybe it's a glob, let's add it to the glob set builder + // to be checked against all the file and directories in the repository. + builder.add(globset::Glob::new(&format!("{clean_path}*")).unwrap()); + glob_entries.push(clean_path.to_string()); + } + } + + let gs = builder.build().unwrap(); + + let mut found = HashSet::new(); + let mut matches = Vec::new(); + + // Walk the entire repository and match any entry against the remaining paths + for entry in ignore::WalkBuilder::new(path).build().flatten() { + // Strip the prefix as mentions entries are always relative to the repo + let entry_path = entry.path().strip_prefix(path).unwrap(); + + // Find the matches and add them to the found set + gs.matches_into(entry_path, &mut matches); + found.extend(matches.iter().copied()); + + // Early-exist if all the globs have been matched + if found.len() == glob_entries.len() { + break; + } + } + + for (i, clean_path) in glob_entries.iter().enumerate() { + if !found.contains(&i) { check.error(format!( - "triagebot.toml [mentions.*] contains path '{clean_path}' which doesn't exist" + "triagebot.toml [mentions.*] contains '{clean_path}' which doesn't match any file or directory in the repository" )); } } diff --git a/src/tools/unicode-table-generator/src/case_mapping.rs b/src/tools/unicode-table-generator/src/case_mapping.rs index 49aef3ec33ec..437e1e47dd70 100644 --- a/src/tools/unicode-table-generator/src/case_mapping.rs +++ b/src/tools/unicode-table-generator/src/case_mapping.rs @@ -91,7 +91,8 @@ pub fn to_lower(c: char) -> [char; 3] { LOWERCASE_TABLE .binary_search_by(|&(key, _)| key.cmp(&c)) .map(|i| { - let u = LOWERCASE_TABLE[i].1; + // SAFETY: i is the result of the binary search + let u = unsafe { LOWERCASE_TABLE.get_unchecked(i) }.1; char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| { // SAFETY: Index comes from statically generated table unsafe { *LOWERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) } @@ -108,7 +109,8 @@ pub fn to_upper(c: char) -> [char; 3] { UPPERCASE_TABLE .binary_search_by(|&(key, _)| key.cmp(&c)) .map(|i| { - let u = UPPERCASE_TABLE[i].1; + // SAFETY: i is the result of the binary search + let u = unsafe { UPPERCASE_TABLE.get_unchecked(i) }.1; char::from_u32(u).map(|c| [c, '\0', '\0']).unwrap_or_else(|| { // SAFETY: Index comes from statically generated table unsafe { *UPPERCASE_TABLE_MULTI.get_unchecked((u & (INDEX_MASK - 1)) as usize) } diff --git a/src/tools/wasm-component-ld/Cargo.toml b/src/tools/wasm-component-ld/Cargo.toml index 744b67c17f65..2d44358c7433 100644 --- a/src/tools/wasm-component-ld/Cargo.toml +++ b/src/tools/wasm-component-ld/Cargo.toml @@ -10,4 +10,4 @@ name = "wasm-component-ld" path = "src/main.rs" [dependencies] -wasm-component-ld = "0.5.19" +wasm-component-ld = "0.5.20" diff --git a/tests/assembly-llvm/asm/s390x-types.rs b/tests/assembly-llvm/asm/s390x-types.rs index 24db91bf7772..10e2966ace0a 100644 --- a/tests/assembly-llvm/asm/s390x-types.rs +++ b/tests/assembly-llvm/asm/s390x-types.rs @@ -6,8 +6,9 @@ //@[s390x_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector //@[s390x_vector] needs-llvm-components: systemz //@ compile-flags: -Zmerge-functions=disabled +//@ min-llvm-version: 21 -#![feature(no_core, repr_simd, f128)] +#![feature(no_core, repr_simd, f16, f128)] #![cfg_attr(s390x_vector, feature(asm_experimental_reg))] #![crate_type = "rlib"] #![no_core] @@ -27,6 +28,8 @@ pub struct i32x4([i32; 4]); #[repr(simd)] pub struct i64x2([i64; 2]); #[repr(simd)] +pub struct f16x8([f16; 8]); +#[repr(simd)] pub struct f32x4([f32; 4]); #[repr(simd)] pub struct f64x2([f64; 2]); @@ -35,6 +38,7 @@ impl Copy for i8x16 {} impl Copy for i16x8 {} impl Copy for i32x4 {} impl Copy for i64x2 {} +impl Copy for f16x8 {} impl Copy for f32x4 {} impl Copy for f64x2 {} @@ -127,6 +131,12 @@ check!(reg_i32_addr, i32, reg_addr, "lgr"); // CHECK: #NO_APP check!(reg_i64_addr, i64, reg_addr, "lgr"); +// CHECK-LABEL: reg_f16: +// CHECK: #APP +// CHECK: ler %f{{[0-9]+}}, %f{{[0-9]+}} +// CHECK: #NO_APP +check!(reg_f16, f16, freg, "ler"); + // CHECK-LABEL: reg_f32: // CHECK: #APP // CHECK: ler %f{{[0-9]+}}, %f{{[0-9]+}} @@ -173,6 +183,13 @@ check!(vreg_i32x4, i32x4, vreg, "vlr"); #[cfg(s390x_vector)] check!(vreg_i64x2, i64x2, vreg, "vlr"); +// s390x_vector-LABEL: vreg_f16x8: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f16x8, f16x8, vreg, "vlr"); + // s390x_vector-LABEL: vreg_f32x4: // s390x_vector: #APP // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} @@ -208,6 +225,13 @@ check!(vreg_i64, i64, vreg, "vlr"); #[cfg(s390x_vector)] check!(vreg_i128, i128, vreg, "vlr"); +// s390x_vector-LABEL: vreg_f16: +// s390x_vector: #APP +// s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check!(vreg_f16, f16, vreg, "vlr"); + // s390x_vector-LABEL: vreg_f32: // s390x_vector: #APP // s390x_vector: vlr %v{{[0-9]+}}, %v{{[0-9]+}} @@ -253,6 +277,12 @@ check_reg!(r0_i32, i32, "r0", "lr"); // CHECK: #NO_APP check_reg!(r0_i64, i64, "r0", "lr"); +// CHECK-LABEL: f0_f16: +// CHECK: #APP +// CHECK: ler %f0, %f0 +// CHECK: #NO_APP +check_reg!(f0_f16, f16, "f0", "ler"); + // CHECK-LABEL: f0_f32: // CHECK: #APP // CHECK: ler %f0, %f0 @@ -293,6 +323,13 @@ check_reg!(v0_i32x4, i32x4, "v0", "vlr"); #[cfg(s390x_vector)] check_reg!(v0_i64x2, i64x2, "v0", "vlr"); +// s390x_vector-LABEL: v0_f16x8: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f16x8, f16x8, "v0", "vlr"); + // s390x_vector-LABEL: v0_f32x4: // s390x_vector: #APP // s390x_vector: vlr %v0, %v0 @@ -328,6 +365,13 @@ check_reg!(v0_i64, i64, "v0", "vlr"); #[cfg(s390x_vector)] check_reg!(v0_i128, i128, "v0", "vlr"); +// s390x_vector-LABEL: v0_f16: +// s390x_vector: #APP +// s390x_vector: vlr %v0, %v0 +// s390x_vector: #NO_APP +#[cfg(s390x_vector)] +check_reg!(v0_f16, f16, "v0", "vlr"); + // s390x_vector-LABEL: v0_f32: // s390x_vector: #APP // s390x_vector: vlr %v0, %v0 diff --git a/tests/assembly-llvm/naked-functions/aix.rs b/tests/assembly-llvm/naked-functions/aix.rs index 3cc84fa0c9c6..8391331d8341 100644 --- a/tests/assembly-llvm/naked-functions/aix.rs +++ b/tests/assembly-llvm/naked-functions/aix.rs @@ -9,7 +9,7 @@ //@[aix] needs-llvm-components: powerpc #![crate_type = "lib"] -#![feature(no_core, asm_experimental_arch, f128, linkage, fn_align)] +#![feature(no_core, asm_experimental_arch)] #![no_core] // tests that naked functions work for the `powerpc64-ibm-aix` target. diff --git a/tests/assembly-llvm/naked-functions/hidden.rs b/tests/assembly-llvm/naked-functions/hidden.rs new file mode 100644 index 000000000000..7686dbab07fb --- /dev/null +++ b/tests/assembly-llvm/naked-functions/hidden.rs @@ -0,0 +1,41 @@ +//@ revisions: macos-x86 macos-aarch64 linux-x86 +//@ add-minicore +//@ assembly-output: emit-asm +// +//@[macos-aarch64] compile-flags: --target aarch64-apple-darwin +//@[macos-aarch64] needs-llvm-components: aarch64 +// +//@[macos-x86] compile-flags: --target x86_64-apple-darwin +//@[macos-x86] needs-llvm-components: x86 +// +//@[linux-x86] compile-flags: --target x86_64-unknown-linux-gnu +//@[linux-x86] needs-llvm-components: x86 + +#![crate_type = "lib"] +#![feature(no_core, asm_experimental_arch)] +#![no_core] + +// Tests that naked functions that are not externally linked (e.g. via `no_mangle`) +// are marked as `Visibility::Hidden` and emit `.private_extern` or `.hidden`. +// +// Without this directive, LTO may fail because the symbol is not visible. +// See also https://github.com/rust-lang/rust/issues/148307. + +extern crate minicore; +use minicore::*; + +// CHECK: .p2align 2 +// macos-x86,macos-aarch64: .private_extern +// linux-x86: .globl +// linux-x86: .hidden +// CHECK: ret +#[unsafe(naked)] +extern "C" fn ret() { + naked_asm!("ret") +} + +// CHECK-LABEL: entry +#[no_mangle] +pub fn entry() { + ret() +} diff --git a/tests/codegen-llvm/gpu_offload/control_flow.rs b/tests/codegen-llvm/gpu_offload/control_flow.rs new file mode 100644 index 000000000000..28ee9c85b0ed --- /dev/null +++ b/tests/codegen-llvm/gpu_offload/control_flow.rs @@ -0,0 +1,42 @@ +//@ compile-flags: -Zoffload=Test -Zunstable-options -C opt-level=3 -Clto=fat +//@ no-prefer-dynamic +//@ needs-offload + +// This test verifies that the offload intrinsic is correctly lowered even when the caller +// contains control flow. + +#![feature(abi_gpu_kernel)] +#![feature(rustc_attrs)] +#![feature(core_intrinsics)] +#![no_main] + +// CHECK: define{{( dso_local)?}} void @main() +// CHECK-NOT: define +// CHECK: %EmptyDesc = alloca %struct.__tgt_bin_desc, align 8 +// CHECK-NEXT: %.offload_baseptrs = alloca [1 x ptr], align 8 +// CHECK-NEXT: %.offload_ptrs = alloca [1 x ptr], align 8 +// CHECK-NEXT: %.offload_sizes = alloca [1 x i64], align 8 +// CHECK-NEXT: %kernel_args = alloca %struct.__tgt_kernel_arguments, align 8 +// CHECK: br label %bb3 +// CHECK-NOT define +// CHECK: bb3 +// CHECK: call void @__tgt_target_data_begin_mapper(ptr nonnull @anon.{{.*}}.1, i64 -1, i32 1, ptr nonnull %.offload_baseptrs, ptr nonnull %.offload_ptrs, ptr nonnull %.offload_sizes, ptr nonnull @.offload_maptypes.foo, ptr null, ptr null) +// CHECK: %10 = call i32 @__tgt_target_kernel(ptr nonnull @anon.{{.*}}.1, i64 -1, i32 256, i32 32, ptr nonnull @.foo.region_id, ptr nonnull %kernel_args) +// CHECK-NEXT: call void @__tgt_target_data_end_mapper(ptr nonnull @anon.{{.*}}.1, i64 -1, i32 1, ptr nonnull %.offload_baseptrs, ptr nonnull %.offload_ptrs, ptr nonnull %.offload_sizes, ptr nonnull @.offload_maptypes.foo, ptr null, ptr null) +#[unsafe(no_mangle)] +unsafe fn main() { + let A = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]; + + for i in 0..100 { + core::intrinsics::offload::<_, _, ()>( + foo, + [256, 1, 1], + [32, 1, 1], + (A.as_ptr() as *const [f32; 6],), + ); + } +} + +unsafe extern "C" { + pub fn foo(A: *const [f32; 6]) -> (); +} diff --git a/tests/codegen-llvm/gpu_offload/gpu_host.rs b/tests/codegen-llvm/gpu_offload/gpu_host.rs index ac179a65828d..dcbd65b14427 100644 --- a/tests/codegen-llvm/gpu_offload/gpu_host.rs +++ b/tests/codegen-llvm/gpu_offload/gpu_host.rs @@ -1,15 +1,10 @@ -//@ compile-flags: -Zoffload=Enable -Zunstable-options -C opt-level=3 -Clto=fat +//@ compile-flags: -Zoffload=Test -Zunstable-options -C opt-level=3 -Clto=fat //@ no-prefer-dynamic -//@ needs-enzyme +//@ needs-offload // This test is verifying that we generate __tgt_target_data_*_mapper before and after a call to the // kernel_1. Better documentation to what each global or variable means is available in the gpu -// offlaod code, or the LLVM offload documentation. This code does not launch any GPU kernels yet, -// and will be rewritten once a proper offload frontend has landed. -// -// We currently only handle memory transfer for specific calls to functions named `kernel_{num}`, -// when inside of a function called main. This, too, is a temporary workaround for not having a -// frontend. +// offload code, or the LLVM offload documentation. #![feature(rustc_attrs)] #![feature(core_intrinsics)] @@ -22,6 +17,20 @@ fn main() { core::hint::black_box(&x); } +#[unsafe(no_mangle)] +#[inline(never)] +pub fn kernel_1(x: &mut [f32; 256]) { + core::intrinsics::offload(_kernel_1, [256, 1, 1], [32, 1, 1], (x,)) +} + +#[unsafe(no_mangle)] +#[inline(never)] +pub fn _kernel_1(x: &mut [f32; 256]) { + for i in 0..256 { + x[i] = 21.0; + } +} + // CHECK: %struct.ident_t = type { i32, i32, i32, i32, ptr } // CHECK: %struct.__tgt_offload_entry = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr } // CHECK: %struct.__tgt_bin_desc = type { i32, ptr, ptr, ptr } @@ -36,8 +45,9 @@ fn main() { // CHECK: @.offloading.entry_name._kernel_1 = internal unnamed_addr constant [10 x i8] c"_kernel_1\00", section ".llvm.rodata.offloading", align 1 // CHECK: @.offloading.entry._kernel_1 = internal constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @._kernel_1.region_id, ptr @.offloading.entry_name._kernel_1, i64 0, i64 0, ptr null }, section "llvm_offload_entries", align 8 -// CHECK: Function Attrs: nounwind // CHECK: declare i32 @__tgt_target_kernel(ptr, i64, i32, i32, ptr, ptr) +// CHECK: declare void @__tgt_register_lib(ptr) local_unnamed_addr +// CHECK: declare void @__tgt_unregister_lib(ptr) local_unnamed_addr // CHECK: define{{( dso_local)?}} void @main() // CHECK-NEXT: start: @@ -82,29 +92,15 @@ fn main() { // CHECK-NEXT: %5 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 40 // CHECK-NEXT: %6 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 72 // CHECK-NEXT: call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %5, i8 0, i64 32, i1 false) -// CHECK-NEXT: store <4 x i32> , ptr %6, align 8 -// CHECK-NEXT: %.fca.1.gep3 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 88 -// CHECK-NEXT: store i32 0, ptr %.fca.1.gep3, align 8 -// CHECK-NEXT: %.fca.2.gep4 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 92 -// CHECK-NEXT: store i32 0, ptr %.fca.2.gep4, align 4 +// CHECK-NEXT: store <4 x i32> , ptr %6, align 8 +// CHECK-NEXT: %.fca.1.gep5 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 88 +// CHECK-NEXT: store i32 1, ptr %.fca.1.gep5, align 8 +// CHECK-NEXT: %.fca.2.gep7 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 92 +// CHECK-NEXT: store i32 1, ptr %.fca.2.gep7, align 4 // CHECK-NEXT: %7 = getelementptr inbounds nuw i8, ptr %kernel_args, i64 96 // CHECK-NEXT: store i32 0, ptr %7, align 8 -// CHECK-NEXT: %8 = call i32 @__tgt_target_kernel(ptr nonnull @anon.{{.*}}.1, i64 -1, i32 2097152, i32 256, ptr nonnull @._kernel_1.region_id, ptr nonnull %kernel_args) +// CHECK-NEXT: %8 = call i32 @__tgt_target_kernel(ptr nonnull @anon.{{.*}}.1, i64 -1, i32 256, i32 32, ptr nonnull @._kernel_1.region_id, ptr nonnull %kernel_args) // CHECK-NEXT: call void @__tgt_target_data_end_mapper(ptr nonnull @anon.{{.*}}.1, i64 -1, i32 1, ptr nonnull %.offload_baseptrs, ptr nonnull %.offload_ptrs, ptr nonnull %.offload_sizes, ptr nonnull @.offload_maptypes._kernel_1, ptr null, ptr null) // CHECK-NEXT: call void @__tgt_unregister_lib(ptr nonnull %EmptyDesc) // CHECK-NEXT: ret void // CHECK-NEXT: } - -#[unsafe(no_mangle)] -#[inline(never)] -pub fn kernel_1(x: &mut [f32; 256]) { - core::intrinsics::offload(_kernel_1, (x,)) -} - -#[unsafe(no_mangle)] -#[inline(never)] -pub fn _kernel_1(x: &mut [f32; 256]) { - for i in 0..256 { - x[i] = 21.0; - } -} diff --git a/tests/codegen-llvm/intrinsics/likely_assert.rs b/tests/codegen-llvm/intrinsics/likely_assert.rs index 87ffb4ee3fb6..59a40c750eab 100644 --- a/tests/codegen-llvm/intrinsics/likely_assert.rs +++ b/tests/codegen-llvm/intrinsics/likely_assert.rs @@ -1,17 +1,31 @@ //@ compile-flags: -Copt-level=3 +#![feature(panic_internals, const_eval_select, rustc_allow_const_fn_unstable, core_intrinsics)] #![crate_type = "lib"] +// check that assert! and const_assert! emit branch weights + #[no_mangle] pub fn test_assert(x: bool) { assert!(x); } -// check that assert! emits branch weights - // CHECK-LABEL: @test_assert( // CHECK: br i1 %x, label %bb2, label %bb1, !prof ![[NUM:[0-9]+]] // CHECK: bb1: // CHECK: panic // CHECK: bb2: // CHECK: ret void + +#[no_mangle] +pub fn test_const_assert(x: bool) { + core::panic::const_assert!(x, "", "",); +} + +// CHECK-LABEL: @test_const_assert( +// CHECK: br i1 %x, label %bb2, label %bb1, !prof ![[NUM:[0-9]+]] +// CHECK: bb1: +// CHECK: panic +// CHECK: bb2: +// CHECK: ret void + // CHECK: ![[NUM]] = !{!"branch_weights", {{(!"expected", )?}}i32 2000, i32 1} diff --git a/tests/codegen-llvm/issues/multiple-option-or-permutations.rs b/tests/codegen-llvm/issues/multiple-option-or-permutations.rs new file mode 100644 index 000000000000..9ec4ec8eeb15 --- /dev/null +++ b/tests/codegen-llvm/issues/multiple-option-or-permutations.rs @@ -0,0 +1,174 @@ +// Tests output of multiple permutations of `Option::or` +//@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled + +#![crate_type = "lib"] + +use std::num::NonZero; + +// CHECK-LABEL: @or_match_u8 +// CHECK-SAME: (i1{{.+}}%0, i8 %1, i1{{.+}}%optb.0, i8 %optb.1) +#[no_mangle] +pub fn or_match_u8(opta: Option, optb: Option) -> Option { + // CHECK: start: + // CHECK-DAG: [[A_OR_B:%.+]] = select i1 %0, i8 %1, i8 %optb.1 + // CHECK-DAG: [[IS_SOME:%.+]] = or i1 {{%0, %optb.0|%optb.0, %0}} + // CHECK-NEXT: [[FLAG:%.+]] = insertvalue { i1, i8 } poison, i1 [[IS_SOME]], 0 + // CHECK-NEXT: [[R:%.+]] = insertvalue { i1, i8 } [[FLAG]], i8 [[A_OR_B]], 1 + // CHECK: ret { i1, i8 } [[R]] + match opta { + Some(x) => Some(x), + None => optb, + } +} + +// CHECK-LABEL: @or_match_alt_u8 +// CHECK-SAME: (i1{{.+}}%opta.0, i8 %opta.1, i1{{.+}}%optb.0, i8 %optb.1) +#[no_mangle] +pub fn or_match_alt_u8(opta: Option, optb: Option) -> Option { + // CHECK: start: + // CHECK-DAG: [[A_OR_B:%.+]] = select i1 %opta.0, i8 %opta.1, i8 %optb.1 + // CHECK-DAG: [[IS_SOME:%.+]] = or i1 {{%opta.0, %optb.0|%optb.0, %opta.0}} + // CHECK-NEXT: [[FLAG:%.+]] = insertvalue { i1, i8 } poison, i1 [[IS_SOME]], 0 + // CHECK-NEXT: [[R:%.+]] = insertvalue { i1, i8 } [[FLAG]], i8 [[A_OR_B]], 1 + // CHECK: ret { i1, i8 } [[R]] + match opta { + Some(_) => opta, + None => optb, + } +} + +// CHECK-LABEL: @option_or_u8 +// CHECK-SAME: (i1{{.+}}%opta.0, i8 %opta.1, i1{{.+}}%optb.0, i8 %optb.1) +#[no_mangle] +pub fn option_or_u8(opta: Option, optb: Option) -> Option { + // CHECK: start: + // CHECK-DAG: [[A_OR_B:%.+]] = select i1 %opta.0, i8 %opta.1, i8 %optb.1 + // CHECK-DAG: [[IS_SOME:%.+]] = or i1 {{%opta.0, %optb.0|%optb.0, %opta.0}} + // CHECK-NEXT: [[FLAG:%.+]] = insertvalue { i1, i8 } poison, i1 [[IS_SOME]], 0 + // CHECK-NEXT: [[R:%.+]] = insertvalue { i1, i8 } [[FLAG]], i8 [[A_OR_B]], 1 + // CHECK: ret { i1, i8 } [[R]] + opta.or(optb) +} + +// CHECK-LABEL: @if_some_u8 +// CHECK-SAME: (i1{{.+}}%opta.0, i8 %opta.1, i1{{.+}}%optb.0, i8 %optb.1) +#[no_mangle] +pub fn if_some_u8(opta: Option, optb: Option) -> Option { + // CHECK: start: + // CHECK-DAG: [[A_OR_B:%.+]] = select i1 %opta.0, i8 %opta.1, i8 %optb.1 + // CHECK-DAG: [[IS_SOME:%.+]] = or i1 {{%opta.0, %optb.0|%optb.0, %opta.0}} + // CHECK-NEXT: [[FLAG:%.+]] = insertvalue { i1, i8 } poison, i1 [[IS_SOME]], 0 + // CHECK-NEXT: [[R:%.+]] = insertvalue { i1, i8 } [[FLAG]], i8 [[A_OR_B]], 1 + // CHECK: ret { i1, i8 } [[R]] + if opta.is_some() { opta } else { optb } +} + +// Tests a case where an input is a type that is represented as `BackendRepr::Memory` + +// CHECK-LABEL: @or_match_slice_u8 +// CHECK-SAME: (i16 %0, i16 %1) +#[no_mangle] +pub fn or_match_slice_u8(opta: Option<[u8; 1]>, optb: Option<[u8; 1]>) -> Option<[u8; 1]> { + // CHECK: start: + // CHECK-NEXT: [[SOME_A:%.+]] = trunc i16 %0 to i1 + // CHECK-NEXT: [[R:%.+]] = select i1 [[SOME_A]], i16 %0, i16 %1 + // CHECK: ret i16 [[R]] + match opta { + Some(x) => Some(x), + None => optb, + } +} + +// CHECK-LABEL: @or_match_slice_alt_u8 +// CHECK-SAME: (i16 %0, i16 %1) +#[no_mangle] +pub fn or_match_slice_alt_u8(opta: Option<[u8; 1]>, optb: Option<[u8; 1]>) -> Option<[u8; 1]> { + // CHECK: start: + // CHECK-NEXT: [[SOME_A:%.+]] = trunc i16 %0 to i1 + // CHECK-NEXT: [[R:%.+]] = select i1 [[SOME_A]], i16 %0, i16 %1 + // CHECK: ret i16 [[R]] + match opta { + Some(_) => opta, + None => optb, + } +} + +// CHECK-LABEL: @option_or_slice_u8 +// CHECK-SAME: (i16 %0, i16 %1) +#[no_mangle] +pub fn option_or_slice_u8(opta: Option<[u8; 1]>, optb: Option<[u8; 1]>) -> Option<[u8; 1]> { + // CHECK: start: + // CHECK-NEXT: [[SOME_A:%.+]] = trunc i16 %0 to i1 + // CHECK-NEXT: [[R:%.+]] = select i1 [[SOME_A]], i16 %0, i16 %1 + // CHECK: ret i16 [[R]] + opta.or(optb) +} + +// CHECK-LABEL: @if_some_slice_u8 +// CHECK-SAME: (i16 %0, i16 %1) +#[no_mangle] +pub fn if_some_slice_u8(opta: Option<[u8; 1]>, optb: Option<[u8; 1]>) -> Option<[u8; 1]> { + // CHECK: start: + // CHECK-NEXT: [[SOME_A:%.+]] = trunc i16 %0 to i1 + // CHECK-NEXT: [[R:%.+]] = select i1 [[SOME_A]], i16 %0, i16 %1 + // CHECK: ret i16 [[R]] + if opta.is_some() { opta } else { optb } +} + +// Test a niche optimization case of `NonZero` + +// CHECK-LABEL: @or_match_nz_u8 +// CHECK-SAME: (i8{{.+}}%0, i8{{.+}}%optb) +#[no_mangle] +pub fn or_match_nz_u8(opta: Option>, optb: Option>) -> Option> { + // CHECK: start: + // CHECK-NEXT: [[NOT_A:%.+]] = icmp eq i8 %0, 0 + // CHECK-NEXT: [[R:%.+]] = select i1 [[NOT_A]], i8 %optb, i8 %0 + // CHECK: ret i8 [[R]] + match opta { + Some(x) => Some(x), + None => optb, + } +} + +// CHECK-LABEL: @or_match_alt_nz_u8 +// CHECK-SAME: (i8{{.+}}%opta, i8{{.+}}%optb) +#[no_mangle] +pub fn or_match_alt_nz_u8( + opta: Option>, + optb: Option>, +) -> Option> { + // CHECK: start: + // CHECK-NEXT: [[NOT_A:%.+]] = icmp eq i8 %opta, 0 + // CHECK-NEXT: [[R:%.+]] = select i1 [[NOT_A]], i8 %optb, i8 %opta + // CHECK: ret i8 [[R]] + match opta { + Some(_) => opta, + None => optb, + } +} + +// CHECK-LABEL: @option_or_nz_u8 +// CHECK-SAME: (i8{{.+}}%opta, i8{{.+}}%optb) +#[no_mangle] +pub fn option_or_nz_u8( + opta: Option>, + optb: Option>, +) -> Option> { + // CHECK: start: + // CHECK-NEXT: [[NOT_A:%.+]] = icmp eq i8 %opta, 0 + // CHECK-NEXT: [[R:%.+]] = select i1 [[NOT_A]], i8 %optb, i8 %opta + // CHECK: ret i8 [[R]] + opta.or(optb) +} + +// CHECK-LABEL: @if_some_nz_u8 +// CHECK-SAME: (i8{{.+}}%opta, i8{{.+}}%optb) +#[no_mangle] +pub fn if_some_nz_u8(opta: Option>, optb: Option>) -> Option> { + // CHECK: start: + // CHECK-NEXT: [[NOT_A:%.+]] = icmp eq i8 %opta, 0 + // CHECK-NEXT: [[R:%.+]] = select i1 [[NOT_A]], i8 %optb, i8 %opta + // CHECK: ret i8 [[R]] + if opta.is_some() { opta } else { optb } +} diff --git a/tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs b/tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs new file mode 100644 index 000000000000..35317b0dd39c --- /dev/null +++ b/tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs @@ -0,0 +1,84 @@ +//! Regression test for . + +// We want to check that `unreachable!()` is optimized away. +//@ compile-flags: -O + +// Don't de-duplicate `some_non_zero_from_atomic_get2()` since we want its LLVM IR. +//@ compile-flags: -Zmerge-functions=disabled + +// So we don't have to worry about usize. +//@ only-64bit + +#![crate_type = "lib"] + +use std::num::NonZeroUsize; +use std::sync::atomic::AtomicUsize; +use std::sync::atomic::Ordering::Relaxed; + +pub static X: AtomicUsize = AtomicUsize::new(1); + +/// We don't need to check the LLVM IR of this function, but we expect its LLVM +/// IR to be identical to `some_non_zero_from_atomic_get2()`. +#[no_mangle] +pub unsafe fn some_non_zero_from_atomic_get() -> Option { + let x = X.load(Relaxed); + Some(NonZeroUsize::new_unchecked(x)) +} + +/// We want to test that the `unreachable!()` branch is optimized out. +/// +/// When that does not happen, the LLVM IR will look like this: +/// +/// ```sh +/// rustc +nightly-2024-02-08 --emit=llvm-ir -O -Zmerge-functions=disabled \ +/// tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs && \ +/// grep -B 1 -A 13 '@some_non_zero_from_atomic_get2()' some-non-zero-from-atomic-optimization.ll +/// ``` +/// ```llvm +/// ; Function Attrs: nonlazybind uwtable +/// define noundef i64 @some_non_zero_from_atomic_get2() unnamed_addr #1 { +/// start: +/// %0 = load atomic i64, ptr @_ZN38some_non_zero_from_atomic_optimization1X17h monotonic, align 8 +/// %1 = icmp eq i64 %0, 0 +/// br i1 %1, label %bb2, label %bb3 +/// +/// bb2: ; preds = %start +/// ; call core::panicking::panic +/// tail call void @_ZN4core9panicking5panic17h0cc48E(..., ..., ... ) #3 +/// unreachable +/// +/// bb3: ; preds = %start +/// ret i64 %0 +/// } +/// ``` +/// +/// When it _is_ optimized out, the LLVM IR will look like this: +/// +/// ```sh +/// rustc +nightly-2024-02-09 --emit=llvm-ir -O -Zmerge-functions=disabled \ +/// tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs && \ +/// grep -B 1 -A 6 '@some_non_zero_from_atomic_get2()' some-non-zero-from-atomic-optimization.ll +/// ``` +/// ```llvm +/// ; Function Attrs: mustprogress nofree nounwind nonlazybind willreturn memory(...) uwtable +/// define noundef i64 @some_non_zero_from_atomic_get2() unnamed_addr #0 { +/// bb3: +/// %0 = load atomic i64, ptr @_ZN38some_non_zero_from_atomic_optimization1X17h monotonic, align 8 +/// %1 = icmp ne i64 %0, 0 +/// tail call void @llvm.assume(i1 %1) +/// ret i64 %0 +/// } +/// ``` +/// +/// The way we check that the LLVM IR is correct is by making sure that neither +/// `panic` nor `unreachable` is part of the LLVM IR: +// CHECK-LABEL: define {{.*}} i64 @some_non_zero_from_atomic_get2() {{.*}} { +// CHECK-NOT: panic +// CHECK-NOT: unreachable +#[no_mangle] +pub unsafe fn some_non_zero_from_atomic_get2() -> usize { + match some_non_zero_from_atomic_get() { + Some(x) => x.get(), + None => unreachable!(), // shall be optimized out + } +} diff --git a/tests/codegen-units/item-collection/opaque-return-impls.rs b/tests/codegen-units/item-collection/opaque-return-impls.rs index d54951b933fd..54ab656c53db 100644 --- a/tests/codegen-units/item-collection/opaque-return-impls.rs +++ b/tests/codegen-units/item-collection/opaque-return-impls.rs @@ -44,7 +44,7 @@ pub fn foo2() -> Box { //~ MONO_ITEM fn ::test_func2 //~ MONO_ITEM fn alloc::alloc::exchange_malloc //~ MONO_ITEM fn foo2 -//~ MONO_ITEM fn std::alloc::Global::alloc_impl +//~ MONO_ITEM fn std::alloc::Global::alloc_impl_runtime //~ MONO_ITEM fn std::boxed::Box::::new //~ MONO_ITEM fn std::alloc::Layout::from_size_align_unchecked::precondition_check //~ MONO_ITEM fn std::ptr::Alignment::new_unchecked::precondition_check diff --git a/tests/coverage/closure.cov-map b/tests/coverage/closure.cov-map index d713145d8612..d21be004594d 100644 --- a/tests/coverage/closure.cov-map +++ b/tests/coverage/closure.cov-map @@ -69,24 +69,22 @@ Number of file 0 mappings: 61 - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 -Function name: closure::main::{closure#0} -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 28, 05, 00, 06, 01, 01, 0d, 00, 1a, 01, 00, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 17, 01, 00, 18, 00, 20, 01, 01, 05, 00, 06] +Function name: closure::main::{closure#0} (unused) +Raw bytes (49): 0x[01, 01, 00, 09, 00, 28, 05, 00, 06, 00, 01, 0d, 00, 1a, 00, 00, 1d, 00, 1e, 00, 01, 0c, 00, 14, 00, 00, 15, 02, 0a, 00, 02, 09, 00, 0a, 00, 01, 09, 00, 17, 00, 00, 18, 00, 20, 00, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of expressions: 0 Number of file 0 mappings: 9 -- Code(Counter(0)) at (prev + 40, 5) to (start + 0, 6) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 26) -- Code(Counter(0)) at (prev + 0, 29) to (start + 0, 30) -- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 20) -- Code(Counter(1)) at (prev + 0, 21) to (start + 2, 10) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 32) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c1 +- Code(Zero) at (prev + 40, 5) to (start + 0, 6) +- Code(Zero) at (prev + 1, 13) to (start + 0, 26) +- Code(Zero) at (prev + 0, 29) to (start + 0, 30) +- Code(Zero) at (prev + 1, 12) to (start + 0, 20) +- Code(Zero) at (prev + 0, 21) to (start + 2, 10) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Zero) at (prev + 1, 9) to (start + 0, 23) +- Code(Zero) at (prev + 0, 24) to (start + 0, 32) +- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: (none) Function name: closure::main::{closure#10} (unused) Raw bytes (20): 0x[01, 01, 00, 03, 00, 9b, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21] @@ -186,24 +184,22 @@ Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) Highest counter ID seen: c1 -Function name: closure::main::{closure#18} -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 19, 0d, 00, 0e, 01, 01, 15, 00, 22, 01, 00, 25, 00, 26, 01, 01, 14, 00, 1c, 05, 00, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 00, 1f, 01, 00, 20, 00, 28, 01, 01, 0d, 00, 0e] +Function name: closure::main::{closure#18} (unused) +Raw bytes (49): 0x[01, 01, 00, 09, 00, 19, 0d, 00, 0e, 00, 01, 15, 00, 22, 00, 00, 25, 00, 26, 00, 01, 14, 00, 1c, 00, 00, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 00, 1f, 00, 00, 20, 00, 28, 00, 01, 0d, 00, 0e] Number of files: 1 - file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of expressions: 0 Number of file 0 mappings: 9 -- Code(Counter(0)) at (prev + 25, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 34) -- Code(Counter(0)) at (prev + 0, 37) to (start + 0, 38) -- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 28) -- Code(Counter(1)) at (prev + 0, 29) to (start + 2, 18) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 31) -- Code(Counter(0)) at (prev + 0, 32) to (start + 0, 40) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) -Highest counter ID seen: c1 +- Code(Zero) at (prev + 25, 13) to (start + 0, 14) +- Code(Zero) at (prev + 1, 21) to (start + 0, 34) +- Code(Zero) at (prev + 0, 37) to (start + 0, 38) +- Code(Zero) at (prev + 1, 20) to (start + 0, 28) +- Code(Zero) at (prev + 0, 29) to (start + 2, 18) +- Code(Zero) at (prev + 2, 17) to (start + 0, 18) +- Code(Zero) at (prev + 1, 17) to (start + 0, 31) +- Code(Zero) at (prev + 0, 32) to (start + 0, 40) +- Code(Zero) at (prev + 1, 13) to (start + 0, 14) +Highest counter ID seen: (none) Function name: closure::main::{closure#19} Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 43, 0d, 00, 0e, 01, 01, 15, 00, 22, 01, 00, 25, 00, 26, 01, 01, 14, 00, 1c, 05, 00, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 00, 1f, 01, 00, 20, 00, 28, 01, 01, 0d, 00, 0e] diff --git a/tests/coverage/try_error_result.cov-map b/tests/coverage/try_error_result.cov-map index 53757ef8a9bd..fa937cfb7755 100644 --- a/tests/coverage/try_error_result.cov-map +++ b/tests/coverage/try_error_result.cov-map @@ -92,71 +92,28 @@ Number of file 0 mappings: 14 Highest counter ID seen: c1 Function name: try_error_result::test2 -Raw bytes (443): 0x[01, 01, 3d, 09, 0d, 09, 57, 0d, 15, 09, 57, 0d, 15, 09, 57, 0d, 15, 09, 4f, 53, 1d, 57, 19, 0d, 15, 09, 57, 0d, 15, 09, 57, 0d, 15, 09, 53, 57, 19, 0d, 15, 09, 4f, 53, 1d, 57, 19, 0d, 15, 41, 6b, 21, 25, 41, 21, 41, 6b, 21, 25, 05, 8f, 01, 93, 01, 2d, 09, 29, 05, 09, 05, 09, 05, 93, 01, 09, 29, 05, 8f, 01, 93, 01, 2d, 09, 29, 45, a7, 01, 31, 35, 45, 31, 45, a7, 01, 31, 35, 49, bb, 01, 39, 3d, 49, 39, 49, bb, 01, 39, 3d, 11, 05, c7, 01, 05, cb, 01, 3d, cf, 01, 39, d3, 01, 35, d7, 01, 31, db, 01, 2d, df, 01, 29, e3, 01, 25, e7, 01, 21, eb, 01, 1d, ef, 01, 19, f3, 01, 15, 11, 0d, 39, 01, 3d, 01, 00, 1d, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 1a, 01, 01, 09, 01, 12, 01, 01, 15, 00, 17, 01, 05, 09, 00, 0e, 05, 02, 09, 01, 11, 05, 04, 0d, 00, 1a, 09, 02, 0d, 00, 13, 09, 00, 14, 00, 1f, 0d, 00, 2f, 00, 30, 02, 00, 31, 00, 35, 02, 00, 45, 00, 4f, 02, 00, 50, 00, 62, 02, 01, 0d, 00, 13, 02, 02, 11, 00, 1c, 15, 01, 11, 00, 12, 36, 02, 11, 00, 15, 36, 02, 11, 00, 1b, 36, 01, 15, 00, 27, 4a, 02, 11, 00, 14, 36, 00, 17, 00, 1d, 36, 00, 1e, 00, 29, 19, 00, 41, 00, 42, 3e, 00, 43, 00, 47, 1d, 00, 5f, 00, 60, 4a, 01, 0d, 00, 17, 66, 01, 11, 00, 14, 41, 00, 17, 00, 1d, 41, 00, 1e, 00, 29, 21, 00, 41, 00, 42, 62, 00, 43, 00, 47, 25, 00, 60, 00, 61, 66, 01, 0d, 00, 17, 8a, 01, 04, 11, 00, 14, 7e, 00, 17, 00, 1d, 7e, 00, 1e, 00, 29, 29, 00, 42, 00, 43, 82, 01, 00, 44, 00, 48, 2d, 00, 61, 00, 62, 8a, 01, 01, 0d, 00, 17, a2, 01, 01, 11, 00, 14, 45, 00, 17, 00, 1d, 45, 01, 12, 00, 1d, 31, 00, 36, 00, 37, 9e, 01, 01, 12, 00, 16, 35, 00, 2f, 00, 30, a2, 01, 01, 0d, 00, 17, b6, 01, 01, 11, 00, 14, 49, 00, 17, 00, 1d, 49, 01, 12, 00, 1d, 39, 01, 11, 00, 12, b2, 01, 01, 12, 00, 16, 3d, 01, 11, 00, 12, b6, 01, 02, 0d, 00, 17, be, 01, 03, 05, 00, 0b, c2, 01, 01, 01, 00, 02] +Raw bytes (325): 0x[01, 01, 12, 07, 09, 01, 05, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 05, 39, 01, 3d, 01, 00, 1d, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 1a, 01, 01, 09, 01, 12, 01, 01, 15, 00, 17, 01, 05, 09, 00, 0e, 05, 02, 09, 01, 11, 05, 04, 0d, 00, 1a, 02, 02, 0d, 00, 13, 02, 00, 14, 00, 1f, 00, 00, 2f, 00, 30, 02, 00, 31, 00, 35, 02, 00, 45, 00, 4f, 02, 00, 50, 00, 62, 02, 01, 0d, 00, 13, 02, 02, 11, 00, 1c, 00, 01, 11, 00, 12, 02, 02, 11, 00, 15, 02, 02, 11, 00, 1b, 02, 01, 15, 00, 27, 00, 02, 11, 00, 14, 02, 00, 17, 00, 1d, 02, 00, 1e, 00, 29, 02, 00, 41, 00, 42, 00, 00, 43, 00, 47, 00, 00, 5f, 00, 60, 00, 01, 0d, 00, 17, 00, 01, 11, 00, 14, 00, 00, 17, 00, 1d, 00, 00, 1e, 00, 29, 00, 00, 41, 00, 42, 00, 00, 43, 00, 47, 00, 00, 60, 00, 61, 00, 01, 0d, 00, 17, 42, 04, 11, 00, 14, 42, 00, 17, 00, 1d, 42, 00, 1e, 00, 29, 00, 00, 42, 00, 43, 42, 00, 44, 00, 48, 00, 00, 61, 00, 62, 42, 01, 0d, 00, 17, 42, 01, 11, 00, 14, 42, 00, 17, 00, 1d, 42, 01, 12, 00, 1d, 00, 00, 36, 00, 37, 42, 01, 12, 00, 16, 00, 00, 2f, 00, 30, 42, 01, 0d, 00, 17, 42, 01, 11, 00, 14, 42, 00, 17, 00, 1d, 42, 01, 12, 00, 1d, 00, 01, 11, 00, 12, 42, 01, 12, 00, 16, 00, 01, 11, 00, 12, 42, 02, 0d, 00, 17, 46, 03, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try_error_result.rs -Number of expressions: 61 -- expression 0 operands: lhs = Counter(2), rhs = Counter(3) -- expression 1 operands: lhs = Counter(2), rhs = Expression(21, Add) -- expression 2 operands: lhs = Counter(3), rhs = Counter(5) -- expression 3 operands: lhs = Counter(2), rhs = Expression(21, Add) -- expression 4 operands: lhs = Counter(3), rhs = Counter(5) -- expression 5 operands: lhs = Counter(2), rhs = Expression(21, Add) -- expression 6 operands: lhs = Counter(3), rhs = Counter(5) -- expression 7 operands: lhs = Counter(2), rhs = Expression(19, Add) -- expression 8 operands: lhs = Expression(20, Add), rhs = Counter(7) -- expression 9 operands: lhs = Expression(21, Add), rhs = Counter(6) -- expression 10 operands: lhs = Counter(3), rhs = Counter(5) -- expression 11 operands: lhs = Counter(2), rhs = Expression(21, Add) -- expression 12 operands: lhs = Counter(3), rhs = Counter(5) -- expression 13 operands: lhs = Counter(2), rhs = Expression(21, Add) -- expression 14 operands: lhs = Counter(3), rhs = Counter(5) -- expression 15 operands: lhs = Counter(2), rhs = Expression(20, Add) -- expression 16 operands: lhs = Expression(21, Add), rhs = Counter(6) -- expression 17 operands: lhs = Counter(3), rhs = Counter(5) -- expression 18 operands: lhs = Counter(2), rhs = Expression(19, Add) -- expression 19 operands: lhs = Expression(20, Add), rhs = Counter(7) -- expression 20 operands: lhs = Expression(21, Add), rhs = Counter(6) -- expression 21 operands: lhs = Counter(3), rhs = Counter(5) -- expression 22 operands: lhs = Counter(16), rhs = Expression(26, Add) -- expression 23 operands: lhs = Counter(8), rhs = Counter(9) -- expression 24 operands: lhs = Counter(16), rhs = Counter(8) -- expression 25 operands: lhs = Counter(16), rhs = Expression(26, Add) -- expression 26 operands: lhs = Counter(8), rhs = Counter(9) -- expression 27 operands: lhs = Counter(1), rhs = Expression(35, Add) -- expression 28 operands: lhs = Expression(36, Add), rhs = Counter(11) -- expression 29 operands: lhs = Counter(2), rhs = Counter(10) -- expression 30 operands: lhs = Counter(1), rhs = Counter(2) -- expression 31 operands: lhs = Counter(1), rhs = Counter(2) -- expression 32 operands: lhs = Counter(1), rhs = Expression(36, Add) -- expression 33 operands: lhs = Counter(2), rhs = Counter(10) -- expression 34 operands: lhs = Counter(1), rhs = Expression(35, Add) -- expression 35 operands: lhs = Expression(36, Add), rhs = Counter(11) -- expression 36 operands: lhs = Counter(2), rhs = Counter(10) -- expression 37 operands: lhs = Counter(17), rhs = Expression(41, Add) -- expression 38 operands: lhs = Counter(12), rhs = Counter(13) -- expression 39 operands: lhs = Counter(17), rhs = Counter(12) -- expression 40 operands: lhs = Counter(17), rhs = Expression(41, Add) -- expression 41 operands: lhs = Counter(12), rhs = Counter(13) -- expression 42 operands: lhs = Counter(18), rhs = Expression(46, Add) -- expression 43 operands: lhs = Counter(14), rhs = Counter(15) -- expression 44 operands: lhs = Counter(18), rhs = Counter(14) -- expression 45 operands: lhs = Counter(18), rhs = Expression(46, Add) -- expression 46 operands: lhs = Counter(14), rhs = Counter(15) -- expression 47 operands: lhs = Counter(4), rhs = Counter(1) -- expression 48 operands: lhs = Expression(49, Add), rhs = Counter(1) -- expression 49 operands: lhs = Expression(50, Add), rhs = Counter(15) -- expression 50 operands: lhs = Expression(51, Add), rhs = Counter(14) -- expression 51 operands: lhs = Expression(52, Add), rhs = Counter(13) -- expression 52 operands: lhs = Expression(53, Add), rhs = Counter(12) -- expression 53 operands: lhs = Expression(54, Add), rhs = Counter(11) -- expression 54 operands: lhs = Expression(55, Add), rhs = Counter(10) -- expression 55 operands: lhs = Expression(56, Add), rhs = Counter(9) -- expression 56 operands: lhs = Expression(57, Add), rhs = Counter(8) -- expression 57 operands: lhs = Expression(58, Add), rhs = Counter(7) -- expression 58 operands: lhs = Expression(59, Add), rhs = Counter(6) -- expression 59 operands: lhs = Expression(60, Add), rhs = Counter(5) -- expression 60 operands: lhs = Counter(4), rhs = Counter(3) +Number of expressions: 18 +- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2) +- expression 1 operands: lhs = Counter(0), rhs = Counter(1) +- expression 2 operands: lhs = Counter(2), rhs = Counter(0) +- expression 3 operands: lhs = Counter(2), rhs = Counter(0) +- expression 4 operands: lhs = Counter(2), rhs = Counter(0) +- expression 5 operands: lhs = Counter(2), rhs = Counter(0) +- expression 6 operands: lhs = Counter(2), rhs = Counter(0) +- expression 7 operands: lhs = Counter(2), rhs = Counter(0) +- expression 8 operands: lhs = Counter(2), rhs = Counter(0) +- expression 9 operands: lhs = Counter(2), rhs = Counter(0) +- expression 10 operands: lhs = Counter(2), rhs = Counter(0) +- expression 11 operands: lhs = Counter(2), rhs = Counter(0) +- expression 12 operands: lhs = Counter(2), rhs = Counter(0) +- expression 13 operands: lhs = Counter(2), rhs = Counter(0) +- expression 14 operands: lhs = Counter(2), rhs = Counter(0) +- expression 15 operands: lhs = Counter(2), rhs = Counter(0) +- expression 16 operands: lhs = Counter(2), rhs = Counter(0) +- expression 17 operands: lhs = Counter(2), rhs = Counter(1) Number of file 0 mappings: 57 - Code(Counter(0)) at (prev + 61, 1) to (start + 0, 29) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) @@ -166,83 +123,83 @@ Number of file 0 mappings: 57 - Code(Counter(0)) at (prev + 5, 9) to (start + 0, 14) - Code(Counter(1)) at (prev + 2, 9) to (start + 1, 17) - Code(Counter(1)) at (prev + 4, 13) to (start + 0, 26) -- Code(Counter(2)) at (prev + 2, 13) to (start + 0, 19) -- Code(Counter(2)) at (prev + 0, 20) to (start + 0, 31) -- Code(Counter(3)) at (prev + 0, 47) to (start + 0, 48) +- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19) + = ((c0 + c1) - c2) +- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 31) + = ((c0 + c1) - c2) +- Code(Zero) at (prev + 0, 47) to (start + 0, 48) - Code(Expression(0, Sub)) at (prev + 0, 49) to (start + 0, 53) - = (c2 - c3) + = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 0, 69) to (start + 0, 79) - = (c2 - c3) + = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 0, 80) to (start + 0, 98) - = (c2 - c3) + = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 0, 19) - = (c2 - c3) + = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 28) - = (c2 - c3) -- Code(Counter(5)) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(13, Sub)) at (prev + 2, 17) to (start + 0, 21) - = (c2 - (c3 + c5)) -- Code(Expression(13, Sub)) at (prev + 2, 17) to (start + 0, 27) - = (c2 - (c3 + c5)) -- Code(Expression(13, Sub)) at (prev + 1, 21) to (start + 0, 39) - = (c2 - (c3 + c5)) -- Code(Expression(18, Sub)) at (prev + 2, 17) to (start + 0, 20) - = (c2 - (((c3 + c5) + c6) + c7)) -- Code(Expression(13, Sub)) at (prev + 0, 23) to (start + 0, 29) - = (c2 - (c3 + c5)) -- Code(Expression(13, Sub)) at (prev + 0, 30) to (start + 0, 41) - = (c2 - (c3 + c5)) -- Code(Counter(6)) at (prev + 0, 65) to (start + 0, 66) -- Code(Expression(15, Sub)) at (prev + 0, 67) to (start + 0, 71) - = (c2 - ((c3 + c5) + c6)) -- Code(Counter(7)) at (prev + 0, 95) to (start + 0, 96) -- Code(Expression(18, Sub)) at (prev + 1, 13) to (start + 0, 23) - = (c2 - (((c3 + c5) + c6) + c7)) -- Code(Expression(25, Sub)) at (prev + 1, 17) to (start + 0, 20) - = (c16 - (c8 + c9)) -- Code(Counter(16)) at (prev + 0, 23) to (start + 0, 29) -- Code(Counter(16)) at (prev + 0, 30) to (start + 0, 41) -- Code(Counter(8)) at (prev + 0, 65) to (start + 0, 66) -- Code(Expression(24, Sub)) at (prev + 0, 67) to (start + 0, 71) - = (c16 - c8) -- Code(Counter(9)) at (prev + 0, 96) to (start + 0, 97) -- Code(Expression(25, Sub)) at (prev + 1, 13) to (start + 0, 23) - = (c16 - (c8 + c9)) -- Code(Expression(34, Sub)) at (prev + 4, 17) to (start + 0, 20) - = (c1 - ((c2 + c10) + c11)) -- Code(Expression(31, Sub)) at (prev + 0, 23) to (start + 0, 29) - = (c1 - c2) -- Code(Expression(31, Sub)) at (prev + 0, 30) to (start + 0, 41) - = (c1 - c2) -- Code(Counter(10)) at (prev + 0, 66) to (start + 0, 67) -- Code(Expression(32, Sub)) at (prev + 0, 68) to (start + 0, 72) - = (c1 - (c2 + c10)) -- Code(Counter(11)) at (prev + 0, 97) to (start + 0, 98) -- Code(Expression(34, Sub)) at (prev + 1, 13) to (start + 0, 23) - = (c1 - ((c2 + c10) + c11)) -- Code(Expression(40, Sub)) at (prev + 1, 17) to (start + 0, 20) - = (c17 - (c12 + c13)) -- Code(Counter(17)) at (prev + 0, 23) to (start + 0, 29) -- Code(Counter(17)) at (prev + 1, 18) to (start + 0, 29) -- Code(Counter(12)) at (prev + 0, 54) to (start + 0, 55) -- Code(Expression(39, Sub)) at (prev + 1, 18) to (start + 0, 22) - = (c17 - c12) -- Code(Counter(13)) at (prev + 0, 47) to (start + 0, 48) -- Code(Expression(40, Sub)) at (prev + 1, 13) to (start + 0, 23) - = (c17 - (c12 + c13)) -- Code(Expression(45, Sub)) at (prev + 1, 17) to (start + 0, 20) - = (c18 - (c14 + c15)) -- Code(Counter(18)) at (prev + 0, 23) to (start + 0, 29) -- Code(Counter(18)) at (prev + 1, 18) to (start + 0, 29) -- Code(Counter(14)) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(44, Sub)) at (prev + 1, 18) to (start + 0, 22) - = (c18 - c14) -- Code(Counter(15)) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(45, Sub)) at (prev + 2, 13) to (start + 0, 23) - = (c18 - (c14 + c15)) -- Code(Expression(47, Sub)) at (prev + 3, 5) to (start + 0, 11) - = (c4 - c1) -- Code(Expression(48, Sub)) at (prev + 1, 1) to (start + 0, 2) - = (((((((((((((c4 + c3) + c5) + c6) + c7) + c8) + c9) + c10) + c11) + c12) + c13) + c14) + c15) - c1) -Highest counter ID seen: c18 + = ((c0 + c1) - c2) +- Code(Zero) at (prev + 1, 17) to (start + 0, 18) +- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 21) + = ((c0 + c1) - c2) +- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 27) + = ((c0 + c1) - c2) +- Code(Expression(0, Sub)) at (prev + 1, 21) to (start + 0, 39) + = ((c0 + c1) - c2) +- Code(Zero) at (prev + 2, 17) to (start + 0, 20) +- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 29) + = ((c0 + c1) - c2) +- Code(Expression(0, Sub)) at (prev + 0, 30) to (start + 0, 41) + = ((c0 + c1) - c2) +- Code(Expression(0, Sub)) at (prev + 0, 65) to (start + 0, 66) + = ((c0 + c1) - c2) +- Code(Zero) at (prev + 0, 67) to (start + 0, 71) +- Code(Zero) at (prev + 0, 95) to (start + 0, 96) +- Code(Zero) at (prev + 1, 13) to (start + 0, 23) +- Code(Zero) at (prev + 1, 17) to (start + 0, 20) +- Code(Zero) at (prev + 0, 23) to (start + 0, 29) +- Code(Zero) at (prev + 0, 30) to (start + 0, 41) +- Code(Zero) at (prev + 0, 65) to (start + 0, 66) +- Code(Zero) at (prev + 0, 67) to (start + 0, 71) +- Code(Zero) at (prev + 0, 96) to (start + 0, 97) +- Code(Zero) at (prev + 1, 13) to (start + 0, 23) +- Code(Expression(16, Sub)) at (prev + 4, 17) to (start + 0, 20) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 0, 23) to (start + 0, 29) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 0, 30) to (start + 0, 41) + = (c2 - c0) +- Code(Zero) at (prev + 0, 66) to (start + 0, 67) +- Code(Expression(16, Sub)) at (prev + 0, 68) to (start + 0, 72) + = (c2 - c0) +- Code(Zero) at (prev + 0, 97) to (start + 0, 98) +- Code(Expression(16, Sub)) at (prev + 1, 13) to (start + 0, 23) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 1, 17) to (start + 0, 20) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 0, 23) to (start + 0, 29) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 29) + = (c2 - c0) +- Code(Zero) at (prev + 0, 54) to (start + 0, 55) +- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 22) + = (c2 - c0) +- Code(Zero) at (prev + 0, 47) to (start + 0, 48) +- Code(Expression(16, Sub)) at (prev + 1, 13) to (start + 0, 23) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 1, 17) to (start + 0, 20) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 0, 23) to (start + 0, 29) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 29) + = (c2 - c0) +- Code(Zero) at (prev + 1, 17) to (start + 0, 18) +- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 22) + = (c2 - c0) +- Code(Zero) at (prev + 1, 17) to (start + 0, 18) +- Code(Expression(16, Sub)) at (prev + 2, 13) to (start + 0, 23) + = (c2 - c0) +- Code(Expression(17, Sub)) at (prev + 3, 5) to (start + 0, 11) + = (c2 - c1) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 diff --git a/tests/crashes/114880.rs b/tests/crashes/114880.rs new file mode 100644 index 000000000000..c05f7ed4ff64 --- /dev/null +++ b/tests/crashes/114880.rs @@ -0,0 +1,7 @@ +//@ known-bug: #114880 +//@ proc-macro: aux114880.rs +//@ ignore-backends: gcc + +aux114880::expand!(); + +fn main() {} diff --git a/tests/crashes/119940.rs b/tests/crashes/119940.rs new file mode 100644 index 000000000000..af259b023c94 --- /dev/null +++ b/tests/crashes/119940.rs @@ -0,0 +1,27 @@ +//@ known-bug: #119940 +//@ compile-flags: -Zvalidate-mir + +#![feature(custom_mir, core_intrinsics)] +extern crate core; +use core::intrinsics::mir::*; + +pub enum E { + V0 { fld0: &'static u64 }, +} + +#[custom_mir(dialect = "runtime", phase = "initial")] +pub fn fn0() { + mir! { + let e: E; + let n: u64; + { + n = 0; + place!(Field::<&u64>(Variant(e, 0), 0)) = &n; + Return() + } + + } +} +pub fn main() { + fn0(); +} diff --git a/tests/crashes/131052.rs b/tests/crashes/131052.rs deleted file mode 100644 index 7ae3ec08f3ed..000000000000 --- a/tests/crashes/131052.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ known-bug: #131052 -#![feature(adt_const_params)] - -struct ConstBytes; - -pub fn main() { - let _: ConstBytes = ConstBytes::; -} diff --git a/tests/crashes/132985.rs b/tests/crashes/132985.rs deleted file mode 100644 index 2735074f44d1..000000000000 --- a/tests/crashes/132985.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ known-bug: #132985 -//@ aux-build:aux132985.rs - -#![allow(incomplete_features)] -#![feature(min_generic_const_args)] -#![feature(adt_const_params)] - -extern crate aux132985; -use aux132985::Foo; - -fn bar() {} - -fn baz() { - bar::<{ Foo }>(); -} - -fn main() {} diff --git a/tests/crashes/133965.rs b/tests/crashes/133965.rs deleted file mode 100644 index 69f533ccbe98..000000000000 --- a/tests/crashes/133965.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #133965 -//@ needs-rustc-debug-assertions - -struct NonGeneric {} - -#[derive(Default)] -struct NonGeneric<'a, const N: usize> {} - -pub fn main() {} diff --git a/tests/crashes/136138.rs b/tests/crashes/136138.rs deleted file mode 100644 index c3893dc9c8e6..000000000000 --- a/tests/crashes/136138.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ known-bug: #136138 -#![feature(min_generic_const_args)] -struct U; -struct S() -where - S<{ U }>:; -fn main() {} diff --git a/tests/crashes/136379.rs b/tests/crashes/136379.rs deleted file mode 100644 index 077b373e3b5d..000000000000 --- a/tests/crashes/136379.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ known-bug: #136379 -#![feature(min_generic_const_args)] -pub struct S(); - -impl S { - pub fn f() -> [u8; S] { - [] - } -} - -pub fn main() {} diff --git a/tests/crashes/138132.rs b/tests/crashes/138132.rs deleted file mode 100644 index 3e31117c526a..000000000000 --- a/tests/crashes/138132.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: #138132 -#![feature(min_generic_const_args)] -struct b(Box<[u8; c]>); -impl b { - fn d(self) { - self.0.e() - } -} -struct c<'a>(&'a u8); -fn main() {} diff --git a/tests/crashes/138274.rs b/tests/crashes/138274.rs new file mode 100644 index 000000000000..d657b27e46f3 --- /dev/null +++ b/tests/crashes/138274.rs @@ -0,0 +1,18 @@ +//@ known-bug: #138274 +//@ edition: 2021 +//@ compile-flags: --crate-type=lib +trait Trait {} + +fn foo() -> Box { + todo!() +} + +fn fetch() { + async { + let fut = async { + let _x = foo(); + async {}.await; + }; + let _: Box = Box::new(fut); + }; +} diff --git a/tests/crashes/138660.rs b/tests/crashes/138660.rs new file mode 100644 index 000000000000..90eb8026f072 --- /dev/null +++ b/tests/crashes/138660.rs @@ -0,0 +1,7 @@ +//@ known-bug: #138660 +enum A { + V1(isize) = 1..=10, + V0 = 1..=10, +} +const B: &'static [A] = &[A::V0, A::V1(111)]; +fn main() {} diff --git a/tests/crashes/139596.rs b/tests/crashes/139596.rs deleted file mode 100644 index 590cfddf83e2..000000000000 --- a/tests/crashes/139596.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: #139596 - -#![feature(min_generic_const_args)] -struct Colour; - -struct Led; - -fn main() { - Led::<{ Colour}>; -} diff --git a/tests/crashes/140891.rs b/tests/crashes/140891.rs deleted file mode 100644 index 421919403eff..000000000000 --- a/tests/crashes/140891.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ known-bug: #140891 -struct A {} -impl Iterator for A { - fn next() -> [(); std::mem::size_of::>] {} -} -fn main() {} diff --git a/tests/crashes/auxiliary/aux114880.rs b/tests/crashes/auxiliary/aux114880.rs new file mode 100644 index 000000000000..244396fdd9ef --- /dev/null +++ b/tests/crashes/auxiliary/aux114880.rs @@ -0,0 +1,13 @@ +#![feature(proc_macro_expand)] +#![crate_type = "proc-macro"] + +extern crate proc_macro; +use std::str::FromStr; + +use proc_macro::TokenStream; + +#[proc_macro] +pub fn expand(_: TokenStream) -> TokenStream { + dbg!(TokenStream::from_str("include!(\"./doesnt_exist\")").unwrap().expand_expr()) + .unwrap_or_default() +} diff --git a/tests/crashes/mgca/ace-with-const-ctor.rs b/tests/crashes/mgca/ace-with-const-ctor.rs deleted file mode 100644 index 9e49bca06d52..000000000000 --- a/tests/crashes/mgca/ace-with-const-ctor.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ known-bug: #132980 -// Originally a rustdoc test. Should be moved back there with @has checks -// readded once fixed. -// Previous issue (before mgca): https://github.com/rust-lang/rust/issues/105952 -#![crate_name = "foo"] -#![feature(associated_const_equality, min_generic_const_args)] -pub enum ParseMode { - Raw, -} -pub trait Parse { - #[type_const] - const PARSE_MODE: ParseMode; -} -pub trait RenderRaw {} - -impl> RenderRaw for T {} diff --git a/tests/debuginfo/macro-stepping.rs b/tests/debuginfo/macro-stepping.rs index 0dff383be825..ba3a4452041a 100644 --- a/tests/debuginfo/macro-stepping.rs +++ b/tests/debuginfo/macro-stepping.rs @@ -14,8 +14,10 @@ #[macro_use] extern crate macro_stepping; // exports new_scope!() -//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts -// SingleUseConsts shouldn't need to be disabled, see #128945 +//@ compile-flags: -g +// FIXME(#128945): SingleUseConsts shouldn't need to be disabled. +//@ revisions: default-mir-passes no-SingleUseConsts-mir-pass +//@ [no-SingleUseConsts-mir-pass] compile-flags: -Zmir-enable-passes=-SingleUseConsts // === GDB TESTS =================================================================================== @@ -48,7 +50,7 @@ extern crate macro_stepping; // exports new_scope!() //@ gdb-check:[...]#inc-loc2[...] //@ gdb-command:next //@ gdb-command:frame -//@ gdb-check:[...]#inc-loc3[...] +//@ [no-SingleUseConsts-mir-pass] gdb-check:[...]#inc-loc3[...] // === LLDB TESTS ================================================================================== diff --git a/tests/incremental/const-generic-type-cycle.rs b/tests/incremental/const-generic-type-cycle.rs index 40a40ebd13fe..5bcbc1d5dafe 100644 --- a/tests/incremental/const-generic-type-cycle.rs +++ b/tests/incremental/const-generic-type-cycle.rs @@ -14,7 +14,6 @@ trait Bar {} trait Bar {} //[cfail]~^ ERROR cycle detected when computing type of `Bar::N` //[cfail]~| ERROR cycle detected when computing type of `Bar::N` -//[cfail]~| ERROR cycle detected when computing type of `Bar::N` //[cfail]~| ERROR `(dyn Bar<{ 2 + 1 }> + 'static)` is forbidden as the type of a const generic parameter trait BB = Bar<{ 2 + 1 }>; diff --git a/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir b/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir index 9f52a8cd1e55..c7c26d6351ad 100644 --- a/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir +++ b/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir @@ -7,10 +7,11 @@ fn foo(_1: Option) -> i32 { let mut _3: isize; let mut _4: &std::string::String; let mut _5: &str; - let mut _6: bool; - let _7: std::option::Option; + let mut _6: &str; + let mut _7: bool; + let _8: std::option::Option; scope 1 { - debug s => _7; + debug s => _8; } bb0: { @@ -26,11 +27,12 @@ fn foo(_1: Option) -> i32 { } bb2: { - _6 = ::eq(copy _5, const "a") -> [return: bb3, unwind unreachable]; + _6 = &(*_5); + _7 = ::eq(copy _6, const "a") -> [return: bb3, unwind unreachable]; } bb3: { - switchInt(move _6) -> [0: bb5, otherwise: bb4]; + switchInt(move _7) -> [0: bb5, otherwise: bb4]; } bb4: { @@ -39,15 +41,15 @@ fn foo(_1: Option) -> i32 { } bb5: { - StorageLive(_7); + StorageLive(_8); _2 = const false; - _7 = move _1; + _8 = move _1; _0 = const 4321_i32; - drop(_7) -> [return: bb6, unwind unreachable]; + drop(_8) -> [return: bb6, unwind unreachable]; } bb6: { - StorageDead(_7); + StorageDead(_8); goto -> bb7; } diff --git a/tests/mir-opt/building/match/deref-patterns/string.rs b/tests/mir-opt/building/match/deref-patterns/string.rs index bb4b5379b275..1f8d6fbb0bd2 100644 --- a/tests/mir-opt/building/match/deref-patterns/string.rs +++ b/tests/mir-opt/building/match/deref-patterns/string.rs @@ -1,7 +1,8 @@ // skip-filecheck //@ compile-flags: -Z mir-opt-level=0 -C panic=abort -#![feature(string_deref_patterns)] +#![feature(deref_patterns)] +#![expect(incomplete_features)] #![crate_type = "lib"] // EMIT_MIR string.foo.PreCodegen.after.mir diff --git a/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff b/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff index 2aa92fd34ebf..bcf0ad7c165f 100644 --- a/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff @@ -26,12 +26,12 @@ scope 4 { debug _x => _8; } - scope 18 (inlined foo) { + scope 19 (inlined foo) { let mut _27: *const [()]; } } - scope 16 (inlined slice_from_raw_parts::<()>) { - scope 17 (inlined std::ptr::from_raw_parts::<[()], ()>) { + scope 17 (inlined slice_from_raw_parts::<()>) { + scope 18 (inlined std::ptr::from_raw_parts::<[()], ()>) { } } } @@ -49,19 +49,21 @@ scope 7 { let _21: std::ptr::NonNull<[u8]>; scope 8 { - scope 11 (inlined NonNull::<[u8]>::as_mut_ptr) { - scope 12 (inlined NonNull::<[u8]>::as_non_null_ptr) { - scope 13 (inlined NonNull::<[u8]>::cast::) { + scope 12 (inlined NonNull::<[u8]>::as_mut_ptr) { + scope 13 (inlined NonNull::<[u8]>::as_non_null_ptr) { + scope 14 (inlined NonNull::<[u8]>::cast::) { let mut _25: *mut [u8]; - scope 14 (inlined NonNull::<[u8]>::as_ptr) { + scope 15 (inlined NonNull::<[u8]>::as_ptr) { } } } - scope 15 (inlined NonNull::::as_ptr) { + scope 16 (inlined NonNull::::as_ptr) { } } } scope 10 (inlined ::allocate) { + scope 11 (inlined std::alloc::Global::alloc_impl) { + } } } scope 9 (inlined #[track_caller] Layout::from_size_align_unchecked) { @@ -192,8 +194,8 @@ + _18 = const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}; StorageDead(_24); StorageLive(_19); -- _19 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], copy _18, const false) -> [return: bb7, unwind unreachable]; -+ _19 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}, const false) -> [return: bb7, unwind unreachable]; +- _19 = std::alloc::Global::alloc_impl_runtime(copy _18, const false) -> [return: bb7, unwind unreachable]; ++ _19 = std::alloc::Global::alloc_impl_runtime(const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}, const false) -> [return: bb7, unwind unreachable]; } bb7: { diff --git a/tests/mir-opt/inline/auxiliary/wrapper.rs b/tests/mir-opt/inline/auxiliary/wrapper.rs new file mode 100644 index 000000000000..35d3ae788239 --- /dev/null +++ b/tests/mir-opt/inline/auxiliary/wrapper.rs @@ -0,0 +1,10 @@ +//@ no-prefer-dynamic +//@ compile-flags: -O + +pub trait Compare { + fn eq(self); +} + +pub fn wrap(a: A) { + Compare::eq(a); +} diff --git a/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs b/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs new file mode 100644 index 000000000000..866d6fbd9e97 --- /dev/null +++ b/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs @@ -0,0 +1,54 @@ +//@ aux-build: wrapper.rs +//@ compile-flags: -Zmir-opt-level=2 -Zinline-mir +// skip-filecheck + +// This is a regression test for https://github.com/rust-lang/rust/issues/146998 + +extern crate wrapper; +use wrapper::{Compare, wrap}; + +pub struct BundleInner; + +impl Compare for BundleInner { + fn eq(self) { + lots_of_calls(); + wrap(Resource::ExtensionValue); + } +} + +pub enum Resource { + Bundle, + ExtensionValue, +} + +impl Compare for Resource { + fn eq(self) { + match self { + Self::Bundle => wrap(BundleInner), + Self::ExtensionValue => lots_of_calls(), + } + } +} + +macro_rules! units { + ($($n: ident)*) => { + $( + struct $n; + + impl Compare for $n { + fn eq(self) { } + } + + wrap($n); + )* + }; +} + +fn lots_of_calls() { + units! { + O1 O2 O3 O4 O5 O6 O7 O8 O9 O10 O11 O12 O13 O14 O15 O16 O17 O18 O19 O20 + O21 O22 O23 O24 O25 O26 O27 O28 O29 O30 O31 O32 O33 O34 O35 O36 O37 O38 O39 O40 + O41 O42 O43 O44 O45 O46 O47 O48 O49 O50 O51 O52 O53 O54 O55 O56 O57 O58 O59 O60 + O61 O62 O63 O64 O65 + } +} diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir index 791d6b71a6f7..013361d1d2fb 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir @@ -25,17 +25,21 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } } scope 18 (inlined ::deallocate) { - let mut _9: *mut u8; - scope 19 (inlined Layout::size) { - } - scope 20 (inlined NonNull::::as_ptr) { - } - scope 21 (inlined std::alloc::dealloc) { - let mut _10: usize; - scope 22 (inlined Layout::size) { - } - scope 23 (inlined Layout::align) { - scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 19 (inlined std::alloc::Global::deallocate_impl) { + scope 20 (inlined std::alloc::Global::deallocate_impl_runtime) { + let mut _9: *mut u8; + scope 21 (inlined Layout::size) { + } + scope 22 (inlined NonNull::::as_ptr) { + } + scope 23 (inlined std::alloc::dealloc) { + let mut _10: usize; + scope 24 (inlined Layout::size) { + } + scope 25 (inlined Layout::align) { + scope 26 (inlined std::ptr::Alignment::as_usize) { + } + } } } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir index 791d6b71a6f7..013361d1d2fb 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir @@ -25,17 +25,21 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } } scope 18 (inlined ::deallocate) { - let mut _9: *mut u8; - scope 19 (inlined Layout::size) { - } - scope 20 (inlined NonNull::::as_ptr) { - } - scope 21 (inlined std::alloc::dealloc) { - let mut _10: usize; - scope 22 (inlined Layout::size) { - } - scope 23 (inlined Layout::align) { - scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 19 (inlined std::alloc::Global::deallocate_impl) { + scope 20 (inlined std::alloc::Global::deallocate_impl_runtime) { + let mut _9: *mut u8; + scope 21 (inlined Layout::size) { + } + scope 22 (inlined NonNull::::as_ptr) { + } + scope 23 (inlined std::alloc::dealloc) { + let mut _10: usize; + scope 24 (inlined Layout::size) { + } + scope 25 (inlined Layout::align) { + scope 26 (inlined std::ptr::Alignment::as_usize) { + } + } } } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir index 791d6b71a6f7..013361d1d2fb 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir @@ -25,17 +25,21 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } } scope 18 (inlined ::deallocate) { - let mut _9: *mut u8; - scope 19 (inlined Layout::size) { - } - scope 20 (inlined NonNull::::as_ptr) { - } - scope 21 (inlined std::alloc::dealloc) { - let mut _10: usize; - scope 22 (inlined Layout::size) { - } - scope 23 (inlined Layout::align) { - scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 19 (inlined std::alloc::Global::deallocate_impl) { + scope 20 (inlined std::alloc::Global::deallocate_impl_runtime) { + let mut _9: *mut u8; + scope 21 (inlined Layout::size) { + } + scope 22 (inlined NonNull::::as_ptr) { + } + scope 23 (inlined std::alloc::dealloc) { + let mut _10: usize; + scope 24 (inlined Layout::size) { + } + scope 25 (inlined Layout::align) { + scope 26 (inlined std::ptr::Alignment::as_usize) { + } + } } } } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff index 3f854b6cbcfb..d0fda06c115c 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff @@ -9,33 +9,33 @@ let mut _4: *mut [u8]; let mut _5: std::ptr::NonNull<[u8]>; let mut _6: std::result::Result, std::alloc::AllocError>; - let mut _7: &std::alloc::Global; - let mut _8: std::alloc::Layout; + let mut _7: std::alloc::Layout; scope 1 { debug layout => _1; - let mut _9: &std::alloc::Global; scope 2 { debug ptr => _3; } scope 5 (inlined ::allocate) { - } - scope 6 (inlined #[track_caller] Result::, std::alloc::AllocError>::unwrap) { - let mut _12: isize; - let _13: std::alloc::AllocError; - let mut _14: !; - let mut _15: &dyn std::fmt::Debug; - let _16: &std::alloc::AllocError; - scope 7 { + scope 6 (inlined std::alloc::Global::alloc_impl) { } + } + scope 7 (inlined #[track_caller] Result::, std::alloc::AllocError>::unwrap) { + let mut _10: isize; + let _11: std::alloc::AllocError; + let mut _12: !; + let mut _13: &dyn std::fmt::Debug; + let _14: &std::alloc::AllocError; scope 8 { } + scope 9 { + } } - scope 9 (inlined NonNull::<[u8]>::as_ptr) { + scope 10 (inlined NonNull::<[u8]>::as_ptr) { } } scope 3 (inlined #[track_caller] Option::::unwrap) { - let mut _10: isize; - let mut _11: !; + let mut _8: isize; + let mut _9: !; scope 4 { } } @@ -46,10 +46,10 @@ StorageLive(_2); - _2 = Option::::None; + _2 = const Option::::None; - StorageLive(_10); -- _10 = discriminant(_2); -- switchInt(move _10) -> [0: bb2, 1: bb3, otherwise: bb1]; -+ _10 = const 0_isize; + StorageLive(_8); +- _8 = discriminant(_2); +- switchInt(move _8) -> [0: bb2, 1: bb3, otherwise: bb1]; ++ _8 = const 0_isize; + switchInt(const 0_isize) -> [0: bb2, 1: bb3, otherwise: bb1]; } @@ -58,48 +58,44 @@ } bb2: { - _11 = option::unwrap_failed() -> unwind unreachable; + _9 = option::unwrap_failed() -> unwind unreachable; } bb3: { - _1 = move ((_2 as Some).0: std::alloc::Layout); + _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; - StorageDead(_10); + StorageDead(_8); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); - _9 = const main::promoted[0]; - _7 = copy _9; - StorageLive(_8); -- _8 = copy _1; -- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable]; -+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; +- _7 = copy _1; +- _6 = std::alloc::Global::alloc_impl_runtime(move _7, const false) -> [return: bb4, unwind unreachable]; ++ _7 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; ++ _6 = std::alloc::Global::alloc_impl_runtime(const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; } bb4: { - StorageDead(_8); StorageDead(_7); - StorageLive(_12); - StorageLive(_16); - _12 = discriminant(_6); - switchInt(move _12) -> [0: bb6, 1: bb5, otherwise: bb1]; + StorageLive(_10); + StorageLive(_14); + _10 = discriminant(_6); + switchInt(move _10) -> [0: bb6, 1: bb5, otherwise: bb1]; } bb5: { - StorageLive(_15); - _16 = &_13; - _15 = copy _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize, Implicit)); - _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable; + StorageLive(_13); + _14 = &_11; + _13 = copy _14 as &dyn std::fmt::Debug (PointerCoercion(Unsize, Implicit)); + _12 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _13) -> unwind unreachable; } bb6: { _5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>); - StorageDead(_16); - StorageDead(_12); + StorageDead(_14); + StorageDead(_10); StorageDead(_6); _4 = copy _5 as *mut [u8] (Transmute); StorageDead(_5); diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff index 15a9d9e39c49..485ff902a7b9 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff @@ -9,22 +9,22 @@ let mut _4: *mut [u8]; let mut _5: std::ptr::NonNull<[u8]>; let mut _6: std::result::Result, std::alloc::AllocError>; - let mut _7: &std::alloc::Global; - let mut _8: std::alloc::Layout; + let mut _7: std::alloc::Layout; scope 1 { debug layout => _1; - let mut _9: &std::alloc::Global; scope 2 { debug ptr => _3; } scope 5 (inlined ::allocate) { + scope 6 (inlined std::alloc::Global::alloc_impl) { + } } - scope 6 (inlined NonNull::<[u8]>::as_ptr) { + scope 7 (inlined NonNull::<[u8]>::as_ptr) { } } scope 3 (inlined #[track_caller] Option::::unwrap) { - let mut _10: isize; - let mut _11: !; + let mut _8: isize; + let mut _9: !; scope 4 { } } @@ -35,10 +35,10 @@ StorageLive(_2); - _2 = Option::::None; + _2 = const Option::::None; - StorageLive(_10); -- _10 = discriminant(_2); -- switchInt(move _10) -> [0: bb3, 1: bb4, otherwise: bb2]; -+ _10 = const 0_isize; + StorageLive(_8); +- _8 = discriminant(_2); +- switchInt(move _8) -> [0: bb3, 1: bb4, otherwise: bb2]; ++ _8 = const 0_isize; + switchInt(const 0_isize) -> [0: bb3, 1: bb4, otherwise: bb2]; } @@ -59,30 +59,26 @@ } bb3: { - _11 = option::unwrap_failed() -> unwind continue; + _9 = option::unwrap_failed() -> unwind continue; } bb4: { - _1 = move ((_2 as Some).0: std::alloc::Layout); + _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; - StorageDead(_10); + StorageDead(_8); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); - _9 = const main::promoted[0]; - _7 = copy _9; - StorageLive(_8); -- _8 = copy _1; -- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue]; -+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; +- _7 = copy _1; +- _6 = std::alloc::Global::alloc_impl_runtime(move _7, const false) -> [return: bb5, unwind continue]; ++ _7 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; ++ _6 = std::alloc::Global::alloc_impl_runtime(const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; } bb5: { - StorageDead(_8); StorageDead(_7); _5 = Result::, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff index df008ececae3..beee899dafe6 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff @@ -9,22 +9,22 @@ let mut _4: *mut [u8]; let mut _5: std::ptr::NonNull<[u8]>; let mut _6: std::result::Result, std::alloc::AllocError>; - let mut _7: &std::alloc::Global; - let mut _8: std::alloc::Layout; + let mut _7: std::alloc::Layout; scope 1 { debug layout => _1; - let mut _9: &std::alloc::Global; scope 2 { debug ptr => _3; } scope 5 (inlined ::allocate) { + scope 6 (inlined std::alloc::Global::alloc_impl) { + } } - scope 6 (inlined NonNull::<[u8]>::as_ptr) { + scope 7 (inlined NonNull::<[u8]>::as_ptr) { } } scope 3 (inlined #[track_caller] Option::::unwrap) { - let mut _10: isize; - let mut _11: !; + let mut _8: isize; + let mut _9: !; scope 4 { } } @@ -35,10 +35,10 @@ StorageLive(_2); - _2 = Option::::None; + _2 = const Option::::None; - StorageLive(_10); -- _10 = discriminant(_2); -- switchInt(move _10) -> [0: bb3, 1: bb4, otherwise: bb2]; -+ _10 = const 0_isize; + StorageLive(_8); +- _8 = discriminant(_2); +- switchInt(move _8) -> [0: bb3, 1: bb4, otherwise: bb2]; ++ _8 = const 0_isize; + switchInt(const 0_isize) -> [0: bb3, 1: bb4, otherwise: bb2]; } @@ -59,30 +59,26 @@ } bb3: { - _11 = option::unwrap_failed() -> unwind continue; + _9 = option::unwrap_failed() -> unwind continue; } bb4: { - _1 = move ((_2 as Some).0: std::alloc::Layout); + _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; - StorageDead(_10); + StorageDead(_8); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); - _9 = const main::promoted[0]; - _7 = copy _9; - StorageLive(_8); -- _8 = copy _1; -- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue]; -+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; +- _7 = copy _1; +- _6 = std::alloc::Global::alloc_impl_runtime(move _7, const false) -> [return: bb5, unwind continue]; ++ _7 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; ++ _6 = std::alloc::Global::alloc_impl_runtime(const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; } bb5: { - StorageDead(_8); StorageDead(_7); _5 = Result::, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir index 4260ec3eaedf..6ab4b7712306 100644 --- a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir @@ -3,304 +3,322 @@ fn vec_move(_1: Vec) -> () { debug v => _1; let mut _0: (); - let mut _21: std::vec::IntoIter; let mut _22: std::vec::IntoIter; - let mut _23: &mut std::vec::IntoIter; - let mut _24: std::option::Option; - let mut _25: isize; - let _27: (); + let mut _23: std::vec::IntoIter; + let mut _24: &mut std::vec::IntoIter; + let mut _25: std::option::Option; + let mut _26: isize; + let _28: (); scope 1 { - debug iter => _22; - let _26: impl Sized; + debug iter => _23; + let _27: impl Sized; scope 2 { - debug x => _26; + debug x => _27; } } scope 3 (inlined as IntoIterator>::into_iter) { debug self => _1; - let _2: std::mem::ManuallyDrop>; - let mut _3: *const std::alloc::Global; - let mut _8: usize; - let mut _10: *mut impl Sized; - let mut _11: *const impl Sized; - let mut _12: usize; - let _28: &std::vec::Vec; - let mut _29: &std::mem::ManuallyDrop>; - let mut _30: &alloc::raw_vec::RawVec; - let mut _31: &std::mem::ManuallyDrop>; - let _32: &std::vec::Vec; - let mut _33: &std::mem::ManuallyDrop>; - let _34: &std::vec::Vec; - let mut _35: &std::mem::ManuallyDrop>; - let mut _36: &alloc::raw_vec::RawVec; - let mut _37: &std::mem::ManuallyDrop>; + let _3: std::mem::ManuallyDrop>; + let mut _4: *const std::alloc::Global; + let mut _9: usize; + let mut _11: *mut impl Sized; + let mut _12: *const impl Sized; + let mut _13: usize; + let _29: &std::vec::Vec; + let mut _30: &std::mem::ManuallyDrop>; + let mut _31: &alloc::raw_vec::RawVec; + let mut _32: &std::mem::ManuallyDrop>; + let _33: &std::vec::Vec; + let mut _34: &std::mem::ManuallyDrop>; + let _35: &std::vec::Vec; + let mut _36: &std::mem::ManuallyDrop>; + let mut _37: &alloc::raw_vec::RawVec; + let mut _38: &std::mem::ManuallyDrop>; scope 4 { - debug me => _2; + debug me => _3; scope 5 { - debug alloc => const ManuallyDrop:: {{ value: std::alloc::Global }}; - let _6: std::ptr::NonNull; + debug alloc => const ManuallyDrop:: {{ value: MaybeDangling::(std::alloc::Global) }}; + let _7: std::ptr::NonNull; scope 6 { - debug buf => _6; - let _7: *mut impl Sized; + debug buf => _7; + let _8: *mut impl Sized; scope 7 { - debug begin => _7; + debug begin => _8; scope 8 { - debug end => _11; - let _19: usize; + debug end => _12; + let _20: usize; scope 9 { - debug cap => _19; + debug cap => _20; } - scope 39 (inlined > as Deref>::deref) { - debug self => _37; - } - scope 40 (inlined alloc::raw_vec::RawVec::::capacity) { - debug self => _36; - let mut _38: &alloc::raw_vec::RawVecInner; - scope 41 (inlined std::mem::size_of::) { + scope 45 (inlined > as Deref>::deref) { + debug self => _38; + scope 46 (inlined MaybeDangling::>::as_ref) { } - scope 42 (inlined alloc::raw_vec::RawVecInner::capacity) { - debug self => _38; + } + scope 47 (inlined alloc::raw_vec::RawVec::::capacity) { + debug self => _37; + let mut _39: &alloc::raw_vec::RawVecInner; + scope 48 (inlined std::mem::size_of::) { + } + scope 49 (inlined alloc::raw_vec::RawVecInner::capacity) { + debug self => _39; debug elem_size => const ::SIZE; - let mut _20: core::num::niche_types::UsizeNoHighBit; - scope 43 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) { - debug self => _20; + let mut _21: core::num::niche_types::UsizeNoHighBit; + scope 50 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) { + debug self => _21; } } } } - scope 25 (inlined > as Deref>::deref) { - debug self => _33; - } - scope 26 (inlined Vec::::len) { - debug self => _32; - let mut _13: bool; - scope 27 { - } - } - scope 28 (inlined std::ptr::mut_ptr::::wrapping_byte_add) { - debug self => _7; - debug count => _12; - let mut _14: *mut u8; - let mut _18: *mut u8; - scope 29 (inlined std::ptr::mut_ptr::::cast::) { - debug self => _7; - } - scope 30 (inlined std::ptr::mut_ptr::::wrapping_add) { - debug self => _14; - debug count => _12; - let mut _15: isize; - scope 31 (inlined std::ptr::mut_ptr::::wrapping_offset) { - debug self => _14; - debug count => _15; - let mut _16: *const u8; - let mut _17: *const u8; - } - } - scope 32 (inlined std::ptr::mut_ptr::::with_metadata_of::) { - debug self => _18; - debug meta => _5; - scope 33 (inlined std::ptr::metadata::) { - debug ptr => _5; - } - scope 34 (inlined std::ptr::from_raw_parts_mut::) { - } - } - } - scope 35 (inlined > as Deref>::deref) { - debug self => _35; - } - scope 36 (inlined Vec::::len) { + scope 29 (inlined > as Deref>::deref) { debug self => _34; - let mut _9: bool; - scope 37 { + scope 30 (inlined MaybeDangling::>::as_ref) { } } - scope 38 (inlined #[track_caller] std::ptr::mut_ptr::::add) { - debug self => _7; - debug count => _8; + scope 31 (inlined Vec::::len) { + debug self => _33; + let mut _14: bool; + scope 32 { + } } - } - scope 24 (inlined NonNull::::as_ptr) { - debug self => _6; - } - } - scope 17 (inlined > as Deref>::deref) { - debug self => _31; - } - scope 18 (inlined alloc::raw_vec::RawVec::::non_null) { - debug self => _30; - scope 19 (inlined alloc::raw_vec::RawVecInner::non_null::) { - let mut _4: std::ptr::NonNull; - scope 20 (inlined Unique::::cast::) { - scope 21 (inlined NonNull::::cast::) { - let mut _5: *const impl Sized; - scope 22 (inlined NonNull::::as_ptr) { + scope 33 (inlined std::ptr::mut_ptr::::wrapping_byte_add) { + debug self => _8; + debug count => _13; + let mut _15: *mut u8; + let mut _19: *mut u8; + scope 34 (inlined std::ptr::mut_ptr::::cast::) { + debug self => _8; + } + scope 35 (inlined std::ptr::mut_ptr::::wrapping_add) { + debug self => _15; + debug count => _13; + let mut _16: isize; + scope 36 (inlined std::ptr::mut_ptr::::wrapping_offset) { + debug self => _15; + debug count => _16; + let mut _17: *const u8; + let mut _18: *const u8; + } + } + scope 37 (inlined std::ptr::mut_ptr::::with_metadata_of::) { + debug self => _19; + debug meta => _6; + scope 38 (inlined std::ptr::metadata::) { + debug ptr => _6; + } + scope 39 (inlined std::ptr::from_raw_parts_mut::) { } } } - scope 23 (inlined Unique::::as_non_null_ptr) { + scope 40 (inlined > as Deref>::deref) { + debug self => _36; + scope 41 (inlined MaybeDangling::>::as_ref) { + } + } + scope 42 (inlined Vec::::len) { + debug self => _35; + let mut _10: bool; + scope 43 { + } + } + scope 44 (inlined #[track_caller] std::ptr::mut_ptr::::add) { + debug self => _8; + debug count => _9; + } + } + scope 28 (inlined NonNull::::as_ptr) { + debug self => _7; + } + } + scope 20 (inlined > as Deref>::deref) { + debug self => _32; + scope 21 (inlined MaybeDangling::>::as_ref) { + } + } + scope 22 (inlined alloc::raw_vec::RawVec::::non_null) { + debug self => _31; + scope 23 (inlined alloc::raw_vec::RawVecInner::non_null::) { + let mut _5: std::ptr::NonNull; + scope 24 (inlined Unique::::cast::) { + scope 25 (inlined NonNull::::cast::) { + let mut _6: *const impl Sized; + scope 26 (inlined NonNull::::as_ptr) { + } + } + } + scope 27 (inlined Unique::::as_non_null_ptr) { } } } } - scope 11 (inlined > as Deref>::deref) { - debug self => _29; + scope 12 (inlined > as Deref>::deref) { + debug self => _30; + scope 13 (inlined MaybeDangling::>::as_ref) { + } } - scope 12 (inlined Vec::::allocator) { - debug self => _28; - scope 13 (inlined alloc::raw_vec::RawVec::::allocator) { - scope 14 (inlined alloc::raw_vec::RawVecInner::allocator) { + scope 14 (inlined Vec::::allocator) { + debug self => _29; + scope 15 (inlined alloc::raw_vec::RawVec::::allocator) { + scope 16 (inlined alloc::raw_vec::RawVecInner::allocator) { } } } - scope 15 (inlined #[track_caller] std::ptr::read::) { - debug src => _3; + scope 17 (inlined #[track_caller] std::ptr::read::) { + debug src => _4; } - scope 16 (inlined ManuallyDrop::::new) { + scope 18 (inlined ManuallyDrop::::new) { debug value => const std::alloc::Global; + scope 19 (inlined MaybeDangling::::new) { + } } } scope 10 (inlined ManuallyDrop::>::new) { debug value => _1; + let mut _2: std::mem::MaybeDangling>; + scope 11 (inlined MaybeDangling::>::new) { + } } } bb0: { - StorageLive(_21); - StorageLive(_6); + StorageLive(_22); StorageLive(_7); - StorageLive(_11); - StorageLive(_19); + StorageLive(_8); + StorageLive(_12); + StorageLive(_20); + StorageLive(_6); StorageLive(_5); - StorageLive(_4); - StorageLive(_17); - StorageLive(_2); - _2 = ManuallyDrop::> { value: copy _1 }; + StorageLive(_18); StorageLive(_3); - // DBG: _29 = &_2; - // DBG: _28 = &(_2.0: std::vec::Vec); - _3 = &raw const ((((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global); - StorageDead(_3); - // DBG: _31 = &_2; - // DBG: _30 = &((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec); - _4 = copy (((((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _5 = copy _4 as *const impl Sized (Transmute); - _6 = NonNull:: { pointer: copy _5 }; - _7 = copy _4 as *mut impl Sized (Transmute); + StorageLive(_2); + _2 = MaybeDangling::>(copy _1); + _3 = ManuallyDrop::> { value: move _2 }; + StorageDead(_2); + StorageLive(_4); + // DBG: _30 = &_3; + // DBG: _29 = &((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec); + _4 = &raw const (((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global); + StorageDead(_4); + // DBG: _32 = &_3; + // DBG: _31 = &(((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec); + _5 = copy ((((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); + _6 = copy _5 as *const impl Sized (Transmute); + _7 = NonNull:: { pointer: copy _6 }; + _8 = copy _5 as *mut impl Sized (Transmute); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); - StorageLive(_8); - // DBG: _35 = &_2; - // DBG: _34 = &(_2.0: std::vec::Vec); - _8 = copy ((_2.0: std::vec::Vec).1: usize); + StorageLive(_11); StorageLive(_9); - _9 = Le(copy _8, const ::MAX_SLICE_LEN); - assume(move _9); - StorageDead(_9); - _10 = Offset(copy _7, copy _8); - _11 = copy _10 as *const impl Sized (PtrToPtr); - StorageDead(_8); + // DBG: _36 = &_3; + // DBG: _35 = &((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec); + _9 = copy (((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).1: usize); + StorageLive(_10); + _10 = Le(copy _9, const ::MAX_SLICE_LEN); + assume(move _10); StorageDead(_10); + _11 = Offset(copy _8, copy _9); + _12 = copy _11 as *const impl Sized (PtrToPtr); + StorageDead(_9); + StorageDead(_11); goto -> bb4; } bb2: { - StorageLive(_12); - // DBG: _33 = &_2; - // DBG: _32 = &(_2.0: std::vec::Vec); - _12 = copy ((_2.0: std::vec::Vec).1: usize); StorageLive(_13); - _13 = Le(copy _12, const ::MAX_SLICE_LEN); - assume(move _13); - StorageDead(_13); - StorageLive(_18); + // DBG: _34 = &_3; + // DBG: _33 = &((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec); + _13 = copy (((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).1: usize); StorageLive(_14); - _14 = copy _4 as *mut u8 (Transmute); + _14 = Le(copy _13, const ::MAX_SLICE_LEN); + assume(move _14); + StorageDead(_14); + StorageLive(_19); StorageLive(_15); - _15 = copy _12 as isize (IntToInt); + _15 = copy _5 as *mut u8 (Transmute); StorageLive(_16); - _16 = copy _4 as *const u8 (Transmute); - _17 = arith_offset::(move _16, move _15) -> [return: bb3, unwind unreachable]; + _16 = copy _13 as isize (IntToInt); + StorageLive(_17); + _17 = copy _5 as *const u8 (Transmute); + _18 = arith_offset::(move _17, move _16) -> [return: bb3, unwind unreachable]; } bb3: { + StorageDead(_17); + _19 = copy _18 as *mut u8 (PtrToPtr); StorageDead(_16); - _18 = copy _17 as *mut u8 (PtrToPtr); StorageDead(_15); - StorageDead(_14); - StorageDead(_18); - StorageDead(_12); - _11 = copy _17 as *const impl Sized (PtrToPtr); + StorageDead(_19); + StorageDead(_13); + _12 = copy _18 as *const impl Sized (PtrToPtr); goto -> bb4; } bb4: { - // DBG: _37 = &_2; - // DBG: _36 = &((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec); - // DBG: _38 = &(((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner); + // DBG: _38 = &_3; + // DBG: _37 = &(((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec); + // DBG: _39 = &((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner); switchInt(const ::SIZE) -> [0: bb5, otherwise: bb6]; } bb5: { - _19 = const usize::MAX; + _20 = const usize::MAX; goto -> bb7; } bb6: { - StorageLive(_20); - _20 = copy ((((_2.0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit); - _19 = copy _20 as usize (Transmute); - StorageDead(_20); + StorageLive(_21); + _21 = copy (((((_3.0: std::mem::MaybeDangling>).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit); + _20 = copy _21 as usize (Transmute); + StorageDead(_21); goto -> bb7; } bb7: { - _21 = std::vec::IntoIter:: { buf: copy _6, phantom: const ZeroSized: PhantomData, cap: move _19, alloc: const ManuallyDrop:: {{ value: std::alloc::Global }}, ptr: copy _6, end: copy _11 }; - StorageDead(_2); - StorageDead(_17); - StorageDead(_4); + _22 = std::vec::IntoIter:: { buf: copy _7, phantom: const ZeroSized: PhantomData, cap: move _20, alloc: const ManuallyDrop:: {{ value: MaybeDangling::(std::alloc::Global) }}, ptr: copy _7, end: copy _12 }; + StorageDead(_3); + StorageDead(_18); StorageDead(_5); - StorageDead(_19); - StorageDead(_11); - StorageDead(_7); StorageDead(_6); - StorageLive(_22); - _22 = move _21; + StorageDead(_20); + StorageDead(_12); + StorageDead(_8); + StorageDead(_7); + StorageLive(_23); + _23 = move _22; goto -> bb8; } bb8: { - StorageLive(_24); - _23 = &mut _22; - _24 = as Iterator>::next(move _23) -> [return: bb9, unwind: bb15]; + StorageLive(_25); + _24 = &mut _23; + _25 = as Iterator>::next(move _24) -> [return: bb9, unwind: bb15]; } bb9: { - _25 = discriminant(_24); - switchInt(move _25) -> [0: bb10, 1: bb12, otherwise: bb14]; + _26 = discriminant(_25); + switchInt(move _26) -> [0: bb10, 1: bb12, otherwise: bb14]; } bb10: { - StorageDead(_24); - drop(_22) -> [return: bb11, unwind continue]; + StorageDead(_25); + drop(_23) -> [return: bb11, unwind continue]; } bb11: { + StorageDead(_23); StorageDead(_22); - StorageDead(_21); return; } bb12: { - _26 = move ((_24 as Some).0: impl Sized); - _27 = opaque::(move _26) -> [return: bb13, unwind: bb15]; + _27 = move ((_25 as Some).0: impl Sized); + _28 = opaque::(move _27) -> [return: bb13, unwind: bb15]; } bb13: { - StorageDead(_24); + StorageDead(_25); goto -> bb8; } @@ -309,7 +327,7 @@ fn vec_move(_1: Vec) -> () { } bb15 (cleanup): { - drop(_22) -> [return: bb16, unwind terminate(cleanup)]; + drop(_23) -> [return: bb16, unwind terminate(cleanup)]; } bb16 (cleanup): { diff --git a/tests/pretty/delegation-inherit-attributes.pp b/tests/pretty/delegation-inherit-attributes.pp index 772e177b8883..8e30da1ad589 100644 --- a/tests/pretty/delegation-inherit-attributes.pp +++ b/tests/pretty/delegation-inherit-attributes.pp @@ -57,5 +57,69 @@ const fn const_fn_extern() -> _ { to_reuse_functions::const_fn_extern() } #[attr = Inline(Hint)] async fn async_fn_extern() -> _ { to_reuse_functions::async_fn_extern() } +mod recursive { + // Check that `baz` inherit attribute from `foo` + mod first { + fn bar() { } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn foo() -> _ { bar() } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn baz() -> _ { foo() } + } + + // Check that `baz` inherit attribute from `bar` + mod second { + #[attr = MustUse {reason: "some reason"}] + fn bar() { } + + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn foo() -> _ { bar() } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn baz() -> _ { foo() } + } + + // Check that `foo5` don't inherit attribute from `bar` + // and inherit attribute from foo4, check that foo1, foo2 and foo3 + // inherit attribute from bar + mod third { + #[attr = MustUse {reason: "some reason"}] + fn bar() { } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn foo1() -> _ { bar() } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn foo2() -> _ { foo1() } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn foo3() -> _ { foo2() } + #[attr = MustUse {reason: "foo4"}] + #[attr = Inline(Hint)] + fn foo4() -> _ { foo3() } + #[attr = MustUse {reason: "foo4"}] + #[attr = Inline(Hint)] + fn foo5() -> _ { foo4() } + } + + mod fourth { + trait T { + fn foo(&self, x: usize) -> usize { x + 1 } + } + + struct X; + impl T for X { } + + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn foo(self: _, arg1: _) -> _ { ::foo(self + 1, arg1) } + #[attr = MustUse {reason: "some reason"}] + #[attr = Inline(Hint)] + fn bar(self: _, arg1: _) -> _ { foo(self + 1, arg1) } + } +} fn main() { } diff --git a/tests/pretty/delegation-inherit-attributes.rs b/tests/pretty/delegation-inherit-attributes.rs index fe74b9a55a7d..581294d472a3 100644 --- a/tests/pretty/delegation-inherit-attributes.rs +++ b/tests/pretty/delegation-inherit-attributes.rs @@ -52,5 +52,50 @@ reuse to_reuse_functions::const_fn_extern; #[must_use = "some reason"] reuse to_reuse_functions::async_fn_extern; +mod recursive { + // Check that `baz` inherit attribute from `foo` + mod first { + fn bar() {} + #[must_use = "some reason"] + reuse bar as foo; + reuse foo as baz; + } + + // Check that `baz` inherit attribute from `bar` + mod second { + #[must_use = "some reason"] + fn bar() {} + + reuse bar as foo; + reuse foo as baz; + } + + // Check that `foo5` don't inherit attribute from `bar` + // and inherit attribute from foo4, check that foo1, foo2 and foo3 + // inherit attribute from bar + mod third { + #[must_use = "some reason"] + fn bar() {} + reuse bar as foo1; + reuse foo1 as foo2; + reuse foo2 as foo3; + #[must_use = "foo4"] + reuse foo3 as foo4; + reuse foo4 as foo5; + } + + mod fourth { + trait T { + fn foo(&self, x: usize) -> usize { x + 1 } + } + + struct X; + impl T for X {} + + #[must_use = "some reason"] + reuse ::foo { self + 1 } + reuse foo as bar { self + 1 } + } +} fn main() {} diff --git a/tests/pretty/delegation_inline_attribute.pp b/tests/pretty/delegation-inline-attribute.pp similarity index 98% rename from tests/pretty/delegation_inline_attribute.pp rename to tests/pretty/delegation-inline-attribute.pp index 4b3b2aa8f80a..826d099e8155 100644 --- a/tests/pretty/delegation_inline_attribute.pp +++ b/tests/pretty/delegation-inline-attribute.pp @@ -1,6 +1,6 @@ //@ pretty-compare-only //@ pretty-mode:hir -//@ pp-exact:delegation_inline_attribute.pp +//@ pp-exact:delegation-inline-attribute.pp #![allow(incomplete_features)] #![feature(fn_delegation)] diff --git a/tests/pretty/delegation_inline_attribute.rs b/tests/pretty/delegation-inline-attribute.rs similarity index 98% rename from tests/pretty/delegation_inline_attribute.rs rename to tests/pretty/delegation-inline-attribute.rs index 0716cfc51f5d..c79f68f8942d 100644 --- a/tests/pretty/delegation_inline_attribute.rs +++ b/tests/pretty/delegation-inline-attribute.rs @@ -1,6 +1,6 @@ //@ pretty-compare-only //@ pretty-mode:hir -//@ pp-exact:delegation_inline_attribute.pp +//@ pp-exact:delegation-inline-attribute.pp #![allow(incomplete_features)] #![feature(fn_delegation)] diff --git a/tests/run-make/apple-deployment-target/rmake.rs b/tests/run-make/apple-deployment-target/rmake.rs index 5d4512843d53..fb46c554c94c 100644 --- a/tests/run-make/apple-deployment-target/rmake.rs +++ b/tests/run-make/apple-deployment-target/rmake.rs @@ -169,9 +169,8 @@ fn main() { // Test that all binaries in rlibs produced by `rustc` have the same version. // Regression test for https://github.com/rust-lang/rust/issues/128419. - let sysroot = rustc().print("sysroot").run().stdout_utf8(); - let target_sysroot = path(sysroot.trim()).join("lib/rustlib").join(target()).join("lib"); - let rlibs = shallow_find_files(&target_sysroot, |path| has_extension(path, "rlib")); + let sysroot_libs_dir = rustc().print("target-libdir").target(target()).run().stdout_utf8(); + let rlibs = shallow_find_files(sysroot_libs_dir.trim(), |path| has_extension(path, "rlib")); let output = cmd("otool").arg("-l").args(rlibs).run().stdout_utf8(); let re = regex::Regex::new(r"(minos|version) ([0-9.]*)").unwrap(); diff --git a/tests/run-make/cdylib-dylib-linkage/rmake.rs b/tests/run-make/cdylib-dylib-linkage/rmake.rs index 3c145d9f99cf..59d8d0337daf 100644 --- a/tests/run-make/cdylib-dylib-linkage/rmake.rs +++ b/tests/run-make/cdylib-dylib-linkage/rmake.rs @@ -16,24 +16,23 @@ use run_make_support::{ fn main() { rustc().arg("-Cprefer-dynamic").input("bar.rs").run(); rustc().input("foo.rs").run(); - let sysroot = rustc().print("sysroot").run().stdout_utf8(); - let sysroot = sysroot.trim(); - let target_sysroot = path(sysroot).join("lib/rustlib").join(target()).join("lib"); + let sysroot_libs_dir = rustc().print("target-libdir").target(target()).run().stdout_utf8(); + let sysroot_libs_dir = sysroot_libs_dir.trim(); if is_windows_msvc() { - let mut libs = shallow_find_files(&target_sysroot, |path| { + let mut libs = shallow_find_files(sysroot_libs_dir, |path| { has_prefix(path, "libstd-") && has_suffix(path, ".dll.lib") }); libs.push(path(msvc_import_dynamic_lib_name("foo"))); libs.push(path(msvc_import_dynamic_lib_name("bar"))); cc().input("foo.c").args(&libs).out_exe("foo").run(); } else { - let stdlibs = shallow_find_files(&target_sysroot, |path| { + let stdlibs = shallow_find_files(sysroot_libs_dir, |path| { has_extension(path, dynamic_lib_extension()) && filename_contains(path, "std") }); cc().input("foo.c") .args(&[dynamic_lib_name("foo"), dynamic_lib_name("bar")]) .arg(stdlibs.get(0).unwrap()) - .library_search_path(&target_sysroot) + .library_search_path(sysroot_libs_dir) .output(bin_name("foo")) .run(); } diff --git a/tests/run-make/crate-loading/dep-2-reexport.rs b/tests/run-make/crate-loading/dep-2-reexport.rs index 07444511472f..8b6ee6749dcc 100644 --- a/tests/run-make/crate-loading/dep-2-reexport.rs +++ b/tests/run-make/crate-loading/dep-2-reexport.rs @@ -2,9 +2,23 @@ #![crate_type = "rlib"] extern crate dependency; -pub use dependency::{Trait2, Type, do_something_trait, do_something_type}; +pub use dependency::{Error, OtherError, Trait2, Type, do_something_trait, do_something_type}; pub struct OtherType; impl dependency::Trait for OtherType { fn foo(&self) {} fn bar() {} } +#[derive(Debug)] +pub struct Error2; + +impl From for Error2 { + fn from(_: Error) -> Error2 { + Error2 + } +} + +impl From for Error2 { + fn from(_: OtherError) -> Error2 { + Error2 + } +} diff --git a/tests/run-make/crate-loading/dependency-1.rs b/tests/run-make/crate-loading/dependency-1.rs index bfeabccf5c14..0eea7a7fae8b 100644 --- a/tests/run-make/crate-loading/dependency-1.rs +++ b/tests/run-make/crate-loading/dependency-1.rs @@ -13,3 +13,27 @@ impl Trait for Type { pub fn do_something(_: X) {} pub fn do_something_type(_: Type) {} pub fn do_something_trait(_: Box) {} + +#[derive(Debug)] +pub struct Error; + +impl From<()> for Error { + fn from(t: ()) -> Error { + Error + } +} + +#[derive(Debug)] +pub struct OtherError; + +impl From<()> for OtherError { + fn from(t: ()) -> OtherError { + OtherError + } +} + +impl From for OtherError { + fn from(t: i32) -> OtherError { + OtherError + } +} diff --git a/tests/run-make/crate-loading/dependency-2.rs b/tests/run-make/crate-loading/dependency-2.rs index 682d1ff64b82..a07873297c54 100644 --- a/tests/run-make/crate-loading/dependency-2.rs +++ b/tests/run-make/crate-loading/dependency-2.rs @@ -14,3 +14,27 @@ impl Trait for Type { pub fn do_something(_: X) {} pub fn do_something_type(_: Type) {} pub fn do_something_trait(_: Box) {} + +#[derive(Debug)] +pub struct Error; + +impl From<()> for Error { + fn from(t: ()) -> Error { + Error + } +} + +#[derive(Debug)] +pub struct OtherError; + +impl From<()> for OtherError { + fn from(_: ()) -> OtherError { + OtherError + } +} + +impl From for OtherError { + fn from(_: i32) -> OtherError { + OtherError + } +} diff --git a/tests/run-make/crate-loading/multiple-dep-versions.rs b/tests/run-make/crate-loading/multiple-dep-versions.rs index 3a4a20d38fc8..69b8360a8c92 100644 --- a/tests/run-make/crate-loading/multiple-dep-versions.rs +++ b/tests/run-make/crate-loading/multiple-dep-versions.rs @@ -1,13 +1,20 @@ extern crate dep_2_reexport; extern crate dependency; -use dep_2_reexport::{OtherType, Trait2, Type}; -use dependency::{Trait, do_something, do_something_trait, do_something_type}; +use dep_2_reexport::{Error2, OtherType, Trait2, Type}; +use dependency::{Error, OtherError, Trait, do_something, do_something_trait, do_something_type}; -fn main() { +fn main() -> Result<(), Error> { do_something(Type); Type.foo(); Type::bar(); do_something(OtherType); do_something_type(Type); do_something_trait(Box::new(Type) as Box); + Err(Error2)?; + Ok(()) +} + +fn foo() -> Result<(), OtherError> { + Err(Error2)?; + Ok(()) } diff --git a/tests/run-make/crate-loading/multiple-dep-versions.stderr b/tests/run-make/crate-loading/multiple-dep-versions.stderr index 235a44a8ce89..f8f8bfaaff6f 100644 --- a/tests/run-make/crate-loading/multiple-dep-versions.stderr +++ b/tests/run-make/crate-loading/multiple-dep-versions.stderr @@ -144,7 +144,51 @@ note: function defined here LL | pub fn do_something_trait(_: Box) {} | ^^^^^^^^^^^^^^^^^^ -error: aborting due to 6 previous errors +error[E0277]: `?` couldn't convert the error to `dependency::Error` + --> replaced + | +LL | fn main() -> Result<(), Error> { + | ----------------- expected `dependency::Error` because of this +... +LL | Err(Error2)?; + | -----------^ the trait `From` is not implemented for `dependency::Error` + | | + | this can't be annotated with `?` because it has type `Result<_, Error2>` + | + = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait +help: the trait `From` is not implemented for `dependency::Error` + but trait `From<()>` is implemented for it + --> replaced + | +LL | impl From<()> for Error { + | ^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `()`, found `Error2` + = note: there are multiple different versions of crate `dependency` in the dependency graph + = help: you can use `cargo tree` to explore your dependency tree + +error[E0277]: `?` couldn't convert the error to `dependency::OtherError` + --> replaced + | +LL | fn foo() -> Result<(), OtherError> { + | ---------------------- expected `dependency::OtherError` because of this +LL | Err(Error2)?; + | -----------^ the trait `From` is not implemented for `dependency::OtherError` + | | + | this can't be annotated with `?` because it has type `Result<_, Error2>` + | + = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait +help: the following other types implement trait `From` + --> replaced + | +LL | impl From<()> for OtherError { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dependency::OtherError` implements `From<()>` +... +LL | impl From for OtherError { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dependency::OtherError` implements `From` + = note: there are multiple different versions of crate `dependency` in the dependency graph + = help: you can use `cargo tree` to explore your dependency tree + +error: aborting due to 8 previous errors Some errors have detailed explanations: E0277, E0308, E0599. For more information about an error, try `rustc --explain E0277`. \ No newline at end of file diff --git a/tests/run-make/libstd-no-protected/rmake.rs b/tests/run-make/libstd-no-protected/rmake.rs index 4091406d46e2..75a1dcc4a7d0 100644 --- a/tests/run-make/libstd-no-protected/rmake.rs +++ b/tests/run-make/libstd-no-protected/rmake.rs @@ -15,10 +15,8 @@ type SymbolTable<'data> = run_make_support::object::read::elf::SymbolTable<'data fn main() { // Find libstd-...rlib - let sysroot = rustc().print("sysroot").run().stdout_utf8(); - let sysroot = sysroot.trim(); - let target_sysroot = path(sysroot).join("lib/rustlib").join(target()).join("lib"); - let mut libs = shallow_find_files(&target_sysroot, |path| { + let sysroot_libs_dir = rustc().print("target-libdir").target(target()).run().stdout_utf8(); + let mut libs = shallow_find_files(sysroot_libs_dir.trim(), |path| { has_prefix(path, "libstd-") && has_suffix(path, ".rlib") }); assert_eq!(libs.len(), 1); diff --git a/tests/run-make/sysroot-crates-are-unstable/rmake.rs b/tests/run-make/sysroot-crates-are-unstable/rmake.rs index 20ad01bef61d..623b9650771c 100644 --- a/tests/run-make/sysroot-crates-are-unstable/rmake.rs +++ b/tests/run-make/sysroot-crates-are-unstable/rmake.rs @@ -44,8 +44,8 @@ fn check_crate_is_unstable(cr: &Crate) { } fn get_unstable_sysroot_crates() -> Vec { - let sysroot = PathBuf::from(rustc().print("sysroot").run().stdout_utf8().trim()); - let sysroot_libs_dir = sysroot.join("lib").join("rustlib").join(target()).join("lib"); + let sysroot_libs_dir = + PathBuf::from(rustc().print("target-libdir").target(target()).run().stdout_utf8().trim()); println!("Sysroot libs dir: {sysroot_libs_dir:?}"); // Generate a list of all library crates in the sysroot. diff --git a/tests/rustdoc-gui/anchors.goml b/tests/rustdoc-gui/anchors.goml index 3168c8e17c52..0e8c834a7a77 100644 --- a/tests/rustdoc-gui/anchors.goml +++ b/tests/rustdoc-gui/anchors.goml @@ -15,7 +15,7 @@ define-function: ( assert-css: (".main-heading h1 span", {"color": |main_heading_type_color|}) assert-css: ( ".rightside a.src", - {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, + {"color": |src_link_color|, "text-decoration": "none"}, ALL, ) compare-elements-css: ( @@ -32,17 +32,17 @@ define-function: ( move-cursor-to: ".main-heading a.src" assert-css: ( ".main-heading a.src", - {"color": |src_link_color|, "text-decoration": "underline solid " + |src_link_color|}, + {"color": |src_link_color|, "text-decoration": "underline"}, ) move-cursor-to: ".impl-items .rightside a.src" assert-css: ( ".impl-items .rightside a.src", - {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, + {"color": |src_link_color|, "text-decoration": "none"}, ) move-cursor-to: ".impl-items a.rightside.src" assert-css: ( ".impl-items a.rightside.src", - {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, + {"color": |src_link_color|, "text-decoration": "none"}, ) go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" diff --git a/tests/rustdoc-gui/copy-code.goml b/tests/rustdoc-gui/copy-code.goml index a6fb816c4bd6..14421ab746f5 100644 --- a/tests/rustdoc-gui/copy-code.goml +++ b/tests/rustdoc-gui/copy-code.goml @@ -42,7 +42,31 @@ store-size: (".example-wrap:nth-of-type(1) .copy-button", { }) assert: |copy_height| > 0 && |copy_width| > 0 -// Checking same things for the copy button when there is no run button. + +// We now check that copying code when line numbers are displayed don't include these line numbers. + +// First we ensure that the clipboard is empty. +assert-clipboard: "" +// We make the line numbers appear. +click: "rustdoc-toolbar .settings-menu" +wait-for-css: ("#settings", {"display": "block"}) +// We make the line numbers appear. +click: "#line-numbers" +wait-for-local-storage: {"rustdoc-line-numbers": "true" } +// We close the settings menu. +click: "rustdoc-toolbar .settings-menu" +wait-for-css-false: ("#settings", {"display": "block"}) +// We ensure that there are actually line numbers generated in the DOM. +assert-text: (".example-wrap pre.rust code span[data-nosnippet]", "1") +// We make the copy button appear. +move-cursor-to: ".example-wrap pre.rust code" +wait-for-css: (".example-wrap .button-holder", {"visibility": "visible"}) +// We click on the copy button. +click: ".example-wrap .button-holder .copy-button" +assert-clipboard: 'println!("nothing fancy"); +println!("but with two lines!");' + +// Back to UI checks, checking same things for the copy button when there is no run button. go-to: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html" call-function: ("check-copy-button", {}) // Ensure there is no run button. diff --git a/tests/rustdoc-gui/docblock-code-block-line-number.goml b/tests/rustdoc-gui/docblock-code-block-line-number.goml index a182124aced2..92ec0eb43a31 100644 --- a/tests/rustdoc-gui/docblock-code-block-line-number.goml +++ b/tests/rustdoc-gui/docblock-code-block-line-number.goml @@ -1,9 +1,14 @@ // Checks that the setting "line numbers" is working as expected. include: "utils.goml" + go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +// Otherwise, we can't check text color +show-text: true + +store-value: (line_numbers_selector, ".example-wrap pre.rust code [data-nosnippet]") // We check that without this setting, there is no line number displayed. -assert-false: "pre.example-line-numbers" +assert-count: (|line_numbers_selector|, 0) // All corners should be rounded. assert-css: ( @@ -17,14 +22,16 @@ assert-css: ( ALL, ) -// We set the setting to show the line numbers on code examples. -set-local-storage: {"rustdoc-line-numbers": "true"} -reload: -// We wait for the line numbers to be added into the DOM by the JS... -wait-for: ".digits-1 pre" +// Before we add line numbers, we get the X position of a span in a code example that we will +// use later on to ensure that when we disable the line numbers, it goes back to its original +// position. +store-position: (".example-wrap code .macro", {"x": span_x_pos}) -// Otherwise, we can't check text color -show-text: true +// We enable the setting to show the line numbers on code examples. +call-function: ("switch-line-numbers-setting", {"expected_status": "true"}) +// We ensure that there are actually line numbers generated in the DOM. +assert-text: (".example-wrap pre.rust code span[data-nosnippet]", "1") +assert-position-false: (".example-wrap code .macro", {"x": |span_x_pos|}) // Let's now check some CSS properties... define-function: ( @@ -68,20 +75,18 @@ call-function: ("check-colors", { // Now, try changing the setting dynamically. We'll turn it off, using the settings menu, // and make sure it goes away. -// First, open the settings menu. -click: "rustdoc-toolbar .settings-menu" -wait-for: "#settings" -assert-css: ("#settings", {"display": "block"}) +call-function: ("switch-line-numbers-setting", {"expected_status": "false"}) +assert: ".digits-1.hide-lines" -// Then, click the toggle button. -click: "input#line-numbers" -wait-for: ".digits-1.hide-lines" -assert-local-storage: {"rustdoc-line-numbers": "false" } +// The line numbers not being displayed, their "space" should have disappear as well. +assert-position: (".example-wrap code .macro", {"x": |span_x_pos|}) // Finally, turn it on again. -click: "input#line-numbers" +call-function: ("switch-line-numbers-setting", {"expected_status": "true"}) wait-for: ".digits-1:not(.hide-lines)" -assert-local-storage: {"rustdoc-line-numbers": "true" } + +// The line numbers are being displayed, their "space" should be back. +assert-position-false: (".example-wrap code .macro", {"x": |span_x_pos|}) // Same check with scraped examples line numbers. go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" @@ -119,26 +124,14 @@ call-function: ("check-padding", { }) define-function: ("check-line-numbers-existence", [], block { - assert-local-storage: {"rustdoc-line-numbers": "true" } - assert-false: ".example-line-numbers" - click: "rustdoc-toolbar .settings-menu" - wait-for: "#settings" - - // Then, click the toggle button. - click: "input#line-numbers" - wait-for-local-storage-false: {"rustdoc-line-numbers": "true" } - assert-false: ".example-line-numbers" + assert-local-storage: {"rustdoc-line-numbers": "true"} + assert-count-false: (|line_numbers_selector|, 0) + call-function: ("switch-line-numbers-setting", {"expected_status": "false"}) // Line numbers should still be there. - assert-css: ("[data-nosnippet]", { "display": "block"}) - // Now disabling the setting. - click: "input#line-numbers" - wait-for-local-storage: {"rustdoc-line-numbers": "true" } - assert-false: ".example-line-numbers" - // Line numbers should still be there. - assert-css: ("[data-nosnippet]", { "display": "block"}) - // Closing settings menu. - click: "rustdoc-toolbar .settings-menu" - wait-for-css: ("#settings", {"display": "none"}) + assert-count-false: (|line_numbers_selector|, 0) + assert-css: (|line_numbers_selector|, {"display": "block"}) + // Now re-enabling the setting. + call-function: ("switch-line-numbers-setting", {"expected_status": "true"}) }) // Checking that turning off the line numbers setting won't remove line numbers from scraped @@ -168,16 +161,11 @@ assert: ".example-wrap > pre.rust" assert-count: (".example-wrap", 2) assert-count: (".example-wrap.digits-1", 2) -click: "rustdoc-toolbar .settings-menu" -wait-for: "#settings" - -// Then, click the toggle button. -click: "input#line-numbers" +// Disabling the line numbers setting. +call-function: ("switch-line-numbers-setting", {"expected_status": "false"}) wait-for-count: (".example-wrap.digits-1.hide-lines", 2) -assert-local-storage-false: {"rustdoc-line-numbers": "true" } -// Now turning off the setting. -click: "input#line-numbers" +// Now re-enabling the setting. +call-function: ("switch-line-numbers-setting", {"expected_status": "true"}) wait-for-count: (".example-wrap.digits-1", 2) wait-for-count: (".example-wrap.digits-1.hide-lines", 0) -assert-local-storage: {"rustdoc-line-numbers": "true" } diff --git a/tests/rustdoc-gui/links-color.goml b/tests/rustdoc-gui/links-color.goml index a363175c1ddb..ae1509c6fa4f 100644 --- a/tests/rustdoc-gui/links-color.goml +++ b/tests/rustdoc-gui/links-color.goml @@ -41,7 +41,7 @@ define-function: ( move-cursor-to: "dd a[href='long_code_block_link/index.html']" assert-css: ( "dd a[href='long_code_block_link/index.html']", - {"text-decoration": "underline solid " + |mod|}, + {"text-decoration": "underline"}, ) }, ) diff --git a/tests/rustdoc-gui/sidebar-mobile.goml b/tests/rustdoc-gui/sidebar-mobile.goml index f828516d7624..1fa5521baac9 100644 --- a/tests/rustdoc-gui/sidebar-mobile.goml +++ b/tests/rustdoc-gui/sidebar-mobile.goml @@ -49,7 +49,7 @@ assert-property: ("rustdoc-topbar", {"clientHeight": "45"}) // so the target is not obscured by the topbar. click: ".sidebar-menu-toggle" click: ".sidebar-elems section .block li > a" -assert-position: ("#method\.must_use", {"y": 46}) +assert-position: ("#method\.must_use", {"y": 45}) // Check that the bottom-most item on the sidebar menu can be scrolled fully into view. click: ".sidebar-menu-toggle" diff --git a/tests/rustdoc-gui/sidebar-source-code-display.goml b/tests/rustdoc-gui/sidebar-source-code-display.goml index 99810cd78633..d2b667b498bc 100644 --- a/tests/rustdoc-gui/sidebar-source-code-display.goml +++ b/tests/rustdoc-gui/sidebar-source-code-display.goml @@ -141,7 +141,7 @@ click: "#sidebar-button" wait-for-css: (".src .sidebar > *", {"visibility": "hidden"}) // We scroll to line 117 to change the scroll position. scroll-to: '//*[@id="117"]' -store-value: (y_offset, "2567") +store-value: (y_offset, "2568") assert-window-property: {"pageYOffset": |y_offset|} // Expanding the sidebar... click: "#sidebar-button" diff --git a/tests/rustdoc-gui/utils.goml b/tests/rustdoc-gui/utils.goml index e13aef6712f3..a40f9fc6fdd7 100644 --- a/tests/rustdoc-gui/utils.goml +++ b/tests/rustdoc-gui/utils.goml @@ -1,35 +1,52 @@ // This file contains code to be re-used by other tests. + +define-function: ( + "open-settings-menu", + [], + block { + // Open the settings menu. + click: "rustdoc-toolbar .settings-menu" + // Wait for the popover to appear... + wait-for-css: ("#settings", {"display": "block"}) + } +) + +define-function: ( + "close-settings-menu", + [], + block { + click: "rustdoc-toolbar .settings-menu" + wait-for-css-false: ("#settings", {"display": "block"}) + } +) + define-function: ( "switch-theme", [theme], block { // Set the theme. - // Open the settings menu. - click: "rustdoc-toolbar .settings-menu" - // Wait for the popover to appear... - wait-for: "#settings" + call-function: ("open-settings-menu", {}) // Change the setting. click: "#theme-"+ |theme| - // Close the popover. - click: "rustdoc-toolbar .settings-menu" + call-function: ("close-settings-menu", {}) // Ensure that the local storage was correctly updated. assert-local-storage: {"rustdoc-theme": |theme|} }, ) +// FIXME: To be removed once `browser-ui-test` has conditions. define-function: ( "switch-theme-mobile", [theme], block { - // Set the theme. // Open the settings menu. click: "rustdoc-topbar .settings-menu" // Wait for the popover to appear... - wait-for: "#settings" + wait-for-css: ("#settings", {"display": "block"}) // Change the setting. click: "#theme-"+ |theme| - // Close the popover. click: "rustdoc-topbar .settings-menu" + wait-for-css-false: ("#settings", {"display": "block"}) // Ensure that the local storage was correctly updated. assert-local-storage: {"rustdoc-theme": |theme|} }, @@ -56,3 +73,15 @@ define-function: ( wait-for-false: "#search-tabs .count.loading" } ) + +define-function: ( + "switch-line-numbers-setting", + [expected_status], + block { + call-function: ("open-settings-menu", {}) + // We change the line numbers setting. + click: "#line-numbers" + call-function: ("close-settings-menu", {}) + assert-local-storage: {"rustdoc-line-numbers": |expected_status|} + } +) diff --git a/tests/rustdoc/all.rs b/tests/rustdoc-html/all.rs similarity index 100% rename from tests/rustdoc/all.rs rename to tests/rustdoc-html/all.rs diff --git a/tests/rustdoc/anchors/anchor-id-duplicate-method-name-25001.rs b/tests/rustdoc-html/anchors/anchor-id-duplicate-method-name-25001.rs similarity index 100% rename from tests/rustdoc/anchors/anchor-id-duplicate-method-name-25001.rs rename to tests/rustdoc-html/anchors/anchor-id-duplicate-method-name-25001.rs diff --git a/tests/rustdoc/anchors/anchor-id-trait-method-15169.rs b/tests/rustdoc-html/anchors/anchor-id-trait-method-15169.rs similarity index 100% rename from tests/rustdoc/anchors/anchor-id-trait-method-15169.rs rename to tests/rustdoc-html/anchors/anchor-id-trait-method-15169.rs diff --git a/tests/rustdoc/anchors/anchor-id-trait-tymethod-28478.rs b/tests/rustdoc-html/anchors/anchor-id-trait-tymethod-28478.rs similarity index 100% rename from tests/rustdoc/anchors/anchor-id-trait-tymethod-28478.rs rename to tests/rustdoc-html/anchors/anchor-id-trait-tymethod-28478.rs diff --git a/tests/rustdoc/anchors/anchors.no_const_anchor.html b/tests/rustdoc-html/anchors/anchors.no_const_anchor.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_const_anchor.html rename to tests/rustdoc-html/anchors/anchors.no_const_anchor.html diff --git a/tests/rustdoc/anchors/anchors.no_const_anchor2.html b/tests/rustdoc-html/anchors/anchors.no_const_anchor2.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_const_anchor2.html rename to tests/rustdoc-html/anchors/anchors.no_const_anchor2.html diff --git a/tests/rustdoc/anchors/anchors.no_method_anchor.html b/tests/rustdoc-html/anchors/anchors.no_method_anchor.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_method_anchor.html rename to tests/rustdoc-html/anchors/anchors.no_method_anchor.html diff --git a/tests/rustdoc/anchors/anchors.no_trait_method_anchor.html b/tests/rustdoc-html/anchors/anchors.no_trait_method_anchor.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_trait_method_anchor.html rename to tests/rustdoc-html/anchors/anchors.no_trait_method_anchor.html diff --git a/tests/rustdoc/anchors/anchors.no_tymethod_anchor.html b/tests/rustdoc-html/anchors/anchors.no_tymethod_anchor.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_tymethod_anchor.html rename to tests/rustdoc-html/anchors/anchors.no_tymethod_anchor.html diff --git a/tests/rustdoc/anchors/anchors.no_type_anchor.html b/tests/rustdoc-html/anchors/anchors.no_type_anchor.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_type_anchor.html rename to tests/rustdoc-html/anchors/anchors.no_type_anchor.html diff --git a/tests/rustdoc/anchors/anchors.no_type_anchor2.html b/tests/rustdoc-html/anchors/anchors.no_type_anchor2.html similarity index 100% rename from tests/rustdoc/anchors/anchors.no_type_anchor2.html rename to tests/rustdoc-html/anchors/anchors.no_type_anchor2.html diff --git a/tests/rustdoc/anchors/anchors.rs b/tests/rustdoc-html/anchors/anchors.rs similarity index 100% rename from tests/rustdoc/anchors/anchors.rs rename to tests/rustdoc-html/anchors/anchors.rs diff --git a/tests/rustdoc/anchors/auxiliary/issue-86620-1.rs b/tests/rustdoc-html/anchors/auxiliary/issue-86620-1.rs similarity index 100% rename from tests/rustdoc/anchors/auxiliary/issue-86620-1.rs rename to tests/rustdoc-html/anchors/auxiliary/issue-86620-1.rs diff --git a/tests/rustdoc/anchors/disambiguate-anchors-32890.rs b/tests/rustdoc-html/anchors/disambiguate-anchors-32890.rs similarity index 100% rename from tests/rustdoc/anchors/disambiguate-anchors-32890.rs rename to tests/rustdoc-html/anchors/disambiguate-anchors-32890.rs diff --git a/tests/rustdoc/anchors/disambiguate-anchors-header-29449.rs b/tests/rustdoc-html/anchors/disambiguate-anchors-header-29449.rs similarity index 100% rename from tests/rustdoc/anchors/disambiguate-anchors-header-29449.rs rename to tests/rustdoc-html/anchors/disambiguate-anchors-header-29449.rs diff --git a/tests/rustdoc/anchors/method-anchor-in-blanket-impl-86620.rs b/tests/rustdoc-html/anchors/method-anchor-in-blanket-impl-86620.rs similarity index 100% rename from tests/rustdoc/anchors/method-anchor-in-blanket-impl-86620.rs rename to tests/rustdoc-html/anchors/method-anchor-in-blanket-impl-86620.rs diff --git a/tests/rustdoc/anchors/trait-impl-items-links-and-anchors.rs b/tests/rustdoc-html/anchors/trait-impl-items-links-and-anchors.rs similarity index 100% rename from tests/rustdoc/anchors/trait-impl-items-links-and-anchors.rs rename to tests/rustdoc-html/anchors/trait-impl-items-links-and-anchors.rs diff --git a/tests/rustdoc/anon-fn-params.rs b/tests/rustdoc-html/anon-fn-params.rs similarity index 100% rename from tests/rustdoc/anon-fn-params.rs rename to tests/rustdoc-html/anon-fn-params.rs diff --git a/tests/rustdoc/anonymous-lifetime.rs b/tests/rustdoc-html/anonymous-lifetime.rs similarity index 100% rename from tests/rustdoc/anonymous-lifetime.rs rename to tests/rustdoc-html/anonymous-lifetime.rs diff --git a/tests/rustdoc/array-links.link_box_generic.html b/tests/rustdoc-html/array-links.link_box_generic.html similarity index 100% rename from tests/rustdoc/array-links.link_box_generic.html rename to tests/rustdoc-html/array-links.link_box_generic.html diff --git a/tests/rustdoc/array-links.link_box_u32.html b/tests/rustdoc-html/array-links.link_box_u32.html similarity index 100% rename from tests/rustdoc/array-links.link_box_u32.html rename to tests/rustdoc-html/array-links.link_box_u32.html diff --git a/tests/rustdoc/array-links.link_slice_generic.html b/tests/rustdoc-html/array-links.link_slice_generic.html similarity index 100% rename from tests/rustdoc/array-links.link_slice_generic.html rename to tests/rustdoc-html/array-links.link_slice_generic.html diff --git a/tests/rustdoc/array-links.link_slice_u32.html b/tests/rustdoc-html/array-links.link_slice_u32.html similarity index 100% rename from tests/rustdoc/array-links.link_slice_u32.html rename to tests/rustdoc-html/array-links.link_slice_u32.html diff --git a/tests/rustdoc/array-links.rs b/tests/rustdoc-html/array-links.rs similarity index 100% rename from tests/rustdoc/array-links.rs rename to tests/rustdoc-html/array-links.rs diff --git a/tests/rustdoc/asm-foreign.rs b/tests/rustdoc-html/asm-foreign.rs similarity index 100% rename from tests/rustdoc/asm-foreign.rs rename to tests/rustdoc-html/asm-foreign.rs diff --git a/tests/rustdoc/asm-foreign2.rs b/tests/rustdoc-html/asm-foreign2.rs similarity index 100% rename from tests/rustdoc/asm-foreign2.rs rename to tests/rustdoc-html/asm-foreign2.rs diff --git a/tests/rustdoc/asref-for-and-of-local-82465.rs b/tests/rustdoc-html/asref-for-and-of-local-82465.rs similarity index 100% rename from tests/rustdoc/asref-for-and-of-local-82465.rs rename to tests/rustdoc-html/asref-for-and-of-local-82465.rs diff --git a/tests/rustdoc/assoc/assoc-fns.rs b/tests/rustdoc-html/assoc/assoc-fns.rs similarity index 100% rename from tests/rustdoc/assoc/assoc-fns.rs rename to tests/rustdoc-html/assoc/assoc-fns.rs diff --git a/tests/rustdoc/assoc/assoc-item-cast.rs b/tests/rustdoc-html/assoc/assoc-item-cast.rs similarity index 100% rename from tests/rustdoc/assoc/assoc-item-cast.rs rename to tests/rustdoc-html/assoc/assoc-item-cast.rs diff --git a/tests/rustdoc/assoc/assoc-type-bindings-20646.rs b/tests/rustdoc-html/assoc/assoc-type-bindings-20646.rs similarity index 100% rename from tests/rustdoc/assoc/assoc-type-bindings-20646.rs rename to tests/rustdoc-html/assoc/assoc-type-bindings-20646.rs diff --git a/tests/rustdoc/assoc/assoc-types.rs b/tests/rustdoc-html/assoc/assoc-types.rs similarity index 100% rename from tests/rustdoc/assoc/assoc-types.rs rename to tests/rustdoc-html/assoc/assoc-types.rs diff --git a/tests/rustdoc/assoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs b/tests/rustdoc-html/assoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs similarity index 100% rename from tests/rustdoc/assoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs rename to tests/rustdoc-html/assoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs diff --git a/tests/rustdoc/assoc/auxiliary/issue-20646.rs b/tests/rustdoc-html/assoc/auxiliary/issue-20646.rs similarity index 100% rename from tests/rustdoc/assoc/auxiliary/issue-20646.rs rename to tests/rustdoc-html/assoc/auxiliary/issue-20646.rs diff --git a/tests/rustdoc/assoc/auxiliary/issue-20727.rs b/tests/rustdoc-html/assoc/auxiliary/issue-20727.rs similarity index 100% rename from tests/rustdoc/assoc/auxiliary/issue-20727.rs rename to tests/rustdoc-html/assoc/auxiliary/issue-20727.rs diff --git a/tests/rustdoc/assoc/auxiliary/normalize-assoc-item.rs b/tests/rustdoc-html/assoc/auxiliary/normalize-assoc-item.rs similarity index 100% rename from tests/rustdoc/assoc/auxiliary/normalize-assoc-item.rs rename to tests/rustdoc-html/assoc/auxiliary/normalize-assoc-item.rs diff --git a/tests/rustdoc/assoc/cross-crate-hidden-assoc-trait-items.rs b/tests/rustdoc-html/assoc/cross-crate-hidden-assoc-trait-items.rs similarity index 100% rename from tests/rustdoc/assoc/cross-crate-hidden-assoc-trait-items.rs rename to tests/rustdoc-html/assoc/cross-crate-hidden-assoc-trait-items.rs diff --git a/tests/rustdoc/assoc/doc-assoc-item.rs b/tests/rustdoc-html/assoc/doc-assoc-item.rs similarity index 100% rename from tests/rustdoc/assoc/doc-assoc-item.rs rename to tests/rustdoc-html/assoc/doc-assoc-item.rs diff --git a/tests/rustdoc/assoc/inline-assoc-type-20727-bindings.rs b/tests/rustdoc-html/assoc/inline-assoc-type-20727-bindings.rs similarity index 100% rename from tests/rustdoc/assoc/inline-assoc-type-20727-bindings.rs rename to tests/rustdoc-html/assoc/inline-assoc-type-20727-bindings.rs diff --git a/tests/rustdoc/assoc/inline-assoc-type-20727-bounds-deref.rs b/tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds-deref.rs similarity index 100% rename from tests/rustdoc/assoc/inline-assoc-type-20727-bounds-deref.rs rename to tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds-deref.rs diff --git a/tests/rustdoc/assoc/inline-assoc-type-20727-bounds-index.rs b/tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds-index.rs similarity index 100% rename from tests/rustdoc/assoc/inline-assoc-type-20727-bounds-index.rs rename to tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds-index.rs diff --git a/tests/rustdoc/assoc/inline-assoc-type-20727-bounds.rs b/tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds.rs similarity index 100% rename from tests/rustdoc/assoc/inline-assoc-type-20727-bounds.rs rename to tests/rustdoc-html/assoc/inline-assoc-type-20727-bounds.rs diff --git a/tests/rustdoc/assoc/normalize-assoc-item.rs b/tests/rustdoc-html/assoc/normalize-assoc-item.rs similarity index 100% rename from tests/rustdoc/assoc/normalize-assoc-item.rs rename to tests/rustdoc-html/assoc/normalize-assoc-item.rs diff --git a/tests/rustdoc/async/async-fn-opaque-item.rs b/tests/rustdoc-html/async/async-fn-opaque-item.rs similarity index 100% rename from tests/rustdoc/async/async-fn-opaque-item.rs rename to tests/rustdoc-html/async/async-fn-opaque-item.rs diff --git a/tests/rustdoc/async/async-fn.rs b/tests/rustdoc-html/async/async-fn.rs similarity index 100% rename from tests/rustdoc/async/async-fn.rs rename to tests/rustdoc-html/async/async-fn.rs diff --git a/tests/rustdoc/async/async-move-doctest.rs b/tests/rustdoc-html/async/async-move-doctest.rs similarity index 100% rename from tests/rustdoc/async/async-move-doctest.rs rename to tests/rustdoc-html/async/async-move-doctest.rs diff --git a/tests/rustdoc/async/async-trait-sig.rs b/tests/rustdoc-html/async/async-trait-sig.rs similarity index 100% rename from tests/rustdoc/async/async-trait-sig.rs rename to tests/rustdoc-html/async/async-trait-sig.rs diff --git a/tests/rustdoc/async/async-trait.rs b/tests/rustdoc-html/async/async-trait.rs similarity index 100% rename from tests/rustdoc/async/async-trait.rs rename to tests/rustdoc-html/async/async-trait.rs diff --git a/tests/rustdoc/async/auxiliary/async-trait-dep.rs b/tests/rustdoc-html/async/auxiliary/async-trait-dep.rs similarity index 100% rename from tests/rustdoc/async/auxiliary/async-trait-dep.rs rename to tests/rustdoc-html/async/auxiliary/async-trait-dep.rs diff --git a/tests/rustdoc/attributes-2021-edition.rs b/tests/rustdoc-html/attributes-2021-edition.rs similarity index 100% rename from tests/rustdoc/attributes-2021-edition.rs rename to tests/rustdoc-html/attributes-2021-edition.rs diff --git a/tests/rustdoc/attributes-inlining-108281.rs b/tests/rustdoc-html/attributes-inlining-108281.rs similarity index 100% rename from tests/rustdoc/attributes-inlining-108281.rs rename to tests/rustdoc-html/attributes-inlining-108281.rs diff --git a/tests/rustdoc/attributes-re-export-2021-edition.rs b/tests/rustdoc-html/attributes-re-export-2021-edition.rs similarity index 100% rename from tests/rustdoc/attributes-re-export-2021-edition.rs rename to tests/rustdoc-html/attributes-re-export-2021-edition.rs diff --git a/tests/rustdoc/attributes-re-export.rs b/tests/rustdoc-html/attributes-re-export.rs similarity index 100% rename from tests/rustdoc/attributes-re-export.rs rename to tests/rustdoc-html/attributes-re-export.rs diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc-html/attributes.rs similarity index 100% rename from tests/rustdoc/attributes.rs rename to tests/rustdoc-html/attributes.rs diff --git a/tests/rustdoc/auto/auto-impl-for-trait.rs b/tests/rustdoc-html/auto/auto-impl-for-trait.rs similarity index 100% rename from tests/rustdoc/auto/auto-impl-for-trait.rs rename to tests/rustdoc-html/auto/auto-impl-for-trait.rs diff --git a/tests/rustdoc/auto/auto-impl-primitive.rs b/tests/rustdoc-html/auto/auto-impl-primitive.rs similarity index 100% rename from tests/rustdoc/auto/auto-impl-primitive.rs rename to tests/rustdoc-html/auto/auto-impl-primitive.rs diff --git a/tests/rustdoc/auto/auto-trait-bounds-by-associated-type-50159.rs b/tests/rustdoc-html/auto/auto-trait-bounds-by-associated-type-50159.rs similarity index 100% rename from tests/rustdoc/auto/auto-trait-bounds-by-associated-type-50159.rs rename to tests/rustdoc-html/auto/auto-trait-bounds-by-associated-type-50159.rs diff --git a/tests/rustdoc/auto/auto-trait-bounds-inference-variables-54705.rs b/tests/rustdoc-html/auto/auto-trait-bounds-inference-variables-54705.rs similarity index 100% rename from tests/rustdoc/auto/auto-trait-bounds-inference-variables-54705.rs rename to tests/rustdoc-html/auto/auto-trait-bounds-inference-variables-54705.rs diff --git a/tests/rustdoc/auto/auto-trait-bounds-where-51236.rs b/tests/rustdoc-html/auto/auto-trait-bounds-where-51236.rs similarity index 100% rename from tests/rustdoc/auto/auto-trait-bounds-where-51236.rs rename to tests/rustdoc-html/auto/auto-trait-bounds-where-51236.rs diff --git a/tests/rustdoc/auto/auto-trait-negative-impl-55321.rs b/tests/rustdoc-html/auto/auto-trait-negative-impl-55321.rs similarity index 100% rename from tests/rustdoc/auto/auto-trait-negative-impl-55321.rs rename to tests/rustdoc-html/auto/auto-trait-negative-impl-55321.rs diff --git a/tests/rustdoc/auto/auto-trait-not-send.rs b/tests/rustdoc-html/auto/auto-trait-not-send.rs similarity index 100% rename from tests/rustdoc/auto/auto-trait-not-send.rs rename to tests/rustdoc-html/auto/auto-trait-not-send.rs diff --git a/tests/rustdoc/auto/auto-traits.rs b/tests/rustdoc-html/auto/auto-traits.rs similarity index 100% rename from tests/rustdoc/auto/auto-traits.rs rename to tests/rustdoc-html/auto/auto-traits.rs diff --git a/tests/rustdoc/auto/auto_aliases.rs b/tests/rustdoc-html/auto/auto_aliases.rs similarity index 100% rename from tests/rustdoc/auto/auto_aliases.rs rename to tests/rustdoc-html/auto/auto_aliases.rs diff --git a/tests/rustdoc/auto/auxiliary/auto-traits.rs b/tests/rustdoc-html/auto/auxiliary/auto-traits.rs similarity index 100% rename from tests/rustdoc/auto/auxiliary/auto-traits.rs rename to tests/rustdoc-html/auto/auxiliary/auto-traits.rs diff --git a/tests/rustdoc/auxiliary/all-item-types.rs b/tests/rustdoc-html/auxiliary/all-item-types.rs similarity index 100% rename from tests/rustdoc/auxiliary/all-item-types.rs rename to tests/rustdoc-html/auxiliary/all-item-types.rs diff --git a/tests/rustdoc/auxiliary/cross_crate_generic_typedef.rs b/tests/rustdoc-html/auxiliary/cross_crate_generic_typedef.rs similarity index 100% rename from tests/rustdoc/auxiliary/cross_crate_generic_typedef.rs rename to tests/rustdoc-html/auxiliary/cross_crate_generic_typedef.rs diff --git a/tests/rustdoc/auxiliary/elided-lifetime.rs b/tests/rustdoc-html/auxiliary/elided-lifetime.rs similarity index 100% rename from tests/rustdoc/auxiliary/elided-lifetime.rs rename to tests/rustdoc-html/auxiliary/elided-lifetime.rs diff --git a/tests/rustdoc/auxiliary/empty.rs b/tests/rustdoc-html/auxiliary/empty.rs similarity index 100% rename from tests/rustdoc/auxiliary/empty.rs rename to tests/rustdoc-html/auxiliary/empty.rs diff --git a/tests/rustdoc/auxiliary/enum-primitive.rs b/tests/rustdoc-html/auxiliary/enum-primitive.rs similarity index 100% rename from tests/rustdoc/auxiliary/enum-primitive.rs rename to tests/rustdoc-html/auxiliary/enum-primitive.rs diff --git a/tests/rustdoc/auxiliary/ext-anon-fn-params.rs b/tests/rustdoc-html/auxiliary/ext-anon-fn-params.rs similarity index 100% rename from tests/rustdoc/auxiliary/ext-anon-fn-params.rs rename to tests/rustdoc-html/auxiliary/ext-anon-fn-params.rs diff --git a/tests/rustdoc/auxiliary/ext-repr.rs b/tests/rustdoc-html/auxiliary/ext-repr.rs similarity index 100% rename from tests/rustdoc/auxiliary/ext-repr.rs rename to tests/rustdoc-html/auxiliary/ext-repr.rs diff --git a/tests/rustdoc/auxiliary/ext-trait-aliases.rs b/tests/rustdoc-html/auxiliary/ext-trait-aliases.rs similarity index 100% rename from tests/rustdoc/auxiliary/ext-trait-aliases.rs rename to tests/rustdoc-html/auxiliary/ext-trait-aliases.rs diff --git a/tests/rustdoc/auxiliary/inline-default-methods.rs b/tests/rustdoc-html/auxiliary/inline-default-methods.rs similarity index 100% rename from tests/rustdoc/auxiliary/inline-default-methods.rs rename to tests/rustdoc-html/auxiliary/inline-default-methods.rs diff --git a/tests/rustdoc/auxiliary/issue-106421-force-unstable.rs b/tests/rustdoc-html/auxiliary/issue-106421-force-unstable.rs similarity index 100% rename from tests/rustdoc/auxiliary/issue-106421-force-unstable.rs rename to tests/rustdoc-html/auxiliary/issue-106421-force-unstable.rs diff --git a/tests/rustdoc/auxiliary/issue-13698.rs b/tests/rustdoc-html/auxiliary/issue-13698.rs similarity index 100% rename from tests/rustdoc/auxiliary/issue-13698.rs rename to tests/rustdoc-html/auxiliary/issue-13698.rs diff --git a/tests/rustdoc/auxiliary/issue-19190-3.rs b/tests/rustdoc-html/auxiliary/issue-19190-3.rs similarity index 100% rename from tests/rustdoc/auxiliary/issue-19190-3.rs rename to tests/rustdoc-html/auxiliary/issue-19190-3.rs diff --git a/tests/rustdoc/auxiliary/issue-61592.rs b/tests/rustdoc-html/auxiliary/issue-61592.rs similarity index 100% rename from tests/rustdoc/auxiliary/issue-61592.rs rename to tests/rustdoc-html/auxiliary/issue-61592.rs diff --git a/tests/rustdoc/auxiliary/issue-99221-aux.rs b/tests/rustdoc-html/auxiliary/issue-99221-aux.rs similarity index 100% rename from tests/rustdoc/auxiliary/issue-99221-aux.rs rename to tests/rustdoc-html/auxiliary/issue-99221-aux.rs diff --git a/tests/rustdoc/auxiliary/issue-99734-aux.rs b/tests/rustdoc-html/auxiliary/issue-99734-aux.rs similarity index 100% rename from tests/rustdoc/auxiliary/issue-99734-aux.rs rename to tests/rustdoc-html/auxiliary/issue-99734-aux.rs diff --git a/tests/rustdoc/auxiliary/jump-to-def-res-err-handling-aux.rs b/tests/rustdoc-html/auxiliary/jump-to-def-res-err-handling-aux.rs similarity index 100% rename from tests/rustdoc/auxiliary/jump-to-def-res-err-handling-aux.rs rename to tests/rustdoc-html/auxiliary/jump-to-def-res-err-handling-aux.rs diff --git a/tests/rustdoc/auxiliary/masked.rs b/tests/rustdoc-html/auxiliary/masked.rs similarity index 100% rename from tests/rustdoc/auxiliary/masked.rs rename to tests/rustdoc-html/auxiliary/masked.rs diff --git a/tests/rustdoc/auxiliary/mod-stackoverflow.rs b/tests/rustdoc-html/auxiliary/mod-stackoverflow.rs similarity index 100% rename from tests/rustdoc/auxiliary/mod-stackoverflow.rs rename to tests/rustdoc-html/auxiliary/mod-stackoverflow.rs diff --git a/tests/rustdoc/auxiliary/reexp-stripped.rs b/tests/rustdoc-html/auxiliary/reexp-stripped.rs similarity index 100% rename from tests/rustdoc/auxiliary/reexp-stripped.rs rename to tests/rustdoc-html/auxiliary/reexp-stripped.rs diff --git a/tests/rustdoc/auxiliary/remapped-paths.rs b/tests/rustdoc-html/auxiliary/remapped-paths.rs similarity index 100% rename from tests/rustdoc/auxiliary/remapped-paths.rs rename to tests/rustdoc-html/auxiliary/remapped-paths.rs diff --git a/tests/rustdoc/auxiliary/rustdoc-ffi.rs b/tests/rustdoc-html/auxiliary/rustdoc-ffi.rs similarity index 100% rename from tests/rustdoc/auxiliary/rustdoc-ffi.rs rename to tests/rustdoc-html/auxiliary/rustdoc-ffi.rs diff --git a/tests/rustdoc/auxiliary/trait-visibility.rs b/tests/rustdoc-html/auxiliary/trait-visibility.rs similarity index 100% rename from tests/rustdoc/auxiliary/trait-visibility.rs rename to tests/rustdoc-html/auxiliary/trait-visibility.rs diff --git a/tests/rustdoc/auxiliary/unit-return.rs b/tests/rustdoc-html/auxiliary/unit-return.rs similarity index 100% rename from tests/rustdoc/auxiliary/unit-return.rs rename to tests/rustdoc-html/auxiliary/unit-return.rs diff --git a/tests/rustdoc/auxiliary/unsafe-binder-dep.rs b/tests/rustdoc-html/auxiliary/unsafe-binder-dep.rs similarity index 100% rename from tests/rustdoc/auxiliary/unsafe-binder-dep.rs rename to tests/rustdoc-html/auxiliary/unsafe-binder-dep.rs diff --git a/tests/rustdoc/auxiliary/unstable-trait.rs b/tests/rustdoc-html/auxiliary/unstable-trait.rs similarity index 100% rename from tests/rustdoc/auxiliary/unstable-trait.rs rename to tests/rustdoc-html/auxiliary/unstable-trait.rs diff --git a/tests/rustdoc/bad-codeblock-syntax.rs b/tests/rustdoc-html/bad-codeblock-syntax.rs similarity index 100% rename from tests/rustdoc/bad-codeblock-syntax.rs rename to tests/rustdoc-html/bad-codeblock-syntax.rs diff --git a/tests/rustdoc/blank-line-in-doc-block-47197.rs b/tests/rustdoc-html/blank-line-in-doc-block-47197.rs similarity index 100% rename from tests/rustdoc/blank-line-in-doc-block-47197.rs rename to tests/rustdoc-html/blank-line-in-doc-block-47197.rs diff --git a/tests/rustdoc/bold-tag-101743.rs b/tests/rustdoc-html/bold-tag-101743.rs similarity index 100% rename from tests/rustdoc/bold-tag-101743.rs rename to tests/rustdoc-html/bold-tag-101743.rs diff --git a/tests/rustdoc/bounds.rs b/tests/rustdoc-html/bounds.rs similarity index 100% rename from tests/rustdoc/bounds.rs rename to tests/rustdoc-html/bounds.rs diff --git a/tests/rustdoc/cap-lints.rs b/tests/rustdoc-html/cap-lints.rs similarity index 100% rename from tests/rustdoc/cap-lints.rs rename to tests/rustdoc-html/cap-lints.rs diff --git a/tests/rustdoc/cfg-bool.rs b/tests/rustdoc-html/cfg-bool.rs similarity index 100% rename from tests/rustdoc/cfg-bool.rs rename to tests/rustdoc-html/cfg-bool.rs diff --git a/tests/rustdoc/cfg-doctest.rs b/tests/rustdoc-html/cfg-doctest.rs similarity index 100% rename from tests/rustdoc/cfg-doctest.rs rename to tests/rustdoc-html/cfg-doctest.rs diff --git a/tests/rustdoc/check-styled-link.rs b/tests/rustdoc-html/check-styled-link.rs similarity index 100% rename from tests/rustdoc/check-styled-link.rs rename to tests/rustdoc-html/check-styled-link.rs diff --git a/tests/rustdoc/check.rs b/tests/rustdoc-html/check.rs similarity index 100% rename from tests/rustdoc/check.rs rename to tests/rustdoc-html/check.rs diff --git a/tests/rustdoc/codeblock-title.rs b/tests/rustdoc-html/codeblock-title.rs similarity index 100% rename from tests/rustdoc/codeblock-title.rs rename to tests/rustdoc-html/codeblock-title.rs diff --git a/tests/rustdoc/comment-in-doctest.rs b/tests/rustdoc-html/comment-in-doctest.rs similarity index 100% rename from tests/rustdoc/comment-in-doctest.rs rename to tests/rustdoc-html/comment-in-doctest.rs diff --git a/tests/rustdoc/const-fn-76501.rs b/tests/rustdoc-html/const-fn-76501.rs similarity index 100% rename from tests/rustdoc/const-fn-76501.rs rename to tests/rustdoc-html/const-fn-76501.rs diff --git a/tests/rustdoc/const-fn-effects.rs b/tests/rustdoc-html/const-fn-effects.rs similarity index 100% rename from tests/rustdoc/const-fn-effects.rs rename to tests/rustdoc-html/const-fn-effects.rs diff --git a/tests/rustdoc/const-fn.rs b/tests/rustdoc-html/const-fn.rs similarity index 100% rename from tests/rustdoc/const-fn.rs rename to tests/rustdoc-html/const-fn.rs diff --git a/tests/rustdoc/const-generics/add-impl.rs b/tests/rustdoc-html/const-generics/add-impl.rs similarity index 100% rename from tests/rustdoc/const-generics/add-impl.rs rename to tests/rustdoc-html/const-generics/add-impl.rs diff --git a/tests/rustdoc/const-generics/auxiliary/extern_crate.rs b/tests/rustdoc-html/const-generics/auxiliary/extern_crate.rs similarity index 100% rename from tests/rustdoc/const-generics/auxiliary/extern_crate.rs rename to tests/rustdoc-html/const-generics/auxiliary/extern_crate.rs diff --git a/tests/rustdoc/const-generics/const-generic-defaults.rs b/tests/rustdoc-html/const-generics/const-generic-defaults.rs similarity index 100% rename from tests/rustdoc/const-generics/const-generic-defaults.rs rename to tests/rustdoc-html/const-generics/const-generic-defaults.rs diff --git a/tests/rustdoc/const-generics/const-generic-slice.rs b/tests/rustdoc-html/const-generics/const-generic-slice.rs similarity index 100% rename from tests/rustdoc/const-generics/const-generic-slice.rs rename to tests/rustdoc-html/const-generics/const-generic-slice.rs diff --git a/tests/rustdoc/const-generics/const-generics-docs.rs b/tests/rustdoc-html/const-generics/const-generics-docs.rs similarity index 100% rename from tests/rustdoc/const-generics/const-generics-docs.rs rename to tests/rustdoc-html/const-generics/const-generics-docs.rs diff --git a/tests/rustdoc/const-generics/const-impl.rs b/tests/rustdoc-html/const-generics/const-impl.rs similarity index 100% rename from tests/rustdoc/const-generics/const-impl.rs rename to tests/rustdoc-html/const-generics/const-impl.rs diff --git a/tests/rustdoc/const-generics/const-param-type-references-generics.rs b/tests/rustdoc-html/const-generics/const-param-type-references-generics.rs similarity index 100% rename from tests/rustdoc/const-generics/const-param-type-references-generics.rs rename to tests/rustdoc-html/const-generics/const-param-type-references-generics.rs diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc-html/const-generics/generic_const_exprs.rs similarity index 100% rename from tests/rustdoc/const-generics/generic_const_exprs.rs rename to tests/rustdoc-html/const-generics/generic_const_exprs.rs diff --git a/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs b/tests/rustdoc-html/const-generics/lazy_normalization_consts/const-equate-pred.rs similarity index 100% rename from tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs rename to tests/rustdoc-html/const-generics/lazy_normalization_consts/const-equate-pred.rs diff --git a/tests/rustdoc/const-generics/type-alias.rs b/tests/rustdoc-html/const-generics/type-alias.rs similarity index 100% rename from tests/rustdoc/const-generics/type-alias.rs rename to tests/rustdoc-html/const-generics/type-alias.rs diff --git a/tests/rustdoc/const-intrinsic.rs b/tests/rustdoc-html/const-intrinsic.rs similarity index 100% rename from tests/rustdoc/const-intrinsic.rs rename to tests/rustdoc-html/const-intrinsic.rs diff --git a/tests/rustdoc/constant/assoc-consts-underscore.rs b/tests/rustdoc-html/constant/assoc-consts-underscore.rs similarity index 100% rename from tests/rustdoc/constant/assoc-consts-underscore.rs rename to tests/rustdoc-html/constant/assoc-consts-underscore.rs diff --git a/tests/rustdoc/constant/assoc-consts-version.rs b/tests/rustdoc-html/constant/assoc-consts-version.rs similarity index 100% rename from tests/rustdoc/constant/assoc-consts-version.rs rename to tests/rustdoc-html/constant/assoc-consts-version.rs diff --git a/tests/rustdoc/constant/assoc-consts.rs b/tests/rustdoc-html/constant/assoc-consts.rs similarity index 100% rename from tests/rustdoc/constant/assoc-consts.rs rename to tests/rustdoc-html/constant/assoc-consts.rs diff --git a/tests/rustdoc/constant/associated-consts.rs b/tests/rustdoc-html/constant/associated-consts.rs similarity index 100% rename from tests/rustdoc/constant/associated-consts.rs rename to tests/rustdoc-html/constant/associated-consts.rs diff --git a/tests/rustdoc/constant/const-display.rs b/tests/rustdoc-html/constant/const-display.rs similarity index 100% rename from tests/rustdoc/constant/const-display.rs rename to tests/rustdoc-html/constant/const-display.rs diff --git a/tests/rustdoc/constant/const-doc.rs b/tests/rustdoc-html/constant/const-doc.rs similarity index 100% rename from tests/rustdoc/constant/const-doc.rs rename to tests/rustdoc-html/constant/const-doc.rs diff --git a/tests/rustdoc/constant/const-effect-param.rs b/tests/rustdoc-html/constant/const-effect-param.rs similarity index 100% rename from tests/rustdoc/constant/const-effect-param.rs rename to tests/rustdoc-html/constant/const-effect-param.rs diff --git a/tests/rustdoc/constant/const-trait-and-impl-methods.rs b/tests/rustdoc-html/constant/const-trait-and-impl-methods.rs similarity index 100% rename from tests/rustdoc/constant/const-trait-and-impl-methods.rs rename to tests/rustdoc-html/constant/const-trait-and-impl-methods.rs diff --git a/tests/rustdoc/constant/const-underscore.rs b/tests/rustdoc-html/constant/const-underscore.rs similarity index 100% rename from tests/rustdoc/constant/const-underscore.rs rename to tests/rustdoc-html/constant/const-underscore.rs diff --git a/tests/rustdoc/constant/const-value-display.rs b/tests/rustdoc-html/constant/const-value-display.rs similarity index 100% rename from tests/rustdoc/constant/const-value-display.rs rename to tests/rustdoc-html/constant/const-value-display.rs diff --git a/tests/rustdoc/constant/const.rs b/tests/rustdoc-html/constant/const.rs similarity index 100% rename from tests/rustdoc/constant/const.rs rename to tests/rustdoc-html/constant/const.rs diff --git a/tests/rustdoc/constant/document-item-with-associated-const-in-where-clause.rs b/tests/rustdoc-html/constant/document-item-with-associated-const-in-where-clause.rs similarity index 100% rename from tests/rustdoc/constant/document-item-with-associated-const-in-where-clause.rs rename to tests/rustdoc-html/constant/document-item-with-associated-const-in-where-clause.rs diff --git a/tests/rustdoc/constant/generic-const-items.rs b/tests/rustdoc-html/constant/generic-const-items.rs similarity index 100% rename from tests/rustdoc/constant/generic-const-items.rs rename to tests/rustdoc-html/constant/generic-const-items.rs diff --git a/tests/rustdoc/constant/generic_const_exprs.rs b/tests/rustdoc-html/constant/generic_const_exprs.rs similarity index 100% rename from tests/rustdoc/constant/generic_const_exprs.rs rename to tests/rustdoc-html/constant/generic_const_exprs.rs diff --git a/tests/rustdoc/constant/glob-shadowing-const.rs b/tests/rustdoc-html/constant/glob-shadowing-const.rs similarity index 100% rename from tests/rustdoc/constant/glob-shadowing-const.rs rename to tests/rustdoc-html/constant/glob-shadowing-const.rs diff --git a/tests/rustdoc/constant/hide-complex-unevaluated-const-arguments.rs b/tests/rustdoc-html/constant/hide-complex-unevaluated-const-arguments.rs similarity index 100% rename from tests/rustdoc/constant/hide-complex-unevaluated-const-arguments.rs rename to tests/rustdoc-html/constant/hide-complex-unevaluated-const-arguments.rs diff --git a/tests/rustdoc/constant/hide-complex-unevaluated-consts.rs b/tests/rustdoc-html/constant/hide-complex-unevaluated-consts.rs similarity index 100% rename from tests/rustdoc/constant/hide-complex-unevaluated-consts.rs rename to tests/rustdoc-html/constant/hide-complex-unevaluated-consts.rs diff --git a/tests/rustdoc-html/constant/ice-associated-const-equality-105952.rs b/tests/rustdoc-html/constant/ice-associated-const-equality-105952.rs new file mode 100644 index 000000000000..310e56b917fc --- /dev/null +++ b/tests/rustdoc-html/constant/ice-associated-const-equality-105952.rs @@ -0,0 +1,20 @@ +//! Regression test for + +#![crate_name = "foo"] +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] +use std::marker::ConstParamTy; + +#[derive(PartialEq, Eq, ConstParamTy)] +pub enum ParseMode { + Raw, +} +pub trait Parse { + #[type_const] + const PARSE_MODE: ParseMode; +} +pub trait RenderRaw {} + +//@ hasraw foo/trait.RenderRaw.html 'impl' +//@ hasraw foo/trait.RenderRaw.html 'ParseMode::Raw' +impl> RenderRaw for T {} diff --git a/tests/rustdoc/constant/legacy-const-generic.rs b/tests/rustdoc-html/constant/legacy-const-generic.rs similarity index 100% rename from tests/rustdoc/constant/legacy-const-generic.rs rename to tests/rustdoc-html/constant/legacy-const-generic.rs diff --git a/tests/rustdoc/constant/link-assoc-const.rs b/tests/rustdoc-html/constant/link-assoc-const.rs similarity index 100% rename from tests/rustdoc/constant/link-assoc-const.rs rename to tests/rustdoc-html/constant/link-assoc-const.rs diff --git a/tests/rustdoc/constant/redirect-const.rs b/tests/rustdoc-html/constant/redirect-const.rs similarity index 100% rename from tests/rustdoc/constant/redirect-const.rs rename to tests/rustdoc-html/constant/redirect-const.rs diff --git a/tests/rustdoc/constant/rfc-2632-const-trait-impl.rs b/tests/rustdoc-html/constant/rfc-2632-const-trait-impl.rs similarity index 100% rename from tests/rustdoc/constant/rfc-2632-const-trait-impl.rs rename to tests/rustdoc-html/constant/rfc-2632-const-trait-impl.rs diff --git a/tests/rustdoc/constant/show-const-contents.rs b/tests/rustdoc-html/constant/show-const-contents.rs similarity index 100% rename from tests/rustdoc/constant/show-const-contents.rs rename to tests/rustdoc-html/constant/show-const-contents.rs diff --git a/tests/rustdoc/constructor-imports.rs b/tests/rustdoc-html/constructor-imports.rs similarity index 100% rename from tests/rustdoc/constructor-imports.rs rename to tests/rustdoc-html/constructor-imports.rs diff --git a/tests/rustdoc/crate-doc-hidden-109695.rs b/tests/rustdoc-html/crate-doc-hidden-109695.rs similarity index 100% rename from tests/rustdoc/crate-doc-hidden-109695.rs rename to tests/rustdoc-html/crate-doc-hidden-109695.rs diff --git a/tests/rustdoc/crate-version-escape.rs b/tests/rustdoc-html/crate-version-escape.rs similarity index 100% rename from tests/rustdoc/crate-version-escape.rs rename to tests/rustdoc-html/crate-version-escape.rs diff --git a/tests/rustdoc/crate-version-extra.rs b/tests/rustdoc-html/crate-version-extra.rs similarity index 100% rename from tests/rustdoc/crate-version-extra.rs rename to tests/rustdoc-html/crate-version-extra.rs diff --git a/tests/rustdoc/crate-version.rs b/tests/rustdoc-html/crate-version.rs similarity index 100% rename from tests/rustdoc/crate-version.rs rename to tests/rustdoc-html/crate-version.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs b/tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs rename to tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs b/tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs rename to tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs b/tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/s.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs rename to tests/rustdoc-html/cross-crate-info/cargo-transitive-no-index/s.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs b/tests/rustdoc-html/cross-crate-info/cargo-transitive/auxiliary/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs rename to tests/rustdoc-html/cross-crate-info/cargo-transitive/auxiliary/q.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs b/tests/rustdoc-html/cross-crate-info/cargo-transitive/auxiliary/t.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs rename to tests/rustdoc-html/cross-crate-info/cargo-transitive/auxiliary/t.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs b/tests/rustdoc-html/cross-crate-info/cargo-transitive/s.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-transitive/s.rs rename to tests/rustdoc-html/cross-crate-info/cargo-transitive/s.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs b/tests/rustdoc-html/cross-crate-info/cargo-two-no-index/auxiliary/f.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs rename to tests/rustdoc-html/cross-crate-info/cargo-two-no-index/auxiliary/f.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs b/tests/rustdoc-html/cross-crate-info/cargo-two-no-index/e.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs rename to tests/rustdoc-html/cross-crate-info/cargo-two-no-index/e.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs b/tests/rustdoc-html/cross-crate-info/cargo-two/auxiliary/f.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs rename to tests/rustdoc-html/cross-crate-info/cargo-two/auxiliary/f.rs diff --git a/tests/rustdoc/cross-crate-info/cargo-two/e.rs b/tests/rustdoc-html/cross-crate-info/cargo-two/e.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/cargo-two/e.rs rename to tests/rustdoc-html/cross-crate-info/cargo-two/e.rs diff --git a/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs b/tests/rustdoc-html/cross-crate-info/index-on-last/auxiliary/f.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs rename to tests/rustdoc-html/cross-crate-info/index-on-last/auxiliary/f.rs diff --git a/tests/rustdoc/cross-crate-info/index-on-last/e.rs b/tests/rustdoc-html/cross-crate-info/index-on-last/e.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/index-on-last/e.rs rename to tests/rustdoc-html/cross-crate-info/index-on-last/e.rs diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs b/tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs rename to tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/q.rs diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs b/tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/r.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs rename to tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/r.rs diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs b/tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/s.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs rename to tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/s.rs diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs b/tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/t.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs rename to tests/rustdoc-html/cross-crate-info/kitchen-sink/auxiliary/t.rs diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs b/tests/rustdoc-html/cross-crate-info/kitchen-sink/i.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/kitchen-sink/i.rs rename to tests/rustdoc-html/cross-crate-info/kitchen-sink/i.rs diff --git a/tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs b/tests/rustdoc-html/cross-crate-info/single-crate-baseline/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs rename to tests/rustdoc-html/cross-crate-info/single-crate-baseline/q.rs diff --git a/tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs b/tests/rustdoc-html/cross-crate-info/single-crate-no-index/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs rename to tests/rustdoc-html/cross-crate-info/single-crate-no-index/q.rs diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs b/tests/rustdoc-html/cross-crate-info/transitive/auxiliary/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs rename to tests/rustdoc-html/cross-crate-info/transitive/auxiliary/q.rs diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs b/tests/rustdoc-html/cross-crate-info/transitive/auxiliary/t.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs rename to tests/rustdoc-html/cross-crate-info/transitive/auxiliary/t.rs diff --git a/tests/rustdoc/cross-crate-info/transitive/s.rs b/tests/rustdoc-html/cross-crate-info/transitive/s.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/transitive/s.rs rename to tests/rustdoc-html/cross-crate-info/transitive/s.rs diff --git a/tests/rustdoc/cross-crate-info/two/auxiliary/f.rs b/tests/rustdoc-html/cross-crate-info/two/auxiliary/f.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/two/auxiliary/f.rs rename to tests/rustdoc-html/cross-crate-info/two/auxiliary/f.rs diff --git a/tests/rustdoc/cross-crate-info/two/e.rs b/tests/rustdoc-html/cross-crate-info/two/e.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/two/e.rs rename to tests/rustdoc-html/cross-crate-info/two/e.rs diff --git a/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs b/tests/rustdoc-html/cross-crate-info/working-dir-examples/q.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/working-dir-examples/q.rs rename to tests/rustdoc-html/cross-crate-info/working-dir-examples/q.rs diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs b/tests/rustdoc-html/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs rename to tests/rustdoc-html/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs b/tests/rustdoc-html/cross-crate-info/write-docs-somewhere-else/e.rs similarity index 100% rename from tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs rename to tests/rustdoc-html/cross-crate-info/write-docs-somewhere-else/e.rs diff --git a/tests/rustdoc/cross-crate-links.rs b/tests/rustdoc-html/cross-crate-links.rs similarity index 100% rename from tests/rustdoc/cross-crate-links.rs rename to tests/rustdoc-html/cross-crate-links.rs diff --git a/tests/rustdoc/custom_code_classes.rs b/tests/rustdoc-html/custom_code_classes.rs similarity index 100% rename from tests/rustdoc/custom_code_classes.rs rename to tests/rustdoc-html/custom_code_classes.rs diff --git a/tests/rustdoc/decl-line-wrapping-empty-arg-list.decl.html b/tests/rustdoc-html/decl-line-wrapping-empty-arg-list.decl.html similarity index 100% rename from tests/rustdoc/decl-line-wrapping-empty-arg-list.decl.html rename to tests/rustdoc-html/decl-line-wrapping-empty-arg-list.decl.html diff --git a/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs b/tests/rustdoc-html/decl-line-wrapping-empty-arg-list.rs similarity index 100% rename from tests/rustdoc/decl-line-wrapping-empty-arg-list.rs rename to tests/rustdoc-html/decl-line-wrapping-empty-arg-list.rs diff --git a/tests/rustdoc/decl-trailing-whitespace.declaration.html b/tests/rustdoc-html/decl-trailing-whitespace.declaration.html similarity index 100% rename from tests/rustdoc/decl-trailing-whitespace.declaration.html rename to tests/rustdoc-html/decl-trailing-whitespace.declaration.html diff --git a/tests/rustdoc/decl-trailing-whitespace.rs b/tests/rustdoc-html/decl-trailing-whitespace.rs similarity index 100% rename from tests/rustdoc/decl-trailing-whitespace.rs rename to tests/rustdoc-html/decl-trailing-whitespace.rs diff --git a/tests/rustdoc/deep-structures.rs b/tests/rustdoc-html/deep-structures.rs similarity index 100% rename from tests/rustdoc/deep-structures.rs rename to tests/rustdoc-html/deep-structures.rs diff --git a/tests/rustdoc/default-theme.rs b/tests/rustdoc-html/default-theme.rs similarity index 100% rename from tests/rustdoc/default-theme.rs rename to tests/rustdoc-html/default-theme.rs diff --git a/tests/rustdoc/default-trait-method-link.rs b/tests/rustdoc-html/default-trait-method-link.rs similarity index 100% rename from tests/rustdoc/default-trait-method-link.rs rename to tests/rustdoc-html/default-trait-method-link.rs diff --git a/tests/rustdoc/default-trait-method.rs b/tests/rustdoc-html/default-trait-method.rs similarity index 100% rename from tests/rustdoc/default-trait-method.rs rename to tests/rustdoc-html/default-trait-method.rs diff --git a/tests/rustdoc/demo-allocator-54478.rs b/tests/rustdoc-html/demo-allocator-54478.rs similarity index 100% rename from tests/rustdoc/demo-allocator-54478.rs rename to tests/rustdoc-html/demo-allocator-54478.rs diff --git a/tests/rustdoc/deprecated-future-staged-api.rs b/tests/rustdoc-html/deprecated-future-staged-api.rs similarity index 100% rename from tests/rustdoc/deprecated-future-staged-api.rs rename to tests/rustdoc-html/deprecated-future-staged-api.rs diff --git a/tests/rustdoc/deprecated-future.rs b/tests/rustdoc-html/deprecated-future.rs similarity index 100% rename from tests/rustdoc/deprecated-future.rs rename to tests/rustdoc-html/deprecated-future.rs diff --git a/tests/rustdoc/deprecated.rs b/tests/rustdoc-html/deprecated.rs similarity index 100% rename from tests/rustdoc/deprecated.rs rename to tests/rustdoc-html/deprecated.rs diff --git a/tests/rustdoc/deref-methods-19190-foreign-type.rs b/tests/rustdoc-html/deref-methods-19190-foreign-type.rs similarity index 100% rename from tests/rustdoc/deref-methods-19190-foreign-type.rs rename to tests/rustdoc-html/deref-methods-19190-foreign-type.rs diff --git a/tests/rustdoc/deref-methods-19190-inline.rs b/tests/rustdoc-html/deref-methods-19190-inline.rs similarity index 100% rename from tests/rustdoc/deref-methods-19190-inline.rs rename to tests/rustdoc-html/deref-methods-19190-inline.rs diff --git a/tests/rustdoc/deref-methods-19190.rs b/tests/rustdoc-html/deref-methods-19190.rs similarity index 100% rename from tests/rustdoc/deref-methods-19190.rs rename to tests/rustdoc-html/deref-methods-19190.rs diff --git a/tests/rustdoc/deref-mut-35169-2.rs b/tests/rustdoc-html/deref-mut-35169-2.rs similarity index 100% rename from tests/rustdoc/deref-mut-35169-2.rs rename to tests/rustdoc-html/deref-mut-35169-2.rs diff --git a/tests/rustdoc/deref-mut-35169.rs b/tests/rustdoc-html/deref-mut-35169.rs similarity index 100% rename from tests/rustdoc/deref-mut-35169.rs rename to tests/rustdoc-html/deref-mut-35169.rs diff --git a/tests/rustdoc/deref/deref-const-fn.rs b/tests/rustdoc-html/deref/deref-const-fn.rs similarity index 100% rename from tests/rustdoc/deref/deref-const-fn.rs rename to tests/rustdoc-html/deref/deref-const-fn.rs diff --git a/tests/rustdoc/deref/deref-methods-24686-target.rs b/tests/rustdoc-html/deref/deref-methods-24686-target.rs similarity index 100% rename from tests/rustdoc/deref/deref-methods-24686-target.rs rename to tests/rustdoc-html/deref/deref-methods-24686-target.rs diff --git a/tests/rustdoc/deref/deref-multiple-impl-blocks.rs b/tests/rustdoc-html/deref/deref-multiple-impl-blocks.rs similarity index 100% rename from tests/rustdoc/deref/deref-multiple-impl-blocks.rs rename to tests/rustdoc-html/deref/deref-multiple-impl-blocks.rs diff --git a/tests/rustdoc/deref/deref-mut-methods.rs b/tests/rustdoc-html/deref/deref-mut-methods.rs similarity index 100% rename from tests/rustdoc/deref/deref-mut-methods.rs rename to tests/rustdoc-html/deref/deref-mut-methods.rs diff --git a/tests/rustdoc/deref/deref-recursive-pathbuf.rs b/tests/rustdoc-html/deref/deref-recursive-pathbuf.rs similarity index 100% rename from tests/rustdoc/deref/deref-recursive-pathbuf.rs rename to tests/rustdoc-html/deref/deref-recursive-pathbuf.rs diff --git a/tests/rustdoc/deref/deref-recursive.rs b/tests/rustdoc-html/deref/deref-recursive.rs similarity index 100% rename from tests/rustdoc/deref/deref-recursive.rs rename to tests/rustdoc-html/deref/deref-recursive.rs diff --git a/tests/rustdoc/deref/deref-slice-core.rs b/tests/rustdoc-html/deref/deref-slice-core.rs similarity index 100% rename from tests/rustdoc/deref/deref-slice-core.rs rename to tests/rustdoc-html/deref/deref-slice-core.rs diff --git a/tests/rustdoc/deref/deref-to-primitive.rs b/tests/rustdoc-html/deref/deref-to-primitive.rs similarity index 100% rename from tests/rustdoc/deref/deref-to-primitive.rs rename to tests/rustdoc-html/deref/deref-to-primitive.rs diff --git a/tests/rustdoc/deref/deref-typedef.rs b/tests/rustdoc-html/deref/deref-typedef.rs similarity index 100% rename from tests/rustdoc/deref/deref-typedef.rs rename to tests/rustdoc-html/deref/deref-typedef.rs diff --git a/tests/rustdoc/deref/escape-deref-methods.rs b/tests/rustdoc-html/deref/escape-deref-methods.rs similarity index 100% rename from tests/rustdoc/deref/escape-deref-methods.rs rename to tests/rustdoc-html/deref/escape-deref-methods.rs diff --git a/tests/rustdoc/deref/recursive-deref-sidebar.rs b/tests/rustdoc-html/deref/recursive-deref-sidebar.rs similarity index 100% rename from tests/rustdoc/deref/recursive-deref-sidebar.rs rename to tests/rustdoc-html/deref/recursive-deref-sidebar.rs diff --git a/tests/rustdoc/deref/recursive-deref.rs b/tests/rustdoc-html/deref/recursive-deref.rs similarity index 100% rename from tests/rustdoc/deref/recursive-deref.rs rename to tests/rustdoc-html/deref/recursive-deref.rs diff --git a/tests/rustdoc/deref/sidebar-links-deref-100679.rs b/tests/rustdoc-html/deref/sidebar-links-deref-100679.rs similarity index 100% rename from tests/rustdoc/deref/sidebar-links-deref-100679.rs rename to tests/rustdoc-html/deref/sidebar-links-deref-100679.rs diff --git a/tests/rustdoc/description.rs b/tests/rustdoc-html/description.rs similarity index 100% rename from tests/rustdoc/description.rs rename to tests/rustdoc-html/description.rs diff --git a/tests/rustdoc/description_default.rs b/tests/rustdoc-html/description_default.rs similarity index 100% rename from tests/rustdoc/description_default.rs rename to tests/rustdoc-html/description_default.rs diff --git a/tests/rustdoc/display-hidden-items.rs b/tests/rustdoc-html/display-hidden-items.rs similarity index 100% rename from tests/rustdoc/display-hidden-items.rs rename to tests/rustdoc-html/display-hidden-items.rs diff --git a/tests/rustdoc/doc-attr-comment-mix-42760.rs b/tests/rustdoc-html/doc-attr-comment-mix-42760.rs similarity index 100% rename from tests/rustdoc/doc-attr-comment-mix-42760.rs rename to tests/rustdoc-html/doc-attr-comment-mix-42760.rs diff --git a/tests/rustdoc/doc-attribute.rs b/tests/rustdoc-html/doc-attribute.rs similarity index 100% rename from tests/rustdoc/doc-attribute.rs rename to tests/rustdoc-html/doc-attribute.rs diff --git a/tests/rustdoc/doc-auto-cfg-public-in-private.rs b/tests/rustdoc-html/doc-auto-cfg-public-in-private.rs similarity index 100% rename from tests/rustdoc/doc-auto-cfg-public-in-private.rs rename to tests/rustdoc-html/doc-auto-cfg-public-in-private.rs diff --git a/tests/rustdoc/doc-auto-cfg.rs b/tests/rustdoc-html/doc-auto-cfg.rs similarity index 100% rename from tests/rustdoc/doc-auto-cfg.rs rename to tests/rustdoc-html/doc-auto-cfg.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-hide.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-hide.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-hide.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-hide.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-implicit-gate.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-implicit-gate.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-implicit.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-implicit.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-implicit.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-implicit.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-inherit-from-module-79201.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-inherit-from-module-79201.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-inherit-from-module-79201.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-inherit-from-module-79201.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-simplification.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-simplification.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-simplification.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-simplification.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-target-feature.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-target-feature.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-target-feature.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-target-feature.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg-traits.rs b/tests/rustdoc-html/doc-cfg/doc-cfg-traits.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg-traits.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg-traits.rs diff --git a/tests/rustdoc/doc-cfg/doc-cfg.rs b/tests/rustdoc-html/doc-cfg/doc-cfg.rs similarity index 100% rename from tests/rustdoc/doc-cfg/doc-cfg.rs rename to tests/rustdoc-html/doc-cfg/doc-cfg.rs diff --git a/tests/rustdoc/doc-cfg/duplicate-cfg.rs b/tests/rustdoc-html/doc-cfg/duplicate-cfg.rs similarity index 100% rename from tests/rustdoc/doc-cfg/duplicate-cfg.rs rename to tests/rustdoc-html/doc-cfg/duplicate-cfg.rs diff --git a/tests/rustdoc/doc-hidden-crate.rs b/tests/rustdoc-html/doc-hidden-crate.rs similarity index 100% rename from tests/rustdoc/doc-hidden-crate.rs rename to tests/rustdoc-html/doc-hidden-crate.rs diff --git a/tests/rustdoc/doc-hidden-method-13698.rs b/tests/rustdoc-html/doc-hidden-method-13698.rs similarity index 100% rename from tests/rustdoc/doc-hidden-method-13698.rs rename to tests/rustdoc-html/doc-hidden-method-13698.rs diff --git a/tests/rustdoc/doc-on-keyword.rs b/tests/rustdoc-html/doc-on-keyword.rs similarity index 100% rename from tests/rustdoc/doc-on-keyword.rs rename to tests/rustdoc-html/doc-on-keyword.rs diff --git a/tests/rustdoc/doc-test-attr-18199.rs b/tests/rustdoc-html/doc-test-attr-18199.rs similarity index 100% rename from tests/rustdoc/doc-test-attr-18199.rs rename to tests/rustdoc-html/doc-test-attr-18199.rs diff --git a/tests/rustdoc/doc_auto_cfg.rs b/tests/rustdoc-html/doc_auto_cfg.rs similarity index 100% rename from tests/rustdoc/doc_auto_cfg.rs rename to tests/rustdoc-html/doc_auto_cfg.rs diff --git a/tests/rustdoc/doc_auto_cfg_reexports.rs b/tests/rustdoc-html/doc_auto_cfg_reexports.rs similarity index 100% rename from tests/rustdoc/doc_auto_cfg_reexports.rs rename to tests/rustdoc-html/doc_auto_cfg_reexports.rs diff --git a/tests/rustdoc/doctest/auxiliary/doctest-runtool.rs b/tests/rustdoc-html/doctest/auxiliary/doctest-runtool.rs similarity index 100% rename from tests/rustdoc/doctest/auxiliary/doctest-runtool.rs rename to tests/rustdoc-html/doctest/auxiliary/doctest-runtool.rs diff --git a/tests/rustdoc/doctest/auxiliary/empty.rs b/tests/rustdoc-html/doctest/auxiliary/empty.rs similarity index 100% rename from tests/rustdoc/doctest/auxiliary/empty.rs rename to tests/rustdoc-html/doctest/auxiliary/empty.rs diff --git a/tests/rustdoc/doctest/doctest-cfg-feature-30252.rs b/tests/rustdoc-html/doctest/doctest-cfg-feature-30252.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-cfg-feature-30252.rs rename to tests/rustdoc-html/doctest/doctest-cfg-feature-30252.rs diff --git a/tests/rustdoc/doctest/doctest-crate-attributes-38129.rs b/tests/rustdoc-html/doctest/doctest-crate-attributes-38129.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-crate-attributes-38129.rs rename to tests/rustdoc-html/doctest/doctest-crate-attributes-38129.rs diff --git a/tests/rustdoc/doctest/doctest-escape-boring-41783.codeblock.html b/tests/rustdoc-html/doctest/doctest-escape-boring-41783.codeblock.html similarity index 100% rename from tests/rustdoc/doctest/doctest-escape-boring-41783.codeblock.html rename to tests/rustdoc-html/doctest/doctest-escape-boring-41783.codeblock.html diff --git a/tests/rustdoc/doctest/doctest-escape-boring-41783.rs b/tests/rustdoc-html/doctest/doctest-escape-boring-41783.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-escape-boring-41783.rs rename to tests/rustdoc-html/doctest/doctest-escape-boring-41783.rs diff --git a/tests/rustdoc/doctest/doctest-hide-empty-line-23106.rs b/tests/rustdoc-html/doctest/doctest-hide-empty-line-23106.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-hide-empty-line-23106.rs rename to tests/rustdoc-html/doctest/doctest-hide-empty-line-23106.rs diff --git a/tests/rustdoc/doctest/doctest-ignore-32556.rs b/tests/rustdoc-html/doctest/doctest-ignore-32556.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-ignore-32556.rs rename to tests/rustdoc-html/doctest/doctest-ignore-32556.rs diff --git a/tests/rustdoc/doctest/doctest-include-43153.rs b/tests/rustdoc-html/doctest/doctest-include-43153.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-include-43153.rs rename to tests/rustdoc-html/doctest/doctest-include-43153.rs diff --git a/tests/rustdoc/doctest/doctest-macro-38219.rs b/tests/rustdoc-html/doctest/doctest-macro-38219.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-macro-38219.rs rename to tests/rustdoc-html/doctest/doctest-macro-38219.rs diff --git a/tests/rustdoc/doctest/doctest-manual-crate-name.rs b/tests/rustdoc-html/doctest/doctest-manual-crate-name.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-manual-crate-name.rs rename to tests/rustdoc-html/doctest/doctest-manual-crate-name.rs diff --git a/tests/rustdoc/doctest/doctest-markdown-inline-parse-23744.rs b/tests/rustdoc-html/doctest/doctest-markdown-inline-parse-23744.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-markdown-inline-parse-23744.rs rename to tests/rustdoc-html/doctest/doctest-markdown-inline-parse-23744.rs diff --git a/tests/rustdoc/doctest/doctest-markdown-trailing-docblock-48377.rs b/tests/rustdoc-html/doctest/doctest-markdown-trailing-docblock-48377.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-markdown-trailing-docblock-48377.rs rename to tests/rustdoc-html/doctest/doctest-markdown-trailing-docblock-48377.rs diff --git a/tests/rustdoc/doctest/doctest-multi-line-string-literal-25944.rs b/tests/rustdoc-html/doctest/doctest-multi-line-string-literal-25944.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-multi-line-string-literal-25944.rs rename to tests/rustdoc-html/doctest/doctest-multi-line-string-literal-25944.rs diff --git a/tests/rustdoc/doctest/doctest-runtool.rs b/tests/rustdoc-html/doctest/doctest-runtool.rs similarity index 100% rename from tests/rustdoc/doctest/doctest-runtool.rs rename to tests/rustdoc-html/doctest/doctest-runtool.rs diff --git a/tests/rustdoc/doctest/ignore-sometimes.rs b/tests/rustdoc-html/doctest/ignore-sometimes.rs similarity index 100% rename from tests/rustdoc/doctest/ignore-sometimes.rs rename to tests/rustdoc-html/doctest/ignore-sometimes.rs diff --git a/tests/rustdoc/document-hidden-items-15347.rs b/tests/rustdoc-html/document-hidden-items-15347.rs similarity index 100% rename from tests/rustdoc/document-hidden-items-15347.rs rename to tests/rustdoc-html/document-hidden-items-15347.rs diff --git a/tests/rustdoc/double-hyphen-to-dash.rs b/tests/rustdoc-html/double-hyphen-to-dash.rs similarity index 100% rename from tests/rustdoc/double-hyphen-to-dash.rs rename to tests/rustdoc-html/double-hyphen-to-dash.rs diff --git a/tests/rustdoc/double-quote-escape.rs b/tests/rustdoc-html/double-quote-escape.rs similarity index 100% rename from tests/rustdoc/double-quote-escape.rs rename to tests/rustdoc-html/double-quote-escape.rs diff --git a/tests/rustdoc/duplicate-flags.rs b/tests/rustdoc-html/duplicate-flags.rs similarity index 100% rename from tests/rustdoc/duplicate-flags.rs rename to tests/rustdoc-html/duplicate-flags.rs diff --git a/tests/rustdoc/duplicate_impls/impls.rs b/tests/rustdoc-html/duplicate_impls/impls.rs similarity index 100% rename from tests/rustdoc/duplicate_impls/impls.rs rename to tests/rustdoc-html/duplicate_impls/impls.rs diff --git a/tests/rustdoc/duplicate_impls/sidebar-links-duplicate-impls-33054.rs b/tests/rustdoc-html/duplicate_impls/sidebar-links-duplicate-impls-33054.rs similarity index 100% rename from tests/rustdoc/duplicate_impls/sidebar-links-duplicate-impls-33054.rs rename to tests/rustdoc-html/duplicate_impls/sidebar-links-duplicate-impls-33054.rs diff --git a/tests/rustdoc/dyn-compatibility.rs b/tests/rustdoc-html/dyn-compatibility.rs similarity index 100% rename from tests/rustdoc/dyn-compatibility.rs rename to tests/rustdoc-html/dyn-compatibility.rs diff --git a/tests/rustdoc/early-unindent.rs b/tests/rustdoc-html/early-unindent.rs similarity index 100% rename from tests/rustdoc/early-unindent.rs rename to tests/rustdoc-html/early-unindent.rs diff --git a/tests/rustdoc/edition-doctest.rs b/tests/rustdoc-html/edition-doctest.rs similarity index 100% rename from tests/rustdoc/edition-doctest.rs rename to tests/rustdoc-html/edition-doctest.rs diff --git a/tests/rustdoc/edition-flag.rs b/tests/rustdoc-html/edition-flag.rs similarity index 100% rename from tests/rustdoc/edition-flag.rs rename to tests/rustdoc-html/edition-flag.rs diff --git a/tests/rustdoc/elided-lifetime.rs b/tests/rustdoc-html/elided-lifetime.rs similarity index 100% rename from tests/rustdoc/elided-lifetime.rs rename to tests/rustdoc-html/elided-lifetime.rs diff --git a/tests/rustdoc/empty-doc-comment.rs b/tests/rustdoc-html/empty-doc-comment.rs similarity index 100% rename from tests/rustdoc/empty-doc-comment.rs rename to tests/rustdoc-html/empty-doc-comment.rs diff --git a/tests/rustdoc/empty-mod-public.rs b/tests/rustdoc-html/empty-mod-public.rs similarity index 100% rename from tests/rustdoc/empty-mod-public.rs rename to tests/rustdoc-html/empty-mod-public.rs diff --git a/tests/rustdoc/empty-section.rs b/tests/rustdoc-html/empty-section.rs similarity index 100% rename from tests/rustdoc/empty-section.rs rename to tests/rustdoc-html/empty-section.rs diff --git a/tests/rustdoc/empty-tuple-struct-118180.rs b/tests/rustdoc-html/empty-tuple-struct-118180.rs similarity index 100% rename from tests/rustdoc/empty-tuple-struct-118180.rs rename to tests/rustdoc-html/empty-tuple-struct-118180.rs diff --git a/tests/rustdoc/ensure-src-link.rs b/tests/rustdoc-html/ensure-src-link.rs similarity index 100% rename from tests/rustdoc/ensure-src-link.rs rename to tests/rustdoc-html/ensure-src-link.rs diff --git a/tests/rustdoc/enum/auxiliary/enum-variant.rs b/tests/rustdoc-html/enum/auxiliary/enum-variant.rs similarity index 100% rename from tests/rustdoc/enum/auxiliary/enum-variant.rs rename to tests/rustdoc-html/enum/auxiliary/enum-variant.rs diff --git a/tests/rustdoc/enum/auxiliary/variant-struct.rs b/tests/rustdoc-html/enum/auxiliary/variant-struct.rs similarity index 100% rename from tests/rustdoc/enum/auxiliary/variant-struct.rs rename to tests/rustdoc-html/enum/auxiliary/variant-struct.rs diff --git a/tests/rustdoc/enum/enum-headings.rs b/tests/rustdoc-html/enum/enum-headings.rs similarity index 100% rename from tests/rustdoc/enum/enum-headings.rs rename to tests/rustdoc-html/enum/enum-headings.rs diff --git a/tests/rustdoc/enum/enum-non-exhaustive-108925.rs b/tests/rustdoc-html/enum/enum-non-exhaustive-108925.rs similarity index 100% rename from tests/rustdoc/enum/enum-non-exhaustive-108925.rs rename to tests/rustdoc-html/enum/enum-non-exhaustive-108925.rs diff --git a/tests/rustdoc/enum/enum-variant-doc-hidden-field-88600.rs b/tests/rustdoc-html/enum/enum-variant-doc-hidden-field-88600.rs similarity index 100% rename from tests/rustdoc/enum/enum-variant-doc-hidden-field-88600.rs rename to tests/rustdoc-html/enum/enum-variant-doc-hidden-field-88600.rs diff --git a/tests/rustdoc/enum/enum-variant-fields-heading.rs b/tests/rustdoc-html/enum/enum-variant-fields-heading.rs similarity index 100% rename from tests/rustdoc/enum/enum-variant-fields-heading.rs rename to tests/rustdoc-html/enum/enum-variant-fields-heading.rs diff --git a/tests/rustdoc/enum/enum-variant-fields-heading.variants.html b/tests/rustdoc-html/enum/enum-variant-fields-heading.variants.html similarity index 100% rename from tests/rustdoc/enum/enum-variant-fields-heading.variants.html rename to tests/rustdoc-html/enum/enum-variant-fields-heading.variants.html diff --git a/tests/rustdoc/enum/enum-variant-non_exhaustive.rs b/tests/rustdoc-html/enum/enum-variant-non_exhaustive.rs similarity index 100% rename from tests/rustdoc/enum/enum-variant-non_exhaustive.rs rename to tests/rustdoc-html/enum/enum-variant-non_exhaustive.rs diff --git a/tests/rustdoc/enum/enum-variant-non_exhaustive.type-alias-code.html b/tests/rustdoc-html/enum/enum-variant-non_exhaustive.type-alias-code.html similarity index 100% rename from tests/rustdoc/enum/enum-variant-non_exhaustive.type-alias-code.html rename to tests/rustdoc-html/enum/enum-variant-non_exhaustive.type-alias-code.html diff --git a/tests/rustdoc/enum/enum-variant-non_exhaustive.type-code.html b/tests/rustdoc-html/enum/enum-variant-non_exhaustive.type-code.html similarity index 100% rename from tests/rustdoc/enum/enum-variant-non_exhaustive.type-code.html rename to tests/rustdoc-html/enum/enum-variant-non_exhaustive.type-code.html diff --git a/tests/rustdoc/enum/enum-variant-value.rs b/tests/rustdoc-html/enum/enum-variant-value.rs similarity index 100% rename from tests/rustdoc/enum/enum-variant-value.rs rename to tests/rustdoc-html/enum/enum-variant-value.rs diff --git a/tests/rustdoc/enum/render-enum-variant-structlike-32395.rs b/tests/rustdoc-html/enum/render-enum-variant-structlike-32395.rs similarity index 100% rename from tests/rustdoc/enum/render-enum-variant-structlike-32395.rs rename to tests/rustdoc-html/enum/render-enum-variant-structlike-32395.rs diff --git a/tests/rustdoc/enum/strip-enum-variant.no-not-shown.html b/tests/rustdoc-html/enum/strip-enum-variant.no-not-shown.html similarity index 100% rename from tests/rustdoc/enum/strip-enum-variant.no-not-shown.html rename to tests/rustdoc-html/enum/strip-enum-variant.no-not-shown.html diff --git a/tests/rustdoc/enum/strip-enum-variant.rs b/tests/rustdoc-html/enum/strip-enum-variant.rs similarity index 100% rename from tests/rustdoc/enum/strip-enum-variant.rs rename to tests/rustdoc-html/enum/strip-enum-variant.rs diff --git a/tests/rustdoc/extern/auxiliary/empty.rs b/tests/rustdoc-html/extern/auxiliary/empty.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/empty.rs rename to tests/rustdoc-html/extern/auxiliary/empty.rs diff --git a/tests/rustdoc/extern/auxiliary/extern-links.rs b/tests/rustdoc-html/extern/auxiliary/extern-links.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/extern-links.rs rename to tests/rustdoc-html/extern/auxiliary/extern-links.rs diff --git a/tests/rustdoc/extern/auxiliary/external-cross-doc.md b/tests/rustdoc-html/extern/auxiliary/external-cross-doc.md similarity index 100% rename from tests/rustdoc/extern/auxiliary/external-cross-doc.md rename to tests/rustdoc-html/extern/auxiliary/external-cross-doc.md diff --git a/tests/rustdoc/extern/auxiliary/external-cross.rs b/tests/rustdoc-html/extern/auxiliary/external-cross.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/external-cross.rs rename to tests/rustdoc-html/extern/auxiliary/external-cross.rs diff --git a/tests/rustdoc/extern/auxiliary/external-doc.md b/tests/rustdoc-html/extern/auxiliary/external-doc.md similarity index 100% rename from tests/rustdoc/extern/auxiliary/external-doc.md rename to tests/rustdoc-html/extern/auxiliary/external-doc.md diff --git a/tests/rustdoc/extern/auxiliary/html_root.rs b/tests/rustdoc-html/extern/auxiliary/html_root.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/html_root.rs rename to tests/rustdoc-html/extern/auxiliary/html_root.rs diff --git a/tests/rustdoc/extern/auxiliary/issue-30109-1.rs b/tests/rustdoc-html/extern/auxiliary/issue-30109-1.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/issue-30109-1.rs rename to tests/rustdoc-html/extern/auxiliary/issue-30109-1.rs diff --git a/tests/rustdoc/extern/auxiliary/no_html_root.rs b/tests/rustdoc-html/extern/auxiliary/no_html_root.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/no_html_root.rs rename to tests/rustdoc-html/extern/auxiliary/no_html_root.rs diff --git a/tests/rustdoc/extern/auxiliary/panic-item.rs b/tests/rustdoc-html/extern/auxiliary/panic-item.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/panic-item.rs rename to tests/rustdoc-html/extern/auxiliary/panic-item.rs diff --git a/tests/rustdoc/extern/auxiliary/pub-extern-crate.rs b/tests/rustdoc-html/extern/auxiliary/pub-extern-crate.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/pub-extern-crate.rs rename to tests/rustdoc-html/extern/auxiliary/pub-extern-crate.rs diff --git a/tests/rustdoc/extern/auxiliary/rustdoc-extern-default-method.rs b/tests/rustdoc-html/extern/auxiliary/rustdoc-extern-default-method.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/rustdoc-extern-default-method.rs rename to tests/rustdoc-html/extern/auxiliary/rustdoc-extern-default-method.rs diff --git a/tests/rustdoc/extern/auxiliary/rustdoc-extern-method.rs b/tests/rustdoc-html/extern/auxiliary/rustdoc-extern-method.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/rustdoc-extern-method.rs rename to tests/rustdoc-html/extern/auxiliary/rustdoc-extern-method.rs diff --git a/tests/rustdoc/extern/auxiliary/variant-struct.rs b/tests/rustdoc-html/extern/auxiliary/variant-struct.rs similarity index 100% rename from tests/rustdoc/extern/auxiliary/variant-struct.rs rename to tests/rustdoc-html/extern/auxiliary/variant-struct.rs diff --git a/tests/rustdoc-html/extern/duplicate-reexports-section-150211.rs b/tests/rustdoc-html/extern/duplicate-reexports-section-150211.rs new file mode 100644 index 000000000000..41f80cc6ab75 --- /dev/null +++ b/tests/rustdoc-html/extern/duplicate-reexports-section-150211.rs @@ -0,0 +1,19 @@ +//@ aux-build:pub-extern-crate.rs + +// Regression test for issue . +// When a module has both `pub extern crate` and `pub use` items, +// they should both appear under a single "Re-exports" section, +// not two separate sections. + +//@ has duplicate_reexports_section_150211/index.html +// Verify there's exactly one Re-exports section header +//@ count - '//h2[@id="reexports"]' 1 +//@ has - '//h2[@id="reexports"]' 'Re-exports' +// Verify both the extern crate and the use item are present +//@ has - '//code' 'pub extern crate inner;' +//@ has - '//code' 'pub use inner::SomeStruct;' + +pub extern crate inner; + +#[doc(no_inline)] +pub use inner::SomeStruct; diff --git a/tests/rustdoc/extern/extern-default-method.no_href_on_anchor.html b/tests/rustdoc-html/extern/extern-default-method.no_href_on_anchor.html similarity index 100% rename from tests/rustdoc/extern/extern-default-method.no_href_on_anchor.html rename to tests/rustdoc-html/extern/extern-default-method.no_href_on_anchor.html diff --git a/tests/rustdoc/extern/extern-default-method.rs b/tests/rustdoc-html/extern/extern-default-method.rs similarity index 100% rename from tests/rustdoc/extern/extern-default-method.rs rename to tests/rustdoc-html/extern/extern-default-method.rs diff --git a/tests/rustdoc/extern/extern-fn-22038.rs b/tests/rustdoc-html/extern/extern-fn-22038.rs similarity index 100% rename from tests/rustdoc/extern/extern-fn-22038.rs rename to tests/rustdoc-html/extern/extern-fn-22038.rs diff --git a/tests/rustdoc/extern/extern-html-alias.rs b/tests/rustdoc-html/extern/extern-html-alias.rs similarity index 100% rename from tests/rustdoc/extern/extern-html-alias.rs rename to tests/rustdoc-html/extern/extern-html-alias.rs diff --git a/tests/rustdoc/extern/extern-html-fallback.rs b/tests/rustdoc-html/extern/extern-html-fallback.rs similarity index 100% rename from tests/rustdoc/extern/extern-html-fallback.rs rename to tests/rustdoc-html/extern/extern-html-fallback.rs diff --git a/tests/rustdoc/extern/extern-html-root-url-precedence.rs b/tests/rustdoc-html/extern/extern-html-root-url-precedence.rs similarity index 100% rename from tests/rustdoc/extern/extern-html-root-url-precedence.rs rename to tests/rustdoc-html/extern/extern-html-root-url-precedence.rs diff --git a/tests/rustdoc/extern/extern-html-root-url.rs b/tests/rustdoc-html/extern/extern-html-root-url.rs similarity index 100% rename from tests/rustdoc/extern/extern-html-root-url.rs rename to tests/rustdoc-html/extern/extern-html-root-url.rs diff --git a/tests/rustdoc/extern/extern-links.rs b/tests/rustdoc-html/extern/extern-links.rs similarity index 100% rename from tests/rustdoc/extern/extern-links.rs rename to tests/rustdoc-html/extern/extern-links.rs diff --git a/tests/rustdoc/extern/extern-method.rs b/tests/rustdoc-html/extern/extern-method.rs similarity index 100% rename from tests/rustdoc/extern/extern-method.rs rename to tests/rustdoc-html/extern/extern-method.rs diff --git a/tests/rustdoc/extern/external-cross.rs b/tests/rustdoc-html/extern/external-cross.rs similarity index 100% rename from tests/rustdoc/extern/external-cross.rs rename to tests/rustdoc-html/extern/external-cross.rs diff --git a/tests/rustdoc/extern/external-doc.rs b/tests/rustdoc-html/extern/external-doc.rs similarity index 100% rename from tests/rustdoc/extern/external-doc.rs rename to tests/rustdoc-html/extern/external-doc.rs diff --git a/tests/rustdoc/extern/hidden-extern-34025.rs b/tests/rustdoc-html/extern/hidden-extern-34025.rs similarity index 100% rename from tests/rustdoc/extern/hidden-extern-34025.rs rename to tests/rustdoc-html/extern/hidden-extern-34025.rs diff --git a/tests/rustdoc/extern/link-extern-crate-33178.rs b/tests/rustdoc-html/extern/link-extern-crate-33178.rs similarity index 100% rename from tests/rustdoc/extern/link-extern-crate-33178.rs rename to tests/rustdoc-html/extern/link-extern-crate-33178.rs diff --git a/tests/rustdoc/extern/link-extern-crate-item-30109.rs b/tests/rustdoc-html/extern/link-extern-crate-item-30109.rs similarity index 100% rename from tests/rustdoc/extern/link-extern-crate-item-30109.rs rename to tests/rustdoc-html/extern/link-extern-crate-item-30109.rs diff --git a/tests/rustdoc/extern/link-extern-crate-title-33178.rs b/tests/rustdoc-html/extern/link-extern-crate-title-33178.rs similarity index 100% rename from tests/rustdoc/extern/link-extern-crate-title-33178.rs rename to tests/rustdoc-html/extern/link-extern-crate-title-33178.rs diff --git a/tests/rustdoc/extern/pub-extern-crate-150176.rs b/tests/rustdoc-html/extern/pub-extern-crate-150176.rs similarity index 100% rename from tests/rustdoc/extern/pub-extern-crate-150176.rs rename to tests/rustdoc-html/extern/pub-extern-crate-150176.rs diff --git a/tests/rustdoc/extern/pub-extern-crate.rs b/tests/rustdoc-html/extern/pub-extern-crate.rs similarity index 100% rename from tests/rustdoc/extern/pub-extern-crate.rs rename to tests/rustdoc-html/extern/pub-extern-crate.rs diff --git a/tests/rustdoc/extern/unsafe-extern-blocks.rs b/tests/rustdoc-html/extern/unsafe-extern-blocks.rs similarity index 100% rename from tests/rustdoc/extern/unsafe-extern-blocks.rs rename to tests/rustdoc-html/extern/unsafe-extern-blocks.rs diff --git a/tests/rustdoc/extern/unused-extern-crate.rs b/tests/rustdoc-html/extern/unused-extern-crate.rs similarity index 100% rename from tests/rustdoc/extern/unused-extern-crate.rs rename to tests/rustdoc-html/extern/unused-extern-crate.rs diff --git a/tests/rustdoc/extremely_long_typename.extremely_long_typename.html b/tests/rustdoc-html/extremely_long_typename.extremely_long_typename.html similarity index 100% rename from tests/rustdoc/extremely_long_typename.extremely_long_typename.html rename to tests/rustdoc-html/extremely_long_typename.extremely_long_typename.html diff --git a/tests/rustdoc/extremely_long_typename.rs b/tests/rustdoc-html/extremely_long_typename.rs similarity index 100% rename from tests/rustdoc/extremely_long_typename.rs rename to tests/rustdoc-html/extremely_long_typename.rs diff --git a/tests/rustdoc/feature-gate-doc_auto_cfg.rs b/tests/rustdoc-html/feature-gate-doc_auto_cfg.rs similarity index 100% rename from tests/rustdoc/feature-gate-doc_auto_cfg.rs rename to tests/rustdoc-html/feature-gate-doc_auto_cfg.rs diff --git a/tests/rustdoc/ffi.rs b/tests/rustdoc-html/ffi.rs similarity index 100% rename from tests/rustdoc/ffi.rs rename to tests/rustdoc-html/ffi.rs diff --git a/tests/rustdoc/file-creation-111249.rs b/tests/rustdoc-html/file-creation-111249.rs similarity index 100% rename from tests/rustdoc/file-creation-111249.rs rename to tests/rustdoc-html/file-creation-111249.rs diff --git a/tests/rustdoc/files-creation-hidden.rs b/tests/rustdoc-html/files-creation-hidden.rs similarity index 100% rename from tests/rustdoc/files-creation-hidden.rs rename to tests/rustdoc-html/files-creation-hidden.rs diff --git a/tests/rustdoc/fn-bound.rs b/tests/rustdoc-html/fn-bound.rs similarity index 100% rename from tests/rustdoc/fn-bound.rs rename to tests/rustdoc-html/fn-bound.rs diff --git a/tests/rustdoc/fn-pointer-arg-name.rs b/tests/rustdoc-html/fn-pointer-arg-name.rs similarity index 100% rename from tests/rustdoc/fn-pointer-arg-name.rs rename to tests/rustdoc-html/fn-pointer-arg-name.rs diff --git a/tests/rustdoc/fn-sidebar.rs b/tests/rustdoc-html/fn-sidebar.rs similarity index 100% rename from tests/rustdoc/fn-sidebar.rs rename to tests/rustdoc-html/fn-sidebar.rs diff --git a/tests/rustdoc/fn-type.rs b/tests/rustdoc-html/fn-type.rs similarity index 100% rename from tests/rustdoc/fn-type.rs rename to tests/rustdoc-html/fn-type.rs diff --git a/tests/rustdoc/footnote-definition-without-blank-line-100638.rs b/tests/rustdoc-html/footnote-definition-without-blank-line-100638.rs similarity index 100% rename from tests/rustdoc/footnote-definition-without-blank-line-100638.rs rename to tests/rustdoc-html/footnote-definition-without-blank-line-100638.rs diff --git a/tests/rustdoc/footnote-ids.rs b/tests/rustdoc-html/footnote-ids.rs similarity index 100% rename from tests/rustdoc/footnote-ids.rs rename to tests/rustdoc-html/footnote-ids.rs diff --git a/tests/rustdoc/footnote-in-summary.rs b/tests/rustdoc-html/footnote-in-summary.rs similarity index 100% rename from tests/rustdoc/footnote-in-summary.rs rename to tests/rustdoc-html/footnote-in-summary.rs diff --git a/tests/rustdoc/footnote-reference-ids.rs b/tests/rustdoc-html/footnote-reference-ids.rs similarity index 100% rename from tests/rustdoc/footnote-reference-ids.rs rename to tests/rustdoc-html/footnote-reference-ids.rs diff --git a/tests/rustdoc/footnote-reference-in-footnote-def.rs b/tests/rustdoc-html/footnote-reference-in-footnote-def.rs similarity index 100% rename from tests/rustdoc/footnote-reference-in-footnote-def.rs rename to tests/rustdoc-html/footnote-reference-in-footnote-def.rs diff --git a/tests/rustdoc/force-target-feature.rs b/tests/rustdoc-html/force-target-feature.rs similarity index 100% rename from tests/rustdoc/force-target-feature.rs rename to tests/rustdoc-html/force-target-feature.rs diff --git a/tests/rustdoc/force-unstable-if-unmarked-106421-not-internal.rs b/tests/rustdoc-html/force-unstable-if-unmarked-106421-not-internal.rs similarity index 100% rename from tests/rustdoc/force-unstable-if-unmarked-106421-not-internal.rs rename to tests/rustdoc-html/force-unstable-if-unmarked-106421-not-internal.rs diff --git a/tests/rustdoc/force-unstable-if-unmarked-106421.rs b/tests/rustdoc-html/force-unstable-if-unmarked-106421.rs similarity index 100% rename from tests/rustdoc/force-unstable-if-unmarked-106421.rs rename to tests/rustdoc-html/force-unstable-if-unmarked-106421.rs diff --git a/tests/rustdoc/foreigntype.rs b/tests/rustdoc-html/foreigntype.rs similarity index 100% rename from tests/rustdoc/foreigntype.rs rename to tests/rustdoc-html/foreigntype.rs diff --git a/tests/rustdoc/generic-associated-types/gat-elided-lifetime-94683.rs b/tests/rustdoc-html/generic-associated-types/gat-elided-lifetime-94683.rs similarity index 100% rename from tests/rustdoc/generic-associated-types/gat-elided-lifetime-94683.rs rename to tests/rustdoc-html/generic-associated-types/gat-elided-lifetime-94683.rs diff --git a/tests/rustdoc/generic-associated-types/gat-linkification-109488.rs b/tests/rustdoc-html/generic-associated-types/gat-linkification-109488.rs similarity index 100% rename from tests/rustdoc/generic-associated-types/gat-linkification-109488.rs rename to tests/rustdoc-html/generic-associated-types/gat-linkification-109488.rs diff --git a/tests/rustdoc/generic-associated-types/gats.rs b/tests/rustdoc-html/generic-associated-types/gats.rs similarity index 100% rename from tests/rustdoc/generic-associated-types/gats.rs rename to tests/rustdoc-html/generic-associated-types/gats.rs diff --git a/tests/rustdoc/glob-shadowing.rs b/tests/rustdoc-html/glob-shadowing.rs similarity index 100% rename from tests/rustdoc/glob-shadowing.rs rename to tests/rustdoc-html/glob-shadowing.rs diff --git a/tests/rustdoc/heading-levels-89309.rs b/tests/rustdoc-html/heading-levels-89309.rs similarity index 100% rename from tests/rustdoc/heading-levels-89309.rs rename to tests/rustdoc-html/heading-levels-89309.rs diff --git a/tests/rustdoc/heterogeneous-concat.rs b/tests/rustdoc-html/heterogeneous-concat.rs similarity index 100% rename from tests/rustdoc/heterogeneous-concat.rs rename to tests/rustdoc-html/heterogeneous-concat.rs diff --git a/tests/rustdoc/hidden-line.rs b/tests/rustdoc-html/hidden-line.rs similarity index 100% rename from tests/rustdoc/hidden-line.rs rename to tests/rustdoc-html/hidden-line.rs diff --git a/tests/rustdoc/hidden-methods.rs b/tests/rustdoc-html/hidden-methods.rs similarity index 100% rename from tests/rustdoc/hidden-methods.rs rename to tests/rustdoc-html/hidden-methods.rs diff --git a/tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs b/tests/rustdoc-html/hidden-trait-methods-with-document-hidden-items.rs similarity index 100% rename from tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs rename to tests/rustdoc-html/hidden-trait-methods-with-document-hidden-items.rs diff --git a/tests/rustdoc/hidden-trait-methods.rs b/tests/rustdoc-html/hidden-trait-methods.rs similarity index 100% rename from tests/rustdoc/hidden-trait-methods.rs rename to tests/rustdoc-html/hidden-trait-methods.rs diff --git a/tests/rustdoc/hide-unstable-trait.rs b/tests/rustdoc-html/hide-unstable-trait.rs similarity index 100% rename from tests/rustdoc/hide-unstable-trait.rs rename to tests/rustdoc-html/hide-unstable-trait.rs diff --git a/tests/rustdoc/higher-ranked-trait-bounds.rs b/tests/rustdoc-html/higher-ranked-trait-bounds.rs similarity index 100% rename from tests/rustdoc/higher-ranked-trait-bounds.rs rename to tests/rustdoc-html/higher-ranked-trait-bounds.rs diff --git a/tests/rustdoc/highlight-invalid-rust-12834.rs b/tests/rustdoc-html/highlight-invalid-rust-12834.rs similarity index 100% rename from tests/rustdoc/highlight-invalid-rust-12834.rs rename to tests/rustdoc-html/highlight-invalid-rust-12834.rs diff --git a/tests/rustdoc/ice-type-error-19181.rs b/tests/rustdoc-html/ice-type-error-19181.rs similarity index 100% rename from tests/rustdoc/ice-type-error-19181.rs rename to tests/rustdoc-html/ice-type-error-19181.rs diff --git a/tests/rustdoc/impl/auxiliary/cross-crate-hidden-impl-parameter.rs b/tests/rustdoc-html/impl/auxiliary/cross-crate-hidden-impl-parameter.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/cross-crate-hidden-impl-parameter.rs rename to tests/rustdoc-html/impl/auxiliary/cross-crate-hidden-impl-parameter.rs diff --git a/tests/rustdoc/impl/auxiliary/extern-impl-trait.rs b/tests/rustdoc-html/impl/auxiliary/extern-impl-trait.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/extern-impl-trait.rs rename to tests/rustdoc-html/impl/auxiliary/extern-impl-trait.rs diff --git a/tests/rustdoc/impl/auxiliary/incoherent-impl-types.rs b/tests/rustdoc-html/impl/auxiliary/incoherent-impl-types.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/incoherent-impl-types.rs rename to tests/rustdoc-html/impl/auxiliary/incoherent-impl-types.rs diff --git a/tests/rustdoc/impl/auxiliary/issue-100204-aux.rs b/tests/rustdoc-html/impl/auxiliary/issue-100204-aux.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/issue-100204-aux.rs rename to tests/rustdoc-html/impl/auxiliary/issue-100204-aux.rs diff --git a/tests/rustdoc/impl/auxiliary/issue-17476.rs b/tests/rustdoc-html/impl/auxiliary/issue-17476.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/issue-17476.rs rename to tests/rustdoc-html/impl/auxiliary/issue-17476.rs diff --git a/tests/rustdoc/impl/auxiliary/issue-21092.rs b/tests/rustdoc-html/impl/auxiliary/issue-21092.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/issue-21092.rs rename to tests/rustdoc-html/impl/auxiliary/issue-21092.rs diff --git a/tests/rustdoc/impl/auxiliary/issue-22025.rs b/tests/rustdoc-html/impl/auxiliary/issue-22025.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/issue-22025.rs rename to tests/rustdoc-html/impl/auxiliary/issue-22025.rs diff --git a/tests/rustdoc/impl/auxiliary/issue-53689.rs b/tests/rustdoc-html/impl/auxiliary/issue-53689.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/issue-53689.rs rename to tests/rustdoc-html/impl/auxiliary/issue-53689.rs diff --git a/tests/rustdoc/impl/auxiliary/precise-capturing.rs b/tests/rustdoc-html/impl/auxiliary/precise-capturing.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/precise-capturing.rs rename to tests/rustdoc-html/impl/auxiliary/precise-capturing.rs diff --git a/tests/rustdoc/impl/auxiliary/real_gimli.rs b/tests/rustdoc-html/impl/auxiliary/real_gimli.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/real_gimli.rs rename to tests/rustdoc-html/impl/auxiliary/real_gimli.rs diff --git a/tests/rustdoc/impl/auxiliary/realcore.rs b/tests/rustdoc-html/impl/auxiliary/realcore.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/realcore.rs rename to tests/rustdoc-html/impl/auxiliary/realcore.rs diff --git a/tests/rustdoc/impl/auxiliary/rustdoc-default-impl.rs b/tests/rustdoc-html/impl/auxiliary/rustdoc-default-impl.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/rustdoc-default-impl.rs rename to tests/rustdoc-html/impl/auxiliary/rustdoc-default-impl.rs diff --git a/tests/rustdoc/impl/auxiliary/rustdoc-impl-parts-crosscrate.rs b/tests/rustdoc-html/impl/auxiliary/rustdoc-impl-parts-crosscrate.rs similarity index 100% rename from tests/rustdoc/impl/auxiliary/rustdoc-impl-parts-crosscrate.rs rename to tests/rustdoc-html/impl/auxiliary/rustdoc-impl-parts-crosscrate.rs diff --git a/tests/rustdoc/impl/blanket-impl-29503.rs b/tests/rustdoc-html/impl/blanket-impl-29503.rs similarity index 100% rename from tests/rustdoc/impl/blanket-impl-29503.rs rename to tests/rustdoc-html/impl/blanket-impl-29503.rs diff --git a/tests/rustdoc/impl/blanket-impl-78673.rs b/tests/rustdoc-html/impl/blanket-impl-78673.rs similarity index 100% rename from tests/rustdoc/impl/blanket-impl-78673.rs rename to tests/rustdoc-html/impl/blanket-impl-78673.rs diff --git a/tests/rustdoc/impl/cross-crate-hidden-impl-parameter.rs b/tests/rustdoc-html/impl/cross-crate-hidden-impl-parameter.rs similarity index 100% rename from tests/rustdoc/impl/cross-crate-hidden-impl-parameter.rs rename to tests/rustdoc-html/impl/cross-crate-hidden-impl-parameter.rs diff --git a/tests/rustdoc/impl/deduplicate-glob-import-impl-21474.rs b/tests/rustdoc-html/impl/deduplicate-glob-import-impl-21474.rs similarity index 100% rename from tests/rustdoc/impl/deduplicate-glob-import-impl-21474.rs rename to tests/rustdoc-html/impl/deduplicate-glob-import-impl-21474.rs diff --git a/tests/rustdoc/impl/deduplicate-trait-impl-22025.rs b/tests/rustdoc-html/impl/deduplicate-trait-impl-22025.rs similarity index 100% rename from tests/rustdoc/impl/deduplicate-trait-impl-22025.rs rename to tests/rustdoc-html/impl/deduplicate-trait-impl-22025.rs diff --git a/tests/rustdoc/impl/default-impl.rs b/tests/rustdoc-html/impl/default-impl.rs similarity index 100% rename from tests/rustdoc/impl/default-impl.rs rename to tests/rustdoc-html/impl/default-impl.rs diff --git a/tests/rustdoc/impl/deprecated-impls.rs b/tests/rustdoc-html/impl/deprecated-impls.rs similarity index 100% rename from tests/rustdoc/impl/deprecated-impls.rs rename to tests/rustdoc-html/impl/deprecated-impls.rs diff --git a/tests/rustdoc/impl/doc-hidden-trait-implementors-33069.rs b/tests/rustdoc-html/impl/doc-hidden-trait-implementors-33069.rs similarity index 100% rename from tests/rustdoc/impl/doc-hidden-trait-implementors-33069.rs rename to tests/rustdoc-html/impl/doc-hidden-trait-implementors-33069.rs diff --git a/tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs b/tests/rustdoc-html/impl/doc_auto_cfg_nested_impl.rs similarity index 100% rename from tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs rename to tests/rustdoc-html/impl/doc_auto_cfg_nested_impl.rs diff --git a/tests/rustdoc/impl/duplicated_impl.rs b/tests/rustdoc-html/impl/duplicated_impl.rs similarity index 100% rename from tests/rustdoc/impl/duplicated_impl.rs rename to tests/rustdoc-html/impl/duplicated_impl.rs diff --git a/tests/rustdoc/impl/empty-impl-block.rs b/tests/rustdoc-html/impl/empty-impl-block.rs similarity index 100% rename from tests/rustdoc/impl/empty-impl-block.rs rename to tests/rustdoc-html/impl/empty-impl-block.rs diff --git a/tests/rustdoc/impl/empty-impls.rs b/tests/rustdoc-html/impl/empty-impls.rs similarity index 100% rename from tests/rustdoc/impl/empty-impls.rs rename to tests/rustdoc-html/impl/empty-impls.rs diff --git a/tests/rustdoc/impl/extern-impl-trait.rs b/tests/rustdoc-html/impl/extern-impl-trait.rs similarity index 100% rename from tests/rustdoc/impl/extern-impl-trait.rs rename to tests/rustdoc-html/impl/extern-impl-trait.rs diff --git a/tests/rustdoc/impl/extern-impl.rs b/tests/rustdoc-html/impl/extern-impl.rs similarity index 100% rename from tests/rustdoc/impl/extern-impl.rs rename to tests/rustdoc-html/impl/extern-impl.rs diff --git a/tests/rustdoc/impl/foreign-implementors-js-43701.rs b/tests/rustdoc-html/impl/foreign-implementors-js-43701.rs similarity index 100% rename from tests/rustdoc/impl/foreign-implementors-js-43701.rs rename to tests/rustdoc-html/impl/foreign-implementors-js-43701.rs diff --git a/tests/rustdoc/impl/generic-impl.rs b/tests/rustdoc-html/impl/generic-impl.rs similarity index 100% rename from tests/rustdoc/impl/generic-impl.rs rename to tests/rustdoc-html/impl/generic-impl.rs diff --git a/tests/rustdoc/impl/hidden-implementors-90781.rs b/tests/rustdoc-html/impl/hidden-implementors-90781.rs similarity index 100% rename from tests/rustdoc/impl/hidden-implementors-90781.rs rename to tests/rustdoc-html/impl/hidden-implementors-90781.rs diff --git a/tests/rustdoc/impl/hidden-impls.rs b/tests/rustdoc-html/impl/hidden-impls.rs similarity index 100% rename from tests/rustdoc/impl/hidden-impls.rs rename to tests/rustdoc-html/impl/hidden-impls.rs diff --git a/tests/rustdoc/impl/hidden-trait-struct-impls.rs b/tests/rustdoc-html/impl/hidden-trait-struct-impls.rs similarity index 100% rename from tests/rustdoc/impl/hidden-trait-struct-impls.rs rename to tests/rustdoc-html/impl/hidden-trait-struct-impls.rs diff --git a/tests/rustdoc/impl/hide-mut-methods-if-no-derefmut-impl-74083.rs b/tests/rustdoc-html/impl/hide-mut-methods-if-no-derefmut-impl-74083.rs similarity index 100% rename from tests/rustdoc/impl/hide-mut-methods-if-no-derefmut-impl-74083.rs rename to tests/rustdoc-html/impl/hide-mut-methods-if-no-derefmut-impl-74083.rs diff --git a/tests/rustdoc/impl/impl-alias-substituted.rs b/tests/rustdoc-html/impl/impl-alias-substituted.rs similarity index 100% rename from tests/rustdoc/impl/impl-alias-substituted.rs rename to tests/rustdoc-html/impl/impl-alias-substituted.rs diff --git a/tests/rustdoc/impl/impl-assoc-type-21092.rs b/tests/rustdoc-html/impl/impl-assoc-type-21092.rs similarity index 100% rename from tests/rustdoc/impl/impl-assoc-type-21092.rs rename to tests/rustdoc-html/impl/impl-assoc-type-21092.rs diff --git a/tests/rustdoc/impl/impl-associated-items-order.rs b/tests/rustdoc-html/impl/impl-associated-items-order.rs similarity index 100% rename from tests/rustdoc/impl/impl-associated-items-order.rs rename to tests/rustdoc-html/impl/impl-associated-items-order.rs diff --git a/tests/rustdoc/impl/impl-associated-items-sidebar.rs b/tests/rustdoc-html/impl/impl-associated-items-sidebar.rs similarity index 100% rename from tests/rustdoc/impl/impl-associated-items-sidebar.rs rename to tests/rustdoc-html/impl/impl-associated-items-sidebar.rs diff --git a/tests/rustdoc/impl/impl-blanket-53689.rs b/tests/rustdoc-html/impl/impl-blanket-53689.rs similarity index 100% rename from tests/rustdoc/impl/impl-blanket-53689.rs rename to tests/rustdoc-html/impl/impl-blanket-53689.rs diff --git a/tests/rustdoc/impl/impl-box.rs b/tests/rustdoc-html/impl/impl-box.rs similarity index 100% rename from tests/rustdoc/impl/impl-box.rs rename to tests/rustdoc-html/impl/impl-box.rs diff --git a/tests/rustdoc/impl/impl-disambiguation.rs b/tests/rustdoc-html/impl/impl-disambiguation.rs similarity index 100% rename from tests/rustdoc/impl/impl-disambiguation.rs rename to tests/rustdoc-html/impl/impl-disambiguation.rs diff --git a/tests/rustdoc/impl/impl-everywhere.rs b/tests/rustdoc-html/impl/impl-everywhere.rs similarity index 100% rename from tests/rustdoc/impl/impl-everywhere.rs rename to tests/rustdoc-html/impl/impl-everywhere.rs diff --git a/tests/rustdoc/impl/impl-in-const-block.rs b/tests/rustdoc-html/impl/impl-in-const-block.rs similarity index 100% rename from tests/rustdoc/impl/impl-in-const-block.rs rename to tests/rustdoc-html/impl/impl-in-const-block.rs diff --git a/tests/rustdoc/impl/impl-on-ty-alias-issue-119015.rs b/tests/rustdoc-html/impl/impl-on-ty-alias-issue-119015.rs similarity index 100% rename from tests/rustdoc/impl/impl-on-ty-alias-issue-119015.rs rename to tests/rustdoc-html/impl/impl-on-ty-alias-issue-119015.rs diff --git a/tests/rustdoc/impl/impl-parts-crosscrate.rs b/tests/rustdoc-html/impl/impl-parts-crosscrate.rs similarity index 100% rename from tests/rustdoc/impl/impl-parts-crosscrate.rs rename to tests/rustdoc-html/impl/impl-parts-crosscrate.rs diff --git a/tests/rustdoc/impl/impl-parts.rs b/tests/rustdoc-html/impl/impl-parts.rs similarity index 100% rename from tests/rustdoc/impl/impl-parts.rs rename to tests/rustdoc-html/impl/impl-parts.rs diff --git a/tests/rustdoc/impl/impl-ref-20175.rs b/tests/rustdoc-html/impl/impl-ref-20175.rs similarity index 100% rename from tests/rustdoc/impl/impl-ref-20175.rs rename to tests/rustdoc-html/impl/impl-ref-20175.rs diff --git a/tests/rustdoc/impl/impl-trait-43869.rs b/tests/rustdoc-html/impl/impl-trait-43869.rs similarity index 100% rename from tests/rustdoc/impl/impl-trait-43869.rs rename to tests/rustdoc-html/impl/impl-trait-43869.rs diff --git a/tests/rustdoc/impl/impl-trait-alias.rs b/tests/rustdoc-html/impl/impl-trait-alias.rs similarity index 100% rename from tests/rustdoc/impl/impl-trait-alias.rs rename to tests/rustdoc-html/impl/impl-trait-alias.rs diff --git a/tests/rustdoc/impl/impl-trait-precise-capturing.rs b/tests/rustdoc-html/impl/impl-trait-precise-capturing.rs similarity index 100% rename from tests/rustdoc/impl/impl-trait-precise-capturing.rs rename to tests/rustdoc-html/impl/impl-trait-precise-capturing.rs diff --git a/tests/rustdoc/impl/impl-type-parameter-33592.rs b/tests/rustdoc-html/impl/impl-type-parameter-33592.rs similarity index 100% rename from tests/rustdoc/impl/impl-type-parameter-33592.rs rename to tests/rustdoc-html/impl/impl-type-parameter-33592.rs diff --git a/tests/rustdoc/impl/implementor-stable-version.rs b/tests/rustdoc-html/impl/implementor-stable-version.rs similarity index 100% rename from tests/rustdoc/impl/implementor-stable-version.rs rename to tests/rustdoc-html/impl/implementor-stable-version.rs diff --git a/tests/rustdoc/impl/implementors-unstable-75588.rs b/tests/rustdoc-html/impl/implementors-unstable-75588.rs similarity index 100% rename from tests/rustdoc/impl/implementors-unstable-75588.rs rename to tests/rustdoc-html/impl/implementors-unstable-75588.rs diff --git a/tests/rustdoc/impl/inline-impl-through-glob-import-100204.rs b/tests/rustdoc-html/impl/inline-impl-through-glob-import-100204.rs similarity index 100% rename from tests/rustdoc/impl/inline-impl-through-glob-import-100204.rs rename to tests/rustdoc-html/impl/inline-impl-through-glob-import-100204.rs diff --git a/tests/rustdoc/impl/manual_impl.rs b/tests/rustdoc-html/impl/manual_impl.rs similarity index 100% rename from tests/rustdoc/impl/manual_impl.rs rename to tests/rustdoc-html/impl/manual_impl.rs diff --git a/tests/rustdoc/impl/method-link-foreign-trait-impl-17476.rs b/tests/rustdoc-html/impl/method-link-foreign-trait-impl-17476.rs similarity index 100% rename from tests/rustdoc/impl/method-link-foreign-trait-impl-17476.rs rename to tests/rustdoc-html/impl/method-link-foreign-trait-impl-17476.rs diff --git a/tests/rustdoc/impl/module-impls.rs b/tests/rustdoc-html/impl/module-impls.rs similarity index 100% rename from tests/rustdoc/impl/module-impls.rs rename to tests/rustdoc-html/impl/module-impls.rs diff --git a/tests/rustdoc/impl/must_implement_one_of.rs b/tests/rustdoc-html/impl/must_implement_one_of.rs similarity index 100% rename from tests/rustdoc/impl/must_implement_one_of.rs rename to tests/rustdoc-html/impl/must_implement_one_of.rs diff --git a/tests/rustdoc/impl/negative-impl-no-items.rs b/tests/rustdoc-html/impl/negative-impl-no-items.rs similarity index 100% rename from tests/rustdoc/impl/negative-impl-no-items.rs rename to tests/rustdoc-html/impl/negative-impl-no-items.rs diff --git a/tests/rustdoc/impl/negative-impl-sidebar.rs b/tests/rustdoc-html/impl/negative-impl-sidebar.rs similarity index 100% rename from tests/rustdoc/impl/negative-impl-sidebar.rs rename to tests/rustdoc-html/impl/negative-impl-sidebar.rs diff --git a/tests/rustdoc/impl/negative-impl.rs b/tests/rustdoc-html/impl/negative-impl.rs similarity index 100% rename from tests/rustdoc/impl/negative-impl.rs rename to tests/rustdoc-html/impl/negative-impl.rs diff --git a/tests/rustdoc/impl/return-impl-trait.rs b/tests/rustdoc-html/impl/return-impl-trait.rs similarity index 100% rename from tests/rustdoc/impl/return-impl-trait.rs rename to tests/rustdoc-html/impl/return-impl-trait.rs diff --git a/tests/rustdoc/impl/rustc-incoherent-impls.rs b/tests/rustdoc-html/impl/rustc-incoherent-impls.rs similarity index 100% rename from tests/rustdoc/impl/rustc-incoherent-impls.rs rename to tests/rustdoc-html/impl/rustc-incoherent-impls.rs diff --git a/tests/rustdoc/impl/same-crate-hidden-impl-parameter.rs b/tests/rustdoc-html/impl/same-crate-hidden-impl-parameter.rs similarity index 100% rename from tests/rustdoc/impl/same-crate-hidden-impl-parameter.rs rename to tests/rustdoc-html/impl/same-crate-hidden-impl-parameter.rs diff --git a/tests/rustdoc/impl/sidebar-trait-impl-disambiguate-78701.rs b/tests/rustdoc-html/impl/sidebar-trait-impl-disambiguate-78701.rs similarity index 100% rename from tests/rustdoc/impl/sidebar-trait-impl-disambiguate-78701.rs rename to tests/rustdoc-html/impl/sidebar-trait-impl-disambiguate-78701.rs diff --git a/tests/rustdoc/impl/struct-implementations-title.rs b/tests/rustdoc-html/impl/struct-implementations-title.rs similarity index 100% rename from tests/rustdoc/impl/struct-implementations-title.rs rename to tests/rustdoc-html/impl/struct-implementations-title.rs diff --git a/tests/rustdoc/impl/trait-impl.rs b/tests/rustdoc-html/impl/trait-impl.rs similarity index 100% rename from tests/rustdoc/impl/trait-impl.rs rename to tests/rustdoc-html/impl/trait-impl.rs diff --git a/tests/rustdoc/impl/trait-implementations-duplicate-self-45584.rs b/tests/rustdoc-html/impl/trait-implementations-duplicate-self-45584.rs similarity index 100% rename from tests/rustdoc/impl/trait-implementations-duplicate-self-45584.rs rename to tests/rustdoc-html/impl/trait-implementations-duplicate-self-45584.rs diff --git a/tests/rustdoc/impl/underscore-type-in-trait-impl-96381.rs b/tests/rustdoc-html/impl/underscore-type-in-trait-impl-96381.rs similarity index 100% rename from tests/rustdoc/impl/underscore-type-in-trait-impl-96381.rs rename to tests/rustdoc-html/impl/underscore-type-in-trait-impl-96381.rs diff --git a/tests/rustdoc/impl/universal-impl-trait.rs b/tests/rustdoc-html/impl/universal-impl-trait.rs similarity index 100% rename from tests/rustdoc/impl/universal-impl-trait.rs rename to tests/rustdoc-html/impl/universal-impl-trait.rs diff --git a/tests/rustdoc/impl/unneeded-trait-implementations-title.rs b/tests/rustdoc-html/impl/unneeded-trait-implementations-title.rs similarity index 100% rename from tests/rustdoc/impl/unneeded-trait-implementations-title.rs rename to tests/rustdoc-html/impl/unneeded-trait-implementations-title.rs diff --git a/tests/rustdoc/import-remapped-paths.rs b/tests/rustdoc-html/import-remapped-paths.rs similarity index 100% rename from tests/rustdoc/import-remapped-paths.rs rename to tests/rustdoc-html/import-remapped-paths.rs diff --git a/tests/rustdoc/impossible-default.rs b/tests/rustdoc-html/impossible-default.rs similarity index 100% rename from tests/rustdoc/impossible-default.rs rename to tests/rustdoc-html/impossible-default.rs diff --git a/tests/rustdoc/include_str_cut.rs b/tests/rustdoc-html/include_str_cut.rs similarity index 100% rename from tests/rustdoc/include_str_cut.rs rename to tests/rustdoc-html/include_str_cut.rs diff --git a/tests/rustdoc/index-page.rs b/tests/rustdoc-html/index-page.rs similarity index 100% rename from tests/rustdoc/index-page.rs rename to tests/rustdoc-html/index-page.rs diff --git a/tests/rustdoc/infinite-redirection-16265-1.rs b/tests/rustdoc-html/infinite-redirection-16265-1.rs similarity index 100% rename from tests/rustdoc/infinite-redirection-16265-1.rs rename to tests/rustdoc-html/infinite-redirection-16265-1.rs diff --git a/tests/rustdoc/infinite-redirection-16265-2.rs b/tests/rustdoc-html/infinite-redirection-16265-2.rs similarity index 100% rename from tests/rustdoc/infinite-redirection-16265-2.rs rename to tests/rustdoc-html/infinite-redirection-16265-2.rs diff --git a/tests/rustdoc/infinite-redirection.rs b/tests/rustdoc-html/infinite-redirection.rs similarity index 100% rename from tests/rustdoc/infinite-redirection.rs rename to tests/rustdoc-html/infinite-redirection.rs diff --git a/tests/rustdoc/inherent-projections.rs b/tests/rustdoc-html/inherent-projections.rs similarity index 100% rename from tests/rustdoc/inherent-projections.rs rename to tests/rustdoc-html/inherent-projections.rs diff --git a/tests/rustdoc/inline-default-methods.rs b/tests/rustdoc-html/inline-default-methods.rs similarity index 100% rename from tests/rustdoc/inline-default-methods.rs rename to tests/rustdoc-html/inline-default-methods.rs diff --git a/tests/rustdoc/inline-rename-34473.rs b/tests/rustdoc-html/inline-rename-34473.rs similarity index 100% rename from tests/rustdoc/inline-rename-34473.rs rename to tests/rustdoc-html/inline-rename-34473.rs diff --git a/tests/rustdoc/inline_cross/add-docs.rs b/tests/rustdoc-html/inline_cross/add-docs.rs similarity index 100% rename from tests/rustdoc/inline_cross/add-docs.rs rename to tests/rustdoc-html/inline_cross/add-docs.rs diff --git a/tests/rustdoc/inline_cross/assoc-const-equality.rs b/tests/rustdoc-html/inline_cross/assoc-const-equality.rs similarity index 100% rename from tests/rustdoc/inline_cross/assoc-const-equality.rs rename to tests/rustdoc-html/inline_cross/assoc-const-equality.rs diff --git a/tests/rustdoc/inline_cross/assoc-items.rs b/tests/rustdoc-html/inline_cross/assoc-items.rs similarity index 100% rename from tests/rustdoc/inline_cross/assoc-items.rs rename to tests/rustdoc-html/inline_cross/assoc-items.rs diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html b/tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.out0.html similarity index 100% rename from tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html rename to tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.out0.html diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html b/tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.out2.html similarity index 100% rename from tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html rename to tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.out2.html diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html b/tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.out9.html similarity index 100% rename from tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html rename to tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.out9.html diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs b/tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.rs similarity index 100% rename from tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs rename to tests/rustdoc-html/inline_cross/assoc_item_trait_bounds.rs diff --git a/tests/rustdoc/inline_cross/async-fn.rs b/tests/rustdoc-html/inline_cross/async-fn.rs similarity index 100% rename from tests/rustdoc/inline_cross/async-fn.rs rename to tests/rustdoc-html/inline_cross/async-fn.rs diff --git a/tests/rustdoc/inline_cross/attributes.rs b/tests/rustdoc-html/inline_cross/attributes.rs similarity index 100% rename from tests/rustdoc/inline_cross/attributes.rs rename to tests/rustdoc-html/inline_cross/attributes.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/add-docs.rs b/tests/rustdoc-html/inline_cross/auxiliary/add-docs.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/add-docs.rs rename to tests/rustdoc-html/inline_cross/auxiliary/add-docs.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs b/tests/rustdoc-html/inline_cross/auxiliary/assoc-const-equality.rs similarity index 67% rename from tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs rename to tests/rustdoc-html/inline_cross/auxiliary/assoc-const-equality.rs index f6c03d189b5e..598d2b5bf29d 100644 --- a/tests/rustdoc/inline_cross/auxiliary/assoc-const-equality.rs +++ b/tests/rustdoc-html/inline_cross/auxiliary/assoc-const-equality.rs @@ -1,5 +1,5 @@ #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] pub fn accept(_: impl Trait) {} diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc-items.rs b/tests/rustdoc-html/inline_cross/auxiliary/assoc-items.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/assoc-items.rs rename to tests/rustdoc-html/inline_cross/auxiliary/assoc-items.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs b/tests/rustdoc-html/inline_cross/auxiliary/assoc_item_trait_bounds.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs rename to tests/rustdoc-html/inline_cross/auxiliary/assoc_item_trait_bounds.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/async-fn.rs b/tests/rustdoc-html/inline_cross/auxiliary/async-fn.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/async-fn.rs rename to tests/rustdoc-html/inline_cross/auxiliary/async-fn.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/attributes.rs b/tests/rustdoc-html/inline_cross/auxiliary/attributes.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/attributes.rs rename to tests/rustdoc-html/inline_cross/auxiliary/attributes.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs b/tests/rustdoc-html/inline_cross/auxiliary/const-effect-param.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs rename to tests/rustdoc-html/inline_cross/auxiliary/const-effect-param.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/cross-glob.rs b/tests/rustdoc-html/inline_cross/auxiliary/cross-glob.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/cross-glob.rs rename to tests/rustdoc-html/inline_cross/auxiliary/cross-glob.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/default-generic-args.rs b/tests/rustdoc-html/inline_cross/auxiliary/default-generic-args.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/default-generic-args.rs rename to tests/rustdoc-html/inline_cross/auxiliary/default-generic-args.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs b/tests/rustdoc-html/inline_cross/auxiliary/default-trait-method.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs rename to tests/rustdoc-html/inline_cross/auxiliary/default-trait-method.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/doc-auto-cfg.rs b/tests/rustdoc-html/inline_cross/auxiliary/doc-auto-cfg.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/doc-auto-cfg.rs rename to tests/rustdoc-html/inline_cross/auxiliary/doc-auto-cfg.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs b/tests/rustdoc-html/inline_cross/auxiliary/dyn_trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs rename to tests/rustdoc-html/inline_cross/auxiliary/dyn_trait.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/early-late-bound-lifetime-params.rs b/tests/rustdoc-html/inline_cross/auxiliary/early-late-bound-lifetime-params.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/early-late-bound-lifetime-params.rs rename to tests/rustdoc-html/inline_cross/auxiliary/early-late-bound-lifetime-params.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/fn-ptr-ty.rs b/tests/rustdoc-html/inline_cross/auxiliary/fn-ptr-ty.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/fn-ptr-ty.rs rename to tests/rustdoc-html/inline_cross/auxiliary/fn-ptr-ty.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/generic-const-items.rs b/tests/rustdoc-html/inline_cross/auxiliary/generic-const-items.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/generic-const-items.rs rename to tests/rustdoc-html/inline_cross/auxiliary/generic-const-items.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs b/tests/rustdoc-html/inline_cross/auxiliary/impl-inline-without-trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs rename to tests/rustdoc-html/inline_cross/auxiliary/impl-inline-without-trait.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs b/tests/rustdoc-html/inline_cross/auxiliary/impl-sized.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/impl-sized.rs rename to tests/rustdoc-html/inline_cross/auxiliary/impl-sized.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs b/tests/rustdoc-html/inline_cross/auxiliary/impl_trait_aux.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs rename to tests/rustdoc-html/inline_cross/auxiliary/impl_trait_aux.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs b/tests/rustdoc-html/inline_cross/auxiliary/implementors_inline.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs rename to tests/rustdoc-html/inline_cross/auxiliary/implementors_inline.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-21801.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-21801.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-21801.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-21801.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-23207-1.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-23207-1.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-23207-1.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-23207-1.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-23207-2.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-23207-2.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-23207-2.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-23207-2.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-24183.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-24183.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-24183.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-24183.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-27362-aux.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-27362-aux.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-27362-aux.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-27362-aux.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-29584.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-29584.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-29584.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-29584.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-33113.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-33113.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-33113.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-33113.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-46727.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-46727.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-46727.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-46727.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-57180.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-57180.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-57180.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-57180.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-76736-1.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-76736-1.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-76736-2.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-76736-2.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs b/tests/rustdoc-html/inline_cross/auxiliary/issue-85454.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/issue-85454.rs rename to tests/rustdoc-html/inline_cross/auxiliary/issue-85454.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/macro-vis.rs b/tests/rustdoc-html/inline_cross/auxiliary/macro-vis.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/macro-vis.rs rename to tests/rustdoc-html/inline_cross/auxiliary/macro-vis.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/macros.rs b/tests/rustdoc-html/inline_cross/auxiliary/macros.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/macros.rs rename to tests/rustdoc-html/inline_cross/auxiliary/macros.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs b/tests/rustdoc-html/inline_cross/auxiliary/non_lifetime_binders.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs rename to tests/rustdoc-html/inline_cross/auxiliary/non_lifetime_binders.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/proc_macro.rs b/tests/rustdoc-html/inline_cross/auxiliary/proc_macro.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/proc_macro.rs rename to tests/rustdoc-html/inline_cross/auxiliary/proc_macro.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs b/tests/rustdoc-html/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs rename to tests/rustdoc-html/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs b/tests/rustdoc-html/inline_cross/auxiliary/renamed-via-module.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs rename to tests/rustdoc-html/inline_cross/auxiliary/renamed-via-module.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs b/tests/rustdoc-html/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs rename to tests/rustdoc-html/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs b/tests/rustdoc-html/inline_cross/auxiliary/rustdoc-hidden-sig.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs rename to tests/rustdoc-html/inline_cross/auxiliary/rustdoc-hidden-sig.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs b/tests/rustdoc-html/inline_cross/auxiliary/rustdoc-hidden.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs rename to tests/rustdoc-html/inline_cross/auxiliary/rustdoc-hidden.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs b/tests/rustdoc-html/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs rename to tests/rustdoc-html/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs b/tests/rustdoc-html/inline_cross/auxiliary/rustdoc-trait-object-impl.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs rename to tests/rustdoc-html/inline_cross/auxiliary/rustdoc-trait-object-impl.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/trait-vis.rs b/tests/rustdoc-html/inline_cross/auxiliary/trait-vis.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/trait-vis.rs rename to tests/rustdoc-html/inline_cross/auxiliary/trait-vis.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/use_crate.rs b/tests/rustdoc-html/inline_cross/auxiliary/use_crate.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/use_crate.rs rename to tests/rustdoc-html/inline_cross/auxiliary/use_crate.rs diff --git a/tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs b/tests/rustdoc-html/inline_cross/auxiliary/use_crate_2.rs similarity index 100% rename from tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs rename to tests/rustdoc-html/inline_cross/auxiliary/use_crate_2.rs diff --git a/tests/rustdoc/inline_cross/const-effect-param.rs b/tests/rustdoc-html/inline_cross/const-effect-param.rs similarity index 100% rename from tests/rustdoc/inline_cross/const-effect-param.rs rename to tests/rustdoc-html/inline_cross/const-effect-param.rs diff --git a/tests/rustdoc/inline_cross/const-eval-46727.rs b/tests/rustdoc-html/inline_cross/const-eval-46727.rs similarity index 100% rename from tests/rustdoc/inline_cross/const-eval-46727.rs rename to tests/rustdoc-html/inline_cross/const-eval-46727.rs diff --git a/tests/rustdoc/inline_cross/const-fn-27362.rs b/tests/rustdoc-html/inline_cross/const-fn-27362.rs similarity index 100% rename from tests/rustdoc/inline_cross/const-fn-27362.rs rename to tests/rustdoc-html/inline_cross/const-fn-27362.rs diff --git a/tests/rustdoc/inline_cross/cross-glob.rs b/tests/rustdoc-html/inline_cross/cross-glob.rs similarity index 100% rename from tests/rustdoc/inline_cross/cross-glob.rs rename to tests/rustdoc-html/inline_cross/cross-glob.rs diff --git a/tests/rustdoc/inline_cross/deduplicate-inlined-items-23207.rs b/tests/rustdoc-html/inline_cross/deduplicate-inlined-items-23207.rs similarity index 100% rename from tests/rustdoc/inline_cross/deduplicate-inlined-items-23207.rs rename to tests/rustdoc-html/inline_cross/deduplicate-inlined-items-23207.rs diff --git a/tests/rustdoc/inline_cross/default-generic-args.rs b/tests/rustdoc-html/inline_cross/default-generic-args.rs similarity index 100% rename from tests/rustdoc/inline_cross/default-generic-args.rs rename to tests/rustdoc-html/inline_cross/default-generic-args.rs diff --git a/tests/rustdoc/inline_cross/default-trait-method.rs b/tests/rustdoc-html/inline_cross/default-trait-method.rs similarity index 100% rename from tests/rustdoc/inline_cross/default-trait-method.rs rename to tests/rustdoc-html/inline_cross/default-trait-method.rs diff --git a/tests/rustdoc/inline_cross/doc-auto-cfg.rs b/tests/rustdoc-html/inline_cross/doc-auto-cfg.rs similarity index 100% rename from tests/rustdoc/inline_cross/doc-auto-cfg.rs rename to tests/rustdoc-html/inline_cross/doc-auto-cfg.rs diff --git a/tests/rustdoc/inline_cross/doc-hidden-broken-link-28480.rs b/tests/rustdoc-html/inline_cross/doc-hidden-broken-link-28480.rs similarity index 100% rename from tests/rustdoc/inline_cross/doc-hidden-broken-link-28480.rs rename to tests/rustdoc-html/inline_cross/doc-hidden-broken-link-28480.rs diff --git a/tests/rustdoc/inline_cross/doc-hidden-extern-trait-impl-29584.rs b/tests/rustdoc-html/inline_cross/doc-hidden-extern-trait-impl-29584.rs similarity index 100% rename from tests/rustdoc/inline_cross/doc-hidden-extern-trait-impl-29584.rs rename to tests/rustdoc-html/inline_cross/doc-hidden-extern-trait-impl-29584.rs diff --git a/tests/rustdoc/inline_cross/doc-reachability-impl-31948-1.rs b/tests/rustdoc-html/inline_cross/doc-reachability-impl-31948-1.rs similarity index 100% rename from tests/rustdoc/inline_cross/doc-reachability-impl-31948-1.rs rename to tests/rustdoc-html/inline_cross/doc-reachability-impl-31948-1.rs diff --git a/tests/rustdoc/inline_cross/doc-reachability-impl-31948-2.rs b/tests/rustdoc-html/inline_cross/doc-reachability-impl-31948-2.rs similarity index 100% rename from tests/rustdoc/inline_cross/doc-reachability-impl-31948-2.rs rename to tests/rustdoc-html/inline_cross/doc-reachability-impl-31948-2.rs diff --git a/tests/rustdoc/inline_cross/doc-reachability-impl-31948.rs b/tests/rustdoc-html/inline_cross/doc-reachability-impl-31948.rs similarity index 100% rename from tests/rustdoc/inline_cross/doc-reachability-impl-31948.rs rename to tests/rustdoc-html/inline_cross/doc-reachability-impl-31948.rs diff --git a/tests/rustdoc/inline_cross/dyn_trait.rs b/tests/rustdoc-html/inline_cross/dyn_trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/dyn_trait.rs rename to tests/rustdoc-html/inline_cross/dyn_trait.rs diff --git a/tests/rustdoc/inline_cross/early-late-bound-lifetime-params.rs b/tests/rustdoc-html/inline_cross/early-late-bound-lifetime-params.rs similarity index 100% rename from tests/rustdoc/inline_cross/early-late-bound-lifetime-params.rs rename to tests/rustdoc-html/inline_cross/early-late-bound-lifetime-params.rs diff --git a/tests/rustdoc/inline_cross/fn-ptr-ty.rs b/tests/rustdoc-html/inline_cross/fn-ptr-ty.rs similarity index 100% rename from tests/rustdoc/inline_cross/fn-ptr-ty.rs rename to tests/rustdoc-html/inline_cross/fn-ptr-ty.rs diff --git a/tests/rustdoc/inline_cross/generic-const-items.rs b/tests/rustdoc-html/inline_cross/generic-const-items.rs similarity index 100% rename from tests/rustdoc/inline_cross/generic-const-items.rs rename to tests/rustdoc-html/inline_cross/generic-const-items.rs diff --git a/tests/rustdoc/inline_cross/hidden-use.rs b/tests/rustdoc-html/inline_cross/hidden-use.rs similarity index 100% rename from tests/rustdoc/inline_cross/hidden-use.rs rename to tests/rustdoc-html/inline_cross/hidden-use.rs diff --git a/tests/rustdoc/inline_cross/ice-import-crate-57180.rs b/tests/rustdoc-html/inline_cross/ice-import-crate-57180.rs similarity index 100% rename from tests/rustdoc/inline_cross/ice-import-crate-57180.rs rename to tests/rustdoc-html/inline_cross/ice-import-crate-57180.rs diff --git a/tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs b/tests/rustdoc-html/inline_cross/impl-dyn-trait-32881.rs similarity index 100% rename from tests/rustdoc/inline_cross/impl-dyn-trait-32881.rs rename to tests/rustdoc-html/inline_cross/impl-dyn-trait-32881.rs diff --git a/tests/rustdoc/inline_cross/impl-inline-without-trait.rs b/tests/rustdoc-html/inline_cross/impl-inline-without-trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/impl-inline-without-trait.rs rename to tests/rustdoc-html/inline_cross/impl-inline-without-trait.rs diff --git a/tests/rustdoc/inline_cross/impl-ref-33113.rs b/tests/rustdoc-html/inline_cross/impl-ref-33113.rs similarity index 100% rename from tests/rustdoc/inline_cross/impl-ref-33113.rs rename to tests/rustdoc-html/inline_cross/impl-ref-33113.rs diff --git a/tests/rustdoc/inline_cross/impl-sized.rs b/tests/rustdoc-html/inline_cross/impl-sized.rs similarity index 100% rename from tests/rustdoc/inline_cross/impl-sized.rs rename to tests/rustdoc-html/inline_cross/impl-sized.rs diff --git a/tests/rustdoc/inline_cross/impl_trait.rs b/tests/rustdoc-html/inline_cross/impl_trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/impl_trait.rs rename to tests/rustdoc-html/inline_cross/impl_trait.rs diff --git a/tests/rustdoc/inline_cross/implementors-js.rs b/tests/rustdoc-html/inline_cross/implementors-js.rs similarity index 100% rename from tests/rustdoc/inline_cross/implementors-js.rs rename to tests/rustdoc-html/inline_cross/implementors-js.rs diff --git a/tests/rustdoc/inline_cross/inline_hidden.rs b/tests/rustdoc-html/inline_cross/inline_hidden.rs similarity index 100% rename from tests/rustdoc/inline_cross/inline_hidden.rs rename to tests/rustdoc-html/inline_cross/inline_hidden.rs diff --git a/tests/rustdoc/inline_cross/macro-vis.rs b/tests/rustdoc-html/inline_cross/macro-vis.rs similarity index 100% rename from tests/rustdoc/inline_cross/macro-vis.rs rename to tests/rustdoc-html/inline_cross/macro-vis.rs diff --git a/tests/rustdoc/inline_cross/macros.rs b/tests/rustdoc-html/inline_cross/macros.rs similarity index 100% rename from tests/rustdoc/inline_cross/macros.rs rename to tests/rustdoc-html/inline_cross/macros.rs diff --git a/tests/rustdoc/inline_cross/non_lifetime_binders.rs b/tests/rustdoc-html/inline_cross/non_lifetime_binders.rs similarity index 100% rename from tests/rustdoc/inline_cross/non_lifetime_binders.rs rename to tests/rustdoc-html/inline_cross/non_lifetime_binders.rs diff --git a/tests/rustdoc/inline_cross/proc_macro.rs b/tests/rustdoc-html/inline_cross/proc_macro.rs similarity index 100% rename from tests/rustdoc/inline_cross/proc_macro.rs rename to tests/rustdoc-html/inline_cross/proc_macro.rs diff --git a/tests/rustdoc/inline_cross/qpath-self-85454.rs b/tests/rustdoc-html/inline_cross/qpath-self-85454.rs similarity index 100% rename from tests/rustdoc/inline_cross/qpath-self-85454.rs rename to tests/rustdoc-html/inline_cross/qpath-self-85454.rs diff --git a/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs b/tests/rustdoc-html/inline_cross/reexport-with-anonymous-lifetime-98697.rs similarity index 100% rename from tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs rename to tests/rustdoc-html/inline_cross/reexport-with-anonymous-lifetime-98697.rs diff --git a/tests/rustdoc/inline_cross/renamed-via-module.rs b/tests/rustdoc-html/inline_cross/renamed-via-module.rs similarity index 100% rename from tests/rustdoc/inline_cross/renamed-via-module.rs rename to tests/rustdoc-html/inline_cross/renamed-via-module.rs diff --git a/tests/rustdoc/inline_cross/ret-pos-impl-trait-in-trait.rs b/tests/rustdoc-html/inline_cross/ret-pos-impl-trait-in-trait.rs similarity index 100% rename from tests/rustdoc/inline_cross/ret-pos-impl-trait-in-trait.rs rename to tests/rustdoc-html/inline_cross/ret-pos-impl-trait-in-trait.rs diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-1.rs b/tests/rustdoc-html/inline_cross/rustc-private-76736-1.rs similarity index 100% rename from tests/rustdoc/inline_cross/rustc-private-76736-1.rs rename to tests/rustdoc-html/inline_cross/rustc-private-76736-1.rs diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-2.rs b/tests/rustdoc-html/inline_cross/rustc-private-76736-2.rs similarity index 100% rename from tests/rustdoc/inline_cross/rustc-private-76736-2.rs rename to tests/rustdoc-html/inline_cross/rustc-private-76736-2.rs diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-3.rs b/tests/rustdoc-html/inline_cross/rustc-private-76736-3.rs similarity index 100% rename from tests/rustdoc/inline_cross/rustc-private-76736-3.rs rename to tests/rustdoc-html/inline_cross/rustc-private-76736-3.rs diff --git a/tests/rustdoc/inline_cross/rustc-private-76736-4.rs b/tests/rustdoc-html/inline_cross/rustc-private-76736-4.rs similarity index 100% rename from tests/rustdoc/inline_cross/rustc-private-76736-4.rs rename to tests/rustdoc-html/inline_cross/rustc-private-76736-4.rs diff --git a/tests/rustdoc/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html b/tests/rustdoc-html/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html similarity index 100% rename from tests/rustdoc/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html rename to tests/rustdoc-html/inline_cross/self-sized-bounds-24183.method_no_where_self_sized.html diff --git a/tests/rustdoc/inline_cross/self-sized-bounds-24183.rs b/tests/rustdoc-html/inline_cross/self-sized-bounds-24183.rs similarity index 100% rename from tests/rustdoc/inline_cross/self-sized-bounds-24183.rs rename to tests/rustdoc-html/inline_cross/self-sized-bounds-24183.rs diff --git a/tests/rustdoc/inline_cross/sugar-closure-crate-21801.rs b/tests/rustdoc-html/inline_cross/sugar-closure-crate-21801.rs similarity index 100% rename from tests/rustdoc/inline_cross/sugar-closure-crate-21801.rs rename to tests/rustdoc-html/inline_cross/sugar-closure-crate-21801.rs diff --git a/tests/rustdoc/inline_cross/trait-vis.rs b/tests/rustdoc-html/inline_cross/trait-vis.rs similarity index 100% rename from tests/rustdoc/inline_cross/trait-vis.rs rename to tests/rustdoc-html/inline_cross/trait-vis.rs diff --git a/tests/rustdoc/inline_cross/use_crate.rs b/tests/rustdoc-html/inline_cross/use_crate.rs similarity index 100% rename from tests/rustdoc/inline_cross/use_crate.rs rename to tests/rustdoc-html/inline_cross/use_crate.rs diff --git a/tests/rustdoc/inline_local/blanket-impl-reexported-trait-94183.rs b/tests/rustdoc-html/inline_local/blanket-impl-reexported-trait-94183.rs similarity index 100% rename from tests/rustdoc/inline_local/blanket-impl-reexported-trait-94183.rs rename to tests/rustdoc-html/inline_local/blanket-impl-reexported-trait-94183.rs diff --git a/tests/rustdoc/inline_local/doc-no-inline-32343.rs b/tests/rustdoc-html/inline_local/doc-no-inline-32343.rs similarity index 100% rename from tests/rustdoc/inline_local/doc-no-inline-32343.rs rename to tests/rustdoc-html/inline_local/doc-no-inline-32343.rs diff --git a/tests/rustdoc/inline_local/enum-variant-reexport-46766.rs b/tests/rustdoc-html/inline_local/enum-variant-reexport-46766.rs similarity index 100% rename from tests/rustdoc/inline_local/enum-variant-reexport-46766.rs rename to tests/rustdoc-html/inline_local/enum-variant-reexport-46766.rs diff --git a/tests/rustdoc/inline_local/fully-stable-path-is-better.rs b/tests/rustdoc-html/inline_local/fully-stable-path-is-better.rs similarity index 100% rename from tests/rustdoc/inline_local/fully-stable-path-is-better.rs rename to tests/rustdoc-html/inline_local/fully-stable-path-is-better.rs diff --git a/tests/rustdoc/inline_local/glob-extern-document-private-items.rs b/tests/rustdoc-html/inline_local/glob-extern-document-private-items.rs similarity index 100% rename from tests/rustdoc/inline_local/glob-extern-document-private-items.rs rename to tests/rustdoc-html/inline_local/glob-extern-document-private-items.rs diff --git a/tests/rustdoc/inline_local/glob-extern.rs b/tests/rustdoc-html/inline_local/glob-extern.rs similarity index 100% rename from tests/rustdoc/inline_local/glob-extern.rs rename to tests/rustdoc-html/inline_local/glob-extern.rs diff --git a/tests/rustdoc/inline_local/glob-private-document-private-items.rs b/tests/rustdoc-html/inline_local/glob-private-document-private-items.rs similarity index 100% rename from tests/rustdoc/inline_local/glob-private-document-private-items.rs rename to tests/rustdoc-html/inline_local/glob-private-document-private-items.rs diff --git a/tests/rustdoc/inline_local/glob-private.rs b/tests/rustdoc-html/inline_local/glob-private.rs similarity index 100% rename from tests/rustdoc/inline_local/glob-private.rs rename to tests/rustdoc-html/inline_local/glob-private.rs diff --git a/tests/rustdoc/inline_local/hidden-use.rs b/tests/rustdoc-html/inline_local/hidden-use.rs similarity index 100% rename from tests/rustdoc/inline_local/hidden-use.rs rename to tests/rustdoc-html/inline_local/hidden-use.rs diff --git a/tests/rustdoc/inline_local/macro_by_example.rs b/tests/rustdoc-html/inline_local/macro_by_example.rs similarity index 100% rename from tests/rustdoc/inline_local/macro_by_example.rs rename to tests/rustdoc-html/inline_local/macro_by_example.rs diff --git a/tests/rustdoc/inline_local/parent-path-is-better.rs b/tests/rustdoc-html/inline_local/parent-path-is-better.rs similarity index 100% rename from tests/rustdoc/inline_local/parent-path-is-better.rs rename to tests/rustdoc-html/inline_local/parent-path-is-better.rs diff --git a/tests/rustdoc/inline_local/please_inline.rs b/tests/rustdoc-html/inline_local/please_inline.rs similarity index 100% rename from tests/rustdoc/inline_local/please_inline.rs rename to tests/rustdoc-html/inline_local/please_inline.rs diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-81141-2.rs b/tests/rustdoc-html/inline_local/private-reexport-in-public-api-81141-2.rs similarity index 100% rename from tests/rustdoc/inline_local/private-reexport-in-public-api-81141-2.rs rename to tests/rustdoc-html/inline_local/private-reexport-in-public-api-81141-2.rs diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-81141.rs b/tests/rustdoc-html/inline_local/private-reexport-in-public-api-81141.rs similarity index 100% rename from tests/rustdoc/inline_local/private-reexport-in-public-api-81141.rs rename to tests/rustdoc-html/inline_local/private-reexport-in-public-api-81141.rs diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-generics-81141.rs b/tests/rustdoc-html/inline_local/private-reexport-in-public-api-generics-81141.rs similarity index 100% rename from tests/rustdoc/inline_local/private-reexport-in-public-api-generics-81141.rs rename to tests/rustdoc-html/inline_local/private-reexport-in-public-api-generics-81141.rs diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-hidden-81141.rs b/tests/rustdoc-html/inline_local/private-reexport-in-public-api-hidden-81141.rs similarity index 100% rename from tests/rustdoc/inline_local/private-reexport-in-public-api-hidden-81141.rs rename to tests/rustdoc-html/inline_local/private-reexport-in-public-api-hidden-81141.rs diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-private-81141.rs b/tests/rustdoc-html/inline_local/private-reexport-in-public-api-private-81141.rs similarity index 100% rename from tests/rustdoc/inline_local/private-reexport-in-public-api-private-81141.rs rename to tests/rustdoc-html/inline_local/private-reexport-in-public-api-private-81141.rs diff --git a/tests/rustdoc/inline_local/pub-re-export-28537.rs b/tests/rustdoc-html/inline_local/pub-re-export-28537.rs similarity index 100% rename from tests/rustdoc/inline_local/pub-re-export-28537.rs rename to tests/rustdoc-html/inline_local/pub-re-export-28537.rs diff --git a/tests/rustdoc/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs b/tests/rustdoc-html/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs similarity index 100% rename from tests/rustdoc/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs rename to tests/rustdoc-html/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs diff --git a/tests/rustdoc/inline_local/staged-inline.rs b/tests/rustdoc-html/inline_local/staged-inline.rs similarity index 100% rename from tests/rustdoc/inline_local/staged-inline.rs rename to tests/rustdoc-html/inline_local/staged-inline.rs diff --git a/tests/rustdoc/inline_local/trait-vis.rs b/tests/rustdoc-html/inline_local/trait-vis.rs similarity index 100% rename from tests/rustdoc/inline_local/trait-vis.rs rename to tests/rustdoc-html/inline_local/trait-vis.rs diff --git a/tests/rustdoc/internal.rs b/tests/rustdoc-html/internal.rs similarity index 100% rename from tests/rustdoc/internal.rs rename to tests/rustdoc-html/internal.rs diff --git a/tests/rustdoc/intra-doc-crate/auxiliary/self.rs b/tests/rustdoc-html/intra-doc-crate/auxiliary/self.rs similarity index 100% rename from tests/rustdoc/intra-doc-crate/auxiliary/self.rs rename to tests/rustdoc-html/intra-doc-crate/auxiliary/self.rs diff --git a/tests/rustdoc/intra-doc-crate/self.rs b/tests/rustdoc-html/intra-doc-crate/self.rs similarity index 100% rename from tests/rustdoc/intra-doc-crate/self.rs rename to tests/rustdoc-html/intra-doc-crate/self.rs diff --git a/tests/rustdoc/intra-doc/anchors.rs b/tests/rustdoc-html/intra-doc/anchors.rs similarity index 100% rename from tests/rustdoc/intra-doc/anchors.rs rename to tests/rustdoc-html/intra-doc/anchors.rs diff --git a/tests/rustdoc/intra-doc/assoc-reexport-super.rs b/tests/rustdoc-html/intra-doc/assoc-reexport-super.rs similarity index 100% rename from tests/rustdoc/intra-doc/assoc-reexport-super.rs rename to tests/rustdoc-html/intra-doc/assoc-reexport-super.rs diff --git a/tests/rustdoc/intra-doc/associated-defaults.rs b/tests/rustdoc-html/intra-doc/associated-defaults.rs similarity index 100% rename from tests/rustdoc/intra-doc/associated-defaults.rs rename to tests/rustdoc-html/intra-doc/associated-defaults.rs diff --git a/tests/rustdoc/intra-doc/associated-items.rs b/tests/rustdoc-html/intra-doc/associated-items.rs similarity index 100% rename from tests/rustdoc/intra-doc/associated-items.rs rename to tests/rustdoc-html/intra-doc/associated-items.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/empty.rs b/tests/rustdoc-html/intra-doc/auxiliary/empty.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/empty.rs rename to tests/rustdoc-html/intra-doc/auxiliary/empty.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/empty2.rs b/tests/rustdoc-html/intra-doc/auxiliary/empty2.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/empty2.rs rename to tests/rustdoc-html/intra-doc/auxiliary/empty2.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs b/tests/rustdoc-html/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs rename to tests/rustdoc-html/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/extern-inherent-impl-dep.rs b/tests/rustdoc-html/intra-doc/auxiliary/extern-inherent-impl-dep.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/extern-inherent-impl-dep.rs rename to tests/rustdoc-html/intra-doc/auxiliary/extern-inherent-impl-dep.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-link-extern-crate.rs b/tests/rustdoc-html/intra-doc/auxiliary/intra-link-extern-crate.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/intra-link-extern-crate.rs rename to tests/rustdoc-html/intra-doc/auxiliary/intra-link-extern-crate.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-link-pub-use.rs b/tests/rustdoc-html/intra-doc/auxiliary/intra-link-pub-use.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/intra-link-pub-use.rs rename to tests/rustdoc-html/intra-doc/auxiliary/intra-link-pub-use.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs b/tests/rustdoc-html/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs rename to tests/rustdoc-html/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-links-external-traits.rs b/tests/rustdoc-html/intra-doc/auxiliary/intra-links-external-traits.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/intra-links-external-traits.rs rename to tests/rustdoc-html/intra-doc/auxiliary/intra-links-external-traits.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs b/tests/rustdoc-html/intra-doc/auxiliary/issue-66159-1.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs rename to tests/rustdoc-html/intra-doc/auxiliary/issue-66159-1.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/my-core.rs b/tests/rustdoc-html/intra-doc/auxiliary/my-core.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/my-core.rs rename to tests/rustdoc-html/intra-doc/auxiliary/my-core.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs b/tests/rustdoc-html/intra-doc/auxiliary/proc-macro-macro.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs rename to tests/rustdoc-html/intra-doc/auxiliary/proc-macro-macro.rs diff --git a/tests/rustdoc/intra-doc/auxiliary/pub-struct.rs b/tests/rustdoc-html/intra-doc/auxiliary/pub-struct.rs similarity index 100% rename from tests/rustdoc/intra-doc/auxiliary/pub-struct.rs rename to tests/rustdoc-html/intra-doc/auxiliary/pub-struct.rs diff --git a/tests/rustdoc/intra-doc/basic.rs b/tests/rustdoc-html/intra-doc/basic.rs similarity index 100% rename from tests/rustdoc/intra-doc/basic.rs rename to tests/rustdoc-html/intra-doc/basic.rs diff --git a/tests/rustdoc/intra-doc/builtin-macros.rs b/tests/rustdoc-html/intra-doc/builtin-macros.rs similarity index 100% rename from tests/rustdoc/intra-doc/builtin-macros.rs rename to tests/rustdoc-html/intra-doc/builtin-macros.rs diff --git a/tests/rustdoc/intra-doc/crate-relative-assoc.rs b/tests/rustdoc-html/intra-doc/crate-relative-assoc.rs similarity index 100% rename from tests/rustdoc/intra-doc/crate-relative-assoc.rs rename to tests/rustdoc-html/intra-doc/crate-relative-assoc.rs diff --git a/tests/rustdoc/intra-doc/crate-relative.rs b/tests/rustdoc-html/intra-doc/crate-relative.rs similarity index 100% rename from tests/rustdoc/intra-doc/crate-relative.rs rename to tests/rustdoc-html/intra-doc/crate-relative.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/additional_doc.rs b/tests/rustdoc-html/intra-doc/cross-crate/additional_doc.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/additional_doc.rs rename to tests/rustdoc-html/intra-doc/cross-crate/additional_doc.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/additional_doc.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/additional_doc.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/hidden.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/hidden.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/intra-link-cross-crate-crate.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/intra-link-cross-crate-crate.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/intra-link-cross-crate-crate.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/intra-link-cross-crate-crate.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/macro_inner.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/macro_inner.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/module.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/module.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/module.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/module.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/proc_macro.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/proc_macro.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/proc_macro.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/proc_macro.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/submodule-inner.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/submodule-inner.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/submodule-outer.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/submodule-outer.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/auxiliary/traits.rs b/tests/rustdoc-html/intra-doc/cross-crate/auxiliary/traits.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/auxiliary/traits.rs rename to tests/rustdoc-html/intra-doc/cross-crate/auxiliary/traits.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/basic.rs b/tests/rustdoc-html/intra-doc/cross-crate/basic.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/basic.rs rename to tests/rustdoc-html/intra-doc/cross-crate/basic.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/crate.rs b/tests/rustdoc-html/intra-doc/cross-crate/crate.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/crate.rs rename to tests/rustdoc-html/intra-doc/cross-crate/crate.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/hidden.rs b/tests/rustdoc-html/intra-doc/cross-crate/hidden.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/hidden.rs rename to tests/rustdoc-html/intra-doc/cross-crate/hidden.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/macro.rs b/tests/rustdoc-html/intra-doc/cross-crate/macro.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/macro.rs rename to tests/rustdoc-html/intra-doc/cross-crate/macro.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/module.rs b/tests/rustdoc-html/intra-doc/cross-crate/module.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/module.rs rename to tests/rustdoc-html/intra-doc/cross-crate/module.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs b/tests/rustdoc-html/intra-doc/cross-crate/submodule-inner.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs rename to tests/rustdoc-html/intra-doc/cross-crate/submodule-inner.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs b/tests/rustdoc-html/intra-doc/cross-crate/submodule-outer.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs rename to tests/rustdoc-html/intra-doc/cross-crate/submodule-outer.rs diff --git a/tests/rustdoc/intra-doc/cross-crate/traits.rs b/tests/rustdoc-html/intra-doc/cross-crate/traits.rs similarity index 100% rename from tests/rustdoc/intra-doc/cross-crate/traits.rs rename to tests/rustdoc-html/intra-doc/cross-crate/traits.rs diff --git a/tests/rustdoc/intra-doc/deps.rs b/tests/rustdoc-html/intra-doc/deps.rs similarity index 100% rename from tests/rustdoc/intra-doc/deps.rs rename to tests/rustdoc-html/intra-doc/deps.rs diff --git a/tests/rustdoc/intra-doc/disambiguators-removed.rs b/tests/rustdoc-html/intra-doc/disambiguators-removed.rs similarity index 100% rename from tests/rustdoc/intra-doc/disambiguators-removed.rs rename to tests/rustdoc-html/intra-doc/disambiguators-removed.rs diff --git a/tests/rustdoc/intra-doc/email-address.rs b/tests/rustdoc-html/intra-doc/email-address.rs similarity index 100% rename from tests/rustdoc/intra-doc/email-address.rs rename to tests/rustdoc-html/intra-doc/email-address.rs diff --git a/tests/rustdoc/intra-doc/enum-self-82209.rs b/tests/rustdoc-html/intra-doc/enum-self-82209.rs similarity index 100% rename from tests/rustdoc/intra-doc/enum-self-82209.rs rename to tests/rustdoc-html/intra-doc/enum-self-82209.rs diff --git a/tests/rustdoc/intra-doc/enum-struct-field.rs b/tests/rustdoc-html/intra-doc/enum-struct-field.rs similarity index 100% rename from tests/rustdoc/intra-doc/enum-struct-field.rs rename to tests/rustdoc-html/intra-doc/enum-struct-field.rs diff --git a/tests/rustdoc/intra-doc/extern-builtin-type-impl.rs b/tests/rustdoc-html/intra-doc/extern-builtin-type-impl.rs similarity index 100% rename from tests/rustdoc/intra-doc/extern-builtin-type-impl.rs rename to tests/rustdoc-html/intra-doc/extern-builtin-type-impl.rs diff --git a/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs b/tests/rustdoc-html/intra-doc/extern-crate-only-used-in-link.rs similarity index 100% rename from tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs rename to tests/rustdoc-html/intra-doc/extern-crate-only-used-in-link.rs diff --git a/tests/rustdoc/intra-doc/extern-crate.rs b/tests/rustdoc-html/intra-doc/extern-crate.rs similarity index 100% rename from tests/rustdoc/intra-doc/extern-crate.rs rename to tests/rustdoc-html/intra-doc/extern-crate.rs diff --git a/tests/rustdoc/intra-doc/extern-inherent-impl.rs b/tests/rustdoc-html/intra-doc/extern-inherent-impl.rs similarity index 100% rename from tests/rustdoc/intra-doc/extern-inherent-impl.rs rename to tests/rustdoc-html/intra-doc/extern-inherent-impl.rs diff --git a/tests/rustdoc/intra-doc/extern-reference-link.rs b/tests/rustdoc-html/intra-doc/extern-reference-link.rs similarity index 100% rename from tests/rustdoc/intra-doc/extern-reference-link.rs rename to tests/rustdoc-html/intra-doc/extern-reference-link.rs diff --git a/tests/rustdoc/intra-doc/extern-type.rs b/tests/rustdoc-html/intra-doc/extern-type.rs similarity index 100% rename from tests/rustdoc/intra-doc/extern-type.rs rename to tests/rustdoc-html/intra-doc/extern-type.rs diff --git a/tests/rustdoc/intra-doc/external-traits.rs b/tests/rustdoc-html/intra-doc/external-traits.rs similarity index 100% rename from tests/rustdoc/intra-doc/external-traits.rs rename to tests/rustdoc-html/intra-doc/external-traits.rs diff --git a/tests/rustdoc/intra-doc/field.rs b/tests/rustdoc-html/intra-doc/field.rs similarity index 100% rename from tests/rustdoc/intra-doc/field.rs rename to tests/rustdoc-html/intra-doc/field.rs diff --git a/tests/rustdoc/intra-doc/filter-out-private.rs b/tests/rustdoc-html/intra-doc/filter-out-private.rs similarity index 100% rename from tests/rustdoc/intra-doc/filter-out-private.rs rename to tests/rustdoc-html/intra-doc/filter-out-private.rs diff --git a/tests/rustdoc/intra-doc/generic-params.rs b/tests/rustdoc-html/intra-doc/generic-params.rs similarity index 100% rename from tests/rustdoc/intra-doc/generic-params.rs rename to tests/rustdoc-html/intra-doc/generic-params.rs diff --git a/tests/rustdoc/intra-doc/generic-trait-impl.rs b/tests/rustdoc-html/intra-doc/generic-trait-impl.rs similarity index 100% rename from tests/rustdoc/intra-doc/generic-trait-impl.rs rename to tests/rustdoc-html/intra-doc/generic-trait-impl.rs diff --git a/tests/rustdoc/intra-doc/ice-intra-doc-links-107995.rs b/tests/rustdoc-html/intra-doc/ice-intra-doc-links-107995.rs similarity index 100% rename from tests/rustdoc/intra-doc/ice-intra-doc-links-107995.rs rename to tests/rustdoc-html/intra-doc/ice-intra-doc-links-107995.rs diff --git a/tests/rustdoc/intra-doc/in-bodies.rs b/tests/rustdoc-html/intra-doc/in-bodies.rs similarity index 100% rename from tests/rustdoc/intra-doc/in-bodies.rs rename to tests/rustdoc-html/intra-doc/in-bodies.rs diff --git a/tests/rustdoc/intra-doc/inherent-associated-types.rs b/tests/rustdoc-html/intra-doc/inherent-associated-types.rs similarity index 100% rename from tests/rustdoc/intra-doc/inherent-associated-types.rs rename to tests/rustdoc-html/intra-doc/inherent-associated-types.rs diff --git a/tests/rustdoc/intra-doc/intra-doc-link-method-trait-impl-72340.rs b/tests/rustdoc-html/intra-doc/intra-doc-link-method-trait-impl-72340.rs similarity index 100% rename from tests/rustdoc/intra-doc/intra-doc-link-method-trait-impl-72340.rs rename to tests/rustdoc-html/intra-doc/intra-doc-link-method-trait-impl-72340.rs diff --git a/tests/rustdoc/intra-doc/libstd-re-export.rs b/tests/rustdoc-html/intra-doc/libstd-re-export.rs similarity index 100% rename from tests/rustdoc/intra-doc/libstd-re-export.rs rename to tests/rustdoc-html/intra-doc/libstd-re-export.rs diff --git a/tests/rustdoc/intra-doc/link-in-footnotes-132208.rs b/tests/rustdoc-html/intra-doc/link-in-footnotes-132208.rs similarity index 100% rename from tests/rustdoc/intra-doc/link-in-footnotes-132208.rs rename to tests/rustdoc-html/intra-doc/link-in-footnotes-132208.rs diff --git a/tests/rustdoc/intra-doc/link-same-name-different-disambiguator-108459.rs b/tests/rustdoc-html/intra-doc/link-same-name-different-disambiguator-108459.rs similarity index 100% rename from tests/rustdoc/intra-doc/link-same-name-different-disambiguator-108459.rs rename to tests/rustdoc-html/intra-doc/link-same-name-different-disambiguator-108459.rs diff --git a/tests/rustdoc/intra-doc/link-to-proc-macro.rs b/tests/rustdoc-html/intra-doc/link-to-proc-macro.rs similarity index 100% rename from tests/rustdoc/intra-doc/link-to-proc-macro.rs rename to tests/rustdoc-html/intra-doc/link-to-proc-macro.rs diff --git a/tests/rustdoc/intra-doc/macro-caching-144965.rs b/tests/rustdoc-html/intra-doc/macro-caching-144965.rs similarity index 100% rename from tests/rustdoc/intra-doc/macro-caching-144965.rs rename to tests/rustdoc-html/intra-doc/macro-caching-144965.rs diff --git a/tests/rustdoc/intra-doc/macros-disambiguators.rs b/tests/rustdoc-html/intra-doc/macros-disambiguators.rs similarity index 100% rename from tests/rustdoc/intra-doc/macros-disambiguators.rs rename to tests/rustdoc-html/intra-doc/macros-disambiguators.rs diff --git a/tests/rustdoc/intra-doc/mod-ambiguity.rs b/tests/rustdoc-html/intra-doc/mod-ambiguity.rs similarity index 100% rename from tests/rustdoc/intra-doc/mod-ambiguity.rs rename to tests/rustdoc-html/intra-doc/mod-ambiguity.rs diff --git a/tests/rustdoc/intra-doc/mod-relative.rs b/tests/rustdoc-html/intra-doc/mod-relative.rs similarity index 100% rename from tests/rustdoc/intra-doc/mod-relative.rs rename to tests/rustdoc-html/intra-doc/mod-relative.rs diff --git a/tests/rustdoc/intra-doc/module-scope-name-resolution-55364.rs b/tests/rustdoc-html/intra-doc/module-scope-name-resolution-55364.rs similarity index 100% rename from tests/rustdoc/intra-doc/module-scope-name-resolution-55364.rs rename to tests/rustdoc-html/intra-doc/module-scope-name-resolution-55364.rs diff --git a/tests/rustdoc/intra-doc/nested-use.rs b/tests/rustdoc-html/intra-doc/nested-use.rs similarity index 100% rename from tests/rustdoc/intra-doc/nested-use.rs rename to tests/rustdoc-html/intra-doc/nested-use.rs diff --git a/tests/rustdoc/intra-doc/no-doc-primitive.rs b/tests/rustdoc-html/intra-doc/no-doc-primitive.rs similarity index 100% rename from tests/rustdoc/intra-doc/no-doc-primitive.rs rename to tests/rustdoc-html/intra-doc/no-doc-primitive.rs diff --git a/tests/rustdoc/intra-doc/non-path-primitives.rs b/tests/rustdoc-html/intra-doc/non-path-primitives.rs similarity index 100% rename from tests/rustdoc/intra-doc/non-path-primitives.rs rename to tests/rustdoc-html/intra-doc/non-path-primitives.rs diff --git a/tests/rustdoc/intra-doc/prim-assoc.rs b/tests/rustdoc-html/intra-doc/prim-assoc.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-assoc.rs rename to tests/rustdoc-html/intra-doc/prim-assoc.rs diff --git a/tests/rustdoc/intra-doc/prim-associated-traits.rs b/tests/rustdoc-html/intra-doc/prim-associated-traits.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-associated-traits.rs rename to tests/rustdoc-html/intra-doc/prim-associated-traits.rs diff --git a/tests/rustdoc/intra-doc/prim-methods-external-core.rs b/tests/rustdoc-html/intra-doc/prim-methods-external-core.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-methods-external-core.rs rename to tests/rustdoc-html/intra-doc/prim-methods-external-core.rs diff --git a/tests/rustdoc/intra-doc/prim-methods-local.rs b/tests/rustdoc-html/intra-doc/prim-methods-local.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-methods-local.rs rename to tests/rustdoc-html/intra-doc/prim-methods-local.rs diff --git a/tests/rustdoc/intra-doc/prim-methods.rs b/tests/rustdoc-html/intra-doc/prim-methods.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-methods.rs rename to tests/rustdoc-html/intra-doc/prim-methods.rs diff --git a/tests/rustdoc/intra-doc/prim-precedence.rs b/tests/rustdoc-html/intra-doc/prim-precedence.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-precedence.rs rename to tests/rustdoc-html/intra-doc/prim-precedence.rs diff --git a/tests/rustdoc/intra-doc/prim-self.rs b/tests/rustdoc-html/intra-doc/prim-self.rs similarity index 100% rename from tests/rustdoc/intra-doc/prim-self.rs rename to tests/rustdoc-html/intra-doc/prim-self.rs diff --git a/tests/rustdoc/intra-doc/primitive-disambiguators.rs b/tests/rustdoc-html/intra-doc/primitive-disambiguators.rs similarity index 100% rename from tests/rustdoc/intra-doc/primitive-disambiguators.rs rename to tests/rustdoc-html/intra-doc/primitive-disambiguators.rs diff --git a/tests/rustdoc/intra-doc/primitive-non-default-impl.rs b/tests/rustdoc-html/intra-doc/primitive-non-default-impl.rs similarity index 100% rename from tests/rustdoc/intra-doc/primitive-non-default-impl.rs rename to tests/rustdoc-html/intra-doc/primitive-non-default-impl.rs diff --git a/tests/rustdoc/intra-doc/private-failures-ignored.rs b/tests/rustdoc-html/intra-doc/private-failures-ignored.rs similarity index 100% rename from tests/rustdoc/intra-doc/private-failures-ignored.rs rename to tests/rustdoc-html/intra-doc/private-failures-ignored.rs diff --git a/tests/rustdoc/intra-doc/private.rs b/tests/rustdoc-html/intra-doc/private.rs similarity index 100% rename from tests/rustdoc/intra-doc/private.rs rename to tests/rustdoc-html/intra-doc/private.rs diff --git a/tests/rustdoc/intra-doc/proc-macro.rs b/tests/rustdoc-html/intra-doc/proc-macro.rs similarity index 100% rename from tests/rustdoc/intra-doc/proc-macro.rs rename to tests/rustdoc-html/intra-doc/proc-macro.rs diff --git a/tests/rustdoc/intra-doc/pub-use.rs b/tests/rustdoc-html/intra-doc/pub-use.rs similarity index 100% rename from tests/rustdoc/intra-doc/pub-use.rs rename to tests/rustdoc-html/intra-doc/pub-use.rs diff --git a/tests/rustdoc/intra-doc/raw-ident-self.rs b/tests/rustdoc-html/intra-doc/raw-ident-self.rs similarity index 100% rename from tests/rustdoc/intra-doc/raw-ident-self.rs rename to tests/rustdoc-html/intra-doc/raw-ident-self.rs diff --git a/tests/rustdoc/intra-doc/reexport-additional-docs.rs b/tests/rustdoc-html/intra-doc/reexport-additional-docs.rs similarity index 100% rename from tests/rustdoc/intra-doc/reexport-additional-docs.rs rename to tests/rustdoc-html/intra-doc/reexport-additional-docs.rs diff --git a/tests/rustdoc/intra-doc/same-name-different-crates-66159.rs b/tests/rustdoc-html/intra-doc/same-name-different-crates-66159.rs similarity index 100% rename from tests/rustdoc/intra-doc/same-name-different-crates-66159.rs rename to tests/rustdoc-html/intra-doc/same-name-different-crates-66159.rs diff --git a/tests/rustdoc/intra-doc/self-cache.rs b/tests/rustdoc-html/intra-doc/self-cache.rs similarity index 100% rename from tests/rustdoc/intra-doc/self-cache.rs rename to tests/rustdoc-html/intra-doc/self-cache.rs diff --git a/tests/rustdoc/intra-doc/self.rs b/tests/rustdoc-html/intra-doc/self.rs similarity index 100% rename from tests/rustdoc/intra-doc/self.rs rename to tests/rustdoc-html/intra-doc/self.rs diff --git a/tests/rustdoc/intra-doc/trait-impl.rs b/tests/rustdoc-html/intra-doc/trait-impl.rs similarity index 100% rename from tests/rustdoc/intra-doc/trait-impl.rs rename to tests/rustdoc-html/intra-doc/trait-impl.rs diff --git a/tests/rustdoc/intra-doc/trait-item.rs b/tests/rustdoc-html/intra-doc/trait-item.rs similarity index 100% rename from tests/rustdoc/intra-doc/trait-item.rs rename to tests/rustdoc-html/intra-doc/trait-item.rs diff --git a/tests/rustdoc/intra-doc/true-false.rs b/tests/rustdoc-html/intra-doc/true-false.rs similarity index 100% rename from tests/rustdoc/intra-doc/true-false.rs rename to tests/rustdoc-html/intra-doc/true-false.rs diff --git a/tests/rustdoc/intra-doc/type-alias-primitive.rs b/tests/rustdoc-html/intra-doc/type-alias-primitive.rs similarity index 100% rename from tests/rustdoc/intra-doc/type-alias-primitive.rs rename to tests/rustdoc-html/intra-doc/type-alias-primitive.rs diff --git a/tests/rustdoc/intra-doc/type-alias.rs b/tests/rustdoc-html/intra-doc/type-alias.rs similarity index 100% rename from tests/rustdoc/intra-doc/type-alias.rs rename to tests/rustdoc-html/intra-doc/type-alias.rs diff --git a/tests/rustdoc/invalid$crate$name.rs b/tests/rustdoc-html/invalid$crate$name.rs similarity index 100% rename from tests/rustdoc/invalid$crate$name.rs rename to tests/rustdoc-html/invalid$crate$name.rs diff --git a/tests/rustdoc/item-desc-list-at-start.item-table.html b/tests/rustdoc-html/item-desc-list-at-start.item-table.html similarity index 100% rename from tests/rustdoc/item-desc-list-at-start.item-table.html rename to tests/rustdoc-html/item-desc-list-at-start.item-table.html diff --git a/tests/rustdoc/item-desc-list-at-start.rs b/tests/rustdoc-html/item-desc-list-at-start.rs similarity index 100% rename from tests/rustdoc/item-desc-list-at-start.rs rename to tests/rustdoc-html/item-desc-list-at-start.rs diff --git a/tests/rustdoc/jump-to-def/assoc-items.rs b/tests/rustdoc-html/jump-to-def/assoc-items.rs similarity index 100% rename from tests/rustdoc/jump-to-def/assoc-items.rs rename to tests/rustdoc-html/jump-to-def/assoc-items.rs diff --git a/tests/rustdoc/jump-to-def/assoc-types.rs b/tests/rustdoc-html/jump-to-def/assoc-types.rs similarity index 100% rename from tests/rustdoc/jump-to-def/assoc-types.rs rename to tests/rustdoc-html/jump-to-def/assoc-types.rs diff --git a/tests/rustdoc/jump-to-def/auxiliary/symbols.rs b/tests/rustdoc-html/jump-to-def/auxiliary/symbols.rs similarity index 100% rename from tests/rustdoc/jump-to-def/auxiliary/symbols.rs rename to tests/rustdoc-html/jump-to-def/auxiliary/symbols.rs diff --git a/tests/rustdoc/jump-to-def/derive-macro.rs b/tests/rustdoc-html/jump-to-def/derive-macro.rs similarity index 100% rename from tests/rustdoc/jump-to-def/derive-macro.rs rename to tests/rustdoc-html/jump-to-def/derive-macro.rs diff --git a/tests/rustdoc/jump-to-def/doc-links-calls.rs b/tests/rustdoc-html/jump-to-def/doc-links-calls.rs similarity index 100% rename from tests/rustdoc/jump-to-def/doc-links-calls.rs rename to tests/rustdoc-html/jump-to-def/doc-links-calls.rs diff --git a/tests/rustdoc/jump-to-def/doc-links.rs b/tests/rustdoc-html/jump-to-def/doc-links.rs similarity index 100% rename from tests/rustdoc/jump-to-def/doc-links.rs rename to tests/rustdoc-html/jump-to-def/doc-links.rs diff --git a/tests/rustdoc/jump-to-def/macro.rs b/tests/rustdoc-html/jump-to-def/macro.rs similarity index 100% rename from tests/rustdoc/jump-to-def/macro.rs rename to tests/rustdoc-html/jump-to-def/macro.rs diff --git a/tests/rustdoc/jump-to-def/no-body-items.rs b/tests/rustdoc-html/jump-to-def/no-body-items.rs similarity index 100% rename from tests/rustdoc/jump-to-def/no-body-items.rs rename to tests/rustdoc-html/jump-to-def/no-body-items.rs diff --git a/tests/rustdoc/jump-to-def/non-local-method.rs b/tests/rustdoc-html/jump-to-def/non-local-method.rs similarity index 100% rename from tests/rustdoc/jump-to-def/non-local-method.rs rename to tests/rustdoc-html/jump-to-def/non-local-method.rs diff --git a/tests/rustdoc/jump-to-def/patterns.rs b/tests/rustdoc-html/jump-to-def/patterns.rs similarity index 100% rename from tests/rustdoc/jump-to-def/patterns.rs rename to tests/rustdoc-html/jump-to-def/patterns.rs diff --git a/tests/rustdoc/jump-to-def/prelude-types.rs b/tests/rustdoc-html/jump-to-def/prelude-types.rs similarity index 100% rename from tests/rustdoc/jump-to-def/prelude-types.rs rename to tests/rustdoc-html/jump-to-def/prelude-types.rs diff --git a/tests/rustdoc/jump-to-def/shebang.rs b/tests/rustdoc-html/jump-to-def/shebang.rs similarity index 100% rename from tests/rustdoc/jump-to-def/shebang.rs rename to tests/rustdoc-html/jump-to-def/shebang.rs diff --git a/tests/rustdoc/keyword.rs b/tests/rustdoc-html/keyword.rs similarity index 100% rename from tests/rustdoc/keyword.rs rename to tests/rustdoc-html/keyword.rs diff --git a/tests/rustdoc/lifetime-name.rs b/tests/rustdoc-html/lifetime-name.rs similarity index 100% rename from tests/rustdoc/lifetime-name.rs rename to tests/rustdoc-html/lifetime-name.rs diff --git a/tests/rustdoc/line-breaks.rs b/tests/rustdoc-html/line-breaks.rs similarity index 100% rename from tests/rustdoc/line-breaks.rs rename to tests/rustdoc-html/line-breaks.rs diff --git a/tests/rustdoc/link-on-path-with-generics.rs b/tests/rustdoc-html/link-on-path-with-generics.rs similarity index 100% rename from tests/rustdoc/link-on-path-with-generics.rs rename to tests/rustdoc-html/link-on-path-with-generics.rs diff --git a/tests/rustdoc/link-title-escape.rs b/tests/rustdoc-html/link-title-escape.rs similarity index 100% rename from tests/rustdoc/link-title-escape.rs rename to tests/rustdoc-html/link-title-escape.rs diff --git a/tests/rustdoc/links-in-headings.rs b/tests/rustdoc-html/links-in-headings.rs similarity index 100% rename from tests/rustdoc/links-in-headings.rs rename to tests/rustdoc-html/links-in-headings.rs diff --git a/tests/rustdoc/logo-class-default.rs b/tests/rustdoc-html/logo-class-default.rs similarity index 100% rename from tests/rustdoc/logo-class-default.rs rename to tests/rustdoc-html/logo-class-default.rs diff --git a/tests/rustdoc/logo-class-rust.rs b/tests/rustdoc-html/logo-class-rust.rs similarity index 100% rename from tests/rustdoc/logo-class-rust.rs rename to tests/rustdoc-html/logo-class-rust.rs diff --git a/tests/rustdoc/logo-class.rs b/tests/rustdoc-html/logo-class.rs similarity index 100% rename from tests/rustdoc/logo-class.rs rename to tests/rustdoc-html/logo-class.rs diff --git a/tests/rustdoc/macro-expansion/field-followed-by-exclamation.rs b/tests/rustdoc-html/macro-expansion/field-followed-by-exclamation.rs similarity index 100% rename from tests/rustdoc/macro-expansion/field-followed-by-exclamation.rs rename to tests/rustdoc-html/macro-expansion/field-followed-by-exclamation.rs diff --git a/tests/rustdoc/macro-expansion/type-macro-expansion.rs b/tests/rustdoc-html/macro-expansion/type-macro-expansion.rs similarity index 100% rename from tests/rustdoc/macro-expansion/type-macro-expansion.rs rename to tests/rustdoc-html/macro-expansion/type-macro-expansion.rs diff --git a/tests/rustdoc/macro/auxiliary/external-macro-src.rs b/tests/rustdoc-html/macro/auxiliary/external-macro-src.rs similarity index 100% rename from tests/rustdoc/macro/auxiliary/external-macro-src.rs rename to tests/rustdoc-html/macro/auxiliary/external-macro-src.rs diff --git a/tests/rustdoc/macro/auxiliary/issue-99221-aux.rs b/tests/rustdoc-html/macro/auxiliary/issue-99221-aux.rs similarity index 100% rename from tests/rustdoc/macro/auxiliary/issue-99221-aux.rs rename to tests/rustdoc-html/macro/auxiliary/issue-99221-aux.rs diff --git a/tests/rustdoc/macro/auxiliary/macro_pub_in_module.rs b/tests/rustdoc-html/macro/auxiliary/macro_pub_in_module.rs similarity index 100% rename from tests/rustdoc/macro/auxiliary/macro_pub_in_module.rs rename to tests/rustdoc-html/macro/auxiliary/macro_pub_in_module.rs diff --git a/tests/rustdoc/macro/auxiliary/one-line-expand.rs b/tests/rustdoc-html/macro/auxiliary/one-line-expand.rs similarity index 100% rename from tests/rustdoc/macro/auxiliary/one-line-expand.rs rename to tests/rustdoc-html/macro/auxiliary/one-line-expand.rs diff --git a/tests/rustdoc/macro/auxiliary/pub-use-extern-macros.rs b/tests/rustdoc-html/macro/auxiliary/pub-use-extern-macros.rs similarity index 100% rename from tests/rustdoc/macro/auxiliary/pub-use-extern-macros.rs rename to tests/rustdoc-html/macro/auxiliary/pub-use-extern-macros.rs diff --git a/tests/rustdoc/macro/compiler-derive-proc-macro.rs b/tests/rustdoc-html/macro/compiler-derive-proc-macro.rs similarity index 100% rename from tests/rustdoc/macro/compiler-derive-proc-macro.rs rename to tests/rustdoc-html/macro/compiler-derive-proc-macro.rs diff --git a/tests/rustdoc/macro/const-rendering-macros-33302.rs b/tests/rustdoc-html/macro/const-rendering-macros-33302.rs similarity index 100% rename from tests/rustdoc/macro/const-rendering-macros-33302.rs rename to tests/rustdoc-html/macro/const-rendering-macros-33302.rs diff --git a/tests/rustdoc/macro/decl_macro.rs b/tests/rustdoc-html/macro/decl_macro.rs similarity index 100% rename from tests/rustdoc/macro/decl_macro.rs rename to tests/rustdoc-html/macro/decl_macro.rs diff --git a/tests/rustdoc/macro/decl_macro_priv.rs b/tests/rustdoc-html/macro/decl_macro_priv.rs similarity index 100% rename from tests/rustdoc/macro/decl_macro_priv.rs rename to tests/rustdoc-html/macro/decl_macro_priv.rs diff --git a/tests/rustdoc/macro/doc-proc-macro.rs b/tests/rustdoc-html/macro/doc-proc-macro.rs similarity index 100% rename from tests/rustdoc/macro/doc-proc-macro.rs rename to tests/rustdoc-html/macro/doc-proc-macro.rs diff --git a/tests/rustdoc/macro/external-macro-src.rs b/tests/rustdoc-html/macro/external-macro-src.rs similarity index 100% rename from tests/rustdoc/macro/external-macro-src.rs rename to tests/rustdoc-html/macro/external-macro-src.rs diff --git a/tests/rustdoc/macro/macro-const-display-115295.rs b/tests/rustdoc-html/macro/macro-const-display-115295.rs similarity index 100% rename from tests/rustdoc/macro/macro-const-display-115295.rs rename to tests/rustdoc-html/macro/macro-const-display-115295.rs diff --git a/tests/rustdoc/macro/macro-doc-comment-23812.rs b/tests/rustdoc-html/macro/macro-doc-comment-23812.rs similarity index 100% rename from tests/rustdoc/macro/macro-doc-comment-23812.rs rename to tests/rustdoc-html/macro/macro-doc-comment-23812.rs diff --git a/tests/rustdoc/macro/macro-export-crate-root-108231.rs b/tests/rustdoc-html/macro/macro-export-crate-root-108231.rs similarity index 100% rename from tests/rustdoc/macro/macro-export-crate-root-108231.rs rename to tests/rustdoc-html/macro/macro-export-crate-root-108231.rs diff --git a/tests/rustdoc/macro/macro-generated-macro.macro_linebreak_pre.html b/tests/rustdoc-html/macro/macro-generated-macro.macro_linebreak_pre.html similarity index 100% rename from tests/rustdoc/macro/macro-generated-macro.macro_linebreak_pre.html rename to tests/rustdoc-html/macro/macro-generated-macro.macro_linebreak_pre.html diff --git a/tests/rustdoc/macro/macro-generated-macro.macro_morestuff_pre.html b/tests/rustdoc-html/macro/macro-generated-macro.macro_morestuff_pre.html similarity index 100% rename from tests/rustdoc/macro/macro-generated-macro.macro_morestuff_pre.html rename to tests/rustdoc-html/macro/macro-generated-macro.macro_morestuff_pre.html diff --git a/tests/rustdoc/macro/macro-generated-macro.rs b/tests/rustdoc-html/macro/macro-generated-macro.rs similarity index 100% rename from tests/rustdoc/macro/macro-generated-macro.rs rename to tests/rustdoc-html/macro/macro-generated-macro.rs diff --git a/tests/rustdoc/macro/macro-higher-kinded-function.rs b/tests/rustdoc-html/macro/macro-higher-kinded-function.rs similarity index 100% rename from tests/rustdoc/macro/macro-higher-kinded-function.rs rename to tests/rustdoc-html/macro/macro-higher-kinded-function.rs diff --git a/tests/rustdoc/macro/macro-ice-16019.rs b/tests/rustdoc-html/macro/macro-ice-16019.rs similarity index 100% rename from tests/rustdoc/macro/macro-ice-16019.rs rename to tests/rustdoc-html/macro/macro-ice-16019.rs diff --git a/tests/rustdoc/macro/macro-in-async-block.rs b/tests/rustdoc-html/macro/macro-in-async-block.rs similarity index 100% rename from tests/rustdoc/macro/macro-in-async-block.rs rename to tests/rustdoc-html/macro/macro-in-async-block.rs diff --git a/tests/rustdoc/macro/macro-in-closure.rs b/tests/rustdoc-html/macro/macro-in-closure.rs similarity index 100% rename from tests/rustdoc/macro/macro-in-closure.rs rename to tests/rustdoc-html/macro/macro-in-closure.rs diff --git a/tests/rustdoc/macro/macro-indirect-use.rs b/tests/rustdoc-html/macro/macro-indirect-use.rs similarity index 100% rename from tests/rustdoc/macro/macro-indirect-use.rs rename to tests/rustdoc-html/macro/macro-indirect-use.rs diff --git a/tests/rustdoc/macro/macro_expansion.rs b/tests/rustdoc-html/macro/macro_expansion.rs similarity index 100% rename from tests/rustdoc/macro/macro_expansion.rs rename to tests/rustdoc-html/macro/macro_expansion.rs diff --git a/tests/rustdoc/macro/macro_pub_in_module.rs b/tests/rustdoc-html/macro/macro_pub_in_module.rs similarity index 100% rename from tests/rustdoc/macro/macro_pub_in_module.rs rename to tests/rustdoc-html/macro/macro_pub_in_module.rs diff --git a/tests/rustdoc/macro/macro_rules-matchers.rs b/tests/rustdoc-html/macro/macro_rules-matchers.rs similarity index 100% rename from tests/rustdoc/macro/macro_rules-matchers.rs rename to tests/rustdoc-html/macro/macro_rules-matchers.rs diff --git a/tests/rustdoc/macro/macros.rs b/tests/rustdoc-html/macro/macros.rs similarity index 100% rename from tests/rustdoc/macro/macros.rs rename to tests/rustdoc-html/macro/macros.rs diff --git a/tests/rustdoc/macro/multiple-macro-rules-w-same-name-99221.rs b/tests/rustdoc-html/macro/multiple-macro-rules-w-same-name-99221.rs similarity index 100% rename from tests/rustdoc/macro/multiple-macro-rules-w-same-name-99221.rs rename to tests/rustdoc-html/macro/multiple-macro-rules-w-same-name-99221.rs diff --git a/tests/rustdoc/macro/multiple-macro-rules-w-same-name-submodule-99221.rs b/tests/rustdoc-html/macro/multiple-macro-rules-w-same-name-submodule-99221.rs similarity index 100% rename from tests/rustdoc/macro/multiple-macro-rules-w-same-name-submodule-99221.rs rename to tests/rustdoc-html/macro/multiple-macro-rules-w-same-name-submodule-99221.rs diff --git a/tests/rustdoc/macro/one-line-expand.rs b/tests/rustdoc-html/macro/one-line-expand.rs similarity index 100% rename from tests/rustdoc/macro/one-line-expand.rs rename to tests/rustdoc-html/macro/one-line-expand.rs diff --git a/tests/rustdoc/macro/proc-macro.rs b/tests/rustdoc-html/macro/proc-macro.rs similarity index 100% rename from tests/rustdoc/macro/proc-macro.rs rename to tests/rustdoc-html/macro/proc-macro.rs diff --git a/tests/rustdoc/macro/pub-use-extern-macros.rs b/tests/rustdoc-html/macro/pub-use-extern-macros.rs similarity index 100% rename from tests/rustdoc/macro/pub-use-extern-macros.rs rename to tests/rustdoc-html/macro/pub-use-extern-macros.rs diff --git a/tests/rustdoc/macro/rustc-macro-crate.rs b/tests/rustdoc-html/macro/rustc-macro-crate.rs similarity index 100% rename from tests/rustdoc/macro/rustc-macro-crate.rs rename to tests/rustdoc-html/macro/rustc-macro-crate.rs diff --git a/tests/rustdoc/markdown-60482.rs b/tests/rustdoc-html/markdown-60482.rs similarity index 100% rename from tests/rustdoc/markdown-60482.rs rename to tests/rustdoc-html/markdown-60482.rs diff --git a/tests/rustdoc/markdown-table-escape-pipe-27862.rs b/tests/rustdoc-html/markdown-table-escape-pipe-27862.rs similarity index 100% rename from tests/rustdoc/markdown-table-escape-pipe-27862.rs rename to tests/rustdoc-html/markdown-table-escape-pipe-27862.rs diff --git a/tests/rustdoc/masked.rs b/tests/rustdoc-html/masked.rs similarity index 100% rename from tests/rustdoc/masked.rs rename to tests/rustdoc-html/masked.rs diff --git a/tests/rustdoc/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/cargo-transitive-read-write/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/cargo-transitive-read-write/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/cargo-transitive-read-write/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/cargo-transitive-read-write/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs b/tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs rename to tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs diff --git a/tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/indigo.rs b/tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/indigo.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/kitchen-sink-separate-dirs/indigo.rs rename to tests/rustdoc-html/merge-cross-crate-info/kitchen-sink-separate-dirs/indigo.rs diff --git a/tests/rustdoc/merge-cross-crate-info/no-merge-separate/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/no-merge-separate/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/no-merge-separate/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/no-merge-separate/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/no-merge-separate/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/no-merge-separate/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/no-merge-separate/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/no-merge-separate/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/no-merge-separate/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/no-merge-separate/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/no-merge-separate/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/no-merge-separate/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/no-merge-write-anyway/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/no-merge-write-anyway/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/no-merge-write-anyway/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/no-merge-write-anyway/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite-but-include/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite-but-include/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite-but-include/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite-but-include/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite-but-include/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite-but-include/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite-but-include/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite-but-include/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite-but-include/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite-but-include/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite-but-include/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite-but-include/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite-but-separate/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite-but-separate/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite-but-separate/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite-but-separate/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite-but-separate/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite-but-separate/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite-but-separate/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite-but-separate/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/overwrite/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/overwrite/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/overwrite/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/overwrite/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/single-crate-finalize/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/single-crate-finalize/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/single-crate-finalize/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/single-crate-finalize/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/single-crate-read-write/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/single-crate-read-write/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/single-crate-read-write/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/single-crate-read-write/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/single-crate-write-anyway/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/single-crate-write-anyway/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/single-crate-write-anyway/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/single-crate-write-anyway/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/single-merge-none-useless-write/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/single-merge-none-useless-write/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/single-merge-none-useless-write/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/single-merge-none-useless-write/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-finalize/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-finalize/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-finalize/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-finalize/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-finalize/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-finalize/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-finalize/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-finalize/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-finalize/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-finalize/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-finalize/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-finalize/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-merge-none/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-merge-none/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-merge-none/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-merge-none/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-merge-none/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-merge-none/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-merge-none/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-merge-none/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-merge-none/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-merge-none/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-merge-none/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-merge-none/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-merge-read-write/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-merge-read-write/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-merge-read-write/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-merge-read-write/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-no-info/auxiliary/quebec.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-no-info/auxiliary/quebec.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-no-info/auxiliary/quebec.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-no-info/auxiliary/quebec.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-no-info/auxiliary/tango.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-no-info/auxiliary/tango.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-no-info/auxiliary/tango.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-no-info/auxiliary/tango.rs diff --git a/tests/rustdoc/merge-cross-crate-info/transitive-no-info/sierra.rs b/tests/rustdoc-html/merge-cross-crate-info/transitive-no-info/sierra.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/transitive-no-info/sierra.rs rename to tests/rustdoc-html/merge-cross-crate-info/transitive-no-info/sierra.rs diff --git a/tests/rustdoc/merge-cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs b/tests/rustdoc-html/merge-cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs rename to tests/rustdoc-html/merge-cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs diff --git a/tests/rustdoc/merge-cross-crate-info/two-separate-out-dir/echo.rs b/tests/rustdoc-html/merge-cross-crate-info/two-separate-out-dir/echo.rs similarity index 100% rename from tests/rustdoc/merge-cross-crate-info/two-separate-out-dir/echo.rs rename to tests/rustdoc-html/merge-cross-crate-info/two-separate-out-dir/echo.rs diff --git a/tests/rustdoc/method-list.rs b/tests/rustdoc-html/method-list.rs similarity index 100% rename from tests/rustdoc/method-list.rs rename to tests/rustdoc-html/method-list.rs diff --git a/tests/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html b/tests/rustdoc-html/mixing-doc-comments-and-attrs.S1_top-doc.html similarity index 100% rename from tests/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html rename to tests/rustdoc-html/mixing-doc-comments-and-attrs.S1_top-doc.html diff --git a/tests/rustdoc/mixing-doc-comments-and-attrs.S2_top-doc.html b/tests/rustdoc-html/mixing-doc-comments-and-attrs.S2_top-doc.html similarity index 100% rename from tests/rustdoc/mixing-doc-comments-and-attrs.S2_top-doc.html rename to tests/rustdoc-html/mixing-doc-comments-and-attrs.S2_top-doc.html diff --git a/tests/rustdoc/mixing-doc-comments-and-attrs.S3_top-doc.html b/tests/rustdoc-html/mixing-doc-comments-and-attrs.S3_top-doc.html similarity index 100% rename from tests/rustdoc/mixing-doc-comments-and-attrs.S3_top-doc.html rename to tests/rustdoc-html/mixing-doc-comments-and-attrs.S3_top-doc.html diff --git a/tests/rustdoc/mixing-doc-comments-and-attrs.rs b/tests/rustdoc-html/mixing-doc-comments-and-attrs.rs similarity index 100% rename from tests/rustdoc/mixing-doc-comments-and-attrs.rs rename to tests/rustdoc-html/mixing-doc-comments-and-attrs.rs diff --git a/tests/rustdoc/mod-stackoverflow.rs b/tests/rustdoc-html/mod-stackoverflow.rs similarity index 100% rename from tests/rustdoc/mod-stackoverflow.rs rename to tests/rustdoc-html/mod-stackoverflow.rs diff --git a/tests/rustdoc/multiple-foreigns-w-same-name-99734.rs b/tests/rustdoc-html/multiple-foreigns-w-same-name-99734.rs similarity index 100% rename from tests/rustdoc/multiple-foreigns-w-same-name-99734.rs rename to tests/rustdoc-html/multiple-foreigns-w-same-name-99734.rs diff --git a/tests/rustdoc/multiple-import-levels.rs b/tests/rustdoc-html/multiple-import-levels.rs similarity index 100% rename from tests/rustdoc/multiple-import-levels.rs rename to tests/rustdoc-html/multiple-import-levels.rs diff --git a/tests/rustdoc/multiple-mods-w-same-name-99734.rs b/tests/rustdoc-html/multiple-mods-w-same-name-99734.rs similarity index 100% rename from tests/rustdoc/multiple-mods-w-same-name-99734.rs rename to tests/rustdoc-html/multiple-mods-w-same-name-99734.rs diff --git a/tests/rustdoc/multiple-mods-w-same-name-doc-inline-83375.rs b/tests/rustdoc-html/multiple-mods-w-same-name-doc-inline-83375.rs similarity index 100% rename from tests/rustdoc/multiple-mods-w-same-name-doc-inline-83375.rs rename to tests/rustdoc-html/multiple-mods-w-same-name-doc-inline-83375.rs diff --git a/tests/rustdoc/multiple-mods-w-same-name-doc-inline-last-item-83375.rs b/tests/rustdoc-html/multiple-mods-w-same-name-doc-inline-last-item-83375.rs similarity index 100% rename from tests/rustdoc/multiple-mods-w-same-name-doc-inline-last-item-83375.rs rename to tests/rustdoc-html/multiple-mods-w-same-name-doc-inline-last-item-83375.rs diff --git a/tests/rustdoc/multiple-structs-w-same-name-99221.rs b/tests/rustdoc-html/multiple-structs-w-same-name-99221.rs similarity index 100% rename from tests/rustdoc/multiple-structs-w-same-name-99221.rs rename to tests/rustdoc-html/multiple-structs-w-same-name-99221.rs diff --git a/tests/rustdoc/mut-params.rs b/tests/rustdoc-html/mut-params.rs similarity index 100% rename from tests/rustdoc/mut-params.rs rename to tests/rustdoc-html/mut-params.rs diff --git a/tests/rustdoc/namespaces.rs b/tests/rustdoc-html/namespaces.rs similarity index 100% rename from tests/rustdoc/namespaces.rs rename to tests/rustdoc-html/namespaces.rs diff --git a/tests/rustdoc/nested-items-issue-111415.rs b/tests/rustdoc-html/nested-items-issue-111415.rs similarity index 100% rename from tests/rustdoc/nested-items-issue-111415.rs rename to tests/rustdoc-html/nested-items-issue-111415.rs diff --git a/tests/rustdoc/nested-modules.rs b/tests/rustdoc-html/nested-modules.rs similarity index 100% rename from tests/rustdoc/nested-modules.rs rename to tests/rustdoc-html/nested-modules.rs diff --git a/tests/rustdoc/no-run-still-checks-lints.rs b/tests/rustdoc-html/no-run-still-checks-lints.rs similarity index 100% rename from tests/rustdoc/no-run-still-checks-lints.rs rename to tests/rustdoc-html/no-run-still-checks-lints.rs diff --git a/tests/rustdoc/no-stack-overflow-25295.rs b/tests/rustdoc-html/no-stack-overflow-25295.rs similarity index 100% rename from tests/rustdoc/no-stack-overflow-25295.rs rename to tests/rustdoc-html/no-stack-overflow-25295.rs diff --git a/tests/rustdoc/no-unit-struct-field.rs b/tests/rustdoc-html/no-unit-struct-field.rs similarity index 100% rename from tests/rustdoc/no-unit-struct-field.rs rename to tests/rustdoc-html/no-unit-struct-field.rs diff --git a/tests/rustdoc/non_lifetime_binders.rs b/tests/rustdoc-html/non_lifetime_binders.rs similarity index 100% rename from tests/rustdoc/non_lifetime_binders.rs rename to tests/rustdoc-html/non_lifetime_binders.rs diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs rename to tests/rustdoc-html/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs rename to tests/rustdoc-html/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-negative.negative.html b/tests/rustdoc-html/notable-trait/doc-notable_trait-negative.negative.html similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-negative.negative.html rename to tests/rustdoc-html/notable-trait/doc-notable_trait-negative.negative.html diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-negative.positive.html b/tests/rustdoc-html/notable-trait/doc-notable_trait-negative.positive.html similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-negative.positive.html rename to tests/rustdoc-html/notable-trait/doc-notable_trait-negative.positive.html diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-negative.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait-negative.rs similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-negative.rs rename to tests/rustdoc-html/notable-trait/doc-notable_trait-negative.rs diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html b/tests/rustdoc-html/notable-trait/doc-notable_trait-slice.bare_fn_matches.html similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html rename to tests/rustdoc-html/notable-trait/doc-notable_trait-slice.bare_fn_matches.html diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait-slice.rs similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait-slice.rs rename to tests/rustdoc-html/notable-trait/doc-notable_trait-slice.rs diff --git a/tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html b/tests/rustdoc-html/notable-trait/doc-notable_trait.bare-fn.html similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html rename to tests/rustdoc-html/notable-trait/doc-notable_trait.bare-fn.html diff --git a/tests/rustdoc/notable-trait/doc-notable_trait.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait.rs similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait.rs rename to tests/rustdoc-html/notable-trait/doc-notable_trait.rs diff --git a/tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html b/tests/rustdoc-html/notable-trait/doc-notable_trait.some-struct-new.html similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html rename to tests/rustdoc-html/notable-trait/doc-notable_trait.some-struct-new.html diff --git a/tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html b/tests/rustdoc-html/notable-trait/doc-notable_trait.wrap-me.html similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html rename to tests/rustdoc-html/notable-trait/doc-notable_trait.wrap-me.html diff --git a/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs similarity index 100% rename from tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs rename to tests/rustdoc-html/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs diff --git a/tests/rustdoc/notable-trait/notable-trait-generics.rs b/tests/rustdoc-html/notable-trait/notable-trait-generics.rs similarity index 100% rename from tests/rustdoc/notable-trait/notable-trait-generics.rs rename to tests/rustdoc-html/notable-trait/notable-trait-generics.rs diff --git a/tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html b/tests/rustdoc-html/notable-trait/spotlight-from-dependency.odd.html similarity index 100% rename from tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html rename to tests/rustdoc-html/notable-trait/spotlight-from-dependency.odd.html diff --git a/tests/rustdoc/notable-trait/spotlight-from-dependency.rs b/tests/rustdoc-html/notable-trait/spotlight-from-dependency.rs similarity index 100% rename from tests/rustdoc/notable-trait/spotlight-from-dependency.rs rename to tests/rustdoc-html/notable-trait/spotlight-from-dependency.rs diff --git a/tests/rustdoc/nul-error.rs b/tests/rustdoc-html/nul-error.rs similarity index 100% rename from tests/rustdoc/nul-error.rs rename to tests/rustdoc-html/nul-error.rs diff --git a/tests/rustdoc/playground-arg.rs b/tests/rustdoc-html/playground-arg.rs similarity index 100% rename from tests/rustdoc/playground-arg.rs rename to tests/rustdoc-html/playground-arg.rs diff --git a/tests/rustdoc/playground-empty.rs b/tests/rustdoc-html/playground-empty.rs similarity index 100% rename from tests/rustdoc/playground-empty.rs rename to tests/rustdoc-html/playground-empty.rs diff --git a/tests/rustdoc/playground-none.rs b/tests/rustdoc-html/playground-none.rs similarity index 100% rename from tests/rustdoc/playground-none.rs rename to tests/rustdoc-html/playground-none.rs diff --git a/tests/rustdoc/playground-syntax-error.rs b/tests/rustdoc-html/playground-syntax-error.rs similarity index 100% rename from tests/rustdoc/playground-syntax-error.rs rename to tests/rustdoc-html/playground-syntax-error.rs diff --git a/tests/rustdoc/playground.rs b/tests/rustdoc-html/playground.rs similarity index 100% rename from tests/rustdoc/playground.rs rename to tests/rustdoc-html/playground.rs diff --git a/tests/rustdoc/primitive/auxiliary/issue-15318.rs b/tests/rustdoc-html/primitive/auxiliary/issue-15318.rs similarity index 100% rename from tests/rustdoc/primitive/auxiliary/issue-15318.rs rename to tests/rustdoc-html/primitive/auxiliary/issue-15318.rs diff --git a/tests/rustdoc/primitive/auxiliary/primitive-doc.rs b/tests/rustdoc-html/primitive/auxiliary/primitive-doc.rs similarity index 100% rename from tests/rustdoc/primitive/auxiliary/primitive-doc.rs rename to tests/rustdoc-html/primitive/auxiliary/primitive-doc.rs diff --git a/tests/rustdoc/primitive/cross-crate-primitive-doc.rs b/tests/rustdoc-html/primitive/cross-crate-primitive-doc.rs similarity index 100% rename from tests/rustdoc/primitive/cross-crate-primitive-doc.rs rename to tests/rustdoc-html/primitive/cross-crate-primitive-doc.rs diff --git a/tests/rustdoc/primitive/no_std-primitive.rs b/tests/rustdoc-html/primitive/no_std-primitive.rs similarity index 100% rename from tests/rustdoc/primitive/no_std-primitive.rs rename to tests/rustdoc-html/primitive/no_std-primitive.rs diff --git a/tests/rustdoc/primitive/no_std.rs b/tests/rustdoc-html/primitive/no_std.rs similarity index 100% rename from tests/rustdoc/primitive/no_std.rs rename to tests/rustdoc-html/primitive/no_std.rs diff --git a/tests/rustdoc/primitive/primitive-generic-impl.rs b/tests/rustdoc-html/primitive/primitive-generic-impl.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-generic-impl.rs rename to tests/rustdoc-html/primitive/primitive-generic-impl.rs diff --git a/tests/rustdoc/primitive/primitive-link.rs b/tests/rustdoc-html/primitive/primitive-link.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-link.rs rename to tests/rustdoc-html/primitive/primitive-link.rs diff --git a/tests/rustdoc/primitive/primitive-raw-pointer-dox-15318-3.rs b/tests/rustdoc-html/primitive/primitive-raw-pointer-dox-15318-3.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-raw-pointer-dox-15318-3.rs rename to tests/rustdoc-html/primitive/primitive-raw-pointer-dox-15318-3.rs diff --git a/tests/rustdoc/primitive/primitive-raw-pointer-link-15318.rs b/tests/rustdoc-html/primitive/primitive-raw-pointer-link-15318.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-raw-pointer-link-15318.rs rename to tests/rustdoc-html/primitive/primitive-raw-pointer-link-15318.rs diff --git a/tests/rustdoc/primitive/primitive-raw-pointer-link-no-inlined-15318-2.rs b/tests/rustdoc-html/primitive/primitive-raw-pointer-link-no-inlined-15318-2.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-raw-pointer-link-no-inlined-15318-2.rs rename to tests/rustdoc-html/primitive/primitive-raw-pointer-link-no-inlined-15318-2.rs diff --git a/tests/rustdoc/primitive/primitive-reference.rs b/tests/rustdoc-html/primitive/primitive-reference.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-reference.rs rename to tests/rustdoc-html/primitive/primitive-reference.rs diff --git a/tests/rustdoc/primitive/primitive-slice-auto-trait.rs b/tests/rustdoc-html/primitive/primitive-slice-auto-trait.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-slice-auto-trait.rs rename to tests/rustdoc-html/primitive/primitive-slice-auto-trait.rs diff --git a/tests/rustdoc/primitive/primitive-tuple-auto-trait.rs b/tests/rustdoc-html/primitive/primitive-tuple-auto-trait.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-tuple-auto-trait.rs rename to tests/rustdoc-html/primitive/primitive-tuple-auto-trait.rs diff --git a/tests/rustdoc/primitive/primitive-tuple-variadic.rs b/tests/rustdoc-html/primitive/primitive-tuple-variadic.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-tuple-variadic.rs rename to tests/rustdoc-html/primitive/primitive-tuple-variadic.rs diff --git a/tests/rustdoc/primitive/primitive-unit-auto-trait.rs b/tests/rustdoc-html/primitive/primitive-unit-auto-trait.rs similarity index 100% rename from tests/rustdoc/primitive/primitive-unit-auto-trait.rs rename to tests/rustdoc-html/primitive/primitive-unit-auto-trait.rs diff --git a/tests/rustdoc/primitive/primitive.rs b/tests/rustdoc-html/primitive/primitive.rs similarity index 100% rename from tests/rustdoc/primitive/primitive.rs rename to tests/rustdoc-html/primitive/primitive.rs diff --git a/tests/rustdoc/primitive/search-index-primitive-inherent-method-23511.rs b/tests/rustdoc-html/primitive/search-index-primitive-inherent-method-23511.rs similarity index 100% rename from tests/rustdoc/primitive/search-index-primitive-inherent-method-23511.rs rename to tests/rustdoc-html/primitive/search-index-primitive-inherent-method-23511.rs diff --git a/tests/rustdoc/private/doc-hidden-private-67851-both.rs b/tests/rustdoc-html/private/doc-hidden-private-67851-both.rs similarity index 100% rename from tests/rustdoc/private/doc-hidden-private-67851-both.rs rename to tests/rustdoc-html/private/doc-hidden-private-67851-both.rs diff --git a/tests/rustdoc/private/doc-hidden-private-67851-hidden.rs b/tests/rustdoc-html/private/doc-hidden-private-67851-hidden.rs similarity index 100% rename from tests/rustdoc/private/doc-hidden-private-67851-hidden.rs rename to tests/rustdoc-html/private/doc-hidden-private-67851-hidden.rs diff --git a/tests/rustdoc/private/doc-hidden-private-67851-neither.rs b/tests/rustdoc-html/private/doc-hidden-private-67851-neither.rs similarity index 100% rename from tests/rustdoc/private/doc-hidden-private-67851-neither.rs rename to tests/rustdoc-html/private/doc-hidden-private-67851-neither.rs diff --git a/tests/rustdoc/private/doc-hidden-private-67851-private.rs b/tests/rustdoc-html/private/doc-hidden-private-67851-private.rs similarity index 100% rename from tests/rustdoc/private/doc-hidden-private-67851-private.rs rename to tests/rustdoc-html/private/doc-hidden-private-67851-private.rs diff --git a/tests/rustdoc/private/empty-impl-block-private-with-doc.rs b/tests/rustdoc-html/private/empty-impl-block-private-with-doc.rs similarity index 100% rename from tests/rustdoc/private/empty-impl-block-private-with-doc.rs rename to tests/rustdoc-html/private/empty-impl-block-private-with-doc.rs diff --git a/tests/rustdoc/private/empty-impl-block-private.rs b/tests/rustdoc-html/private/empty-impl-block-private.rs similarity index 100% rename from tests/rustdoc/private/empty-impl-block-private.rs rename to tests/rustdoc-html/private/empty-impl-block-private.rs diff --git a/tests/rustdoc/private/empty-mod-private.rs b/tests/rustdoc-html/private/empty-mod-private.rs similarity index 100% rename from tests/rustdoc/private/empty-mod-private.rs rename to tests/rustdoc-html/private/empty-mod-private.rs diff --git a/tests/rustdoc/private/enum-variant-private-46767.rs b/tests/rustdoc-html/private/enum-variant-private-46767.rs similarity index 100% rename from tests/rustdoc/private/enum-variant-private-46767.rs rename to tests/rustdoc-html/private/enum-variant-private-46767.rs diff --git a/tests/rustdoc/private/files-creation-private.rs b/tests/rustdoc-html/private/files-creation-private.rs similarity index 100% rename from tests/rustdoc/private/files-creation-private.rs rename to tests/rustdoc-html/private/files-creation-private.rs diff --git a/tests/rustdoc/private/hidden-private.rs b/tests/rustdoc-html/private/hidden-private.rs similarity index 100% rename from tests/rustdoc/private/hidden-private.rs rename to tests/rustdoc-html/private/hidden-private.rs diff --git a/tests/rustdoc/private/inline-private-with-intermediate-doc-hidden.rs b/tests/rustdoc-html/private/inline-private-with-intermediate-doc-hidden.rs similarity index 100% rename from tests/rustdoc/private/inline-private-with-intermediate-doc-hidden.rs rename to tests/rustdoc-html/private/inline-private-with-intermediate-doc-hidden.rs diff --git a/tests/rustdoc/private/inner-private-110422.rs b/tests/rustdoc-html/private/inner-private-110422.rs similarity index 100% rename from tests/rustdoc/private/inner-private-110422.rs rename to tests/rustdoc-html/private/inner-private-110422.rs diff --git a/tests/rustdoc/private/macro-document-private-duplicate.rs b/tests/rustdoc-html/private/macro-document-private-duplicate.rs similarity index 100% rename from tests/rustdoc/private/macro-document-private-duplicate.rs rename to tests/rustdoc-html/private/macro-document-private-duplicate.rs diff --git a/tests/rustdoc/private/macro-document-private.rs b/tests/rustdoc-html/private/macro-document-private.rs similarity index 100% rename from tests/rustdoc/private/macro-document-private.rs rename to tests/rustdoc-html/private/macro-document-private.rs diff --git a/tests/rustdoc/private/macro-private-not-documented.rs b/tests/rustdoc-html/private/macro-private-not-documented.rs similarity index 100% rename from tests/rustdoc/private/macro-private-not-documented.rs rename to tests/rustdoc-html/private/macro-private-not-documented.rs diff --git a/tests/rustdoc/private/missing-private-inlining-109258.rs b/tests/rustdoc-html/private/missing-private-inlining-109258.rs similarity index 100% rename from tests/rustdoc/private/missing-private-inlining-109258.rs rename to tests/rustdoc-html/private/missing-private-inlining-109258.rs diff --git a/tests/rustdoc/private/private-fields-tuple-struct.rs b/tests/rustdoc-html/private/private-fields-tuple-struct.rs similarity index 100% rename from tests/rustdoc/private/private-fields-tuple-struct.rs rename to tests/rustdoc-html/private/private-fields-tuple-struct.rs diff --git a/tests/rustdoc/private/private-non-local-fields-2.rs b/tests/rustdoc-html/private/private-non-local-fields-2.rs similarity index 100% rename from tests/rustdoc/private/private-non-local-fields-2.rs rename to tests/rustdoc-html/private/private-non-local-fields-2.rs diff --git a/tests/rustdoc/private/private-non-local-fields.rs b/tests/rustdoc-html/private/private-non-local-fields.rs similarity index 100% rename from tests/rustdoc/private/private-non-local-fields.rs rename to tests/rustdoc-html/private/private-non-local-fields.rs diff --git a/tests/rustdoc/private/private-type-alias.rs b/tests/rustdoc-html/private/private-type-alias.rs similarity index 100% rename from tests/rustdoc/private/private-type-alias.rs rename to tests/rustdoc-html/private/private-type-alias.rs diff --git a/tests/rustdoc/private/private-type-cycle-110629.rs b/tests/rustdoc-html/private/private-type-cycle-110629.rs similarity index 100% rename from tests/rustdoc/private/private-type-cycle-110629.rs rename to tests/rustdoc-html/private/private-type-cycle-110629.rs diff --git a/tests/rustdoc/private/private-use-decl-macro-47038.rs b/tests/rustdoc-html/private/private-use-decl-macro-47038.rs similarity index 100% rename from tests/rustdoc/private/private-use-decl-macro-47038.rs rename to tests/rustdoc-html/private/private-use-decl-macro-47038.rs diff --git a/tests/rustdoc/private/private-use.rs b/tests/rustdoc-html/private/private-use.rs similarity index 100% rename from tests/rustdoc/private/private-use.rs rename to tests/rustdoc-html/private/private-use.rs diff --git a/tests/rustdoc/private/public-impl-mention-private-generic-46380-2.rs b/tests/rustdoc-html/private/public-impl-mention-private-generic-46380-2.rs similarity index 100% rename from tests/rustdoc/private/public-impl-mention-private-generic-46380-2.rs rename to tests/rustdoc-html/private/public-impl-mention-private-generic-46380-2.rs diff --git a/tests/rustdoc/private/traits-in-bodies-private.rs b/tests/rustdoc-html/private/traits-in-bodies-private.rs similarity index 100% rename from tests/rustdoc/private/traits-in-bodies-private.rs rename to tests/rustdoc-html/private/traits-in-bodies-private.rs diff --git a/tests/rustdoc/process-termination.rs b/tests/rustdoc-html/process-termination.rs similarity index 100% rename from tests/rustdoc/process-termination.rs rename to tests/rustdoc-html/process-termination.rs diff --git a/tests/rustdoc/pub-method.rs b/tests/rustdoc-html/pub-method.rs similarity index 100% rename from tests/rustdoc/pub-method.rs rename to tests/rustdoc-html/pub-method.rs diff --git a/tests/rustdoc/pub-use-loop-107350.rs b/tests/rustdoc-html/pub-use-loop-107350.rs similarity index 100% rename from tests/rustdoc/pub-use-loop-107350.rs rename to tests/rustdoc-html/pub-use-loop-107350.rs diff --git a/tests/rustdoc/pub-use-root-path-95873.rs b/tests/rustdoc-html/pub-use-root-path-95873.rs similarity index 100% rename from tests/rustdoc/pub-use-root-path-95873.rs rename to tests/rustdoc-html/pub-use-root-path-95873.rs diff --git a/tests/rustdoc/range-arg-pattern.rs b/tests/rustdoc-html/range-arg-pattern.rs similarity index 100% rename from tests/rustdoc/range-arg-pattern.rs rename to tests/rustdoc-html/range-arg-pattern.rs diff --git a/tests/rustdoc/raw-ident-eliminate-r-hashtag.rs b/tests/rustdoc-html/raw-ident-eliminate-r-hashtag.rs similarity index 100% rename from tests/rustdoc/raw-ident-eliminate-r-hashtag.rs rename to tests/rustdoc-html/raw-ident-eliminate-r-hashtag.rs diff --git a/tests/rustdoc/read-more-unneeded.rs b/tests/rustdoc-html/read-more-unneeded.rs similarity index 100% rename from tests/rustdoc/read-more-unneeded.rs rename to tests/rustdoc-html/read-more-unneeded.rs diff --git a/tests/rustdoc/recursion1.rs b/tests/rustdoc-html/recursion1.rs similarity index 100% rename from tests/rustdoc/recursion1.rs rename to tests/rustdoc-html/recursion1.rs diff --git a/tests/rustdoc/recursion2.rs b/tests/rustdoc-html/recursion2.rs similarity index 100% rename from tests/rustdoc/recursion2.rs rename to tests/rustdoc-html/recursion2.rs diff --git a/tests/rustdoc/recursion3.rs b/tests/rustdoc-html/recursion3.rs similarity index 100% rename from tests/rustdoc/recursion3.rs rename to tests/rustdoc-html/recursion3.rs diff --git a/tests/rustdoc/redirect-map-empty.rs b/tests/rustdoc-html/redirect-map-empty.rs similarity index 100% rename from tests/rustdoc/redirect-map-empty.rs rename to tests/rustdoc-html/redirect-map-empty.rs diff --git a/tests/rustdoc/redirect-map.rs b/tests/rustdoc-html/redirect-map.rs similarity index 100% rename from tests/rustdoc/redirect-map.rs rename to tests/rustdoc-html/redirect-map.rs diff --git a/tests/rustdoc/redirect-rename.rs b/tests/rustdoc-html/redirect-rename.rs similarity index 100% rename from tests/rustdoc/redirect-rename.rs rename to tests/rustdoc-html/redirect-rename.rs diff --git a/tests/rustdoc/redirect.rs b/tests/rustdoc-html/redirect.rs similarity index 100% rename from tests/rustdoc/redirect.rs rename to tests/rustdoc-html/redirect.rs diff --git a/tests/rustdoc/reexport/alias-reexport.rs b/tests/rustdoc-html/reexport/alias-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/alias-reexport.rs rename to tests/rustdoc-html/reexport/alias-reexport.rs diff --git a/tests/rustdoc/reexport/alias-reexport2.rs b/tests/rustdoc-html/reexport/alias-reexport2.rs similarity index 100% rename from tests/rustdoc/reexport/alias-reexport2.rs rename to tests/rustdoc-html/reexport/alias-reexport2.rs diff --git a/tests/rustdoc/reexport/anonymous-reexport-108931.rs b/tests/rustdoc-html/reexport/anonymous-reexport-108931.rs similarity index 100% rename from tests/rustdoc/reexport/anonymous-reexport-108931.rs rename to tests/rustdoc-html/reexport/anonymous-reexport-108931.rs diff --git a/tests/rustdoc/reexport/anonymous-reexport.rs b/tests/rustdoc-html/reexport/anonymous-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/anonymous-reexport.rs rename to tests/rustdoc-html/reexport/anonymous-reexport.rs diff --git a/tests/rustdoc/reexport/auxiliary/alias-reexport.rs b/tests/rustdoc-html/reexport/auxiliary/alias-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/alias-reexport.rs rename to tests/rustdoc-html/reexport/auxiliary/alias-reexport.rs diff --git a/tests/rustdoc/reexport/auxiliary/alias-reexport2.rs b/tests/rustdoc-html/reexport/auxiliary/alias-reexport2.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/alias-reexport2.rs rename to tests/rustdoc-html/reexport/auxiliary/alias-reexport2.rs diff --git a/tests/rustdoc/reexport/auxiliary/all-item-types.rs b/tests/rustdoc-html/reexport/auxiliary/all-item-types.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/all-item-types.rs rename to tests/rustdoc-html/reexport/auxiliary/all-item-types.rs diff --git a/tests/rustdoc/reexport/auxiliary/issue-28927-1.rs b/tests/rustdoc-html/reexport/auxiliary/issue-28927-1.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/issue-28927-1.rs rename to tests/rustdoc-html/reexport/auxiliary/issue-28927-1.rs diff --git a/tests/rustdoc/reexport/auxiliary/issue-28927-2.rs b/tests/rustdoc-html/reexport/auxiliary/issue-28927-2.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/issue-28927-2.rs rename to tests/rustdoc-html/reexport/auxiliary/issue-28927-2.rs diff --git a/tests/rustdoc/reexport/auxiliary/primitive-reexport.rs b/tests/rustdoc-html/reexport/auxiliary/primitive-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/primitive-reexport.rs rename to tests/rustdoc-html/reexport/auxiliary/primitive-reexport.rs diff --git a/tests/rustdoc/reexport/auxiliary/reexport-check.rs b/tests/rustdoc-html/reexport/auxiliary/reexport-check.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/reexport-check.rs rename to tests/rustdoc-html/reexport/auxiliary/reexport-check.rs diff --git a/tests/rustdoc/reexport/auxiliary/reexport-doc-aux.rs b/tests/rustdoc-html/reexport/auxiliary/reexport-doc-aux.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/reexport-doc-aux.rs rename to tests/rustdoc-html/reexport/auxiliary/reexport-doc-aux.rs diff --git a/tests/rustdoc/reexport/auxiliary/reexports.rs b/tests/rustdoc-html/reexport/auxiliary/reexports.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/reexports.rs rename to tests/rustdoc-html/reexport/auxiliary/reexports.rs diff --git a/tests/rustdoc/reexport/auxiliary/wrap-unnamable-type.rs b/tests/rustdoc-html/reexport/auxiliary/wrap-unnamable-type.rs similarity index 100% rename from tests/rustdoc/reexport/auxiliary/wrap-unnamable-type.rs rename to tests/rustdoc-html/reexport/auxiliary/wrap-unnamable-type.rs diff --git a/tests/rustdoc/reexport/blanket-reexport-item.rs b/tests/rustdoc-html/reexport/blanket-reexport-item.rs similarity index 100% rename from tests/rustdoc/reexport/blanket-reexport-item.rs rename to tests/rustdoc-html/reexport/blanket-reexport-item.rs diff --git a/tests/rustdoc/reexport/cfg_doc_reexport.rs b/tests/rustdoc-html/reexport/cfg_doc_reexport.rs similarity index 100% rename from tests/rustdoc/reexport/cfg_doc_reexport.rs rename to tests/rustdoc-html/reexport/cfg_doc_reexport.rs diff --git a/tests/rustdoc/reexport/doc-hidden-reexports-109449.rs b/tests/rustdoc-html/reexport/doc-hidden-reexports-109449.rs similarity index 100% rename from tests/rustdoc/reexport/doc-hidden-reexports-109449.rs rename to tests/rustdoc-html/reexport/doc-hidden-reexports-109449.rs diff --git a/tests/rustdoc/reexport/duplicated-glob-reexport-60522.rs b/tests/rustdoc-html/reexport/duplicated-glob-reexport-60522.rs similarity index 100% rename from tests/rustdoc/reexport/duplicated-glob-reexport-60522.rs rename to tests/rustdoc-html/reexport/duplicated-glob-reexport-60522.rs diff --git a/tests/rustdoc/reexport/enum-variant-reexport-35488.rs b/tests/rustdoc-html/reexport/enum-variant-reexport-35488.rs similarity index 100% rename from tests/rustdoc/reexport/enum-variant-reexport-35488.rs rename to tests/rustdoc-html/reexport/enum-variant-reexport-35488.rs diff --git a/tests/rustdoc/reexport/enum-variant.rs b/tests/rustdoc-html/reexport/enum-variant.rs similarity index 100% rename from tests/rustdoc/reexport/enum-variant.rs rename to tests/rustdoc-html/reexport/enum-variant.rs diff --git a/tests/rustdoc/reexport/extern-135092.rs b/tests/rustdoc-html/reexport/extern-135092.rs similarity index 100% rename from tests/rustdoc/reexport/extern-135092.rs rename to tests/rustdoc-html/reexport/extern-135092.rs diff --git a/tests/rustdoc/reexport/foreigntype-reexport.rs b/tests/rustdoc-html/reexport/foreigntype-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/foreigntype-reexport.rs rename to tests/rustdoc-html/reexport/foreigntype-reexport.rs diff --git a/tests/rustdoc/reexport/glob-reexport-attribute-merge-120487.rs b/tests/rustdoc-html/reexport/glob-reexport-attribute-merge-120487.rs similarity index 100% rename from tests/rustdoc/reexport/glob-reexport-attribute-merge-120487.rs rename to tests/rustdoc-html/reexport/glob-reexport-attribute-merge-120487.rs diff --git a/tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs b/tests/rustdoc-html/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs similarity index 100% rename from tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs rename to tests/rustdoc-html/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs diff --git a/tests/rustdoc/reexport/ice-reexport-crate-root-28927.rs b/tests/rustdoc-html/reexport/ice-reexport-crate-root-28927.rs similarity index 100% rename from tests/rustdoc/reexport/ice-reexport-crate-root-28927.rs rename to tests/rustdoc-html/reexport/ice-reexport-crate-root-28927.rs diff --git a/tests/rustdoc/reexport/import_trait_associated_functions.rs b/tests/rustdoc-html/reexport/import_trait_associated_functions.rs similarity index 100% rename from tests/rustdoc/reexport/import_trait_associated_functions.rs rename to tests/rustdoc-html/reexport/import_trait_associated_functions.rs diff --git a/tests/rustdoc/reexport/local-reexport-doc.rs b/tests/rustdoc-html/reexport/local-reexport-doc.rs similarity index 100% rename from tests/rustdoc/reexport/local-reexport-doc.rs rename to tests/rustdoc-html/reexport/local-reexport-doc.rs diff --git a/tests/rustdoc/reexport/merge-glob-and-non-glob.rs b/tests/rustdoc-html/reexport/merge-glob-and-non-glob.rs similarity index 100% rename from tests/rustdoc/reexport/merge-glob-and-non-glob.rs rename to tests/rustdoc-html/reexport/merge-glob-and-non-glob.rs diff --git a/tests/rustdoc/reexport/no-compiler-reexport.rs b/tests/rustdoc-html/reexport/no-compiler-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/no-compiler-reexport.rs rename to tests/rustdoc-html/reexport/no-compiler-reexport.rs diff --git a/tests/rustdoc/reexport/overlapping-reexport-105735-2.rs b/tests/rustdoc-html/reexport/overlapping-reexport-105735-2.rs similarity index 100% rename from tests/rustdoc/reexport/overlapping-reexport-105735-2.rs rename to tests/rustdoc-html/reexport/overlapping-reexport-105735-2.rs diff --git a/tests/rustdoc/reexport/overlapping-reexport-105735.rs b/tests/rustdoc-html/reexport/overlapping-reexport-105735.rs similarity index 100% rename from tests/rustdoc/reexport/overlapping-reexport-105735.rs rename to tests/rustdoc-html/reexport/overlapping-reexport-105735.rs diff --git a/tests/rustdoc/reexport/primitive-reexport.rs b/tests/rustdoc-html/reexport/primitive-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/primitive-reexport.rs rename to tests/rustdoc-html/reexport/primitive-reexport.rs diff --git a/tests/rustdoc/reexport/private-mod-override-reexport.rs b/tests/rustdoc-html/reexport/private-mod-override-reexport.rs similarity index 100% rename from tests/rustdoc/reexport/private-mod-override-reexport.rs rename to tests/rustdoc-html/reexport/private-mod-override-reexport.rs diff --git a/tests/rustdoc/reexport/pub-reexport-of-pub-reexport-46506.rs b/tests/rustdoc-html/reexport/pub-reexport-of-pub-reexport-46506.rs similarity index 100% rename from tests/rustdoc/reexport/pub-reexport-of-pub-reexport-46506.rs rename to tests/rustdoc-html/reexport/pub-reexport-of-pub-reexport-46506.rs diff --git a/tests/rustdoc/reexport/reexport-attr-merge.rs b/tests/rustdoc-html/reexport/reexport-attr-merge.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-attr-merge.rs rename to tests/rustdoc-html/reexport/reexport-attr-merge.rs diff --git a/tests/rustdoc/reexport/reexport-cfg.rs b/tests/rustdoc-html/reexport/reexport-cfg.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-cfg.rs rename to tests/rustdoc-html/reexport/reexport-cfg.rs diff --git a/tests/rustdoc/reexport/reexport-check.rs b/tests/rustdoc-html/reexport/reexport-check.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-check.rs rename to tests/rustdoc-html/reexport/reexport-check.rs diff --git a/tests/rustdoc/reexport/reexport-dep-foreign-fn.rs b/tests/rustdoc-html/reexport/reexport-dep-foreign-fn.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-dep-foreign-fn.rs rename to tests/rustdoc-html/reexport/reexport-dep-foreign-fn.rs diff --git a/tests/rustdoc/reexport/reexport-doc-hidden-inside-private.rs b/tests/rustdoc-html/reexport/reexport-doc-hidden-inside-private.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-doc-hidden-inside-private.rs rename to tests/rustdoc-html/reexport/reexport-doc-hidden-inside-private.rs diff --git a/tests/rustdoc/reexport/reexport-doc-hidden.rs b/tests/rustdoc-html/reexport/reexport-doc-hidden.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-doc-hidden.rs rename to tests/rustdoc-html/reexport/reexport-doc-hidden.rs diff --git a/tests/rustdoc/reexport/reexport-doc.rs b/tests/rustdoc-html/reexport/reexport-doc.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-doc.rs rename to tests/rustdoc-html/reexport/reexport-doc.rs diff --git a/tests/rustdoc/reexport/reexport-hidden-macro.rs b/tests/rustdoc-html/reexport/reexport-hidden-macro.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-hidden-macro.rs rename to tests/rustdoc-html/reexport/reexport-hidden-macro.rs diff --git a/tests/rustdoc/reexport/reexport-macro.rs b/tests/rustdoc-html/reexport/reexport-macro.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-macro.rs rename to tests/rustdoc-html/reexport/reexport-macro.rs diff --git a/tests/rustdoc/reexport/reexport-of-doc-hidden.rs b/tests/rustdoc-html/reexport/reexport-of-doc-hidden.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-of-doc-hidden.rs rename to tests/rustdoc-html/reexport/reexport-of-doc-hidden.rs diff --git a/tests/rustdoc/reexport/reexport-of-reexport-108679.rs b/tests/rustdoc-html/reexport/reexport-of-reexport-108679.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-of-reexport-108679.rs rename to tests/rustdoc-html/reexport/reexport-of-reexport-108679.rs diff --git a/tests/rustdoc/reexport/reexport-stability-tags-deprecated-and-portability.rs b/tests/rustdoc-html/reexport/reexport-stability-tags-deprecated-and-portability.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-stability-tags-deprecated-and-portability.rs rename to tests/rustdoc-html/reexport/reexport-stability-tags-deprecated-and-portability.rs diff --git a/tests/rustdoc/reexport/reexport-stability-tags-unstable-and-portability.rs b/tests/rustdoc-html/reexport/reexport-stability-tags-unstable-and-portability.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-stability-tags-unstable-and-portability.rs rename to tests/rustdoc-html/reexport/reexport-stability-tags-unstable-and-portability.rs diff --git a/tests/rustdoc/reexport/reexport-trait-from-hidden-111064-2.rs b/tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064-2.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-trait-from-hidden-111064-2.rs rename to tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064-2.rs diff --git a/tests/rustdoc/reexport/reexport-trait-from-hidden-111064.rs b/tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064.rs similarity index 100% rename from tests/rustdoc/reexport/reexport-trait-from-hidden-111064.rs rename to tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064.rs diff --git a/tests/rustdoc/reexport/reexports-of-same-name.rs b/tests/rustdoc-html/reexport/reexports-of-same-name.rs similarity index 100% rename from tests/rustdoc/reexport/reexports-of-same-name.rs rename to tests/rustdoc-html/reexport/reexports-of-same-name.rs diff --git a/tests/rustdoc/reexport/reexports-priv.rs b/tests/rustdoc-html/reexport/reexports-priv.rs similarity index 100% rename from tests/rustdoc/reexport/reexports-priv.rs rename to tests/rustdoc-html/reexport/reexports-priv.rs diff --git a/tests/rustdoc/reexport/reexports.rs b/tests/rustdoc-html/reexport/reexports.rs similarity index 100% rename from tests/rustdoc/reexport/reexports.rs rename to tests/rustdoc-html/reexport/reexports.rs diff --git a/tests/rustdoc/reexport/wrapped-unnamble-type-143222.rs b/tests/rustdoc-html/reexport/wrapped-unnamble-type-143222.rs similarity index 100% rename from tests/rustdoc/reexport/wrapped-unnamble-type-143222.rs rename to tests/rustdoc-html/reexport/wrapped-unnamble-type-143222.rs diff --git a/tests/rustdoc/remove-duplicates.rs b/tests/rustdoc-html/remove-duplicates.rs similarity index 100% rename from tests/rustdoc/remove-duplicates.rs rename to tests/rustdoc-html/remove-duplicates.rs diff --git a/tests/rustdoc/remove-url-from-headings.rs b/tests/rustdoc-html/remove-url-from-headings.rs similarity index 100% rename from tests/rustdoc/remove-url-from-headings.rs rename to tests/rustdoc-html/remove-url-from-headings.rs diff --git a/tests/rustdoc/repr.rs b/tests/rustdoc-html/repr.rs similarity index 100% rename from tests/rustdoc/repr.rs rename to tests/rustdoc-html/repr.rs diff --git a/tests/rustdoc/resolve-ice-124363.rs b/tests/rustdoc-html/resolve-ice-124363.rs similarity index 100% rename from tests/rustdoc/resolve-ice-124363.rs rename to tests/rustdoc-html/resolve-ice-124363.rs diff --git a/tests/rustdoc/return-type-notation.rs b/tests/rustdoc-html/return-type-notation.rs similarity index 100% rename from tests/rustdoc/return-type-notation.rs rename to tests/rustdoc-html/return-type-notation.rs diff --git a/tests/rustdoc/safe-intrinsic.rs b/tests/rustdoc-html/safe-intrinsic.rs similarity index 100% rename from tests/rustdoc/safe-intrinsic.rs rename to tests/rustdoc-html/safe-intrinsic.rs diff --git a/tests/rustdoc/sanitizer-option.rs b/tests/rustdoc-html/sanitizer-option.rs similarity index 100% rename from tests/rustdoc/sanitizer-option.rs rename to tests/rustdoc-html/sanitizer-option.rs diff --git a/tests/rustdoc/search-index-summaries.rs b/tests/rustdoc-html/search-index-summaries.rs similarity index 100% rename from tests/rustdoc/search-index-summaries.rs rename to tests/rustdoc-html/search-index-summaries.rs diff --git a/tests/rustdoc/search-index.rs b/tests/rustdoc-html/search-index.rs similarity index 100% rename from tests/rustdoc/search-index.rs rename to tests/rustdoc-html/search-index.rs diff --git a/tests/rustdoc/short-docblock-codeblock.rs b/tests/rustdoc-html/short-docblock-codeblock.rs similarity index 100% rename from tests/rustdoc/short-docblock-codeblock.rs rename to tests/rustdoc-html/short-docblock-codeblock.rs diff --git a/tests/rustdoc/short-docblock.rs b/tests/rustdoc-html/short-docblock.rs similarity index 100% rename from tests/rustdoc/short-docblock.rs rename to tests/rustdoc-html/short-docblock.rs diff --git a/tests/rustdoc/short-line.md b/tests/rustdoc-html/short-line.md similarity index 100% rename from tests/rustdoc/short-line.md rename to tests/rustdoc-html/short-line.md diff --git a/tests/rustdoc/sidebar/module.rs b/tests/rustdoc-html/sidebar/module.rs similarity index 100% rename from tests/rustdoc/sidebar/module.rs rename to tests/rustdoc-html/sidebar/module.rs diff --git a/tests/rustdoc/sidebar/sidebar-all-page.rs b/tests/rustdoc-html/sidebar/sidebar-all-page.rs similarity index 100% rename from tests/rustdoc/sidebar/sidebar-all-page.rs rename to tests/rustdoc-html/sidebar/sidebar-all-page.rs diff --git a/tests/rustdoc/sidebar/sidebar-items.rs b/tests/rustdoc-html/sidebar/sidebar-items.rs similarity index 100% rename from tests/rustdoc/sidebar/sidebar-items.rs rename to tests/rustdoc-html/sidebar/sidebar-items.rs diff --git a/tests/rustdoc/sidebar/sidebar-link-generation.rs b/tests/rustdoc-html/sidebar/sidebar-link-generation.rs similarity index 100% rename from tests/rustdoc/sidebar/sidebar-link-generation.rs rename to tests/rustdoc-html/sidebar/sidebar-link-generation.rs diff --git a/tests/rustdoc/sidebar/sidebar-links-to-foreign-impl.rs b/tests/rustdoc-html/sidebar/sidebar-links-to-foreign-impl.rs similarity index 100% rename from tests/rustdoc/sidebar/sidebar-links-to-foreign-impl.rs rename to tests/rustdoc-html/sidebar/sidebar-links-to-foreign-impl.rs diff --git a/tests/rustdoc/sidebar/top-toc-html.rs b/tests/rustdoc-html/sidebar/top-toc-html.rs similarity index 100% rename from tests/rustdoc/sidebar/top-toc-html.rs rename to tests/rustdoc-html/sidebar/top-toc-html.rs diff --git a/tests/rustdoc/sidebar/top-toc-idmap.rs b/tests/rustdoc-html/sidebar/top-toc-idmap.rs similarity index 100% rename from tests/rustdoc/sidebar/top-toc-idmap.rs rename to tests/rustdoc-html/sidebar/top-toc-idmap.rs diff --git a/tests/rustdoc/sidebar/top-toc-nil.rs b/tests/rustdoc-html/sidebar/top-toc-nil.rs similarity index 100% rename from tests/rustdoc/sidebar/top-toc-nil.rs rename to tests/rustdoc-html/sidebar/top-toc-nil.rs diff --git a/tests/rustdoc/sized_trait.rs b/tests/rustdoc-html/sized_trait.rs similarity index 100% rename from tests/rustdoc/sized_trait.rs rename to tests/rustdoc-html/sized_trait.rs diff --git a/tests/rustdoc/slice-links.link_box_generic.html b/tests/rustdoc-html/slice-links.link_box_generic.html similarity index 100% rename from tests/rustdoc/slice-links.link_box_generic.html rename to tests/rustdoc-html/slice-links.link_box_generic.html diff --git a/tests/rustdoc/slice-links.link_box_u32.html b/tests/rustdoc-html/slice-links.link_box_u32.html similarity index 100% rename from tests/rustdoc/slice-links.link_box_u32.html rename to tests/rustdoc-html/slice-links.link_box_u32.html diff --git a/tests/rustdoc/slice-links.link_slice_generic.html b/tests/rustdoc-html/slice-links.link_slice_generic.html similarity index 100% rename from tests/rustdoc/slice-links.link_slice_generic.html rename to tests/rustdoc-html/slice-links.link_slice_generic.html diff --git a/tests/rustdoc/slice-links.link_slice_u32.html b/tests/rustdoc-html/slice-links.link_slice_u32.html similarity index 100% rename from tests/rustdoc/slice-links.link_slice_u32.html rename to tests/rustdoc-html/slice-links.link_slice_u32.html diff --git a/tests/rustdoc/slice-links.rs b/tests/rustdoc-html/slice-links.rs similarity index 100% rename from tests/rustdoc/slice-links.rs rename to tests/rustdoc-html/slice-links.rs diff --git a/tests/rustdoc/smart-punct.rs b/tests/rustdoc-html/smart-punct.rs similarity index 100% rename from tests/rustdoc/smart-punct.rs rename to tests/rustdoc-html/smart-punct.rs diff --git a/tests/rustdoc/smoke.rs b/tests/rustdoc-html/smoke.rs similarity index 100% rename from tests/rustdoc/smoke.rs rename to tests/rustdoc-html/smoke.rs diff --git a/tests/rustdoc/sort-53812.rs b/tests/rustdoc-html/sort-53812.rs similarity index 100% rename from tests/rustdoc/sort-53812.rs rename to tests/rustdoc-html/sort-53812.rs diff --git a/tests/rustdoc/sort-modules-by-appearance.rs b/tests/rustdoc-html/sort-modules-by-appearance.rs similarity index 100% rename from tests/rustdoc/sort-modules-by-appearance.rs rename to tests/rustdoc-html/sort-modules-by-appearance.rs diff --git a/tests/rustdoc/source-code-pages/assoc-type-source-link.rs b/tests/rustdoc-html/source-code-pages/assoc-type-source-link.rs similarity index 100% rename from tests/rustdoc/source-code-pages/assoc-type-source-link.rs rename to tests/rustdoc-html/source-code-pages/assoc-type-source-link.rs diff --git a/tests/rustdoc/source-code-pages/auxiliary/issue-26606-macro.rs b/tests/rustdoc-html/source-code-pages/auxiliary/issue-26606-macro.rs similarity index 100% rename from tests/rustdoc/source-code-pages/auxiliary/issue-26606-macro.rs rename to tests/rustdoc-html/source-code-pages/auxiliary/issue-26606-macro.rs diff --git a/tests/rustdoc/source-code-pages/auxiliary/issue-34274.rs b/tests/rustdoc-html/source-code-pages/auxiliary/issue-34274.rs similarity index 100% rename from tests/rustdoc/source-code-pages/auxiliary/issue-34274.rs rename to tests/rustdoc-html/source-code-pages/auxiliary/issue-34274.rs diff --git a/tests/rustdoc/source-code-pages/auxiliary/source-code-bar.rs b/tests/rustdoc-html/source-code-pages/auxiliary/source-code-bar.rs similarity index 100% rename from tests/rustdoc/source-code-pages/auxiliary/source-code-bar.rs rename to tests/rustdoc-html/source-code-pages/auxiliary/source-code-bar.rs diff --git a/tests/rustdoc/source-code-pages/auxiliary/source_code.rs b/tests/rustdoc-html/source-code-pages/auxiliary/source_code.rs similarity index 100% rename from tests/rustdoc/source-code-pages/auxiliary/source_code.rs rename to tests/rustdoc-html/source-code-pages/auxiliary/source_code.rs diff --git a/tests/rustdoc/source-code-pages/auxiliary/src-links-external.rs b/tests/rustdoc-html/source-code-pages/auxiliary/src-links-external.rs similarity index 100% rename from tests/rustdoc/source-code-pages/auxiliary/src-links-external.rs rename to tests/rustdoc-html/source-code-pages/auxiliary/src-links-external.rs diff --git a/tests/rustdoc/source-code-pages/check-source-code-urls-to-def-std.rs b/tests/rustdoc-html/source-code-pages/check-source-code-urls-to-def-std.rs similarity index 100% rename from tests/rustdoc/source-code-pages/check-source-code-urls-to-def-std.rs rename to tests/rustdoc-html/source-code-pages/check-source-code-urls-to-def-std.rs diff --git a/tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs b/tests/rustdoc-html/source-code-pages/check-source-code-urls-to-def.rs similarity index 100% rename from tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs rename to tests/rustdoc-html/source-code-pages/check-source-code-urls-to-def.rs diff --git a/tests/rustdoc/source-code-pages/doc-hidden-source.rs b/tests/rustdoc-html/source-code-pages/doc-hidden-source.rs similarity index 100% rename from tests/rustdoc/source-code-pages/doc-hidden-source.rs rename to tests/rustdoc-html/source-code-pages/doc-hidden-source.rs diff --git a/tests/rustdoc/source-code-pages/failing-expansion-on-wrong-macro.rs b/tests/rustdoc-html/source-code-pages/failing-expansion-on-wrong-macro.rs similarity index 100% rename from tests/rustdoc/source-code-pages/failing-expansion-on-wrong-macro.rs rename to tests/rustdoc-html/source-code-pages/failing-expansion-on-wrong-macro.rs diff --git a/tests/rustdoc/source-code-pages/frontmatter.rs b/tests/rustdoc-html/source-code-pages/frontmatter.rs similarity index 100% rename from tests/rustdoc/source-code-pages/frontmatter.rs rename to tests/rustdoc-html/source-code-pages/frontmatter.rs diff --git a/tests/rustdoc/source-code-pages/html-no-source.rs b/tests/rustdoc-html/source-code-pages/html-no-source.rs similarity index 100% rename from tests/rustdoc/source-code-pages/html-no-source.rs rename to tests/rustdoc-html/source-code-pages/html-no-source.rs diff --git a/tests/rustdoc/source-code-pages/keyword-macros.rs b/tests/rustdoc-html/source-code-pages/keyword-macros.rs similarity index 100% rename from tests/rustdoc/source-code-pages/keyword-macros.rs rename to tests/rustdoc-html/source-code-pages/keyword-macros.rs diff --git a/tests/rustdoc/source-code-pages/shebang.rs b/tests/rustdoc-html/source-code-pages/shebang.rs similarity index 100% rename from tests/rustdoc/source-code-pages/shebang.rs rename to tests/rustdoc-html/source-code-pages/shebang.rs diff --git a/tests/rustdoc/source-code-pages/source-code-highlight.rs b/tests/rustdoc-html/source-code-pages/source-code-highlight.rs similarity index 100% rename from tests/rustdoc/source-code-pages/source-code-highlight.rs rename to tests/rustdoc-html/source-code-pages/source-code-highlight.rs diff --git a/tests/rustdoc/source-code-pages/source-file.rs b/tests/rustdoc-html/source-code-pages/source-file.rs similarity index 100% rename from tests/rustdoc/source-code-pages/source-file.rs rename to tests/rustdoc-html/source-code-pages/source-file.rs diff --git a/tests/rustdoc/source-code-pages/source-line-numbers.rs b/tests/rustdoc-html/source-code-pages/source-line-numbers.rs similarity index 100% rename from tests/rustdoc/source-code-pages/source-line-numbers.rs rename to tests/rustdoc-html/source-code-pages/source-line-numbers.rs diff --git a/tests/rustdoc/source-code-pages/source-version-separator.rs b/tests/rustdoc-html/source-code-pages/source-version-separator.rs similarity index 100% rename from tests/rustdoc/source-code-pages/source-version-separator.rs rename to tests/rustdoc-html/source-code-pages/source-version-separator.rs diff --git a/tests/rustdoc/source-code-pages/src-link-external-macro-26606.rs b/tests/rustdoc-html/source-code-pages/src-link-external-macro-26606.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-link-external-macro-26606.rs rename to tests/rustdoc-html/source-code-pages/src-link-external-macro-26606.rs diff --git a/tests/rustdoc/source-code-pages/src-links-auto-impls.rs b/tests/rustdoc-html/source-code-pages/src-links-auto-impls.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links-auto-impls.rs rename to tests/rustdoc-html/source-code-pages/src-links-auto-impls.rs diff --git a/tests/rustdoc/source-code-pages/src-links-external.rs b/tests/rustdoc-html/source-code-pages/src-links-external.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links-external.rs rename to tests/rustdoc-html/source-code-pages/src-links-external.rs diff --git a/tests/rustdoc/source-code-pages/src-links-implementor-43893.rs b/tests/rustdoc-html/source-code-pages/src-links-implementor-43893.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links-implementor-43893.rs rename to tests/rustdoc-html/source-code-pages/src-links-implementor-43893.rs diff --git a/tests/rustdoc/source-code-pages/src-links-inlined-34274.rs b/tests/rustdoc-html/source-code-pages/src-links-inlined-34274.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links-inlined-34274.rs rename to tests/rustdoc-html/source-code-pages/src-links-inlined-34274.rs diff --git a/tests/rustdoc/source-code-pages/src-links.rs b/tests/rustdoc-html/source-code-pages/src-links.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links.rs rename to tests/rustdoc-html/source-code-pages/src-links.rs diff --git a/tests/rustdoc/source-code-pages/src-links/compiletest-ignore-dir b/tests/rustdoc-html/source-code-pages/src-links/compiletest-ignore-dir similarity index 100% rename from tests/rustdoc/source-code-pages/src-links/compiletest-ignore-dir rename to tests/rustdoc-html/source-code-pages/src-links/compiletest-ignore-dir diff --git a/tests/rustdoc/source-code-pages/src-links/fizz.rs b/tests/rustdoc-html/source-code-pages/src-links/fizz.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links/fizz.rs rename to tests/rustdoc-html/source-code-pages/src-links/fizz.rs diff --git a/tests/rustdoc/source-code-pages/src-links/mod.rs b/tests/rustdoc-html/source-code-pages/src-links/mod.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-links/mod.rs rename to tests/rustdoc-html/source-code-pages/src-links/mod.rs diff --git a/tests/rustdoc/source-code-pages/src-mod-path-absolute-26995.rs b/tests/rustdoc-html/source-code-pages/src-mod-path-absolute-26995.rs similarity index 100% rename from tests/rustdoc/source-code-pages/src-mod-path-absolute-26995.rs rename to tests/rustdoc-html/source-code-pages/src-mod-path-absolute-26995.rs diff --git a/tests/rustdoc/source-code-pages/version-separator-without-source.rs b/tests/rustdoc-html/source-code-pages/version-separator-without-source.rs similarity index 100% rename from tests/rustdoc/source-code-pages/version-separator-without-source.rs rename to tests/rustdoc-html/source-code-pages/version-separator-without-source.rs diff --git a/tests/rustdoc/stability.rs b/tests/rustdoc-html/stability.rs similarity index 100% rename from tests/rustdoc/stability.rs rename to tests/rustdoc-html/stability.rs diff --git a/tests/rustdoc/staged-api-deprecated-unstable-32374.rs b/tests/rustdoc-html/staged-api-deprecated-unstable-32374.rs similarity index 100% rename from tests/rustdoc/staged-api-deprecated-unstable-32374.rs rename to tests/rustdoc-html/staged-api-deprecated-unstable-32374.rs diff --git a/tests/rustdoc/staged-api-feature-issue-27759.rs b/tests/rustdoc-html/staged-api-feature-issue-27759.rs similarity index 100% rename from tests/rustdoc/staged-api-feature-issue-27759.rs rename to tests/rustdoc-html/staged-api-feature-issue-27759.rs diff --git a/tests/rustdoc/static-root-path.rs b/tests/rustdoc-html/static-root-path.rs similarity index 100% rename from tests/rustdoc/static-root-path.rs rename to tests/rustdoc-html/static-root-path.rs diff --git a/tests/rustdoc/static.rs b/tests/rustdoc-html/static.rs similarity index 100% rename from tests/rustdoc/static.rs rename to tests/rustdoc-html/static.rs diff --git a/tests/rustdoc/strip-block-doc-comments-stars.docblock.html b/tests/rustdoc-html/strip-block-doc-comments-stars.docblock.html similarity index 100% rename from tests/rustdoc/strip-block-doc-comments-stars.docblock.html rename to tests/rustdoc-html/strip-block-doc-comments-stars.docblock.html diff --git a/tests/rustdoc/strip-block-doc-comments-stars.rs b/tests/rustdoc-html/strip-block-doc-comments-stars.rs similarity index 100% rename from tests/rustdoc/strip-block-doc-comments-stars.rs rename to tests/rustdoc-html/strip-block-doc-comments-stars.rs diff --git a/tests/rustdoc/strip-priv-imports-pass-27104.rs b/tests/rustdoc-html/strip-priv-imports-pass-27104.rs similarity index 100% rename from tests/rustdoc/strip-priv-imports-pass-27104.rs rename to tests/rustdoc-html/strip-priv-imports-pass-27104.rs diff --git a/tests/rustdoc/struct-arg-pattern.rs b/tests/rustdoc-html/struct-arg-pattern.rs similarity index 100% rename from tests/rustdoc/struct-arg-pattern.rs rename to tests/rustdoc-html/struct-arg-pattern.rs diff --git a/tests/rustdoc/struct-field.rs b/tests/rustdoc-html/struct-field.rs similarity index 100% rename from tests/rustdoc/struct-field.rs rename to tests/rustdoc-html/struct-field.rs diff --git a/tests/rustdoc/structfields.rs b/tests/rustdoc-html/structfields.rs similarity index 100% rename from tests/rustdoc/structfields.rs rename to tests/rustdoc-html/structfields.rs diff --git a/tests/rustdoc/summary-codeblock-31899.rs b/tests/rustdoc-html/summary-codeblock-31899.rs similarity index 100% rename from tests/rustdoc/summary-codeblock-31899.rs rename to tests/rustdoc-html/summary-codeblock-31899.rs diff --git a/tests/rustdoc/summary-header-46377.rs b/tests/rustdoc-html/summary-header-46377.rs similarity index 100% rename from tests/rustdoc/summary-header-46377.rs rename to tests/rustdoc-html/summary-header-46377.rs diff --git a/tests/rustdoc/summary-reference-link-30366.rs b/tests/rustdoc-html/summary-reference-link-30366.rs similarity index 100% rename from tests/rustdoc/summary-reference-link-30366.rs rename to tests/rustdoc-html/summary-reference-link-30366.rs diff --git a/tests/rustdoc/synthetic_auto/auto-trait-lifetimes-56822.rs b/tests/rustdoc-html/synthetic_auto/auto-trait-lifetimes-56822.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/auto-trait-lifetimes-56822.rs rename to tests/rustdoc-html/synthetic_auto/auto-trait-lifetimes-56822.rs diff --git a/tests/rustdoc/synthetic_auto/basic.rs b/tests/rustdoc-html/synthetic_auto/basic.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/basic.rs rename to tests/rustdoc-html/synthetic_auto/basic.rs diff --git a/tests/rustdoc/synthetic_auto/bounds.rs b/tests/rustdoc-html/synthetic_auto/bounds.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/bounds.rs rename to tests/rustdoc-html/synthetic_auto/bounds.rs diff --git a/tests/rustdoc/synthetic_auto/complex.rs b/tests/rustdoc-html/synthetic_auto/complex.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/complex.rs rename to tests/rustdoc-html/synthetic_auto/complex.rs diff --git a/tests/rustdoc/synthetic_auto/crate-local.rs b/tests/rustdoc-html/synthetic_auto/crate-local.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/crate-local.rs rename to tests/rustdoc-html/synthetic_auto/crate-local.rs diff --git a/tests/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs b/tests/rustdoc-html/synthetic_auto/issue-72213-projection-lifetime.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs rename to tests/rustdoc-html/synthetic_auto/issue-72213-projection-lifetime.rs diff --git a/tests/rustdoc/synthetic_auto/lifetimes.rs b/tests/rustdoc-html/synthetic_auto/lifetimes.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/lifetimes.rs rename to tests/rustdoc-html/synthetic_auto/lifetimes.rs diff --git a/tests/rustdoc/synthetic_auto/manual.rs b/tests/rustdoc-html/synthetic_auto/manual.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/manual.rs rename to tests/rustdoc-html/synthetic_auto/manual.rs diff --git a/tests/rustdoc/synthetic_auto/negative.rs b/tests/rustdoc-html/synthetic_auto/negative.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/negative.rs rename to tests/rustdoc-html/synthetic_auto/negative.rs diff --git a/tests/rustdoc/synthetic_auto/nested.rs b/tests/rustdoc-html/synthetic_auto/nested.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/nested.rs rename to tests/rustdoc-html/synthetic_auto/nested.rs diff --git a/tests/rustdoc/synthetic_auto/no-redundancy.rs b/tests/rustdoc-html/synthetic_auto/no-redundancy.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/no-redundancy.rs rename to tests/rustdoc-html/synthetic_auto/no-redundancy.rs diff --git a/tests/rustdoc/synthetic_auto/normalize-auto-trait-80233.rs b/tests/rustdoc-html/synthetic_auto/normalize-auto-trait-80233.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/normalize-auto-trait-80233.rs rename to tests/rustdoc-html/synthetic_auto/normalize-auto-trait-80233.rs diff --git a/tests/rustdoc/synthetic_auto/overflow.rs b/tests/rustdoc-html/synthetic_auto/overflow.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/overflow.rs rename to tests/rustdoc-html/synthetic_auto/overflow.rs diff --git a/tests/rustdoc/synthetic_auto/project.rs b/tests/rustdoc-html/synthetic_auto/project.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/project.rs rename to tests/rustdoc-html/synthetic_auto/project.rs diff --git a/tests/rustdoc/synthetic_auto/self-referential.rs b/tests/rustdoc-html/synthetic_auto/self-referential.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/self-referential.rs rename to tests/rustdoc-html/synthetic_auto/self-referential.rs diff --git a/tests/rustdoc/synthetic_auto/send-impl-conditional-60726.rs b/tests/rustdoc-html/synthetic_auto/send-impl-conditional-60726.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/send-impl-conditional-60726.rs rename to tests/rustdoc-html/synthetic_auto/send-impl-conditional-60726.rs diff --git a/tests/rustdoc/synthetic_auto/static-region.rs b/tests/rustdoc-html/synthetic_auto/static-region.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/static-region.rs rename to tests/rustdoc-html/synthetic_auto/static-region.rs diff --git a/tests/rustdoc/synthetic_auto/supertrait-bounds.rs b/tests/rustdoc-html/synthetic_auto/supertrait-bounds.rs similarity index 100% rename from tests/rustdoc/synthetic_auto/supertrait-bounds.rs rename to tests/rustdoc-html/synthetic_auto/supertrait-bounds.rs diff --git a/tests/rustdoc/tab_title.rs b/tests/rustdoc-html/tab_title.rs similarity index 100% rename from tests/rustdoc/tab_title.rs rename to tests/rustdoc-html/tab_title.rs diff --git a/tests/rustdoc/table-in-docblock.rs b/tests/rustdoc-html/table-in-docblock.rs similarity index 100% rename from tests/rustdoc/table-in-docblock.rs rename to tests/rustdoc-html/table-in-docblock.rs diff --git a/tests/rustdoc/target-feature.rs b/tests/rustdoc-html/target-feature.rs similarity index 100% rename from tests/rustdoc/target-feature.rs rename to tests/rustdoc-html/target-feature.rs diff --git a/tests/rustdoc/task-lists.rs b/tests/rustdoc-html/task-lists.rs similarity index 100% rename from tests/rustdoc/task-lists.rs rename to tests/rustdoc-html/task-lists.rs diff --git a/tests/rustdoc/test-lists.rs b/tests/rustdoc-html/test-lists.rs similarity index 100% rename from tests/rustdoc/test-lists.rs rename to tests/rustdoc-html/test-lists.rs diff --git a/tests/rustdoc/test-parens.rs b/tests/rustdoc-html/test-parens.rs similarity index 100% rename from tests/rustdoc/test-parens.rs rename to tests/rustdoc-html/test-parens.rs diff --git a/tests/rustdoc/test-strikethrough.rs b/tests/rustdoc-html/test-strikethrough.rs similarity index 100% rename from tests/rustdoc/test-strikethrough.rs rename to tests/rustdoc-html/test-strikethrough.rs diff --git a/tests/rustdoc/test_option_check/bar.rs b/tests/rustdoc-html/test_option_check/bar.rs similarity index 100% rename from tests/rustdoc/test_option_check/bar.rs rename to tests/rustdoc-html/test_option_check/bar.rs diff --git a/tests/rustdoc/test_option_check/test.rs b/tests/rustdoc-html/test_option_check/test.rs similarity index 100% rename from tests/rustdoc/test_option_check/test.rs rename to tests/rustdoc-html/test_option_check/test.rs diff --git a/tests/rustdoc/thread-local-src.rs b/tests/rustdoc-html/thread-local-src.rs similarity index 100% rename from tests/rustdoc/thread-local-src.rs rename to tests/rustdoc-html/thread-local-src.rs diff --git a/tests/rustdoc/titles.rs b/tests/rustdoc-html/titles.rs similarity index 100% rename from tests/rustdoc/titles.rs rename to tests/rustdoc-html/titles.rs diff --git a/tests/rustdoc/toggle-item-contents.rs b/tests/rustdoc-html/toggle-item-contents.rs similarity index 100% rename from tests/rustdoc/toggle-item-contents.rs rename to tests/rustdoc-html/toggle-item-contents.rs diff --git a/tests/rustdoc/toggle-method.rs b/tests/rustdoc-html/toggle-method.rs similarity index 100% rename from tests/rustdoc/toggle-method.rs rename to tests/rustdoc-html/toggle-method.rs diff --git a/tests/rustdoc/toggle-trait-fn.rs b/tests/rustdoc-html/toggle-trait-fn.rs similarity index 100% rename from tests/rustdoc/toggle-trait-fn.rs rename to tests/rustdoc-html/toggle-trait-fn.rs diff --git a/tests/rustdoc/trait-aliases.rs b/tests/rustdoc-html/trait-aliases.rs similarity index 100% rename from tests/rustdoc/trait-aliases.rs rename to tests/rustdoc-html/trait-aliases.rs diff --git a/tests/rustdoc/trait-item-info.rs b/tests/rustdoc-html/trait-item-info.rs similarity index 100% rename from tests/rustdoc/trait-item-info.rs rename to tests/rustdoc-html/trait-item-info.rs diff --git a/tests/rustdoc/trait-self-link.rs b/tests/rustdoc-html/trait-self-link.rs similarity index 100% rename from tests/rustdoc/trait-self-link.rs rename to tests/rustdoc-html/trait-self-link.rs diff --git a/tests/rustdoc/trait-src-link.rs b/tests/rustdoc-html/trait-src-link.rs similarity index 100% rename from tests/rustdoc/trait-src-link.rs rename to tests/rustdoc-html/trait-src-link.rs diff --git a/tests/rustdoc/trait-visibility.rs b/tests/rustdoc-html/trait-visibility.rs similarity index 100% rename from tests/rustdoc/trait-visibility.rs rename to tests/rustdoc-html/trait-visibility.rs diff --git a/tests/rustdoc/traits-in-bodies.rs b/tests/rustdoc-html/traits-in-bodies.rs similarity index 100% rename from tests/rustdoc/traits-in-bodies.rs rename to tests/rustdoc-html/traits-in-bodies.rs diff --git a/tests/rustdoc/tuple-struct-fields-doc.rs b/tests/rustdoc-html/tuple-struct-fields-doc.rs similarity index 100% rename from tests/rustdoc/tuple-struct-fields-doc.rs rename to tests/rustdoc-html/tuple-struct-fields-doc.rs diff --git a/tests/rustdoc/tuple-struct-where-clause-34928.rs b/tests/rustdoc-html/tuple-struct-where-clause-34928.rs similarity index 100% rename from tests/rustdoc/tuple-struct-where-clause-34928.rs rename to tests/rustdoc-html/tuple-struct-where-clause-34928.rs diff --git a/tests/rustdoc/tuples.link1_i32.html b/tests/rustdoc-html/tuples.link1_i32.html similarity index 100% rename from tests/rustdoc/tuples.link1_i32.html rename to tests/rustdoc-html/tuples.link1_i32.html diff --git a/tests/rustdoc/tuples.link1_t.html b/tests/rustdoc-html/tuples.link1_t.html similarity index 100% rename from tests/rustdoc/tuples.link1_t.html rename to tests/rustdoc-html/tuples.link1_t.html diff --git a/tests/rustdoc/tuples.link2_i32.html b/tests/rustdoc-html/tuples.link2_i32.html similarity index 100% rename from tests/rustdoc/tuples.link2_i32.html rename to tests/rustdoc-html/tuples.link2_i32.html diff --git a/tests/rustdoc/tuples.link2_t.html b/tests/rustdoc-html/tuples.link2_t.html similarity index 100% rename from tests/rustdoc/tuples.link2_t.html rename to tests/rustdoc-html/tuples.link2_t.html diff --git a/tests/rustdoc/tuples.link2_tu.html b/tests/rustdoc-html/tuples.link2_tu.html similarity index 100% rename from tests/rustdoc/tuples.link2_tu.html rename to tests/rustdoc-html/tuples.link2_tu.html diff --git a/tests/rustdoc/tuples.link_unit.html b/tests/rustdoc-html/tuples.link_unit.html similarity index 100% rename from tests/rustdoc/tuples.link_unit.html rename to tests/rustdoc-html/tuples.link_unit.html diff --git a/tests/rustdoc/tuples.rs b/tests/rustdoc-html/tuples.rs similarity index 100% rename from tests/rustdoc/tuples.rs rename to tests/rustdoc-html/tuples.rs diff --git a/tests/rustdoc/type-alias/auxiliary/parent-crate-115718.rs b/tests/rustdoc-html/type-alias/auxiliary/parent-crate-115718.rs similarity index 100% rename from tests/rustdoc/type-alias/auxiliary/parent-crate-115718.rs rename to tests/rustdoc-html/type-alias/auxiliary/parent-crate-115718.rs diff --git a/tests/rustdoc/type-alias/cross-crate-115718.rs b/tests/rustdoc-html/type-alias/cross-crate-115718.rs similarity index 100% rename from tests/rustdoc/type-alias/cross-crate-115718.rs rename to tests/rustdoc-html/type-alias/cross-crate-115718.rs diff --git a/tests/rustdoc/type-alias/deeply-nested-112515.rs b/tests/rustdoc-html/type-alias/deeply-nested-112515.rs similarity index 100% rename from tests/rustdoc/type-alias/deeply-nested-112515.rs rename to tests/rustdoc-html/type-alias/deeply-nested-112515.rs diff --git a/tests/rustdoc/type-alias/deref-32077.rs b/tests/rustdoc-html/type-alias/deref-32077.rs similarity index 100% rename from tests/rustdoc/type-alias/deref-32077.rs rename to tests/rustdoc-html/type-alias/deref-32077.rs diff --git a/tests/rustdoc/type-alias/impl_trait_in_assoc_type.rs b/tests/rustdoc-html/type-alias/impl_trait_in_assoc_type.rs similarity index 100% rename from tests/rustdoc/type-alias/impl_trait_in_assoc_type.rs rename to tests/rustdoc-html/type-alias/impl_trait_in_assoc_type.rs diff --git a/tests/rustdoc/type-alias/primitive-local-link-121106.rs b/tests/rustdoc-html/type-alias/primitive-local-link-121106.rs similarity index 100% rename from tests/rustdoc/type-alias/primitive-local-link-121106.rs rename to tests/rustdoc-html/type-alias/primitive-local-link-121106.rs diff --git a/tests/rustdoc/type-alias/repr.rs b/tests/rustdoc-html/type-alias/repr.rs similarity index 100% rename from tests/rustdoc/type-alias/repr.rs rename to tests/rustdoc-html/type-alias/repr.rs diff --git a/tests/rustdoc/type-alias/same-crate-115718.rs b/tests/rustdoc-html/type-alias/same-crate-115718.rs similarity index 100% rename from tests/rustdoc/type-alias/same-crate-115718.rs rename to tests/rustdoc-html/type-alias/same-crate-115718.rs diff --git a/tests/rustdoc/type-layout-flag-required.rs b/tests/rustdoc-html/type-layout-flag-required.rs similarity index 100% rename from tests/rustdoc/type-layout-flag-required.rs rename to tests/rustdoc-html/type-layout-flag-required.rs diff --git a/tests/rustdoc/type-layout.rs b/tests/rustdoc-html/type-layout.rs similarity index 100% rename from tests/rustdoc/type-layout.rs rename to tests/rustdoc-html/type-layout.rs diff --git a/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs b/tests/rustdoc-html/typedef-inner-variants-lazy_type_alias.rs similarity index 100% rename from tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs rename to tests/rustdoc-html/typedef-inner-variants-lazy_type_alias.rs diff --git a/tests/rustdoc/typedef-inner-variants.rs b/tests/rustdoc-html/typedef-inner-variants.rs similarity index 100% rename from tests/rustdoc/typedef-inner-variants.rs rename to tests/rustdoc-html/typedef-inner-variants.rs diff --git a/tests/rustdoc/typedef.rs b/tests/rustdoc-html/typedef.rs similarity index 100% rename from tests/rustdoc/typedef.rs rename to tests/rustdoc-html/typedef.rs diff --git a/tests/rustdoc/underscore-import-61592.rs b/tests/rustdoc-html/underscore-import-61592.rs similarity index 100% rename from tests/rustdoc/underscore-import-61592.rs rename to tests/rustdoc-html/underscore-import-61592.rs diff --git a/tests/rustdoc/unindent.md b/tests/rustdoc-html/unindent.md similarity index 100% rename from tests/rustdoc/unindent.md rename to tests/rustdoc-html/unindent.md diff --git a/tests/rustdoc/unindent.rs b/tests/rustdoc-html/unindent.rs similarity index 100% rename from tests/rustdoc/unindent.rs rename to tests/rustdoc-html/unindent.rs diff --git a/tests/rustdoc/union-fields-html.rs b/tests/rustdoc-html/union-fields-html.rs similarity index 100% rename from tests/rustdoc/union-fields-html.rs rename to tests/rustdoc-html/union-fields-html.rs diff --git a/tests/rustdoc/union.rs b/tests/rustdoc-html/union.rs similarity index 100% rename from tests/rustdoc/union.rs rename to tests/rustdoc-html/union.rs diff --git a/tests/rustdoc/unit-return.rs b/tests/rustdoc-html/unit-return.rs similarity index 100% rename from tests/rustdoc/unit-return.rs rename to tests/rustdoc-html/unit-return.rs diff --git a/tests/rustdoc/unsafe-binder.rs b/tests/rustdoc-html/unsafe-binder.rs similarity index 100% rename from tests/rustdoc/unsafe-binder.rs rename to tests/rustdoc-html/unsafe-binder.rs diff --git a/tests/rustdoc/use-attr.rs b/tests/rustdoc-html/use-attr.rs similarity index 100% rename from tests/rustdoc/use-attr.rs rename to tests/rustdoc-html/use-attr.rs diff --git a/tests/rustdoc/useless_lifetime_bound.rs b/tests/rustdoc-html/useless_lifetime_bound.rs similarity index 100% rename from tests/rustdoc/useless_lifetime_bound.rs rename to tests/rustdoc-html/useless_lifetime_bound.rs diff --git a/tests/rustdoc/variadic.rs b/tests/rustdoc-html/variadic.rs similarity index 100% rename from tests/rustdoc/variadic.rs rename to tests/rustdoc-html/variadic.rs diff --git a/tests/rustdoc/viewpath-rename.rs b/tests/rustdoc-html/viewpath-rename.rs similarity index 100% rename from tests/rustdoc/viewpath-rename.rs rename to tests/rustdoc-html/viewpath-rename.rs diff --git a/tests/rustdoc/viewpath-self.rs b/tests/rustdoc-html/viewpath-self.rs similarity index 100% rename from tests/rustdoc/viewpath-self.rs rename to tests/rustdoc-html/viewpath-self.rs diff --git a/tests/rustdoc/visibility.rs b/tests/rustdoc-html/visibility.rs similarity index 100% rename from tests/rustdoc/visibility.rs rename to tests/rustdoc-html/visibility.rs diff --git a/tests/rustdoc/where-clause-order.rs b/tests/rustdoc-html/where-clause-order.rs similarity index 100% rename from tests/rustdoc/where-clause-order.rs rename to tests/rustdoc-html/where-clause-order.rs diff --git a/tests/rustdoc/where-sized.rs b/tests/rustdoc-html/where-sized.rs similarity index 100% rename from tests/rustdoc/where-sized.rs rename to tests/rustdoc-html/where-sized.rs diff --git a/tests/rustdoc/where.SWhere_Echo_impl.html b/tests/rustdoc-html/where.SWhere_Echo_impl.html similarity index 100% rename from tests/rustdoc/where.SWhere_Echo_impl.html rename to tests/rustdoc-html/where.SWhere_Echo_impl.html diff --git a/tests/rustdoc/where.SWhere_Simd_item-decl.html b/tests/rustdoc-html/where.SWhere_Simd_item-decl.html similarity index 100% rename from tests/rustdoc/where.SWhere_Simd_item-decl.html rename to tests/rustdoc-html/where.SWhere_Simd_item-decl.html diff --git a/tests/rustdoc/where.SWhere_TraitWhere_item-decl.html b/tests/rustdoc-html/where.SWhere_TraitWhere_item-decl.html similarity index 100% rename from tests/rustdoc/where.SWhere_TraitWhere_item-decl.html rename to tests/rustdoc-html/where.SWhere_TraitWhere_item-decl.html diff --git a/tests/rustdoc/where.alpha_trait_decl.html b/tests/rustdoc-html/where.alpha_trait_decl.html similarity index 100% rename from tests/rustdoc/where.alpha_trait_decl.html rename to tests/rustdoc-html/where.alpha_trait_decl.html diff --git a/tests/rustdoc/where.bravo_trait_decl.html b/tests/rustdoc-html/where.bravo_trait_decl.html similarity index 100% rename from tests/rustdoc/where.bravo_trait_decl.html rename to tests/rustdoc-html/where.bravo_trait_decl.html diff --git a/tests/rustdoc/where.charlie_fn_decl.html b/tests/rustdoc-html/where.charlie_fn_decl.html similarity index 100% rename from tests/rustdoc/where.charlie_fn_decl.html rename to tests/rustdoc-html/where.charlie_fn_decl.html diff --git a/tests/rustdoc/where.golf_type_alias_decl.html b/tests/rustdoc-html/where.golf_type_alias_decl.html similarity index 100% rename from tests/rustdoc/where.golf_type_alias_decl.html rename to tests/rustdoc-html/where.golf_type_alias_decl.html diff --git a/tests/rustdoc/where.rs b/tests/rustdoc-html/where.rs similarity index 100% rename from tests/rustdoc/where.rs rename to tests/rustdoc-html/where.rs diff --git a/tests/rustdoc/whitespace-after-where-clause.enum.html b/tests/rustdoc-html/whitespace-after-where-clause.enum.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.enum.html rename to tests/rustdoc-html/whitespace-after-where-clause.enum.html diff --git a/tests/rustdoc/whitespace-after-where-clause.enum2.html b/tests/rustdoc-html/whitespace-after-where-clause.enum2.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.enum2.html rename to tests/rustdoc-html/whitespace-after-where-clause.enum2.html diff --git a/tests/rustdoc/whitespace-after-where-clause.rs b/tests/rustdoc-html/whitespace-after-where-clause.rs similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.rs rename to tests/rustdoc-html/whitespace-after-where-clause.rs diff --git a/tests/rustdoc/whitespace-after-where-clause.struct.html b/tests/rustdoc-html/whitespace-after-where-clause.struct.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.struct.html rename to tests/rustdoc-html/whitespace-after-where-clause.struct.html diff --git a/tests/rustdoc/whitespace-after-where-clause.struct2.html b/tests/rustdoc-html/whitespace-after-where-clause.struct2.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.struct2.html rename to tests/rustdoc-html/whitespace-after-where-clause.struct2.html diff --git a/tests/rustdoc/whitespace-after-where-clause.trait.html b/tests/rustdoc-html/whitespace-after-where-clause.trait.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.trait.html rename to tests/rustdoc-html/whitespace-after-where-clause.trait.html diff --git a/tests/rustdoc/whitespace-after-where-clause.trait2.html b/tests/rustdoc-html/whitespace-after-where-clause.trait2.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.trait2.html rename to tests/rustdoc-html/whitespace-after-where-clause.trait2.html diff --git a/tests/rustdoc/whitespace-after-where-clause.union.html b/tests/rustdoc-html/whitespace-after-where-clause.union.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.union.html rename to tests/rustdoc-html/whitespace-after-where-clause.union.html diff --git a/tests/rustdoc/whitespace-after-where-clause.union2.html b/tests/rustdoc-html/whitespace-after-where-clause.union2.html similarity index 100% rename from tests/rustdoc/whitespace-after-where-clause.union2.html rename to tests/rustdoc-html/whitespace-after-where-clause.union2.html diff --git a/tests/rustdoc/without-redirect.rs b/tests/rustdoc-html/without-redirect.rs similarity index 100% rename from tests/rustdoc/without-redirect.rs rename to tests/rustdoc-html/without-redirect.rs diff --git a/tests/rustdoc/wrapping.rs b/tests/rustdoc-html/wrapping.rs similarity index 100% rename from tests/rustdoc/wrapping.rs rename to tests/rustdoc-html/wrapping.rs diff --git a/tests/rustdoc-ui/associated-constant-not-allowed-102467.rs b/tests/rustdoc-ui/associated-constant-not-allowed-102467.rs index c4bbcfc2b077..5b8a90d64121 100644 --- a/tests/rustdoc-ui/associated-constant-not-allowed-102467.rs +++ b/tests/rustdoc-ui/associated-constant-not-allowed-102467.rs @@ -2,7 +2,7 @@ // It ensures that the expected error is displayed. #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] trait T { type A: S = 34>; diff --git a/tests/ui-fulldeps/lexer/unicode-version.rs b/tests/ui-fulldeps/lexer/unicode-version.rs index cd02b952895c..a924f9241649 100644 --- a/tests/ui-fulldeps/lexer/unicode-version.rs +++ b/tests/ui-fulldeps/lexer/unicode-version.rs @@ -12,7 +12,6 @@ #![feature(rustc_private)] extern crate rustc_driver; -extern crate rustc_lexer; extern crate rustc_parse; fn main() { @@ -22,6 +21,5 @@ fn main() { it should also be updated in the reference at \ https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md." ); - println!("Unicode XID version is: {:?}", rustc_lexer::UNICODE_XID_VERSION); - println!("Unicode normalization version is: {:?}", rustc_parse::UNICODE_NORMALIZATION_VERSION); + println!("Unicode version used in rustc_parse is: {:?}", rustc_parse::UNICODE_VERSION); } diff --git a/tests/ui-fulldeps/lexer/unicode-version.run.stdout b/tests/ui-fulldeps/lexer/unicode-version.run.stdout index f32c8365cdf3..327b08997034 100644 --- a/tests/ui-fulldeps/lexer/unicode-version.run.stdout +++ b/tests/ui-fulldeps/lexer/unicode-version.run.stdout @@ -1,4 +1,3 @@ Checking if Unicode version changed. If the Unicode version changes are intentional, it should also be updated in the reference at https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md. -Unicode XID version is: (16, 0, 0) -Unicode normalization version is: (16, 0, 0) +Unicode version used in rustc_parse is: (17, 0, 0) diff --git a/tests/ui/README.md b/tests/ui/README.md index da9be2e209ac..4c91f313a735 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -328,7 +328,7 @@ Tests for crate resolution and loading behavior, including `extern crate` declar ## `tests/ui/cross/`: Various tests related to the concept of "cross" -**FIXME**: The unifying topic of these tests appears to be that their filenames begin with the word "cross". The similarities end there - one test is about "cross-borrowing" a `Box` into `&T`, while another is about a global trait used "across" files. Some of these terminology are really outdated and does not match the current terminology. Additionally, "cross" is also way too generic, it's easy to confuse with cross-compile. +**FIXME**: The unifying topic of these tests appears to be that their filenames begin with the word "cross". The similarities end there - one test is about "cross-borrowing" a `Box` into `&T`, while another is about a global trait used "across" files. Some of this terminology is really outdated and does not match the current terminology. Additionally, "cross" is also way too generic, it's easy to confuse with cross-compile. ## `tests/ui/cross-crate/`: Cross-Crate Interaction @@ -380,12 +380,6 @@ These tests use the unstable command line option `query-dep-graph` to examine th Tests for `#[deprecated]` attribute and `deprecated_in_future` internal lint. -## `tests/ui/deref-patterns/`: `#![feature(deref_patterns)]` and `#![feature(string_deref_patterns)]` - -Tests for `#![feature(deref_patterns)]` and `#![feature(string_deref_patterns)]`. See [Deref patterns | The Unstable book](https://doc.rust-lang.org/nightly/unstable-book/language-features/deref-patterns.html). - -**FIXME**: May have some overlap with `tests/ui/pattern/deref-patterns`. - ## `tests/ui/derived-errors/`: Derived Error Messages Tests for quality of diagnostics involving suppression of cascading errors in some cases to avoid overwhelming the user. @@ -911,7 +905,7 @@ Something is missing which could be added to fix (e.g. suggestions). Tests for checking missing trait bounds, and their diagnostics. -**FIMXE**: Maybe a subdirectory of `ui/trait-bounds` would be more appropriate. +**FIXME**: Maybe a subdirectory of `ui/trait-bounds` would be more appropriate. ## `tests/ui/modules/` @@ -957,7 +951,7 @@ Despite the size of the directory, this is a single test, spawning a sprawling ` A very similar principle as `non_modrs_mods`, but with an added inline `mod` statement inside another `mod`'s code block. -**FXIME**: Consider merge with `tests/ui/modules/`, keeping the directory structure. +**FIXME**: Consider merge with `tests/ui/modules/`, keeping the directory structure. ## `tests/ui/no_std/` diff --git a/tests/ui/abi/cannot-be-called.amdgpu.stderr b/tests/ui/abi/cannot-be-called.amdgpu.stderr new file mode 100644 index 000000000000..039e2d7b4f00 --- /dev/null +++ b/tests/ui/abi/cannot-be-called.amdgpu.stderr @@ -0,0 +1,87 @@ +error[E0570]: "msp430-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:43:8 + | +LL | extern "msp430-interrupt" fn msp430() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0570]: "avr-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:45:8 + | +LL | extern "avr-interrupt" fn avr() {} + | ^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:47:8 + | +LL | extern "riscv-interrupt-m" fn riscv_m() {} + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:49:8 + | +LL | extern "riscv-interrupt-s" fn riscv_s() {} + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "x86-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:51:8 + | +LL | extern "x86-interrupt" fn x86(_x: *const u8) {} + | ^^^^^^^^^^^^^^^ + +error[E0570]: "avr-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:76:22 + | +LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { + | ^^^^^^^^^^^^^^^ + +error[E0570]: "msp430-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:82:25 + | +LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { + | ^^^^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:88:26 + | +LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:94:26 + | +LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "x86-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:100:22 + | +LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { + | ^^^^^^^^^^^^^^^ + +error: functions with the "gpu-kernel" ABI cannot be called + --> $DIR/cannot-be-called.rs:70:5 + | +LL | gpu_kernel(); + | ^^^^^^^^^^^^ + | +note: an `extern "gpu-kernel"` function must be launched on the GPU by the runtime + --> $DIR/cannot-be-called.rs:70:5 + | +LL | gpu_kernel(); + | ^^^^^^^^^^^^ + +error: functions with the "gpu-kernel" ABI cannot be called + --> $DIR/cannot-be-called.rs:108:5 + | +LL | f() + | ^^^ + | +note: an `extern "gpu-kernel"` function must be launched on the GPU by the runtime + --> $DIR/cannot-be-called.rs:108:5 + | +LL | f() + | ^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.avr.stderr b/tests/ui/abi/cannot-be-called.avr.stderr index 2128991d83cd..752292a58705 100644 --- a/tests/ui/abi/cannot-be-called.avr.stderr +++ b/tests/ui/abi/cannot-be-called.avr.stderr @@ -1,75 +1,87 @@ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:38:8 + --> $DIR/cannot-be-called.rs:43:8 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:42:8 + --> $DIR/cannot-be-called.rs:47:8 | LL | extern "riscv-interrupt-m" fn riscv_m() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:44:8 + --> $DIR/cannot-be-called.rs:49:8 | LL | extern "riscv-interrupt-s" fn riscv_s() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:46:8 + --> $DIR/cannot-be-called.rs:51:8 | LL | extern "x86-interrupt" fn x86(_x: *const u8) {} | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:73:25 + --> $DIR/cannot-be-called.rs:82:25 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:79:26 + --> $DIR/cannot-be-called.rs:88:26 | LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:85:26 + --> $DIR/cannot-be-called.rs:94:26 | LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:91:22 + --> $DIR/cannot-be-called.rs:100:22 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "avr-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:53:5 + --> $DIR/cannot-be-called.rs:60:5 | LL | avr(); | ^^^^^ | note: an `extern "avr-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:53:5 + --> $DIR/cannot-be-called.rs:60:5 | LL | avr(); | ^^^^^ error: functions with the "avr-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:69:5 + --> $DIR/cannot-be-called.rs:78:5 | LL | f() | ^^^ | note: an `extern "avr-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:69:5 + --> $DIR/cannot-be-called.rs:78:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.i686.stderr b/tests/ui/abi/cannot-be-called.i686.stderr index 9b1755921aea..30e294ad61ec 100644 --- a/tests/ui/abi/cannot-be-called.i686.stderr +++ b/tests/ui/abi/cannot-be-called.i686.stderr @@ -1,75 +1,87 @@ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:38:8 + --> $DIR/cannot-be-called.rs:43:8 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:40:8 + --> $DIR/cannot-be-called.rs:45:8 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:42:8 + --> $DIR/cannot-be-called.rs:47:8 | LL | extern "riscv-interrupt-m" fn riscv_m() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:44:8 + --> $DIR/cannot-be-called.rs:49:8 | LL | extern "riscv-interrupt-s" fn riscv_s() {} | ^^^^^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:67:22 + --> $DIR/cannot-be-called.rs:76:22 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:73:25 + --> $DIR/cannot-be-called.rs:82:25 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:79:26 + --> $DIR/cannot-be-called.rs:88:26 | LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:85:26 + --> $DIR/cannot-be-called.rs:94:26 | LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ^^^^^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "x86-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:61:5 + --> $DIR/cannot-be-called.rs:68:5 | LL | x86(&raw const BYTE); | ^^^^^^^^^^^^^^^^^^^^ | note: an `extern "x86-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:61:5 + --> $DIR/cannot-be-called.rs:68:5 | LL | x86(&raw const BYTE); | ^^^^^^^^^^^^^^^^^^^^ error: functions with the "x86-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:93:5 + --> $DIR/cannot-be-called.rs:102:5 | LL | f() | ^^^ | note: an `extern "x86-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:93:5 + --> $DIR/cannot-be-called.rs:102:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.msp430.stderr b/tests/ui/abi/cannot-be-called.msp430.stderr index 9a047b11cf79..12ab88bc858b 100644 --- a/tests/ui/abi/cannot-be-called.msp430.stderr +++ b/tests/ui/abi/cannot-be-called.msp430.stderr @@ -1,75 +1,87 @@ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:40:8 + --> $DIR/cannot-be-called.rs:45:8 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:42:8 + --> $DIR/cannot-be-called.rs:47:8 | LL | extern "riscv-interrupt-m" fn riscv_m() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:44:8 + --> $DIR/cannot-be-called.rs:49:8 | LL | extern "riscv-interrupt-s" fn riscv_s() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:46:8 + --> $DIR/cannot-be-called.rs:51:8 | LL | extern "x86-interrupt" fn x86(_x: *const u8) {} | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:67:22 + --> $DIR/cannot-be-called.rs:76:22 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:79:26 + --> $DIR/cannot-be-called.rs:88:26 | LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:85:26 + --> $DIR/cannot-be-called.rs:94:26 | LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:91:22 + --> $DIR/cannot-be-called.rs:100:22 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "msp430-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:55:5 + --> $DIR/cannot-be-called.rs:62:5 | LL | msp430(); | ^^^^^^^^ | note: an `extern "msp430-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:55:5 + --> $DIR/cannot-be-called.rs:62:5 | LL | msp430(); | ^^^^^^^^ error: functions with the "msp430-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:75:5 + --> $DIR/cannot-be-called.rs:84:5 | LL | f() | ^^^ | note: an `extern "msp430-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:75:5 + --> $DIR/cannot-be-called.rs:84:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.nvptx.stderr b/tests/ui/abi/cannot-be-called.nvptx.stderr new file mode 100644 index 000000000000..039e2d7b4f00 --- /dev/null +++ b/tests/ui/abi/cannot-be-called.nvptx.stderr @@ -0,0 +1,87 @@ +error[E0570]: "msp430-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:43:8 + | +LL | extern "msp430-interrupt" fn msp430() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0570]: "avr-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:45:8 + | +LL | extern "avr-interrupt" fn avr() {} + | ^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:47:8 + | +LL | extern "riscv-interrupt-m" fn riscv_m() {} + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:49:8 + | +LL | extern "riscv-interrupt-s" fn riscv_s() {} + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "x86-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:51:8 + | +LL | extern "x86-interrupt" fn x86(_x: *const u8) {} + | ^^^^^^^^^^^^^^^ + +error[E0570]: "avr-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:76:22 + | +LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { + | ^^^^^^^^^^^^^^^ + +error[E0570]: "msp430-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:82:25 + | +LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { + | ^^^^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:88:26 + | +LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:94:26 + | +LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0570]: "x86-interrupt" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:100:22 + | +LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { + | ^^^^^^^^^^^^^^^ + +error: functions with the "gpu-kernel" ABI cannot be called + --> $DIR/cannot-be-called.rs:70:5 + | +LL | gpu_kernel(); + | ^^^^^^^^^^^^ + | +note: an `extern "gpu-kernel"` function must be launched on the GPU by the runtime + --> $DIR/cannot-be-called.rs:70:5 + | +LL | gpu_kernel(); + | ^^^^^^^^^^^^ + +error: functions with the "gpu-kernel" ABI cannot be called + --> $DIR/cannot-be-called.rs:108:5 + | +LL | f() + | ^^^ + | +note: an `extern "gpu-kernel"` function must be launched on the GPU by the runtime + --> $DIR/cannot-be-called.rs:108:5 + | +LL | f() + | ^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.riscv32.stderr b/tests/ui/abi/cannot-be-called.riscv32.stderr index 135b20c50d58..b1897b74ebbe 100644 --- a/tests/ui/abi/cannot-be-called.riscv32.stderr +++ b/tests/ui/abi/cannot-be-called.riscv32.stderr @@ -1,87 +1,99 @@ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:38:8 + --> $DIR/cannot-be-called.rs:43:8 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:40:8 + --> $DIR/cannot-be-called.rs:45:8 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:46:8 + --> $DIR/cannot-be-called.rs:51:8 | LL | extern "x86-interrupt" fn x86(_x: *const u8) {} | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:67:22 + --> $DIR/cannot-be-called.rs:76:22 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:73:25 + --> $DIR/cannot-be-called.rs:82:25 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:91:22 + --> $DIR/cannot-be-called.rs:100:22 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "riscv-interrupt-m" ABI cannot be called - --> $DIR/cannot-be-called.rs:57:5 + --> $DIR/cannot-be-called.rs:64:5 | LL | riscv_m(); | ^^^^^^^^^ | note: an `extern "riscv-interrupt-m"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:57:5 + --> $DIR/cannot-be-called.rs:64:5 | LL | riscv_m(); | ^^^^^^^^^ error: functions with the "riscv-interrupt-s" ABI cannot be called - --> $DIR/cannot-be-called.rs:59:5 + --> $DIR/cannot-be-called.rs:66:5 | LL | riscv_s(); | ^^^^^^^^^ | note: an `extern "riscv-interrupt-s"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:59:5 + --> $DIR/cannot-be-called.rs:66:5 | LL | riscv_s(); | ^^^^^^^^^ error: functions with the "riscv-interrupt-m" ABI cannot be called - --> $DIR/cannot-be-called.rs:81:5 + --> $DIR/cannot-be-called.rs:90:5 | LL | f() | ^^^ | note: an `extern "riscv-interrupt-m"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:81:5 + --> $DIR/cannot-be-called.rs:90:5 | LL | f() | ^^^ error: functions with the "riscv-interrupt-s" ABI cannot be called - --> $DIR/cannot-be-called.rs:87:5 + --> $DIR/cannot-be-called.rs:96:5 | LL | f() | ^^^ | note: an `extern "riscv-interrupt-s"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:87:5 + --> $DIR/cannot-be-called.rs:96:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.riscv64.stderr b/tests/ui/abi/cannot-be-called.riscv64.stderr index 135b20c50d58..b1897b74ebbe 100644 --- a/tests/ui/abi/cannot-be-called.riscv64.stderr +++ b/tests/ui/abi/cannot-be-called.riscv64.stderr @@ -1,87 +1,99 @@ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:38:8 + --> $DIR/cannot-be-called.rs:43:8 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:40:8 + --> $DIR/cannot-be-called.rs:45:8 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:46:8 + --> $DIR/cannot-be-called.rs:51:8 | LL | extern "x86-interrupt" fn x86(_x: *const u8) {} | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:67:22 + --> $DIR/cannot-be-called.rs:76:22 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:73:25 + --> $DIR/cannot-be-called.rs:82:25 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^ error[E0570]: "x86-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:91:22 + --> $DIR/cannot-be-called.rs:100:22 | LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "riscv-interrupt-m" ABI cannot be called - --> $DIR/cannot-be-called.rs:57:5 + --> $DIR/cannot-be-called.rs:64:5 | LL | riscv_m(); | ^^^^^^^^^ | note: an `extern "riscv-interrupt-m"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:57:5 + --> $DIR/cannot-be-called.rs:64:5 | LL | riscv_m(); | ^^^^^^^^^ error: functions with the "riscv-interrupt-s" ABI cannot be called - --> $DIR/cannot-be-called.rs:59:5 + --> $DIR/cannot-be-called.rs:66:5 | LL | riscv_s(); | ^^^^^^^^^ | note: an `extern "riscv-interrupt-s"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:59:5 + --> $DIR/cannot-be-called.rs:66:5 | LL | riscv_s(); | ^^^^^^^^^ error: functions with the "riscv-interrupt-m" ABI cannot be called - --> $DIR/cannot-be-called.rs:81:5 + --> $DIR/cannot-be-called.rs:90:5 | LL | f() | ^^^ | note: an `extern "riscv-interrupt-m"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:81:5 + --> $DIR/cannot-be-called.rs:90:5 | LL | f() | ^^^ error: functions with the "riscv-interrupt-s" ABI cannot be called - --> $DIR/cannot-be-called.rs:87:5 + --> $DIR/cannot-be-called.rs:96:5 | LL | f() | ^^^ | note: an `extern "riscv-interrupt-s"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:87:5 + --> $DIR/cannot-be-called.rs:96:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.rs b/tests/ui/abi/cannot-be-called.rs index 315ea1601633..8d1a4ae0b557 100644 --- a/tests/ui/abi/cannot-be-called.rs +++ b/tests/ui/abi/cannot-be-called.rs @@ -4,7 +4,7 @@ Interrupt ABIs share similar semantics, in that they are special entry-points un So we test that they error in essentially all of the same places. */ //@ add-minicore -//@ revisions: x64 x64_win i686 riscv32 riscv64 avr msp430 +//@ revisions: x64 x64_win i686 riscv32 riscv64 avr msp430 amdgpu nvptx // //@ [x64] needs-llvm-components: x86 //@ [x64] compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib @@ -20,6 +20,10 @@ So we test that they error in essentially all of the same places. //@ [avr] compile-flags: --target=avr-none -C target-cpu=atmega328p --crate-type=rlib //@ [msp430] needs-llvm-components: msp430 //@ [msp430] compile-flags: --target=msp430-none-elf --crate-type=rlib +//@ [amdgpu] needs-llvm-components: amdgpu +//@ [amdgpu] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 --crate-type=rlib +//@ [nvptx] needs-llvm-components: nvptx +//@ [nvptx] compile-flags: --target nvptx64-nvidia-cuda --crate-type=rlib //@ ignore-backends: gcc #![no_core] #![feature( @@ -27,7 +31,8 @@ So we test that they error in essentially all of the same places. abi_msp430_interrupt, abi_avr_interrupt, abi_x86_interrupt, - abi_riscv_interrupt + abi_riscv_interrupt, + abi_gpu_kernel )] extern crate minicore; @@ -36,15 +41,17 @@ use minicore::*; /* extern "interrupt" definition */ extern "msp430-interrupt" fn msp430() {} -//[x64,x64_win,i686,riscv32,riscv64,avr]~^ ERROR is not a supported ABI +//[x64,x64_win,i686,riscv32,riscv64,avr,amdgpu,nvptx]~^ ERROR is not a supported ABI extern "avr-interrupt" fn avr() {} -//[x64,x64_win,i686,riscv32,riscv64,msp430]~^ ERROR is not a supported ABI +//[x64,x64_win,i686,riscv32,riscv64,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI extern "riscv-interrupt-m" fn riscv_m() {} -//[x64,x64_win,i686,avr,msp430]~^ ERROR is not a supported ABI +//[x64,x64_win,i686,avr,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI extern "riscv-interrupt-s" fn riscv_s() {} -//[x64,x64_win,i686,avr,msp430]~^ ERROR is not a supported ABI +//[x64,x64_win,i686,avr,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI extern "x86-interrupt" fn x86(_x: *const u8) {} -//[riscv32,riscv64,avr,msp430]~^ ERROR is not a supported ABI +//[riscv32,riscv64,avr,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI +extern "gpu-kernel" fn gpu_kernel() {} +//[x64,x64_win,i686,riscv32,riscv64,avr,msp430]~^ ERROR is not a supported ABI static BYTE: u8 = 0; @@ -60,36 +67,44 @@ fn call_the_interrupts() { //[riscv32,riscv64]~^ ERROR functions with the "riscv-interrupt-s" ABI cannot be called x86(&raw const BYTE); //[x64,x64_win,i686]~^ ERROR functions with the "x86-interrupt" ABI cannot be called + gpu_kernel(); + //[amdgpu,nvptx]~^ ERROR functions with the "gpu-kernel" ABI cannot be called } /* extern "interrupt" fnptr calls */ fn avr_ptr(f: extern "avr-interrupt" fn()) { - //[x64,x64_win,i686,riscv32,riscv64,msp430]~^ ERROR is not a supported ABI + //[x64,x64_win,i686,riscv32,riscv64,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI f() //[avr]~^ ERROR functions with the "avr-interrupt" ABI cannot be called } fn msp430_ptr(f: extern "msp430-interrupt" fn()) { - //[x64,x64_win,i686,riscv32,riscv64,avr]~^ ERROR is not a supported ABI + //[x64,x64_win,i686,riscv32,riscv64,avr,amdgpu,nvptx]~^ ERROR is not a supported ABI f() //[msp430]~^ ERROR functions with the "msp430-interrupt" ABI cannot be called } fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { - //[x64,x64_win,i686,avr,msp430]~^ ERROR is not a supported ABI + //[x64,x64_win,i686,avr,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI f() //[riscv32,riscv64]~^ ERROR functions with the "riscv-interrupt-m" ABI cannot be called } fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { - //[x64,x64_win,i686,avr,msp430]~^ ERROR is not a supported ABI + //[x64,x64_win,i686,avr,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI f() //[riscv32,riscv64]~^ ERROR functions with the "riscv-interrupt-s" ABI cannot be called } fn x86_ptr(f: extern "x86-interrupt" fn()) { - //[riscv32,riscv64,avr,msp430]~^ ERROR is not a supported ABI + //[riscv32,riscv64,avr,msp430,amdgpu,nvptx]~^ ERROR is not a supported ABI f() //[x64,x64_win,i686]~^ ERROR functions with the "x86-interrupt" ABI cannot be called } + +fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + //[x64,x64_win,i686,riscv32,riscv64,avr,msp430]~^ ERROR is not a supported ABI + f() + //[amdgpu,nvptx]~^ ERROR functions with the "gpu-kernel" ABI cannot be called +} diff --git a/tests/ui/abi/cannot-be-called.x64.stderr b/tests/ui/abi/cannot-be-called.x64.stderr index 9b1755921aea..30e294ad61ec 100644 --- a/tests/ui/abi/cannot-be-called.x64.stderr +++ b/tests/ui/abi/cannot-be-called.x64.stderr @@ -1,75 +1,87 @@ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:38:8 + --> $DIR/cannot-be-called.rs:43:8 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:40:8 + --> $DIR/cannot-be-called.rs:45:8 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:42:8 + --> $DIR/cannot-be-called.rs:47:8 | LL | extern "riscv-interrupt-m" fn riscv_m() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:44:8 + --> $DIR/cannot-be-called.rs:49:8 | LL | extern "riscv-interrupt-s" fn riscv_s() {} | ^^^^^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:67:22 + --> $DIR/cannot-be-called.rs:76:22 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:73:25 + --> $DIR/cannot-be-called.rs:82:25 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:79:26 + --> $DIR/cannot-be-called.rs:88:26 | LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:85:26 + --> $DIR/cannot-be-called.rs:94:26 | LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ^^^^^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "x86-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:61:5 + --> $DIR/cannot-be-called.rs:68:5 | LL | x86(&raw const BYTE); | ^^^^^^^^^^^^^^^^^^^^ | note: an `extern "x86-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:61:5 + --> $DIR/cannot-be-called.rs:68:5 | LL | x86(&raw const BYTE); | ^^^^^^^^^^^^^^^^^^^^ error: functions with the "x86-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:93:5 + --> $DIR/cannot-be-called.rs:102:5 | LL | f() | ^^^ | note: an `extern "x86-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:93:5 + --> $DIR/cannot-be-called.rs:102:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-called.x64_win.stderr b/tests/ui/abi/cannot-be-called.x64_win.stderr index 9b1755921aea..30e294ad61ec 100644 --- a/tests/ui/abi/cannot-be-called.x64_win.stderr +++ b/tests/ui/abi/cannot-be-called.x64_win.stderr @@ -1,75 +1,87 @@ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:38:8 + --> $DIR/cannot-be-called.rs:43:8 | LL | extern "msp430-interrupt" fn msp430() {} | ^^^^^^^^^^^^^^^^^^ error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:40:8 + --> $DIR/cannot-be-called.rs:45:8 | LL | extern "avr-interrupt" fn avr() {} | ^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:42:8 + --> $DIR/cannot-be-called.rs:47:8 | LL | extern "riscv-interrupt-m" fn riscv_m() {} | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:44:8 + --> $DIR/cannot-be-called.rs:49:8 | LL | extern "riscv-interrupt-s" fn riscv_s() {} | ^^^^^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:53:8 + | +LL | extern "gpu-kernel" fn gpu_kernel() {} + | ^^^^^^^^^^^^ + error[E0570]: "avr-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:67:22 + --> $DIR/cannot-be-called.rs:76:22 | LL | fn avr_ptr(f: extern "avr-interrupt" fn()) { | ^^^^^^^^^^^^^^^ error[E0570]: "msp430-interrupt" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:73:25 + --> $DIR/cannot-be-called.rs:82:25 | LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:79:26 + --> $DIR/cannot-be-called.rs:88:26 | LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ^^^^^^^^^^^^^^^^^^^ error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target - --> $DIR/cannot-be-called.rs:85:26 + --> $DIR/cannot-be-called.rs:94:26 | LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ^^^^^^^^^^^^^^^^^^^ +error[E0570]: "gpu-kernel" is not a supported ABI for the current target + --> $DIR/cannot-be-called.rs:106:29 + | +LL | fn gpu_kernel_ptr(f: extern "gpu-kernel" fn()) { + | ^^^^^^^^^^^^ + error: functions with the "x86-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:61:5 + --> $DIR/cannot-be-called.rs:68:5 | LL | x86(&raw const BYTE); | ^^^^^^^^^^^^^^^^^^^^ | note: an `extern "x86-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:61:5 + --> $DIR/cannot-be-called.rs:68:5 | LL | x86(&raw const BYTE); | ^^^^^^^^^^^^^^^^^^^^ error: functions with the "x86-interrupt" ABI cannot be called - --> $DIR/cannot-be-called.rs:93:5 + --> $DIR/cannot-be-called.rs:102:5 | LL | f() | ^^^ | note: an `extern "x86-interrupt"` function can only be called using inline assembly - --> $DIR/cannot-be-called.rs:93:5 + --> $DIR/cannot-be-called.rs:102:5 | LL | f() | ^^^ -error: aborting due to 10 previous errors +error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0570`. diff --git a/tests/ui/abi/cannot-be-coroutine.amdgpu.stderr b/tests/ui/abi/cannot-be-coroutine.amdgpu.stderr new file mode 100644 index 000000000000..a36ea0caa19e --- /dev/null +++ b/tests/ui/abi/cannot-be-coroutine.amdgpu.stderr @@ -0,0 +1,23 @@ +error: functions with the "gpu-kernel" ABI cannot be `async` + --> $DIR/cannot-be-coroutine.rs:62:1 + | +LL | async extern "gpu-kernel" fn async_kernel() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the `async` keyword from this definition + | +LL - async extern "gpu-kernel" fn async_kernel() { +LL + extern "gpu-kernel" fn async_kernel() { + | + +error: requires `ResumeTy` lang_item + --> $DIR/cannot-be-coroutine.rs:38:19 + | +LL | async fn vanilla(){ + | ___________________^ +LL | | +LL | | } + | |_^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/abi/cannot-be-coroutine.avr.stderr b/tests/ui/abi/cannot-be-coroutine.avr.stderr index 11bc93b1eef1..643a575bece1 100644 --- a/tests/ui/abi/cannot-be-coroutine.avr.stderr +++ b/tests/ui/abi/cannot-be-coroutine.avr.stderr @@ -1,5 +1,5 @@ error: functions with the "avr-interrupt" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:37:1 + --> $DIR/cannot-be-coroutine.rs:42:1 | LL | async extern "avr-interrupt" fn avr() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "avr-interrupt" fn avr() { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-be-coroutine.i686.stderr b/tests/ui/abi/cannot-be-coroutine.i686.stderr index 4a344bb09020..f618507df47d 100644 --- a/tests/ui/abi/cannot-be-coroutine.i686.stderr +++ b/tests/ui/abi/cannot-be-coroutine.i686.stderr @@ -1,5 +1,5 @@ error: functions with the "x86-interrupt" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:53:1 + --> $DIR/cannot-be-coroutine.rs:58:1 | LL | async extern "x86-interrupt" fn x86(_p: *mut ()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "x86-interrupt" fn x86(_p: *mut ()) { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-be-coroutine.msp430.stderr b/tests/ui/abi/cannot-be-coroutine.msp430.stderr index c2867705df78..f2586c8cd975 100644 --- a/tests/ui/abi/cannot-be-coroutine.msp430.stderr +++ b/tests/ui/abi/cannot-be-coroutine.msp430.stderr @@ -1,5 +1,5 @@ error: functions with the "msp430-interrupt" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:41:1 + --> $DIR/cannot-be-coroutine.rs:46:1 | LL | async extern "msp430-interrupt" fn msp430() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "msp430-interrupt" fn msp430() { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-be-coroutine.nvptx.stderr b/tests/ui/abi/cannot-be-coroutine.nvptx.stderr new file mode 100644 index 000000000000..a36ea0caa19e --- /dev/null +++ b/tests/ui/abi/cannot-be-coroutine.nvptx.stderr @@ -0,0 +1,23 @@ +error: functions with the "gpu-kernel" ABI cannot be `async` + --> $DIR/cannot-be-coroutine.rs:62:1 + | +LL | async extern "gpu-kernel" fn async_kernel() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove the `async` keyword from this definition + | +LL - async extern "gpu-kernel" fn async_kernel() { +LL + extern "gpu-kernel" fn async_kernel() { + | + +error: requires `ResumeTy` lang_item + --> $DIR/cannot-be-coroutine.rs:38:19 + | +LL | async fn vanilla(){ + | ___________________^ +LL | | +LL | | } + | |_^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/abi/cannot-be-coroutine.riscv32.stderr b/tests/ui/abi/cannot-be-coroutine.riscv32.stderr index 398f888205df..c5a8c3f60a38 100644 --- a/tests/ui/abi/cannot-be-coroutine.riscv32.stderr +++ b/tests/ui/abi/cannot-be-coroutine.riscv32.stderr @@ -1,5 +1,5 @@ error: functions with the "riscv-interrupt-m" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:45:1 + --> $DIR/cannot-be-coroutine.rs:50:1 | LL | async extern "riscv-interrupt-m" fn riscv_m() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "riscv-interrupt-m" fn riscv_m() { | error: functions with the "riscv-interrupt-s" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:49:1 + --> $DIR/cannot-be-coroutine.rs:54:1 | LL | async extern "riscv-interrupt-s" fn riscv_s() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL + extern "riscv-interrupt-s" fn riscv_s() { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-be-coroutine.riscv64.stderr b/tests/ui/abi/cannot-be-coroutine.riscv64.stderr index 398f888205df..c5a8c3f60a38 100644 --- a/tests/ui/abi/cannot-be-coroutine.riscv64.stderr +++ b/tests/ui/abi/cannot-be-coroutine.riscv64.stderr @@ -1,5 +1,5 @@ error: functions with the "riscv-interrupt-m" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:45:1 + --> $DIR/cannot-be-coroutine.rs:50:1 | LL | async extern "riscv-interrupt-m" fn riscv_m() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "riscv-interrupt-m" fn riscv_m() { | error: functions with the "riscv-interrupt-s" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:49:1 + --> $DIR/cannot-be-coroutine.rs:54:1 | LL | async extern "riscv-interrupt-s" fn riscv_s() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL + extern "riscv-interrupt-s" fn riscv_s() { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-be-coroutine.rs b/tests/ui/abi/cannot-be-coroutine.rs index c070e8032e1a..239f5aa5c31f 100644 --- a/tests/ui/abi/cannot-be-coroutine.rs +++ b/tests/ui/abi/cannot-be-coroutine.rs @@ -1,6 +1,6 @@ //@ add-minicore //@ edition: 2021 -//@ revisions: x64 x64_win i686 riscv32 riscv64 avr msp430 +//@ revisions: x64 x64_win i686 riscv32 riscv64 avr msp430 amdgpu nvptx // //@ [x64] needs-llvm-components: x86 //@ [x64] compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib @@ -16,6 +16,10 @@ //@ [avr] compile-flags: --target=avr-none -C target-cpu=atmega328p --crate-type=rlib //@ [msp430] needs-llvm-components: msp430 //@ [msp430] compile-flags: --target=msp430-none-elf --crate-type=rlib +//@ [amdgpu] needs-llvm-components: amdgpu +//@ [amdgpu] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 --crate-type=rlib +//@ [nvptx] needs-llvm-components: nvptx +//@ [nvptx] compile-flags: --target nvptx64-nvidia-cuda --crate-type=rlib //@ ignore-backends: gcc #![no_core] #![feature( @@ -23,7 +27,8 @@ abi_msp430_interrupt, abi_avr_interrupt, abi_x86_interrupt, - abi_riscv_interrupt + abi_riscv_interrupt, + abi_gpu_kernel )] extern crate minicore; @@ -53,3 +58,7 @@ async extern "riscv-interrupt-s" fn riscv_s() { async extern "x86-interrupt" fn x86(_p: *mut ()) { //[x64,x64_win,i686]~^ ERROR functions with the "x86-interrupt" ABI cannot be `async` } + +async extern "gpu-kernel" fn async_kernel() { + //[amdgpu,nvptx]~^ ERROR functions with the "gpu-kernel" ABI cannot be `async` +} diff --git a/tests/ui/abi/cannot-be-coroutine.x64.stderr b/tests/ui/abi/cannot-be-coroutine.x64.stderr index 4a344bb09020..f618507df47d 100644 --- a/tests/ui/abi/cannot-be-coroutine.x64.stderr +++ b/tests/ui/abi/cannot-be-coroutine.x64.stderr @@ -1,5 +1,5 @@ error: functions with the "x86-interrupt" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:53:1 + --> $DIR/cannot-be-coroutine.rs:58:1 | LL | async extern "x86-interrupt" fn x86(_p: *mut ()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "x86-interrupt" fn x86(_p: *mut ()) { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-be-coroutine.x64_win.stderr b/tests/ui/abi/cannot-be-coroutine.x64_win.stderr index 4a344bb09020..f618507df47d 100644 --- a/tests/ui/abi/cannot-be-coroutine.x64_win.stderr +++ b/tests/ui/abi/cannot-be-coroutine.x64_win.stderr @@ -1,5 +1,5 @@ error: functions with the "x86-interrupt" ABI cannot be `async` - --> $DIR/cannot-be-coroutine.rs:53:1 + --> $DIR/cannot-be-coroutine.rs:58:1 | LL | async extern "x86-interrupt" fn x86(_p: *mut ()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL + extern "x86-interrupt" fn x86(_p: *mut ()) { | error: requires `ResumeTy` lang_item - --> $DIR/cannot-be-coroutine.rs:33:19 + --> $DIR/cannot-be-coroutine.rs:38:19 | LL | async fn vanilla(){ | ___________________^ diff --git a/tests/ui/abi/cannot-return.amdgpu.stderr b/tests/ui/abi/cannot-return.amdgpu.stderr new file mode 100644 index 000000000000..f264907d00ec --- /dev/null +++ b/tests/ui/abi/cannot-return.amdgpu.stderr @@ -0,0 +1,15 @@ +error: invalid signature for `extern "gpu-kernel"` function + --> $DIR/cannot-return.rs:17:37 + | +LL | extern "gpu-kernel" fn ret_i32() -> i32 { 0 } + | ^^^ + | + = note: functions with the "gpu-kernel" ABI cannot have a return type +help: remove the return type + --> $DIR/cannot-return.rs:17:37 + | +LL | extern "gpu-kernel" fn ret_i32() -> i32 { 0 } + | ^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/cannot-return.nvptx.stderr b/tests/ui/abi/cannot-return.nvptx.stderr new file mode 100644 index 000000000000..f264907d00ec --- /dev/null +++ b/tests/ui/abi/cannot-return.nvptx.stderr @@ -0,0 +1,15 @@ +error: invalid signature for `extern "gpu-kernel"` function + --> $DIR/cannot-return.rs:17:37 + | +LL | extern "gpu-kernel" fn ret_i32() -> i32 { 0 } + | ^^^ + | + = note: functions with the "gpu-kernel" ABI cannot have a return type +help: remove the return type + --> $DIR/cannot-return.rs:17:37 + | +LL | extern "gpu-kernel" fn ret_i32() -> i32 { 0 } + | ^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/cannot-return.rs b/tests/ui/abi/cannot-return.rs new file mode 100644 index 000000000000..9a5db30431b9 --- /dev/null +++ b/tests/ui/abi/cannot-return.rs @@ -0,0 +1,18 @@ +//@ add-minicore +//@ ignore-backends: gcc +//@ edition: 2024 +//@ revisions: amdgpu nvptx +// +//@ [amdgpu] needs-llvm-components: amdgpu +//@ [amdgpu] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 --crate-type=rlib +//@ [nvptx] needs-llvm-components: nvptx +//@ [nvptx] compile-flags: --target nvptx64-nvidia-cuda --crate-type=rlib +#![no_core] +#![feature(no_core, abi_gpu_kernel)] + +extern crate minicore; +use minicore::*; + +#[unsafe(no_mangle)] +extern "gpu-kernel" fn ret_i32() -> i32 { 0 } +//~^ ERROR invalid signature for `extern "gpu-kernel"` function diff --git a/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr b/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr index 897f872ae72a..8e2da4dcc2a4 100644 --- a/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr +++ b/tests/ui/asm/s390x/bad-reg.s390x_vector.stderr @@ -282,7 +282,7 @@ error: type `u8` cannot be used with this register class LL | asm!("", in("v0") b); | ^ | - = note: register class `vreg` supports these types: i32, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2 + = note: register class `vreg` supports these types: i32, f16, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `u8` cannot be used with this register class --> $DIR/bad-reg.rs:95:28 @@ -290,7 +290,7 @@ error: type `u8` cannot be used with this register class LL | asm!("", out("v0") b); | ^ | - = note: register class `vreg` supports these types: i32, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2 + = note: register class `vreg` supports these types: i32, f16, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `u8` cannot be used with this register class --> $DIR/bad-reg.rs:108:35 @@ -298,7 +298,7 @@ error: type `u8` cannot be used with this register class LL | asm!("/* {} */", in(vreg) b); | ^ | - = note: register class `vreg` supports these types: i32, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2 + = note: register class `vreg` supports these types: i32, f16, f32, i64, f64, i128, f128, i8x16, i16x8, i32x4, i64x2, f16x8, f32x4, f64x2 error: type `i32` cannot be used with this register class --> $DIR/bad-reg.rs:120:27 diff --git a/tests/ui/associated-consts/assoc-const-eq-ambiguity.rs b/tests/ui/associated-consts/assoc-const-eq-ambiguity.rs index 27261a4806eb..6bc2a6d5d153 100644 --- a/tests/ui/associated-consts/assoc-const-eq-ambiguity.rs +++ b/tests/ui/associated-consts/assoc-const-eq-ambiguity.rs @@ -1,7 +1,7 @@ // We used to say "ambiguous associated type" on ambiguous associated consts. // Ensure that we now use the correct label. -#![feature(associated_const_equality, min_generic_const_args, unsized_const_params)] +#![feature(min_generic_const_args, unsized_const_params)] #![allow(incomplete_features)] trait Trait0: Parent0 + Parent0 {} diff --git a/tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr b/tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr index 9ab39e6b8a60..cf4805aaf592 100644 --- a/tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr +++ b/tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr @@ -13,8 +13,8 @@ LL | fn take0(_: impl Trait0) {} = help: consider introducing a new type parameter `T` and adding `where` constraints: where T: Trait0, - T: Parent0::K = { }, - T: Parent0::K = { } + T: Parent0::K = const { }, + T: Parent0::K = const { } error[E0222]: ambiguous associated constant `C` in bounds of `Trait1` --> $DIR/assoc-const-eq-ambiguity.rs:26:25 diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs index 7f8b3036c3e8..803cc59cc93d 100644 --- a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs +++ b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs @@ -1,10 +1,10 @@ // Check that we eventually catch types of assoc const bounds // (containing late-bound vars) that are ill-formed. #![feature( - associated_const_equality, min_generic_const_args, adt_const_params, unsized_const_params, + generic_const_parameter_types, )] #![allow(incomplete_features)] diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr index 4a4c2b285829..76868715b861 100644 --- a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr +++ b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr @@ -1,14 +1,14 @@ error: higher-ranked subtype error - --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:21:19 + --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:21:13 | LL | K = const { () } - | ^^^^^^ + | ^^^^^^^^^^^^ error: higher-ranked subtype error - --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:21:19 + --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:21:13 | LL | K = const { () } - | ^^^^^^ + | ^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs index d3975bc19ad3..e6fd5bdad002 100644 --- a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs +++ b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs @@ -4,10 +4,10 @@ //@ check-pass #![feature( - associated_const_equality, min_generic_const_args, adt_const_params, unsized_const_params, + generic_const_parameter_types, )] #![allow(incomplete_features)] diff --git a/tests/ui/associated-consts/assoc-const-eq-const_evaluatable_unchecked.rs b/tests/ui/associated-consts/assoc-const-eq-const_evaluatable_unchecked.rs index 22a03e47b2f7..161eef63d36f 100644 --- a/tests/ui/associated-consts/assoc-const-eq-const_evaluatable_unchecked.rs +++ b/tests/ui/associated-consts/assoc-const-eq-const_evaluatable_unchecked.rs @@ -4,7 +4,7 @@ // // issue: //@ check-pass -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(incomplete_features)] pub trait TraitA { diff --git a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs index 2571af57e66b..d32737fcb62f 100644 --- a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs +++ b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs @@ -1,6 +1,10 @@ // Detect and reject escaping late-bound generic params in // the type of assoc consts used in an equality bound. -#![feature(associated_const_equality, min_generic_const_args, unsized_const_params)] +#![feature( + min_generic_const_args, + unsized_const_params, + generic_const_parameter_types, +)] #![allow(incomplete_features)] trait Trait<'a> { diff --git a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr index 44304443ac54..ef861cb7f49a 100644 --- a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr +++ b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr @@ -1,5 +1,5 @@ error: the type of the associated constant `K` cannot capture late-bound generic parameters - --> $DIR/assoc-const-eq-esc-bound-var-in-ty.rs:11:35 + --> $DIR/assoc-const-eq-esc-bound-var-in-ty.rs:15:35 | LL | fn take(_: impl for<'r> Trait<'r, K = const { &() }>) {} | -- ^ its type cannot capture the late-bound lifetime parameter `'r` diff --git a/tests/ui/associated-consts/assoc-const-eq-missing.rs b/tests/ui/associated-consts/assoc-const-eq-missing.rs index f384927e4a34..22b565cb27d2 100644 --- a/tests/ui/associated-consts/assoc-const-eq-missing.rs +++ b/tests/ui/associated-consts/assoc-const-eq-missing.rs @@ -1,5 +1,5 @@ -#![feature(associated_const_equality)] -#![allow(unused)] +#![feature(min_generic_const_args)] +#![allow(incomplete_features, unused)] pub trait Foo { const N: usize; diff --git a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs b/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs index 242ad385947a..44e7e3f19ef2 100644 --- a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs +++ b/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs @@ -1,10 +1,10 @@ // Regression test for issue #108271. // Detect and reject generic params in the type of assoc consts used in an equality bound. #![feature( - associated_const_equality, min_generic_const_args, adt_const_params, unsized_const_params, + generic_const_parameter_types, )] #![allow(incomplete_features)] diff --git a/tests/ui/associated-consts/assoc-const-eq-supertraits.rs b/tests/ui/associated-consts/assoc-const-eq-supertraits.rs index d9b8a8cd43d7..a5f8859c92bd 100644 --- a/tests/ui/associated-consts/assoc-const-eq-supertraits.rs +++ b/tests/ui/associated-consts/assoc-const-eq-supertraits.rs @@ -4,10 +4,10 @@ //@ check-pass #![feature( - associated_const_equality, min_generic_const_args, adt_const_params, unsized_const_params, + generic_const_parameter_types, )] #![allow(incomplete_features)] diff --git a/tests/ui/associated-consts/assoc-const-eq-ty-alias-noninteracting.rs b/tests/ui/associated-consts/assoc-const-eq-ty-alias-noninteracting.rs index 41857eca87de..004215986711 100644 --- a/tests/ui/associated-consts/assoc-const-eq-ty-alias-noninteracting.rs +++ b/tests/ui/associated-consts/assoc-const-eq-ty-alias-noninteracting.rs @@ -5,7 +5,7 @@ //@ check-pass -#![feature(associated_const_equality, min_generic_const_args, unsized_const_params)] +#![feature(min_generic_const_args, unsized_const_params)] #![allow(incomplete_features)] trait Trait: SuperTrait { diff --git a/tests/ui/associated-consts/assoc-const-ty-mismatch.rs b/tests/ui/associated-consts/assoc-const-ty-mismatch.rs index 7211637659bd..1092733a8e2e 100644 --- a/tests/ui/associated-consts/assoc-const-ty-mismatch.rs +++ b/tests/ui/associated-consts/assoc-const-ty-mismatch.rs @@ -1,5 +1,5 @@ -#![feature(associated_const_equality)] -#![allow(unused)] +#![feature(min_generic_const_args)] +#![allow(incomplete_features, unused)] pub trait Foo { const N: usize; diff --git a/tests/ui/associated-consts/assoc-const.rs b/tests/ui/associated-consts/assoc-const.rs index 6295fd50b8ff..ac9f7e53b3cb 100644 --- a/tests/ui/associated-consts/assoc-const.rs +++ b/tests/ui/associated-consts/assoc-const.rs @@ -1,5 +1,5 @@ //@ run-pass -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(unused, incomplete_features)] pub trait Foo { diff --git a/tests/ui/associated-consts/equality-unused-issue-126729.rs b/tests/ui/associated-consts/equality-unused-issue-126729.rs index 35b49314b5f5..614ed8c803d4 100644 --- a/tests/ui/associated-consts/equality-unused-issue-126729.rs +++ b/tests/ui/associated-consts/equality-unused-issue-126729.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(incomplete_features)] #![deny(dead_code)] diff --git a/tests/ui/associated-consts/issue-102335-const.rs b/tests/ui/associated-consts/issue-102335-const.rs index f9b816fd3bc9..a88a3abf0a12 100644 --- a/tests/ui/associated-consts/issue-102335-const.rs +++ b/tests/ui/associated-consts/issue-102335-const.rs @@ -1,4 +1,4 @@ -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(incomplete_features)] trait T { diff --git a/tests/ui/associated-consts/issue-105330.stderr b/tests/ui/associated-consts/issue-105330.stderr index 5d6dc48e36c0..06900404ec34 100644 --- a/tests/ui/associated-consts/issue-105330.stderr +++ b/tests/ui/associated-consts/issue-105330.stderr @@ -21,8 +21,8 @@ error[E0658]: associated const equality is incomplete LL | fn foo>() { | ^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete @@ -31,8 +31,8 @@ error[E0658]: associated const equality is incomplete LL | fn main>() { | ^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in impl headers diff --git a/tests/ui/associated-consts/issue-110933.rs b/tests/ui/associated-consts/issue-110933.rs index 731ff1564ce2..9a013ee71274 100644 --- a/tests/ui/associated-consts/issue-110933.rs +++ b/tests/ui/associated-consts/issue-110933.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(incomplete_features)] pub trait Trait { diff --git a/tests/ui/associated-consts/issue-93835.rs b/tests/ui/associated-consts/issue-93835.rs index d6c2acaa9edc..26d0bbe3a40f 100644 --- a/tests/ui/associated-consts/issue-93835.rs +++ b/tests/ui/associated-consts/issue-93835.rs @@ -4,9 +4,9 @@ fn e() { type_ascribe!(p, a>); //~^ ERROR cannot find type `a` in this scope //~| ERROR cannot find value - //~| ERROR associated const equality + //~| ERROR associated const equality is incomplete //~| ERROR cannot find trait `p` in this scope - //~| ERROR associated const equality + //~| ERROR associated const equality is incomplete } fn main() {} diff --git a/tests/ui/associated-consts/issue-93835.stderr b/tests/ui/associated-consts/issue-93835.stderr index 3f1679890130..990d22bba4de 100644 --- a/tests/ui/associated-consts/issue-93835.stderr +++ b/tests/ui/associated-consts/issue-93835.stderr @@ -22,8 +22,8 @@ error[E0658]: associated const equality is incomplete LL | type_ascribe!(p, a>); | ^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete @@ -32,8 +32,8 @@ error[E0658]: associated const equality is incomplete LL | type_ascribe!(p, a>); | ^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/associated-consts/projection-unspecified-but-bounded.rs b/tests/ui/associated-consts/projection-unspecified-but-bounded.rs index 7f3304f07656..8a78b26dbc5d 100644 --- a/tests/ui/associated-consts/projection-unspecified-but-bounded.rs +++ b/tests/ui/associated-consts/projection-unspecified-but-bounded.rs @@ -1,4 +1,4 @@ -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(incomplete_features)] // Issue 110549 diff --git a/tests/ui/associated-type-bounds/const-projection-err.rs b/tests/ui/associated-type-bounds/const-projection-err.rs index b230ea77f5fe..d485316ce371 100644 --- a/tests/ui/associated-type-bounds/const-projection-err.rs +++ b/tests/ui/associated-type-bounds/const-projection-err.rs @@ -1,4 +1,4 @@ -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![allow(incomplete_features)] trait TraitWAssocConst { diff --git a/tests/ui/associated-type-bounds/duplicate-bound-err.rs b/tests/ui/associated-type-bounds/duplicate-bound-err.rs index 7e86148eb811..1587be7200e7 100644 --- a/tests/ui/associated-type-bounds/duplicate-bound-err.rs +++ b/tests/ui/associated-type-bounds/duplicate-bound-err.rs @@ -1,7 +1,6 @@ //@ edition: 2024 #![feature( - associated_const_equality, min_generic_const_args, type_alias_impl_trait, return_type_notation diff --git a/tests/ui/associated-type-bounds/duplicate-bound-err.stderr b/tests/ui/associated-type-bounds/duplicate-bound-err.stderr index 6484880392d6..ec864c1dd96e 100644 --- a/tests/ui/associated-type-bounds/duplicate-bound-err.stderr +++ b/tests/ui/associated-type-bounds/duplicate-bound-err.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/duplicate-bound-err.rs:15:5 + --> $DIR/duplicate-bound-err.rs:14:5 | LL | iter::empty() | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty` @@ -10,7 +10,7 @@ LL | iter::empty::() | +++++ error[E0282]: type annotations needed - --> $DIR/duplicate-bound-err.rs:19:5 + --> $DIR/duplicate-bound-err.rs:18:5 | LL | iter::empty() | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty` @@ -21,7 +21,7 @@ LL | iter::empty::() | +++++ error[E0282]: type annotations needed - --> $DIR/duplicate-bound-err.rs:23:5 + --> $DIR/duplicate-bound-err.rs:22:5 | LL | iter::empty() | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty` @@ -32,7 +32,7 @@ LL | iter::empty::() | +++++ error: unconstrained opaque type - --> $DIR/duplicate-bound-err.rs:27:51 + --> $DIR/duplicate-bound-err.rs:26:51 | LL | type Tait1> = impl Copy; | ^^^^^^^^^ @@ -40,7 +40,7 @@ LL | type Tait1> = impl Copy; = note: `Tait1` must be used in combination with a concrete type within the same crate error: unconstrained opaque type - --> $DIR/duplicate-bound-err.rs:29:51 + --> $DIR/duplicate-bound-err.rs:28:51 | LL | type Tait2> = impl Copy; | ^^^^^^^^^ @@ -48,7 +48,7 @@ LL | type Tait2> = impl Copy; = note: `Tait2` must be used in combination with a concrete type within the same crate error: unconstrained opaque type - --> $DIR/duplicate-bound-err.rs:31:57 + --> $DIR/duplicate-bound-err.rs:30:57 | LL | type Tait3> = impl Copy; | ^^^^^^^^^ @@ -56,7 +56,7 @@ LL | type Tait3> = impl Copy; = note: `Tait3` must be used in combination with a concrete type within the same crate error: unconstrained opaque type - --> $DIR/duplicate-bound-err.rs:34:14 + --> $DIR/duplicate-bound-err.rs:33:14 | LL | type Tait4 = impl Iterator; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -64,7 +64,7 @@ LL | type Tait4 = impl Iterator; = note: `Tait4` must be used in combination with a concrete type within the same crate error: unconstrained opaque type - --> $DIR/duplicate-bound-err.rs:36:14 + --> $DIR/duplicate-bound-err.rs:35:14 | LL | type Tait5 = impl Iterator; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -72,7 +72,7 @@ LL | type Tait5 = impl Iterator; = note: `Tait5` must be used in combination with a concrete type within the same crate error: unconstrained opaque type - --> $DIR/duplicate-bound-err.rs:38:14 + --> $DIR/duplicate-bound-err.rs:37:14 | LL | type Tait6 = impl Iterator; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -80,7 +80,7 @@ LL | type Tait6 = impl Iterator; = note: `Tait6` must be used in combination with a concrete type within the same crate error[E0277]: `*const ()` cannot be sent between threads safely - --> $DIR/duplicate-bound-err.rs:41:18 + --> $DIR/duplicate-bound-err.rs:40:18 | LL | fn mismatch() -> impl Iterator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely @@ -91,7 +91,7 @@ LL | iter::empty::<*const ()>() = help: the trait `Send` is not implemented for `*const ()` error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/duplicate-bound-err.rs:46:20 + --> $DIR/duplicate-bound-err.rs:45:20 | LL | fn mismatch_2() -> impl Iterator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` @@ -100,7 +100,7 @@ LL | iter::empty::() | ----------------------- return type was inferred to be `std::iter::Empty` here error[E0271]: expected `IntoIter` to be an iterator that yields `i32`, but it yields `u32` - --> $DIR/duplicate-bound-err.rs:112:17 + --> $DIR/duplicate-bound-err.rs:111:17 | LL | fn foo() -> impl Iterator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32` @@ -109,7 +109,7 @@ LL | [2u32].into_iter() | ------------------ return type was inferred to be `std::array::IntoIter` here error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate-bound-err.rs:88:42 + --> $DIR/duplicate-bound-err.rs:87:42 | LL | type MustFail = dyn Iterator; | ---------- ^^^^^^^^^^ re-bound here @@ -117,7 +117,7 @@ LL | type MustFail = dyn Iterator; | `Item` bound here first error: conflicting associated type bounds for `Item` - --> $DIR/duplicate-bound-err.rs:88:17 + --> $DIR/duplicate-bound-err.rs:87:17 | LL | type MustFail = dyn Iterator; | ^^^^^^^^^^^^^----------^^----------^ @@ -126,7 +126,7 @@ LL | type MustFail = dyn Iterator; | `Item` is specified to be `i32` here error[E0719]: the value of the associated type `ASSOC` in trait `Trait2` is already specified - --> $DIR/duplicate-bound-err.rs:97:43 + --> $DIR/duplicate-bound-err.rs:96:43 | LL | type MustFail2 = dyn Trait2; | ------------ ^^^^^^^^^^^^ re-bound here @@ -134,7 +134,7 @@ LL | type MustFail2 = dyn Trait2; | `ASSOC` bound here first error: conflicting associated type bounds for `ASSOC` - --> $DIR/duplicate-bound-err.rs:97:18 + --> $DIR/duplicate-bound-err.rs:96:18 | LL | type MustFail2 = dyn Trait2; | ^^^^^^^^^^^------------^^------------^ @@ -143,7 +143,7 @@ LL | type MustFail2 = dyn Trait2; | `ASSOC` is specified to be `3` here error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate-bound-err.rs:101:43 + --> $DIR/duplicate-bound-err.rs:100:43 | LL | type MustFail3 = dyn Iterator; | ---------- ^^^^^^^^^^ re-bound here @@ -151,7 +151,7 @@ LL | type MustFail3 = dyn Iterator; | `Item` bound here first error[E0719]: the value of the associated type `ASSOC` in trait `Trait2` is already specified - --> $DIR/duplicate-bound-err.rs:104:43 + --> $DIR/duplicate-bound-err.rs:103:43 | LL | type MustFail4 = dyn Trait2; | ------------ ^^^^^^^^^^^^ re-bound here @@ -159,19 +159,19 @@ LL | type MustFail4 = dyn Trait2; | `ASSOC` bound here first error[E0271]: expected `impl Iterator` to be an iterator that yields `i32`, but it yields `u32` - --> $DIR/duplicate-bound-err.rs:112:17 + --> $DIR/duplicate-bound-err.rs:111:17 | LL | fn foo() -> impl Iterator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32` | note: required by a bound in `Trait3::foo::{anon_assoc#0}` - --> $DIR/duplicate-bound-err.rs:108:31 + --> $DIR/duplicate-bound-err.rs:107:31 | LL | fn foo() -> impl Iterator; | ^^^^^^^^^^ required by this bound in `Trait3::foo::{anon_assoc#0}` error[E0271]: expected `Empty` to be an iterator that yields `i32`, but it yields `u32` - --> $DIR/duplicate-bound-err.rs:120:16 + --> $DIR/duplicate-bound-err.rs:119:16 | LL | uncallable(iter::empty::()); | ---------- ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32` @@ -179,13 +179,13 @@ LL | uncallable(iter::empty::()); | required by a bound introduced by this call | note: required by a bound in `uncallable` - --> $DIR/duplicate-bound-err.rs:80:32 + --> $DIR/duplicate-bound-err.rs:79:32 | LL | fn uncallable(_: impl Iterator) {} | ^^^^^^^^^^ required by this bound in `uncallable` error[E0271]: expected `Empty` to be an iterator that yields `u32`, but it yields `i32` - --> $DIR/duplicate-bound-err.rs:121:16 + --> $DIR/duplicate-bound-err.rs:120:16 | LL | uncallable(iter::empty::()); | ---------- ^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32` @@ -193,13 +193,13 @@ LL | uncallable(iter::empty::()); | required by a bound introduced by this call | note: required by a bound in `uncallable` - --> $DIR/duplicate-bound-err.rs:80:44 + --> $DIR/duplicate-bound-err.rs:79:44 | LL | fn uncallable(_: impl Iterator) {} | ^^^^^^^^^^ required by this bound in `uncallable` error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4` - --> $DIR/duplicate-bound-err.rs:122:22 + --> $DIR/duplicate-bound-err.rs:121:22 | LL | uncallable_const(()); | ---------------- ^^ expected `4`, found `3` @@ -209,13 +209,13 @@ LL | uncallable_const(()); = note: expected constant `4` found constant `3` note: required by a bound in `uncallable_const` - --> $DIR/duplicate-bound-err.rs:82:46 + --> $DIR/duplicate-bound-err.rs:81:46 | LL | fn uncallable_const(_: impl Trait) {} | ^^^^^^^^^ required by this bound in `uncallable_const` error[E0271]: type mismatch resolving `::ASSOC == 3` - --> $DIR/duplicate-bound-err.rs:123:22 + --> $DIR/duplicate-bound-err.rs:122:22 | LL | uncallable_const(4u32); | ---------------- ^^^^ expected `3`, found `4` @@ -225,13 +225,13 @@ LL | uncallable_const(4u32); = note: expected constant `3` found constant `4` note: required by a bound in `uncallable_const` - --> $DIR/duplicate-bound-err.rs:82:35 + --> $DIR/duplicate-bound-err.rs:81:35 | LL | fn uncallable_const(_: impl Trait) {} | ^^^^^^^^^ required by this bound in `uncallable_const` error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4` - --> $DIR/duplicate-bound-err.rs:124:20 + --> $DIR/duplicate-bound-err.rs:123:20 | LL | uncallable_rtn(()); | -------------- ^^ expected `4`, found `3` @@ -241,7 +241,7 @@ LL | uncallable_rtn(()); = note: expected constant `4` found constant `3` note: required by a bound in `uncallable_rtn` - --> $DIR/duplicate-bound-err.rs:85:61 + --> $DIR/duplicate-bound-err.rs:84:61 | LL | fn uncallable_rtn( | -------------- required by a bound in this function @@ -249,7 +249,7 @@ LL | _: impl Trait, foo(..): Trait> | ^^^^^^^^^ required by this bound in `uncallable_rtn` error[E0271]: type mismatch resolving `::ASSOC == 3` - --> $DIR/duplicate-bound-err.rs:125:20 + --> $DIR/duplicate-bound-err.rs:124:20 | LL | uncallable_rtn(17u32); | -------------- ^^^^^ expected `3`, found `4` @@ -259,7 +259,7 @@ LL | uncallable_rtn(17u32); = note: expected constant `3` found constant `4` note: required by a bound in `uncallable_rtn` - --> $DIR/duplicate-bound-err.rs:85:34 + --> $DIR/duplicate-bound-err.rs:84:34 | LL | fn uncallable_rtn( | -------------- required by a bound in this function diff --git a/tests/ui/associated-type-bounds/duplicate-bound.rs b/tests/ui/associated-type-bounds/duplicate-bound.rs index 6ea0daeca2c4..1aeb0022a04f 100644 --- a/tests/ui/associated-type-bounds/duplicate-bound.rs +++ b/tests/ui/associated-type-bounds/duplicate-bound.rs @@ -1,7 +1,7 @@ //@ edition: 2024 //@ run-pass -#![feature(associated_const_equality, min_generic_const_args, return_type_notation)] +#![feature(min_generic_const_args, return_type_notation)] #![expect(incomplete_features)] #![allow(dead_code, refining_impl_trait_internal, type_alias_bounds)] diff --git a/tests/ui/associated-type-bounds/issue-99828.stderr b/tests/ui/associated-type-bounds/issue-99828.stderr index 132d5251987b..e1dc1f07d9cb 100644 --- a/tests/ui/associated-type-bounds/issue-99828.stderr +++ b/tests/ui/associated-type-bounds/issue-99828.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | fn get_iter(vec: &[i32]) -> impl Iterator + '_ { | ^^^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: expected type, found constant diff --git a/tests/ui/issues/issue-26614.rs b/tests/ui/associated-types/associated-type-const-nomalization.rs similarity index 71% rename from tests/ui/issues/issue-26614.rs rename to tests/ui/associated-types/associated-type-const-nomalization.rs index 576c7545924b..b7951ba9a435 100644 --- a/tests/ui/issues/issue-26614.rs +++ b/tests/ui/associated-types/associated-type-const-nomalization.rs @@ -1,3 +1,4 @@ +//! regression test for //@ check-pass trait Mirror { diff --git a/tests/ui/associated-types/associated-types-eq-2.stderr b/tests/ui/associated-types/associated-types-eq-2.stderr index 19c34241e5f2..9be346516c89 100644 --- a/tests/ui/associated-types/associated-types-eq-2.stderr +++ b/tests/ui/associated-types/associated-types-eq-2.stderr @@ -7,8 +7,8 @@ LL | impl Tr3 for Bar { | |____^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete @@ -17,8 +17,8 @@ error[E0658]: associated const equality is incomplete LL | impl Tr3 for Qux { | ^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete @@ -27,8 +27,8 @@ error[E0658]: associated const equality is incomplete LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar { | ^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete @@ -37,8 +37,8 @@ error[E0658]: associated const equality is incomplete LL | impl Tr3 for Bar { | ^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0229]: associated item constraints are not allowed here diff --git a/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout b/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout index b30c15bcbe6e..13f03ffa65b5 100644 --- a/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout +++ b/tests/ui/async-await/future-sizes/async-awaiting-fut.stdout @@ -7,6 +7,8 @@ print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of calls_fut<{async fn body of big_fut()}>()}>`: 3077 bytes, alignment: 1 bytes print-type-size field `.value`: 3077 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of calls_fut<{async fn body of big_fut()}>()}>`: 3077 bytes, alignment: 1 bytes +print-type-size field `.0`: 3077 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of calls_fut<{async fn body of big_fut()}>()}>`: 3077 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 3077 bytes print-type-size field `.uninit`: 0 bytes @@ -36,6 +38,8 @@ print-type-size variant `Panicked`: 1025 bytes print-type-size upvar `.fut`: 1025 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes print-type-size field `.value`: 1025 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes +print-type-size field `.0`: 1025 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of big_fut()}>`: 1025 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1025 bytes print-type-size field `.uninit`: 0 bytes @@ -85,6 +89,10 @@ print-type-size type: `std::mem::ManuallyDrop`: 1 bytes, alignment: 1 byte print-type-size field `.value`: 1 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes print-type-size field `.value`: 1 bytes +print-type-size type: `std::mem::MaybeDangling`: 1 bytes, alignment: 1 bytes +print-type-size field `.0`: 1 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes +print-type-size field `.0`: 1 bytes print-type-size type: `std::mem::MaybeUninit`: 1 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/async-await/future-sizes/large-arg.stdout b/tests/ui/async-await/future-sizes/large-arg.stdout index e00420d1493f..d51afa33595c 100644 --- a/tests/ui/async-await/future-sizes/large-arg.stdout +++ b/tests/ui/async-await/future-sizes/large-arg.stdout @@ -7,6 +7,8 @@ print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of a<[u8; 1024]>()}>`: 3075 bytes, alignment: 1 bytes print-type-size field `.value`: 3075 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of a<[u8; 1024]>()}>`: 3075 bytes, alignment: 1 bytes +print-type-size field `.0`: 3075 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of a<[u8; 1024]>()}>`: 3075 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 3075 bytes print-type-size field `.uninit`: 0 bytes @@ -24,6 +26,8 @@ print-type-size variant `Panicked`: 1024 bytes print-type-size upvar `.t`: 1024 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of b<[u8; 1024]>()}>`: 2050 bytes, alignment: 1 bytes print-type-size field `.value`: 2050 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of b<[u8; 1024]>()}>`: 2050 bytes, alignment: 1 bytes +print-type-size field `.0`: 2050 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of b<[u8; 1024]>()}>`: 2050 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 2050 bytes print-type-size field `.uninit`: 0 bytes @@ -41,6 +45,8 @@ print-type-size variant `Panicked`: 1024 bytes print-type-size upvar `.t`: 1024 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of c<[u8; 1024]>()}>`: 1025 bytes, alignment: 1 bytes print-type-size field `.value`: 1025 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of c<[u8; 1024]>()}>`: 1025 bytes, alignment: 1 bytes +print-type-size field `.0`: 1025 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of c<[u8; 1024]>()}>`: 1025 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1025 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/attributes/instruction-set.rs b/tests/ui/attributes/instruction-set.rs new file mode 100644 index 000000000000..dafa907cb568 --- /dev/null +++ b/tests/ui/attributes/instruction-set.rs @@ -0,0 +1,111 @@ +//@ add-minicore +//@ compile-flags: --target armv5te-none-eabi +//@ needs-llvm-components: arm +//@ ignore-backends: gcc +//@ edition: 2024 + +#![crate_type = "lib"] +#![feature(no_core, lang_items,)] +#![no_core] + +extern crate minicore; +use minicore::*; + + + + +#[instruction_set(arm::a32)] +fn foo() { +} + +#[instruction_set(arm)] +//~^ ERROR malformed `instruction_set` attribute input [E0539] +fn bar() { +} + +#[instruction_set(arm::)] +//~^ ERROR expected identifier, found `` +fn bazz() { +} + +#[instruction_set(arm::magic)] +//~^ ERROR malformed `instruction_set` attribute input [E0539] +fn bazzer() { + +} + +fn all_instruction_set_cases() { + #[instruction_set(arm::a32)] + || { + 0 + }; + #[instruction_set(arm::t32)] + async || { + 0 + }; +} + +struct Fooer; + +impl Fooer { + #[instruction_set(arm::a32)] + fn fooest() { + + } +} + +trait Bazzest { + fn bazz(); + + #[instruction_set(arm::a32)] + fn bazziest() { + + } +} +impl Bazzest for Fooer { + #[instruction_set(arm::t32)] + fn bazz() {} +} + + +// The following lang items need to be defined for the async closure to work +#[lang = "ResumeTy"] +pub struct ResumeTy(NonNull>); + +#[lang = "future_trait"] +pub trait Future { + /// The type of value produced on completion. + #[lang = "future_output"] + type Output; + + // NOTE: misses the `poll` method. +} + +#[lang = "async_drop"] +pub trait AsyncDrop { + // NOTE: misses the `drop` method. +} + +#[lang = "Poll"] +pub enum Poll { + #[lang = "Ready"] + Ready(T), + + #[lang = "Pending"] + Pending, +} + +#[lang = "Context"] +pub struct Context<'a> { + // NOTE: misses a bunch of fields. + _marker: PhantomData &'a ()>, +} + +#[lang = "get_context"] +pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> { + // NOTE: the actual implementation looks different. + unsafe {mem::transmute(cx.0)} +} + +#[lang = "pin"] +pub struct Pin(T); diff --git a/tests/ui/attributes/instruction-set.stderr b/tests/ui/attributes/instruction-set.stderr new file mode 100644 index 000000000000..c5aea396b53e --- /dev/null +++ b/tests/ui/attributes/instruction-set.stderr @@ -0,0 +1,31 @@ +error[E0539]: malformed `instruction_set` attribute input + --> $DIR/instruction-set.rs:21:1 + | +LL | #[instruction_set(arm)] + | ^^^^^^^^^^^^^^^^^^---^^ + | | | + | | valid arguments are `arm::a32` or `arm::t32` + | help: must be of the form: `#[instruction_set(set)]` + | + = note: for more information, visit + +error: expected identifier, found `` + --> $DIR/instruction-set.rs:26:22 + | +LL | #[instruction_set(arm::)] + | ^^ expected identifier + +error[E0539]: malformed `instruction_set` attribute input + --> $DIR/instruction-set.rs:31:1 + | +LL | #[instruction_set(arm::magic)] + | ^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | | | + | | valid arguments are `a32` or `t32` + | help: must be of the form: `#[instruction_set(set)]` + | + = note: for more information, visit + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0539`. diff --git a/tests/ui/attributes/invalid-instruction-set-target.rs b/tests/ui/attributes/invalid-instruction-set-target.rs new file mode 100644 index 000000000000..08b261c1b309 --- /dev/null +++ b/tests/ui/attributes/invalid-instruction-set-target.rs @@ -0,0 +1,6 @@ +//@ only-x86_64-unknown-linux-gnu + +#[instruction_set(arm::a32)] +//~^ ERROR target `x86_64-unknown-linux-gnu` does not support `#[instruction_set(arm::*)]` +fn main() { +} diff --git a/tests/ui/attributes/invalid-instruction-set-target.stderr b/tests/ui/attributes/invalid-instruction-set-target.stderr new file mode 100644 index 000000000000..d99fbd369a0e --- /dev/null +++ b/tests/ui/attributes/invalid-instruction-set-target.stderr @@ -0,0 +1,8 @@ +error: target `x86_64-unknown-linux-gnu` does not support `#[instruction_set(arm::*)]` + --> $DIR/invalid-instruction-set-target.rs:3:1 + | +LL | #[instruction_set(arm::a32)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 860dcdb349bf..7027328bc27b 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -26,14 +26,6 @@ error[E0463]: can't find crate for `wloop` LL | extern crate wloop; | ^^^^^^^^^^^^^^^^^^^ can't find crate -error: malformed `instruction_set` attribute input - --> $DIR/malformed-attrs.rs:112:1 - | -LL | #[instruction_set] - | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[instruction_set(set)]` - | - = note: for more information, visit - error: malformed `patchable_function_entry` attribute input --> $DIR/malformed-attrs.rs:114:1 | @@ -456,6 +448,17 @@ LL | #[proc_macro = 18] | | didn't expect any arguments here | help: must be of the form: `#[proc_macro]` +error[E0539]: malformed `instruction_set` attribute input + --> $DIR/malformed-attrs.rs:112:1 + | +LL | #[instruction_set] + | ^^^^^^^^^^^^^^^^^^ + | | + | valid arguments are `arm::a32` or `arm::t32` + | help: must be of the form: `#[instruction_set(set)]` + | + = note: for more information, visit + error[E0565]: malformed `coroutine` attribute input --> $DIR/malformed-attrs.rs:117:5 | diff --git a/tests/ui/c-variadic/variadic-ffi-4.stderr b/tests/ui/c-variadic/variadic-ffi-4.stderr index a230bb6f5861..01ace5c79680 100644 --- a/tests/ui/c-variadic/variadic-ffi-4.stderr +++ b/tests/ui/c-variadic/variadic-ffi-4.stderr @@ -30,9 +30,9 @@ error: lifetime may not live long enough --> $DIR/variadic-ffi-4.rs:22:5 | LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { - | ------- ------- has type `VaList<'2>` + | ------- ------- has type `VaList<'1>` | | - | has type `&mut VaList<'1>` + | has type `&mut VaList<'2>` LL | ap0 = &mut ap1; | ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` | @@ -44,9 +44,9 @@ error: lifetime may not live long enough --> $DIR/variadic-ffi-4.rs:22:5 | LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { - | ------- ------- has type `VaList<'2>` + | ------- ------- has type `VaList<'1>` | | - | has type `&mut VaList<'1>` + | has type `&mut VaList<'2>` LL | ap0 = &mut ap1; | ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1` | diff --git a/tests/ui/cast/cast-enum-const.rs b/tests/ui/cast/cast-enum-const.rs new file mode 100644 index 000000000000..cfad40c07b0e --- /dev/null +++ b/tests/ui/cast/cast-enum-const.rs @@ -0,0 +1,12 @@ +//! regression test for +//@ run-pass + +fn main() { + const QUUX: isize = 5; + + enum Stuff { + Bar = QUUX, + } + + assert_eq!(Stuff::Bar as isize, QUUX); +} diff --git a/tests/ui/issues/issue-22403.rs b/tests/ui/cast/cast-to-box-arr.rs similarity index 61% rename from tests/ui/issues/issue-22403.rs rename to tests/ui/cast/cast-to-box-arr.rs index 89c956913f93..1a9004cd074e 100644 --- a/tests/ui/issues/issue-22403.rs +++ b/tests/ui/cast/cast-to-box-arr.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass fn main() { let x = Box::new([1, 2, 3]); diff --git a/tests/ui/issues/issue-41998.rs b/tests/ui/cast/cast-to-char-compare.rs similarity index 64% rename from tests/ui/issues/issue-41998.rs rename to tests/ui/cast/cast-to-char-compare.rs index 303bf7a57513..159b8ee04e02 100644 --- a/tests/ui/issues/issue-41998.rs +++ b/tests/ui/cast/cast-to-char-compare.rs @@ -1,6 +1,6 @@ +//! regression test for //@ check-pass - fn main() { if ('x' as char) < ('y' as char) { print!("x"); diff --git a/tests/ui/cast/ptr-to-ptr-unsized-adt-tail-with-static-region.rs b/tests/ui/cast/ptr-to-ptr-unsized-adt-tail-with-static-region.rs new file mode 100644 index 000000000000..7319a670c881 --- /dev/null +++ b/tests/ui/cast/ptr-to-ptr-unsized-adt-tail-with-static-region.rs @@ -0,0 +1,15 @@ +//@ check-pass + +// During MIR typeck when casting `*mut dyn Sync + '?x` to +// `*mut Wrap` we compute the tail of `Wrap` as `dyn Sync + 'static`. +// +// This test ensures that we first convert the `'static` lifetime to +// the nll var `'?0` before introducing the region constraint `'?x: 'static`. + +struct Wrap(dyn Sync + 'static); + +fn cast(x: *mut (dyn Sync + 'static)) { + x as *mut Wrap; +} + +fn main() {} diff --git a/tests/ui/cfg/invalid-cli-cfg-pred.rs b/tests/ui/cfg/invalid-cli-cfg-pred.rs new file mode 100644 index 000000000000..fdfb6b18d96b --- /dev/null +++ b/tests/ui/cfg/invalid-cli-cfg-pred.rs @@ -0,0 +1,5 @@ +//@ compile-flags: --cfg foo=1x + +fn main() {} + +//~? ERROR invalid `--cfg` argument diff --git a/tests/ui/cfg/invalid-cli-cfg-pred.stderr b/tests/ui/cfg/invalid-cli-cfg-pred.stderr new file mode 100644 index 000000000000..2f5ed55a6423 --- /dev/null +++ b/tests/ui/cfg/invalid-cli-cfg-pred.stderr @@ -0,0 +1,7 @@ +error: invalid suffix `x` for number literal + | + = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) + = note: this occurred on the command line: `--cfg=foo=1x` + +error: invalid `--cfg` argument: `foo=1x` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\") + diff --git a/tests/ui/cfg/invalid-cli-check-cfg-pred.rs b/tests/ui/cfg/invalid-cli-check-cfg-pred.rs new file mode 100644 index 000000000000..30417a912bfc --- /dev/null +++ b/tests/ui/cfg/invalid-cli-check-cfg-pred.rs @@ -0,0 +1,5 @@ +//@ compile-flags: --check-cfg 'foo=1x' + +fn main() {} + +//~? ERROR invalid `--check-cfg` argument diff --git a/tests/ui/cfg/invalid-cli-check-cfg-pred.stderr b/tests/ui/cfg/invalid-cli-check-cfg-pred.stderr new file mode 100644 index 000000000000..be8299aa9edf --- /dev/null +++ b/tests/ui/cfg/invalid-cli-check-cfg-pred.stderr @@ -0,0 +1,10 @@ +error: invalid suffix `x` for number literal + | + = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) + = note: this occurred on the command line: `--check-cfg=foo=1x` + +error: invalid `--check-cfg` argument: `foo=1x` + | + = note: expected `cfg(name, values("value1", "value2", ... "valueN"))` + = note: visit for more details + diff --git a/tests/ui/check-cfg/target_feature.stderr b/tests/ui/check-cfg/target_feature.stderr index 72edc03e10a4..6125e66320c8 100644 --- a/tests/ui/check-cfg/target_feature.stderr +++ b/tests/ui/check-cfg/target_feature.stderr @@ -424,6 +424,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE"); `zkn` `zknd` `zkne` +`zkne_or_zknd` `zknh` `zkr` `zks` diff --git a/tests/ui/codegen/normalization-overflow/recursion-issue-137823.rs b/tests/ui/codegen/normalization-overflow/recursion-issue-137823.rs new file mode 100644 index 000000000000..4ae8d84eba11 --- /dev/null +++ b/tests/ui/codegen/normalization-overflow/recursion-issue-137823.rs @@ -0,0 +1,39 @@ +//@ build-fail + +// Regression test for issue #137823 +// Tests that recursive monomorphization with associated types produces +// a proper "recursion limit" error instead of an ICE. + +fn convert() -> S::Out { + convert2::>() + //~^ ERROR: reached the recursion limit while instantiating +} + +fn convert2() -> S::Out { + convert::() +} + +fn main() { + convert::(); +} + +trait Converter { + type Out; +} + +struct Ser; + +impl Converter for Ser { + type Out = (); +} + +struct ConvertWrap { + _d: S, +} + +impl Converter for ConvertWrap +where + S: Converter, +{ + type Out = S::Out; +} diff --git a/tests/ui/codegen/normalization-overflow/recursion-issue-137823.stderr b/tests/ui/codegen/normalization-overflow/recursion-issue-137823.stderr new file mode 100644 index 000000000000..3d80c45685f5 --- /dev/null +++ b/tests/ui/codegen/normalization-overflow/recursion-issue-137823.stderr @@ -0,0 +1,14 @@ +error: reached the recursion limit while instantiating `convert2::>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/recursion-issue-137823.rs:8:5 + | +LL | convert2::>() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: `convert2` defined here + --> $DIR/recursion-issue-137823.rs:12:1 + | +LL | fn convert2() -> S::Out { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/adt_const_params/byte-string-u8-validation.rs b/tests/ui/const-generics/adt_const_params/byte-string-u8-validation.rs new file mode 100644 index 000000000000..703e63ae047f --- /dev/null +++ b/tests/ui/const-generics/adt_const_params/byte-string-u8-validation.rs @@ -0,0 +1,18 @@ +// Check that a byte string literal to a const parameter with a non-u8 +// element type isn't lowered to a ValTree with an incorrect type + +#![feature(adt_const_params)] +#![feature(rustc_attrs)] + +#[rustc_dump_predicates] +struct ConstBytes +//~^ ERROR rustc_dump_predicates +//~| NOTE Binder { value: ConstArgHasType(T/#0, &'static [*mut u8; 3_usize]), bound_vars: [] } +//~| NOTE Binder { value: TraitPredicate( as std::marker::Sized>, polarity:Positive), bound_vars: [] } +where + ConstBytes: Sized; +//~^ ERROR mismatched types +//~| NOTE expected `&[*mut u8; 3]`, found `&[u8; 3]` +//~| NOTE expected reference `&'static [*mut u8; 3]` + +fn main() {} diff --git a/tests/ui/const-generics/adt_const_params/byte-string-u8-validation.stderr b/tests/ui/const-generics/adt_const_params/byte-string-u8-validation.stderr new file mode 100644 index 000000000000..f5f8a420a703 --- /dev/null +++ b/tests/ui/const-generics/adt_const_params/byte-string-u8-validation.stderr @@ -0,0 +1,21 @@ +error: rustc_dump_predicates + --> $DIR/byte-string-u8-validation.rs:8:1 + | +LL | struct ConstBytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: Binder { value: ConstArgHasType(T/#0, &'static [*mut u8; 3_usize]), bound_vars: [] } + = note: Binder { value: TraitPredicate( as std::marker::Sized>, polarity:Positive), bound_vars: [] } + +error[E0308]: mismatched types + --> $DIR/byte-string-u8-validation.rs:13:16 + | +LL | ConstBytes: Sized; + | ^^^^^^ expected `&[*mut u8; 3]`, found `&[u8; 3]` + | + = note: expected reference `&'static [*mut u8; 3]` + found reference `&'static [u8; 3]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.rs b/tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.rs new file mode 100644 index 000000000000..d1658bf20a74 --- /dev/null +++ b/tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.rs @@ -0,0 +1,12 @@ +//! Regression test for + +#![feature(adt_const_params)] + +struct ConstBytes; +//~^ ERROR `&'static [*mut u8; 3]` can't be used as a const parameter type + +pub fn main() { + let _: ConstBytes = ConstBytes::; + //~^ ERROR mismatched types + //~| ERROR mismatched types +} diff --git a/tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.stderr b/tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.stderr new file mode 100644 index 000000000000..717e680ee536 --- /dev/null +++ b/tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.stderr @@ -0,0 +1,31 @@ +error[E0741]: `&'static [*mut u8; 3]` can't be used as a const parameter type + --> $DIR/mismatch-raw-ptr-in-adt.rs:5:28 + | +LL | struct ConstBytes; + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: `*mut u8` must implement `ConstParamTy_`, but it does not + = note: `[*mut u8; 3]` must implement `ConstParamTy_`, but it does not + +error[E0308]: mismatched types + --> $DIR/mismatch-raw-ptr-in-adt.rs:9:46 + | +LL | let _: ConstBytes = ConstBytes::; + | ^^^^^^ expected `&[*mut u8; 3]`, found `&[u8; 3]` + | + = note: expected reference `&'static [*mut u8; 3]` + found reference `&'static [u8; 3]` + +error[E0308]: mismatched types + --> $DIR/mismatch-raw-ptr-in-adt.rs:9:23 + | +LL | let _: ConstBytes = ConstBytes::; + | ^^^^^^ expected `&[*mut u8; 3]`, found `&[u8; 3]` + | + = note: expected reference `&'static [*mut u8; 3]` + found reference `&'static [u8; 3]` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0308, E0741. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/assoc_const_eq_diagnostic.rs b/tests/ui/const-generics/assoc_const_eq_diagnostic.rs index 6ab82f45e684..f2b581412a72 100644 --- a/tests/ui/const-generics/assoc_const_eq_diagnostic.rs +++ b/tests/ui/const-generics/assoc_const_eq_diagnostic.rs @@ -1,5 +1,6 @@ //@ edition:2015 -#![feature(associated_const_equality)] +#![feature(min_generic_const_args)] +#![allow(incomplete_features)] pub enum Mode { Cool, diff --git a/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr b/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr index bcfad9d1538c..05e0ec93d494 100644 --- a/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr +++ b/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found variant `Mode::Cool` - --> $DIR/assoc_const_eq_diagnostic.rs:12:35 + --> $DIR/assoc_const_eq_diagnostic.rs:13:35 | LL | pub trait CoolStuff: Parse {} | ^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | pub trait CoolStuff: Parse {} | help: try using the variant's enum: `Mode` error[E0573]: expected type, found variant `Mode::Cool` - --> $DIR/assoc_const_eq_diagnostic.rs:18:17 + --> $DIR/assoc_const_eq_diagnostic.rs:19:17 | LL | fn no_help() -> Mode::Cool {} | ^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | fn no_help() -> Mode::Cool {} | help: try using the variant's enum: `Mode` error: expected constant, found type - --> $DIR/assoc_const_eq_diagnostic.rs:12:35 + --> $DIR/assoc_const_eq_diagnostic.rs:13:35 | LL | pub trait CoolStuff: Parse {} | ---- ^^^^^^^^^^ unexpected type @@ -25,7 +25,7 @@ LL | pub trait CoolStuff: Parse {} | expected a constant because of this associated constant | note: the associated constant is defined here - --> $DIR/assoc_const_eq_diagnostic.rs:9:5 + --> $DIR/assoc_const_eq_diagnostic.rs:10:5 | LL | const MODE: Mode; | ^^^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ LL | pub trait CoolStuff: Parse {} | + + error: expected constant, found type - --> $DIR/assoc_const_eq_diagnostic.rs:12:35 + --> $DIR/assoc_const_eq_diagnostic.rs:13:35 | LL | pub trait CoolStuff: Parse {} | ---- ^^^^^^^^^^ unexpected type @@ -43,7 +43,7 @@ LL | pub trait CoolStuff: Parse {} | expected a constant because of this associated constant | note: the associated constant is defined here - --> $DIR/assoc_const_eq_diagnostic.rs:9:5 + --> $DIR/assoc_const_eq_diagnostic.rs:10:5 | LL | const MODE: Mode; | ^^^^^^^^^^^^^^^^ @@ -54,7 +54,7 @@ LL | pub trait CoolStuff: Parse {} | + + error: expected constant, found type - --> $DIR/assoc_const_eq_diagnostic.rs:12:35 + --> $DIR/assoc_const_eq_diagnostic.rs:13:35 | LL | pub trait CoolStuff: Parse {} | ---- ^^^^^^^^^^ unexpected type @@ -62,7 +62,7 @@ LL | pub trait CoolStuff: Parse {} | expected a constant because of this associated constant | note: the associated constant is defined here - --> $DIR/assoc_const_eq_diagnostic.rs:9:5 + --> $DIR/assoc_const_eq_diagnostic.rs:10:5 | LL | const MODE: Mode; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/const-generics/associated_const_equality/coherence.rs b/tests/ui/const-generics/associated_const_equality/coherence.rs index fb5f255c1dc4..f4081fae6144 100644 --- a/tests/ui/const-generics/associated_const_equality/coherence.rs +++ b/tests/ui/const-generics/associated_const_equality/coherence.rs @@ -1,4 +1,4 @@ -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] #![expect(incomplete_features)] pub trait IsVoid { diff --git a/tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs b/tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs index 3973c7af15b4..b7ed8ee39f87 100644 --- a/tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs +++ b/tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(associated_const_equality, min_generic_const_args, generic_const_items)] +#![feature(min_generic_const_args, generic_const_items)] #![expect(incomplete_features)] // Regression test for #133066 where we would try to evaluate `<() as Foo>::ASSOC<_>` even diff --git a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.stderr b/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.stderr index 0b487b6a7aa0..d2f28a62e04e 100644 --- a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.stderr +++ b/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.stderr @@ -1,13 +1,3 @@ -error[E0658]: associated const equality is incomplete - --> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:7:38 - | -LL | fn take0(_: impl Owner = { N }>) {} - | ^^^^^^^^^^^^ - | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0658]: generic const items are experimental --> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:2:12 | @@ -18,6 +8,16 @@ LL | const C: u32 = N; = help: add `#![feature(generic_const_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +error[E0658]: associated const equality is incomplete + --> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:7:38 + | +LL | fn take0(_: impl Owner = { N }>) {} + | ^^^^^^^^^^^^ + | + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.rs b/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.rs index 33afa7e3228e..77f0f06f8040 100644 --- a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.rs +++ b/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.rs @@ -1,4 +1,4 @@ -#![feature(generic_const_items, associated_const_equality, min_generic_const_args)] +#![feature(generic_const_items, min_generic_const_args)] #![expect(incomplete_features)] trait Foo { diff --git a/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.stderr b/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.stderr index 092faff93511..c34674604b51 100644 --- a/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.stderr +++ b/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | impl Trait for () where (U,): AssocConst
    {} | ^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates diff --git a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr index 6cf4e881adae..62bebd53b14a 100644 --- a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr +++ b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr @@ -1,8 +1,8 @@ error: unconstrained generic constant - --> $DIR/doesnt_unify_evaluatable.rs:9:11 + --> $DIR/doesnt_unify_evaluatable.rs:9:13 | LL | bar::<{ T::ASSOC }>(); - | ^^^^^^^^^^^^ + | ^^^^^^^^ | help: try adding a `where` bound | diff --git a/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs b/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs index f1305202ad45..a6988a492f61 100644 --- a/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs +++ b/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs @@ -2,7 +2,7 @@ //~^ WARN the feature `generic_const_exprs` is incomplete fn foo() { - let _ = [0u8; const { std::mem::size_of::() }]; + let _ = [0u8; { const { std::mem::size_of::() } }]; //~^ ERROR: overly complex generic constant } diff --git a/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.stderr b/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.stderr index 03b0004bf0bd..db547e6a2481 100644 --- a/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.stderr +++ b/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.stderr @@ -10,8 +10,10 @@ LL | #![feature(generic_const_exprs)] error: overly complex generic constant --> $DIR/const-block-is-poly.rs:5:19 | -LL | let _ = [0u8; const { std::mem::size_of::() }]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ const blocks are not supported in generic constants +LL | let _ = [0u8; { const { std::mem::size_of::() } }]; + | ^^----------------------------------^^ + | | + | const blocks are not supported in generic constants | = help: consider moving this anonymous constant into a `const` function = note: this operation may be supported in the future diff --git a/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs b/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs index b9537014767e..8d7ec1867857 100644 --- a/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs +++ b/tests/ui/const-generics/generic_const_exprs/feature-attribute-missing-in-dependent-crate-ice.rs @@ -11,7 +11,7 @@ struct Wrapper(i64); impl aux::FromSlice for Wrapper { fn validate_slice(_: &[[u8; Self::SIZE]]) -> Result<(), aux::Error> { - //~^ ERROR generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR generic `Self` Ok(()) } } diff --git a/tests/ui/const-generics/ice-68875.rs b/tests/ui/const-generics/ice-68875.rs index cc9546be2c92..7bf6a824729a 100644 --- a/tests/ui/const-generics/ice-68875.rs +++ b/tests/ui/const-generics/ice-68875.rs @@ -1,7 +1,7 @@ //@ check-fail struct DataWrapper<'a> { - data: &'a [u8; Self::SIZE], //~ ERROR generic `Self` types are currently not permitted in anonymous constants + data: &'a [u8; Self::SIZE], //~ ERROR generic `Self` } impl DataWrapper<'_> { diff --git a/tests/ui/const-generics/issues/issue-56445-2.rs b/tests/ui/const-generics/issues/issue-56445-2.rs index e078c8487c72..11c844340080 100644 --- a/tests/ui/const-generics/issues/issue-56445-2.rs +++ b/tests/ui/const-generics/issues/issue-56445-2.rs @@ -5,7 +5,7 @@ impl<'a> OnDiskDirEntry<'a> { const LFN_FRAGMENT_LEN: usize = 2; fn lfn_contents(&self) -> [char; Self::LFN_FRAGMENT_LEN] { loop { } } - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR: generic `Self` } fn main() {} diff --git a/tests/ui/const-generics/issues/issue-56445-3.rs b/tests/ui/const-generics/issues/issue-56445-3.rs index c29df14586e2..a9a4a48ab675 100644 --- a/tests/ui/const-generics/issues/issue-56445-3.rs +++ b/tests/ui/const-generics/issues/issue-56445-3.rs @@ -2,7 +2,7 @@ pub struct Memory<'rom> { rom: &'rom [u8], ram: [u8; Self::SIZE], - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR: generic `Self` } impl<'rom> Memory<'rom> { diff --git a/tests/ui/const-generics/issues/issue-67945-2.rs b/tests/ui/const-generics/issues/issue-67945-2.rs index ce48b3f86a65..d3c5c891f760 100644 --- a/tests/ui/const-generics/issues/issue-67945-2.rs +++ b/tests/ui/const-generics/issues/issue-67945-2.rs @@ -7,7 +7,7 @@ struct Bug { A: [(); { //[full]~^ ERROR overly complex generic constant let x: Option> = None; - //[min]~^ ERROR generic `Self` types are currently not permitted in anonymous constants + //[min]~^ ERROR generic `Self` 0 }], B: S diff --git a/tests/ui/const-generics/issues/issue-88119.rs b/tests/ui/const-generics/issues/issue-88119.rs index d44b5ab985b0..fb279dd824f8 100644 --- a/tests/ui/const-generics/issues/issue-88119.rs +++ b/tests/ui/const-generics/issues/issue-88119.rs @@ -1,5 +1,4 @@ -//@ known-bug: #110395 -//@ compile-flags: -Znext-solver +//@ check-pass #![allow(incomplete_features)] #![feature(const_trait_impl, generic_const_exprs)] diff --git a/tests/ui/const-generics/issues/issue-88119.stderr b/tests/ui/const-generics/issues/issue-88119.stderr deleted file mode 100644 index 0bdf153468bc..000000000000 --- a/tests/ui/const-generics/issues/issue-88119.stderr +++ /dev/null @@ -1,95 +0,0 @@ -error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed - --> $DIR/issue-88119.rs:4:30 - | -LL | #![feature(const_trait_impl, generic_const_exprs)] - | ^^^^^^^^^^^^^^^^^^^ - | - = help: remove one of these features - -error[E0275]: overflow evaluating the requirement `&T: [const] ConstName` - --> $DIR/issue-88119.rs:18:49 - | -LL | impl const ConstName for &T - | ^^ - -error[E0275]: overflow evaluating the requirement `&T: ConstName` - --> $DIR/issue-88119.rs:18:49 - | -LL | impl const ConstName for &T - | ^^ - -error[E0275]: overflow evaluating the requirement `[(); name_len::()] well-formed` - --> $DIR/issue-88119.rs:20:5 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: required by a bound in `<&T as ConstName>` - --> $DIR/issue-88119.rs:20:5 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>` - -error[E0275]: overflow evaluating the requirement `[(); name_len::()] well-formed` - --> $DIR/issue-88119.rs:20:10 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^ - | -note: required by a bound in `<&T as ConstName>` - --> $DIR/issue-88119.rs:20:5 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>` - -error[E0275]: overflow evaluating the requirement `&mut T: [const] ConstName` - --> $DIR/issue-88119.rs:25:49 - | -LL | impl const ConstName for &mut T - | ^^^^^^ - -error[E0275]: overflow evaluating the requirement `&mut T: ConstName` - --> $DIR/issue-88119.rs:25:49 - | -LL | impl const ConstName for &mut T - | ^^^^^^ - -error[E0275]: overflow evaluating the requirement `[(); name_len::()] well-formed` - --> $DIR/issue-88119.rs:27:5 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^^^^^^^ - | -note: required by a bound in `<&mut T as ConstName>` - --> $DIR/issue-88119.rs:27:5 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>` - -error[E0275]: overflow evaluating the requirement `[(); name_len::()] well-formed` - --> $DIR/issue-88119.rs:27:10 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^ - | -note: required by a bound in `<&mut T as ConstName>` - --> $DIR/issue-88119.rs:27:5 - | -LL | [(); name_len::()]:, - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>` - -error[E0275]: overflow evaluating the requirement `&&mut u8: ConstName` - --> $DIR/issue-88119.rs:32:35 - | -LL | pub const ICE_1: &'static [u8] = <&&mut u8 as ConstName>::NAME_BYTES; - | ^^^^^^^^ - -error[E0275]: overflow evaluating the requirement `&mut &u8: ConstName` - --> $DIR/issue-88119.rs:33:35 - | -LL | pub const ICE_2: &'static [u8] = <&mut &u8 as ConstName>::NAME_BYTES; - | ^^^^^^^^ - -error: aborting due to 11 previous errors - -For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.rs b/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.rs new file mode 100644 index 000000000000..e47052523fa3 --- /dev/null +++ b/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.rs @@ -0,0 +1,20 @@ +#![feature(min_generic_const_args, adt_const_params, unsized_const_params)] +#![expect(incomplete_features)] + +trait Trait { + #[type_const] + const ASSOC: usize; +} + +fn takes_tuple() {} +fn takes_nested_tuple() {} + +fn generic_caller() { + takes_tuple::<{ (N, N + 1) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block + takes_tuple::<{ (N, T::ASSOC + 1) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block + + takes_nested_tuple::<{ (N, (N, N + 1)) }>(); //~ ERROR complex const arguments must be placed inside of a `const` block + takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>(); //~ ERROR generic parameters may not be used in const operations +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.stderr b/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.stderr new file mode 100644 index 000000000000..dbc64a1bf59d --- /dev/null +++ b/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_complex.stderr @@ -0,0 +1,26 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/adt_expr_arg_tuple_expr_complex.rs:13:25 + | +LL | takes_tuple::<{ (N, N + 1) }>(); + | ^^^^^ + +error: complex const arguments must be placed inside of a `const` block + --> $DIR/adt_expr_arg_tuple_expr_complex.rs:14:25 + | +LL | takes_tuple::<{ (N, T::ASSOC + 1) }>(); + | ^^^^^^^^^^^^ + +error: complex const arguments must be placed inside of a `const` block + --> $DIR/adt_expr_arg_tuple_expr_complex.rs:16:36 + | +LL | takes_nested_tuple::<{ (N, (N, N + 1)) }>(); + | ^^^^^ + +error: generic parameters may not be used in const operations + --> $DIR/adt_expr_arg_tuple_expr_complex.rs:17:44 + | +LL | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>(); + | ^ + +error: aborting due to 4 previous errors + diff --git a/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_simple.rs b/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_simple.rs new file mode 100644 index 000000000000..60c4c6e952cf --- /dev/null +++ b/tests/ui/const-generics/mgca/adt_expr_arg_tuple_expr_simple.rs @@ -0,0 +1,22 @@ +//@ check-pass + +#![feature(min_generic_const_args, adt_const_params, unsized_const_params)] +#![expect(incomplete_features)] + +trait Trait { + #[type_const] + const ASSOC: usize; +} + +fn takes_tuple() {} +fn takes_nested_tuple() {} + +fn generic_caller() { + takes_tuple::<{ (N, N2) }>(); + takes_tuple::<{ (N, T::ASSOC) }>(); + + takes_nested_tuple::<{ (N, (N, N2)) }>(); + takes_nested_tuple::<{ (N, (N, T::ASSOC)) }>(); +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/adt_expr_erroneuous_inits.stderr b/tests/ui/const-generics/mgca/adt_expr_erroneuous_inits.stderr index 49d3f67003dc..72e0e94ff625 100644 --- a/tests/ui/const-generics/mgca/adt_expr_erroneuous_inits.stderr +++ b/tests/ui/const-generics/mgca/adt_expr_erroneuous_inits.stderr @@ -23,7 +23,7 @@ error: struct expression with missing field initialiser for `field` --> $DIR/adt_expr_erroneuous_inits.rs:16:17 | LL | accepts::<{ Foo:: { }}>(); - | ^^^^^^^^^ + | ^^^^^^^^^^^^^ error: struct expression with multiple initialisers for `field` --> $DIR/adt_expr_erroneuous_inits.rs:18:49 @@ -35,13 +35,13 @@ error: struct expression with invalid base path --> $DIR/adt_expr_erroneuous_inits.rs:20:17 | LL | accepts::<{ Fooo:: { field: const { 1 } }}>(); - | ^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: struct expression with invalid base path --> $DIR/adt_expr_erroneuous_inits.rs:23:17 | LL | accepts::<{ NonStruct { }}>(); - | ^^^^^^^^^ + | ^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/tests/ui/const-generics/mgca/const-ctor-overflow-eval.rs b/tests/ui/const-generics/mgca/const-ctor-overflow-eval.rs new file mode 100644 index 000000000000..6a4ee3ed1772 --- /dev/null +++ b/tests/ui/const-generics/mgca/const-ctor-overflow-eval.rs @@ -0,0 +1,19 @@ +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] +use std::marker::ConstParamTy; + +#[derive(ConstParamTy, PartialEq, Eq)] +struct U; + +#[derive(ConstParamTy, PartialEq, Eq)] +//~^ ERROR overflow evaluating the requirement `S well-formed` +//~| ERROR overflow evaluating the requirement `S well-formed` + +struct S() +where + S<{ U }>:; +//~^ ERROR overflow evaluating the requirement `S well-formed` +//~| ERROR overflow evaluating the requirement `S well-formed` +//~| ERROR overflow evaluating the requirement `S well-formed` + +fn main() {} diff --git a/tests/ui/const-generics/mgca/const-ctor-overflow-eval.stderr b/tests/ui/const-generics/mgca/const-ctor-overflow-eval.stderr new file mode 100644 index 000000000000..4c5ad645bc45 --- /dev/null +++ b/tests/ui/const-generics/mgca/const-ctor-overflow-eval.stderr @@ -0,0 +1,80 @@ +error[E0275]: overflow evaluating the requirement `S well-formed` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | S<{ U }>:; + | ^^^^^^^^ + | +note: required by a bound in `S` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | struct S() + | - required by a bound in this struct +LL | where +LL | S<{ U }>:; + | ^^^^^^^^ required by this bound in `S` + +error[E0275]: overflow evaluating the requirement `S well-formed` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | S<{ U }>:; + | ^^^^^^^^ + | +note: required by a bound in `S` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | struct S() + | - required by a bound in this struct +LL | where +LL | S<{ U }>:; + | ^^^^^^^^ required by this bound in `S` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0275]: overflow evaluating the requirement `S well-formed` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | S<{ U }>:; + | ^^^^^^^^ + | +note: required by a bound in `S` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | struct S() + | - required by a bound in this struct +LL | where +LL | S<{ U }>:; + | ^^^^^^^^ required by this bound in `S` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0275]: overflow evaluating the requirement `S well-formed` + --> $DIR/const-ctor-overflow-eval.rs:8:24 + | +LL | #[derive(ConstParamTy, PartialEq, Eq)] + | ^^^^^^^^^ + | +note: required by a bound in `S` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | struct S() + | - required by a bound in this struct +LL | where +LL | S<{ U }>:; + | ^^^^^^^^ required by this bound in `S` + +error[E0275]: overflow evaluating the requirement `S well-formed` + --> $DIR/const-ctor-overflow-eval.rs:8:35 + | +LL | #[derive(ConstParamTy, PartialEq, Eq)] + | ^^ + | +note: required by a bound in `S` + --> $DIR/const-ctor-overflow-eval.rs:14:5 + | +LL | struct S() + | - required by a bound in this struct +LL | where +LL | S<{ U }>:; + | ^^^^^^^^ required by this bound in `S` + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/const-generics/mgca/const-ctor-with-error.rs b/tests/ui/const-generics/mgca/const-ctor-with-error.rs new file mode 100644 index 000000000000..95a910e3dd2c --- /dev/null +++ b/tests/ui/const-generics/mgca/const-ctor-with-error.rs @@ -0,0 +1,19 @@ +// to ensure it does not ices like before + +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] +use std::marker::ConstParamTy; + +#[derive(ConstParamTy, PartialEq, Eq)] +enum Option { + #[allow(dead_code)] + Some(T), + None, +} + +fn pass_enum>() {} + +fn main() { + pass_enum::<{ None }>(); + //~^ ERROR missing generics for enum `std::option::Option` +} diff --git a/tests/ui/const-generics/mgca/const-ctor-with-error.stderr b/tests/ui/const-generics/mgca/const-ctor-with-error.stderr new file mode 100644 index 000000000000..8684457a978b --- /dev/null +++ b/tests/ui/const-generics/mgca/const-ctor-with-error.stderr @@ -0,0 +1,14 @@ +error[E0107]: missing generics for enum `std::option::Option` + --> $DIR/const-ctor-with-error.rs:17:19 + | +LL | pass_enum::<{ None }>(); + | ^^^^ expected 1 generic argument + | +help: add missing generic argument + | +LL | pass_enum::<{ None }>(); + | +++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/const-generics/mgca/const-ctor.rs b/tests/ui/const-generics/mgca/const-ctor.rs new file mode 100644 index 000000000000..19900b56a816 --- /dev/null +++ b/tests/ui/const-generics/mgca/const-ctor.rs @@ -0,0 +1,49 @@ +//! Regression test for +//! +//! + +//@ check-pass + +#![feature( + min_generic_const_args, + adt_const_params, + generic_const_parameter_types, + unsized_const_params +)] +#![expect(incomplete_features)] +use std::marker::{ConstParamTy, ConstParamTy_}; +#[derive(ConstParamTy, PartialEq, Eq)] +struct Colour; + +#[derive(ConstParamTy, PartialEq, Eq)] +enum A { + B, +} + +#[derive(ConstParamTy, PartialEq, Eq)] +enum MyOption { + #[allow(dead_code)] + Some(T), + None, +} + +#[derive(ConstParamTy, PartialEq, Eq)] +struct Led; + +#[derive(Eq, PartialEq, ConstParamTy)] +struct Foo; + +fn pass_enum>() {} + +fn accepts_foo>() {} + +fn accepts_bar>() {} + +fn test() { + accepts_foo:: }>(); + accepts_bar:: }>(); +} + +fn main() { + Led::<{ Colour }>; +} diff --git a/tests/ui/const-generics/mgca/early-bound-param-lt-bad.rs b/tests/ui/const-generics/mgca/early-bound-param-lt-bad.rs new file mode 100644 index 000000000000..0ee2b4eb45f6 --- /dev/null +++ b/tests/ui/const-generics/mgca/early-bound-param-lt-bad.rs @@ -0,0 +1,13 @@ +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +trait Trait {} + +fn foo<'a, T>() +where + 'a: 'a, + T: Trait + //~^ ERROR generic parameters may not be used in const operations +{} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/early-bound-param-lt-bad.stderr b/tests/ui/const-generics/mgca/early-bound-param-lt-bad.stderr new file mode 100644 index 000000000000..461a26e33a3c --- /dev/null +++ b/tests/ui/const-generics/mgca/early-bound-param-lt-bad.stderr @@ -0,0 +1,8 @@ +error: generic parameters may not be used in const operations + --> $DIR/early-bound-param-lt-bad.rs:9:30 + | +LL | T: Trait + | ^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-2.rs b/tests/ui/const-generics/mgca/explicit_anon_consts-2.rs deleted file mode 100644 index 37a3321a291e..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(associated_const_equality, generic_const_items, min_generic_const_args)] -#![expect(incomplete_features)] -// library crates exercise weirder code paths around -// DefIds which were created for const args. -#![crate_type = "lib"] - -struct Foo; - -type Alias = Foo; -//~^ ERROR: generic parameters may not be used in const operations diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-2.stderr b/tests/ui/const-generics/mgca/explicit_anon_consts-2.stderr deleted file mode 100644 index 8d8abd9ef313..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-2.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/explicit_anon_consts-2.rs:9:42 - | -LL | type Alias = Foo; - | ^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-3.rs b/tests/ui/const-generics/mgca/explicit_anon_consts-3.rs deleted file mode 100644 index ad7ae7c511ff..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-3.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(associated_const_equality, generic_const_items, min_generic_const_args)] -#![expect(incomplete_features)] -// library crates exercise weirder code paths around -// DefIds which were created for const args. -#![crate_type = "lib"] - -struct Foo; - -type Alias = [(); const { N }]; -//~^ ERROR: generic parameters may not be used in const operations diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-3.stderr b/tests/ui/const-generics/mgca/explicit_anon_consts-3.stderr deleted file mode 100644 index fe2c40486aeb..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-3.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/explicit_anon_consts-3.rs:9:43 - | -LL | type Alias = [(); const { N }]; - | ^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-4.rs b/tests/ui/const-generics/mgca/explicit_anon_consts-4.rs deleted file mode 100644 index bcf34bdb13ee..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-4.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(associated_const_equality, generic_const_items, min_generic_const_args)] -#![expect(incomplete_features)] -// library crates exercise weirder code paths around -// DefIds which were created for const args. -#![crate_type = "lib"] - -#[type_const] -const ITEM3: usize = const { N }; -//~^ ERROR: generic parameters may not be used in const operations diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-4.stderr b/tests/ui/const-generics/mgca/explicit_anon_consts-4.stderr deleted file mode 100644 index 7fc78257aa2c..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-4.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/explicit_anon_consts-4.rs:8:46 - | -LL | const ITEM3: usize = const { N }; - | ^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-5.rs b/tests/ui/const-generics/mgca/explicit_anon_consts-5.rs deleted file mode 100644 index aa14ec4275e4..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-5.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(associated_const_equality, generic_const_items, min_generic_const_args)] -#![expect(incomplete_features)] -// library crates exercise weirder code paths around -// DefIds which were created for const args. -#![crate_type = "lib"] - -trait Trait { - #[type_const] - const ASSOC: usize; -} - -fn ace_bounds< - const N: usize, - T: Trait, - //~^ ERROR: generic parameters may not be used in const operations ->() {} diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-5.stderr b/tests/ui/const-generics/mgca/explicit_anon_consts-5.stderr deleted file mode 100644 index 6d2ab078c8cf..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-5.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/explicit_anon_consts-5.rs:14:30 - | -LL | T: Trait, - | ^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-6.rs b/tests/ui/const-generics/mgca/explicit_anon_consts-6.rs deleted file mode 100644 index 600f4b9cd7f9..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-6.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(associated_const_equality, generic_const_items, min_generic_const_args)] -#![expect(incomplete_features)] -// library crates exercise weirder code paths around -// DefIds which were created for const args. -#![crate_type = "lib"] - -struct Default3; -//~^ ERROR: generic parameters may not be used in const operations diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts-6.stderr b/tests/ui/const-generics/mgca/explicit_anon_consts-6.stderr deleted file mode 100644 index 727e478bee8e..000000000000 --- a/tests/ui/const-generics/mgca/explicit_anon_consts-6.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/explicit_anon_consts-6.rs:7:58 - | -LL | struct Default3; - | ^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts.rs b/tests/ui/const-generics/mgca/explicit_anon_consts.rs index f7df3eddfa64..bf825a44b1c0 100644 --- a/tests/ui/const-generics/mgca/explicit_anon_consts.rs +++ b/tests/ui/const-generics/mgca/explicit_anon_consts.rs @@ -1,30 +1,28 @@ -#![feature(associated_const_equality, generic_const_items, min_generic_const_args)] +#![feature(generic_const_items, min_generic_const_args)] #![expect(incomplete_features)] // library crates exercise weirder code paths around // DefIds which were created for const args. #![crate_type = "lib"] -// FIXME(mgca): merge the split out parts of this test back in - struct Foo; type Adt1 = Foo; type Adt2 = Foo<{ N }>; -// explicit_anon_consts-2.rs -// type Adt3 = Foo; +type Adt3 = Foo; +//~^ ERROR: generic parameters may not be used in const operations type Adt4 = Foo<{ 1 + 1 }>; //~^ ERROR: complex const arguments must be placed inside of a `const` block type Adt5 = Foo; type Arr = [(); N]; type Arr2 = [(); { N }]; -// explicit_anon_consts-3.rs -// type Arr3 = [(); const { N }]; +type Arr3 = [(); const { N }]; +//~^ ERROR: generic parameters may not be used in const operations type Arr4 = [(); 1 + 1]; //~^ ERROR: complex const arguments must be placed inside of a `const` block type Arr5 = [(); const { 1 + 1 }]; -fn repeats() { +fn repeats() -> [(); N] { let _1 = [(); N]; let _2 = [(); { N }]; let _3 = [(); const { N }]; @@ -32,15 +30,17 @@ fn repeats() { let _4 = [(); 1 + 1]; //~^ ERROR: complex const arguments must be placed inside of a `const` block let _5 = [(); const { 1 + 1 }]; + let _6: [(); const { N }] = todo!(); + //~^ ERROR: generic parameters may not be used in const operations } #[type_const] const ITEM1: usize = N; #[type_const] const ITEM2: usize = { N }; -// explicit_anon_consts-4.rs -// #[type_const] -// const ITEM3: usize = const { N }; +#[type_const] +const ITEM3: usize = const { N }; +//~^ ERROR: generic parameters may not be used in const operations #[type_const] const ITEM4: usize = { 1 + 1 }; //~^ ERROR: complex const arguments must be placed inside of a `const` block @@ -57,8 +57,8 @@ fn ace_bounds< // We skip the T1 case because it doesn't resolve // T1: Trait, T2: Trait, - // explicit_anon_consts-5.rs - // T3: Trait, + T3: Trait, + //~^ ERROR: generic parameters may not be used in const operations T4: Trait, //~^ ERROR: complex const arguments must be placed inside of a `const` block T5: Trait, @@ -66,8 +66,8 @@ fn ace_bounds< struct Default1; struct Default2; -// explicit_anon_consts-6.rs -// struct Default3; +struct Default3; +//~^ ERROR: generic parameters may not be used in const operations struct Default4; //~^ ERROR: complex const arguments must be placed inside of a `const` block struct Default5; diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts.stderr b/tests/ui/const-generics/mgca/explicit_anon_consts.stderr index 1605dd8069d0..551815c4c31a 100644 --- a/tests/ui/const-generics/mgca/explicit_anon_consts.stderr +++ b/tests/ui/const-generics/mgca/explicit_anon_consts.stderr @@ -1,17 +1,17 @@ error: complex const arguments must be placed inside of a `const` block - --> $DIR/explicit_anon_consts.rs:15:33 + --> $DIR/explicit_anon_consts.rs:13:33 | LL | type Adt4 = Foo<{ 1 + 1 }>; | ^^^^^^^^^ error: complex const arguments must be placed inside of a `const` block - --> $DIR/explicit_anon_consts.rs:23:34 + --> $DIR/explicit_anon_consts.rs:21:34 | LL | type Arr4 = [(); 1 + 1]; | ^^^^^ error: complex const arguments must be placed inside of a `const` block - --> $DIR/explicit_anon_consts.rs:32:19 + --> $DIR/explicit_anon_consts.rs:30:19 | LL | let _4 = [(); 1 + 1]; | ^^^^^ @@ -35,10 +35,46 @@ LL | struct Default4; | ^^^^^^^^^ error: generic parameters may not be used in const operations - --> $DIR/explicit_anon_consts.rs:30:27 + --> $DIR/explicit_anon_consts.rs:42:46 + | +LL | const ITEM3: usize = const { N }; + | ^ + +error: generic parameters may not be used in const operations + --> $DIR/explicit_anon_consts.rs:60:31 + | +LL | T3: Trait, + | ^ + +error: generic parameters may not be used in const operations + --> $DIR/explicit_anon_consts.rs:69:58 + | +LL | struct Default3; + | ^ + +error: generic parameters may not be used in const operations + --> $DIR/explicit_anon_consts.rs:28:27 | LL | let _3 = [(); const { N }]; | ^ -error: aborting due to 7 previous errors +error: generic parameters may not be used in const operations + --> $DIR/explicit_anon_consts.rs:33:26 + | +LL | let _6: [(); const { N }] = todo!(); + | ^ + +error: generic parameters may not be used in const operations + --> $DIR/explicit_anon_consts.rs:11:41 + | +LL | type Adt3 = Foo; + | ^ + +error: generic parameters may not be used in const operations + --> $DIR/explicit_anon_consts.rs:19:42 + | +LL | type Arr3 = [(); const { N }]; + | ^ + +error: aborting due to 13 previous errors diff --git a/tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs b/tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs index 8c8c5c8e8f88..eb8f04b8b24b 100644 --- a/tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs +++ b/tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs @@ -4,7 +4,7 @@ // However, we don't allow so for const arguments in field init positions. // This is just harder to implement so we did not do so. -#![feature(min_generic_const_args, adt_const_params, associated_const_equality)] +#![feature(min_generic_const_args, adt_const_params)] #![expect(incomplete_features)] trait Trait { diff --git a/tests/ui/const-generics/mgca/higher-ranked-lts-bad.rs b/tests/ui/const-generics/mgca/higher-ranked-lts-bad.rs new file mode 100644 index 000000000000..368644b641df --- /dev/null +++ b/tests/ui/const-generics/mgca/higher-ranked-lts-bad.rs @@ -0,0 +1,12 @@ +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +trait Trait {} + +fn foo() +where + for<'a> T: Trait + //~^ ERROR cannot capture late-bound lifetime in constant +{} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/higher-ranked-lts-bad.stderr b/tests/ui/const-generics/mgca/higher-ranked-lts-bad.stderr new file mode 100644 index 000000000000..0f7389cac5cd --- /dev/null +++ b/tests/ui/const-generics/mgca/higher-ranked-lts-bad.stderr @@ -0,0 +1,8 @@ +error: cannot capture late-bound lifetime in constant + --> $DIR/higher-ranked-lts-bad.rs:8:38 + | +LL | for<'a> T: Trait + | -- lifetime defined here ^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/higher-ranked-lts-good.rs b/tests/ui/const-generics/mgca/higher-ranked-lts-good.rs new file mode 100644 index 000000000000..5b455bb1e71e --- /dev/null +++ b/tests/ui/const-generics/mgca/higher-ranked-lts-good.rs @@ -0,0 +1,13 @@ +//@ check-pass + +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +trait Trait {} + +fn foo() +where + T: Trait fn(&'a ()); 1 }> +{} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/late-bound-param-lt-bad.rs b/tests/ui/const-generics/mgca/late-bound-param-lt-bad.rs new file mode 100644 index 000000000000..5c57bdfb9024 --- /dev/null +++ b/tests/ui/const-generics/mgca/late-bound-param-lt-bad.rs @@ -0,0 +1,12 @@ +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +trait Trait {} + +fn foo<'a, T>() +where + T: Trait + //~^ ERROR cannot capture late-bound lifetime in constant +{} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/late-bound-param-lt-bad.stderr b/tests/ui/const-generics/mgca/late-bound-param-lt-bad.stderr new file mode 100644 index 000000000000..e5c22f282544 --- /dev/null +++ b/tests/ui/const-generics/mgca/late-bound-param-lt-bad.stderr @@ -0,0 +1,11 @@ +error: cannot capture late-bound lifetime in constant + --> $DIR/late-bound-param-lt-bad.rs:8:30 + | +LL | fn foo<'a, T>() + | -- lifetime defined here +LL | where +LL | T: Trait + | ^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/printing_valtrees_supports_non_values.rs b/tests/ui/const-generics/mgca/printing_valtrees_supports_non_values.rs new file mode 100644 index 000000000000..484d6f14a82a --- /dev/null +++ b/tests/ui/const-generics/mgca/printing_valtrees_supports_non_values.rs @@ -0,0 +1,38 @@ +//! Regression test for +//@ edition 2024 + +#![allow(incomplete_features)] +#![feature(min_generic_const_args, adt_const_params)] + +#[derive(Eq, PartialEq, core::marker::ConstParamTy)] +struct Foo; + +trait Trait { + #[type_const] + const ASSOC: usize; +} + +fn foo() {} + +fn bar() { + foo::<{ Option::Some:: { 0: N } }>; + //~^ ERROR the constant `Option::::Some(N)` is not of type `Foo` +} + +fn baz() { + foo::<{ Option::Some:: { 0: ::ASSOC } }>(); + //~^ ERROR the constant `Option::::Some(::ASSOC)` is not of type `Foo` +} + +fn main() {} + +fn test_ice_missing_bound() { + foo::<{Option::Some::{0: ::ASSOC}}>(); + //~^ ERROR the trait bound `T: Trait` is not satisfied + //~| ERROR the constant `Option::::Some(_)` is not of type `Foo` +} + +fn test_underscore_inference() { + foo::<{ Option::Some:: { 0: _ } }>(); + //~^ ERROR the constant `Option::::Some(_)` is not of type `Foo` +} diff --git a/tests/ui/const-generics/mgca/printing_valtrees_supports_non_values.stderr b/tests/ui/const-generics/mgca/printing_valtrees_supports_non_values.stderr new file mode 100644 index 000000000000..bd2162468944 --- /dev/null +++ b/tests/ui/const-generics/mgca/printing_valtrees_supports_non_values.stderr @@ -0,0 +1,62 @@ +error: the constant `Option::::Some(N)` is not of type `Foo` + --> $DIR/printing_valtrees_supports_non_values.rs:18:13 + | +LL | foo::<{ Option::Some:: { 0: N } }>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo`, found `Option` + | +note: required by a const generic parameter in `foo` + --> $DIR/printing_valtrees_supports_non_values.rs:15:8 + | +LL | fn foo() {} + | ^^^^^^^^^^^^ required by this const generic parameter in `foo` + +error: the constant `Option::::Some(::ASSOC)` is not of type `Foo` + --> $DIR/printing_valtrees_supports_non_values.rs:23:13 + | +LL | foo::<{ Option::Some:: { 0: ::ASSOC } }>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo`, found `Option` + | +note: required by a const generic parameter in `foo` + --> $DIR/printing_valtrees_supports_non_values.rs:15:8 + | +LL | fn foo() {} + | ^^^^^^^^^^^^ required by this const generic parameter in `foo` + +error[E0277]: the trait bound `T: Trait` is not satisfied + --> $DIR/printing_valtrees_supports_non_values.rs:30:5 + | +LL | foo::<{Option::Some::{0: ::ASSOC}}>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` + | +help: consider restricting type parameter `T` with trait `Trait` + | +LL | fn test_ice_missing_bound() { + | +++++++ + +error: the constant `Option::::Some(_)` is not of type `Foo` + --> $DIR/printing_valtrees_supports_non_values.rs:30:12 + | +LL | foo::<{Option::Some::{0: ::ASSOC}}>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo`, found `Option` + | +note: required by a const generic parameter in `foo` + --> $DIR/printing_valtrees_supports_non_values.rs:15:8 + | +LL | fn foo() {} + | ^^^^^^^^^^^^ required by this const generic parameter in `foo` + +error: the constant `Option::::Some(_)` is not of type `Foo` + --> $DIR/printing_valtrees_supports_non_values.rs:36:13 + | +LL | foo::<{ Option::Some:: { 0: _ } }>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo`, found `Option` + | +note: required by a const generic parameter in `foo` + --> $DIR/printing_valtrees_supports_non_values.rs:15:8 + | +LL | fn foo() {} + | ^^^^^^^^^^^^ required by this const generic parameter in `foo` + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/const-generics/mgca/selftyalias-containing-param.rs b/tests/ui/const-generics/mgca/selftyalias-containing-param.rs new file mode 100644 index 000000000000..5ab39799078f --- /dev/null +++ b/tests/ui/const-generics/mgca/selftyalias-containing-param.rs @@ -0,0 +1,13 @@ +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +struct S([(); N]); + +impl S { + fn foo() -> [(); const { let _: Self = loop {}; 1 }] { + //~^ ERROR generic `Self` + todo!() + } +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/selftyalias-containing-param.stderr b/tests/ui/const-generics/mgca/selftyalias-containing-param.stderr new file mode 100644 index 000000000000..fdd3e6efdf65 --- /dev/null +++ b/tests/ui/const-generics/mgca/selftyalias-containing-param.stderr @@ -0,0 +1,14 @@ +error: generic `Self` types are currently not permitted in anonymous constants + --> $DIR/selftyalias-containing-param.rs:7:37 + | +LL | fn foo() -> [(); const { let _: Self = loop {}; 1 }] { + | ^^^^ + | +note: not a concrete type + --> $DIR/selftyalias-containing-param.rs:6:22 + | +LL | impl S { + | ^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/selftyparam.rs b/tests/ui/const-generics/mgca/selftyparam.rs new file mode 100644 index 000000000000..58433405b8ca --- /dev/null +++ b/tests/ui/const-generics/mgca/selftyparam.rs @@ -0,0 +1,9 @@ +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +trait Tr { + fn foo() -> [(); const { let _: Self; 1 }]; + //~^ ERROR generic parameters +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/selftyparam.stderr b/tests/ui/const-generics/mgca/selftyparam.stderr new file mode 100644 index 000000000000..376e63da9a75 --- /dev/null +++ b/tests/ui/const-generics/mgca/selftyparam.stderr @@ -0,0 +1,8 @@ +error: generic parameters may not be used in const operations + --> $DIR/selftyparam.rs:5:37 + | +LL | fn foo() -> [(); const { let _: Self; 1 }]; + | ^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/mgca/tuple_ctor_arg_simple.rs b/tests/ui/const-generics/mgca/tuple_ctor_arg_simple.rs new file mode 100644 index 000000000000..a5b3d3d0d5b6 --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_arg_simple.rs @@ -0,0 +1,52 @@ +//@ run-pass +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] +#![allow(dead_code)] + +use std::marker::ConstParamTy; + +#[derive(Debug, Eq, PartialEq, ConstParamTy)] +struct Point(u32, u32); + +#[derive(Debug, Eq, PartialEq, ConstParamTy)] +enum MyEnum { + Variant(T), + Other, +} + +trait Trait { + #[type_const] + const ASSOC: u32; +} + +fn with_point() -> Point { + P +} + +fn with_enum>() -> MyEnum { + E +} + +fn test() { + with_point::<{ Point(::ASSOC, N) }>(); +} + +fn test_basic() { + with_point::<{ Point(N, N) }>(); + with_point::<{ Point(const { 5 }, const { 10 }) }>(); + + with_enum::<{ MyEnum::Variant::(N) }>(); + with_enum::<{ MyEnum::Variant::(const { 42 }) }>(); + + with_enum::<{ >::Variant(N) }>(); +} + +fn main() { + test_basic::<5>(); + + let p = with_point::<{ Point(const { 1 }, const { 2 }) }>(); + assert_eq!(p, Point(1, 2)); + + let e = with_enum::<{ MyEnum::Variant::(const { 10 }) }>(); + assert_eq!(e, MyEnum::Variant(10)); +} diff --git a/tests/ui/const-generics/mgca/tuple_ctor_complex_args.rs b/tests/ui/const-generics/mgca/tuple_ctor_complex_args.rs new file mode 100644 index 000000000000..2e39f8952b11 --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_complex_args.rs @@ -0,0 +1,19 @@ +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] + +use std::marker::ConstParamTy; + +#[derive(Eq, PartialEq, ConstParamTy)] +struct Point(u32, u32); + +fn with_point() {} + +fn test() { + with_point::<{ Point(N + 1, N) }>(); + //~^ ERROR complex const arguments must be placed inside of a `const` block + + with_point::<{ Point(const { N + 1 }, N) }>(); + //~^ ERROR generic parameters may not be used in const operations +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/tuple_ctor_complex_args.stderr b/tests/ui/const-generics/mgca/tuple_ctor_complex_args.stderr new file mode 100644 index 000000000000..e0ea3fd5560c --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_complex_args.stderr @@ -0,0 +1,14 @@ +error: complex const arguments must be placed inside of a `const` block + --> $DIR/tuple_ctor_complex_args.rs:12:26 + | +LL | with_point::<{ Point(N + 1, N) }>(); + | ^^^^^ + +error: generic parameters may not be used in const operations + --> $DIR/tuple_ctor_complex_args.rs:15:34 + | +LL | with_point::<{ Point(const { N + 1 }, N) }>(); + | ^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/const-generics/mgca/tuple_ctor_erroneous.rs b/tests/ui/const-generics/mgca/tuple_ctor_erroneous.rs new file mode 100644 index 000000000000..84ded05fdd0e --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_erroneous.rs @@ -0,0 +1,46 @@ +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] + +use std::marker::ConstParamTy; + +#[derive(Eq, PartialEq, ConstParamTy)] +struct Point(u32, u32); + +#[derive(Eq, PartialEq, ConstParamTy)] +enum MyEnum { + Variant(T), + Unit, +} + +const CONST_ITEM: u32 = 42; + +fn accepts_point() {} +fn accepts_enum>() {} + +fn non_ctor() {} + +fn test_errors() { + accepts_point::<{ Point(N) }>(); + //~^ ERROR tuple constructor has 2 arguments but 1 were provided + + accepts_point::<{ Point(N, N, N) }>(); + //~^ ERROR tuple constructor has 2 arguments but 3 were provided + + accepts_point::<{ UnresolvedIdent(N, N) }>(); + //~^ ERROR cannot find function, tuple struct or tuple variant `UnresolvedIdent` in this scope + //~| ERROR tuple constructor with invalid base path + + accepts_point::<{ non_ctor(N, N) }>(); + //~^ ERROR tuple constructor with invalid base path + + accepts_point::<{ CONST_ITEM(N, N) }>(); + //~^ ERROR tuple constructor with invalid base path + + accepts_point::<{ Point }>(); + //~^ ERROR the constant `Point` is not of type `Point` + + accepts_enum::<{ MyEnum::Variant:: }>(); + //~^ ERROR the constant `MyEnum::::Variant` is not of type `MyEnum` +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/tuple_ctor_erroneous.stderr b/tests/ui/const-generics/mgca/tuple_ctor_erroneous.stderr new file mode 100644 index 000000000000..cc6144b9c88a --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_erroneous.stderr @@ -0,0 +1,68 @@ +error[E0425]: cannot find function, tuple struct or tuple variant `UnresolvedIdent` in this scope + --> $DIR/tuple_ctor_erroneous.rs:29:23 + | +LL | accepts_point::<{ UnresolvedIdent(N, N) }>(); + | ^^^^^^^^^^^^^^^ not found in this scope + | +help: you might be missing a const parameter + | +LL | fn test_errors() { + | +++++++++++++++++++++++++++++++++++ + +error: tuple constructor has 2 arguments but 1 were provided + --> $DIR/tuple_ctor_erroneous.rs:23:23 + | +LL | accepts_point::<{ Point(N) }>(); + | ^^^^^^^^ + +error: tuple constructor has 2 arguments but 3 were provided + --> $DIR/tuple_ctor_erroneous.rs:26:23 + | +LL | accepts_point::<{ Point(N, N, N) }>(); + | ^^^^^^^^^^^^^^ + +error: tuple constructor with invalid base path + --> $DIR/tuple_ctor_erroneous.rs:29:23 + | +LL | accepts_point::<{ UnresolvedIdent(N, N) }>(); + | ^^^^^^^^^^^^^^^^^^^^^ + +error: tuple constructor with invalid base path + --> $DIR/tuple_ctor_erroneous.rs:33:23 + | +LL | accepts_point::<{ non_ctor(N, N) }>(); + | ^^^^^^^^^^^^^^ + +error: tuple constructor with invalid base path + --> $DIR/tuple_ctor_erroneous.rs:36:23 + | +LL | accepts_point::<{ CONST_ITEM(N, N) }>(); + | ^^^^^^^^^^^^^^^^ + +error: the constant `Point` is not of type `Point` + --> $DIR/tuple_ctor_erroneous.rs:39:23 + | +LL | accepts_point::<{ Point }>(); + | ^^^^^ expected `Point`, found struct constructor + | +note: required by a const generic parameter in `accepts_point` + --> $DIR/tuple_ctor_erroneous.rs:17:18 + | +LL | fn accepts_point() {} + | ^^^^^^^^^^^^^^ required by this const generic parameter in `accepts_point` + +error: the constant `MyEnum::::Variant` is not of type `MyEnum` + --> $DIR/tuple_ctor_erroneous.rs:42:22 + | +LL | accepts_enum::<{ MyEnum::Variant:: }>(); + | ^^^^^^^^^^^^^^^^^^^^^^ expected `MyEnum`, found enum constructor + | +note: required by a const generic parameter in `accepts_enum` + --> $DIR/tuple_ctor_erroneous.rs:18:17 + | +LL | fn accepts_enum>() {} + | ^^^^^^^^^^^^^^^^^^^^ required by this const generic parameter in `accepts_enum` + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/const-generics/mgca/tuple_ctor_in_array_len.rs b/tests/ui/const-generics/mgca/tuple_ctor_in_array_len.rs new file mode 100644 index 000000000000..5c7290b40be2 --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_in_array_len.rs @@ -0,0 +1,16 @@ +//! Regression test for + +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +pub struct S(); + +impl S { + pub fn f() -> [u8; S] { + //~^ ERROR the constant `S` is not of type `usize` + [] + //~^ ERROR mismatched types [E0308] + } +} + +pub fn main() {} diff --git a/tests/ui/const-generics/mgca/tuple_ctor_in_array_len.stderr b/tests/ui/const-generics/mgca/tuple_ctor_in_array_len.stderr new file mode 100644 index 000000000000..64c3cecd4fb5 --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_in_array_len.stderr @@ -0,0 +1,23 @@ +error: the constant `S` is not of type `usize` + --> $DIR/tuple_ctor_in_array_len.rs:9:19 + | +LL | pub fn f() -> [u8; S] { + | ^^^^^^^ expected `usize`, found struct constructor + | + = note: the length of array `[u8; S]` must be type `usize` + +error[E0308]: mismatched types + --> $DIR/tuple_ctor_in_array_len.rs:11:9 + | +LL | pub fn f() -> [u8; S] { + | ------- expected `[u8; S]` because of return type +LL | +LL | [] + | ^^ expected an array with a size of S, found one with a size of 0 + | + = note: expected array `[u8; S]` + found array `[_; 0]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/mgca/tuple_ctor_nested.rs b/tests/ui/const-generics/mgca/tuple_ctor_nested.rs new file mode 100644 index 000000000000..49a31ea3e527 --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_nested.rs @@ -0,0 +1,38 @@ +//@ run-pass +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] + +use std::marker::ConstParamTy; + +#[derive(Debug, Eq, PartialEq, ConstParamTy)] +struct Inner(u32); + +#[derive(Debug, Eq, PartialEq, ConstParamTy)] +struct Outer(Inner); + +#[derive(Debug, Eq, PartialEq, ConstParamTy)] +enum Container { + Wrap(T), +} + +fn with_outer() -> Outer { + O +} + +fn with_container>() -> Container { + C +} + +fn test() { + with_outer::<{ Outer(Inner(N)) }>(); + with_outer::<{ Outer(Inner(const { 42 })) }>(); + + with_container::<{ Container::Wrap::(Inner(N)) }>(); +} + +fn main() { + test::<5>(); + + let o = with_outer::<{ Outer(Inner(const { 10 })) }>(); + assert_eq!(o, Outer(Inner(10))); +} diff --git a/tests/ui/const-generics/mgca/tuple_ctor_type_relative.rs b/tests/ui/const-generics/mgca/tuple_ctor_type_relative.rs new file mode 100644 index 000000000000..d5a07cbb7d70 --- /dev/null +++ b/tests/ui/const-generics/mgca/tuple_ctor_type_relative.rs @@ -0,0 +1,26 @@ +//@ run-pass +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] + +use std::marker::ConstParamTy; + +#[derive(Debug, Eq, PartialEq, ConstParamTy)] +enum Option { + Some(T), +} + +fn with_option>() -> Option { + O +} + +fn test() { + with_option::<{ >::Some(N) }>(); + with_option::<{ >::Some(const { 42 }) }>(); +} + +fn main() { + test::<5>(); + + let o = with_option::<{ >::Some(const { 10 }) }>(); + assert_eq!(o, Option::Some(10)); +} diff --git a/tests/ui/const-generics/mgca/type_as_const_in_array_len.rs b/tests/ui/const-generics/mgca/type_as_const_in_array_len.rs new file mode 100644 index 000000000000..b6b76fe3fc91 --- /dev/null +++ b/tests/ui/const-generics/mgca/type_as_const_in_array_len.rs @@ -0,0 +1,14 @@ +//! Regression test for + +#![feature(min_generic_const_args)] +#![expect(incomplete_features)] + +struct B(Box<[u8; C]>); +//~^ ERROR missing generics for struct `C` +impl B { + fn d(self) { + self.0.e() + } +} +struct C<'a>(&'a u8); +fn main() {} diff --git a/tests/ui/const-generics/mgca/type_as_const_in_array_len.stderr b/tests/ui/const-generics/mgca/type_as_const_in_array_len.stderr new file mode 100644 index 000000000000..482fd730a71c --- /dev/null +++ b/tests/ui/const-generics/mgca/type_as_const_in_array_len.stderr @@ -0,0 +1,19 @@ +error[E0107]: missing generics for struct `C` + --> $DIR/type_as_const_in_array_len.rs:6:19 + | +LL | struct B(Box<[u8; C]>); + | ^ expected 1 lifetime argument + | +note: struct defined here, with 1 lifetime parameter: `'a` + --> $DIR/type_as_const_in_array_len.rs:13:8 + | +LL | struct C<'a>(&'a u8); + | ^ -- +help: add missing lifetime argument + | +LL | struct B(Box<[u8; C<'a>]>); + | ++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/const-generics/mgca/type_const-generic-param-in-type.gate.stderr b/tests/ui/const-generics/mgca/type_const-generic-param-in-type.gate.stderr new file mode 100644 index 000000000000..8a64af285da5 --- /dev/null +++ b/tests/ui/const-generics/mgca/type_const-generic-param-in-type.gate.stderr @@ -0,0 +1,38 @@ +error: anonymous constants referencing generics are not yet supported + --> $DIR/type_const-generic-param-in-type.rs:9:53 + | +LL | const FOO: [T; 0] = const { [] }; + | ^^^^^^^^^^^^ + +error: anonymous constants referencing generics are not yet supported + --> $DIR/type_const-generic-param-in-type.rs:14:38 + | +LL | const BAR: [(); N] = const { [] }; + | ^^^^^^^^^^^^ + +error: anonymous constants with lifetimes in their type are not yet supported + --> $DIR/type_const-generic-param-in-type.rs:19:30 + | +LL | const BAZ<'a>: [&'a (); 0] = const { [] }; + | ^^^^^^^^^^^^ + +error: anonymous constants referencing generics are not yet supported + --> $DIR/type_const-generic-param-in-type.rs:39:59 + | +LL | const ASSOC: [T; 0] = const { [] }; + | ^^^^^^^^^^^^ + +error: anonymous constants referencing generics are not yet supported + --> $DIR/type_const-generic-param-in-type.rs:44:50 + | +LL | const ASSOC_CONST: [(); N] = const { [] }; + | ^^^^^^^^^^^^ + +error: anonymous constants with lifetimes in their type are not yet supported + --> $DIR/type_const-generic-param-in-type.rs:49:39 + | +LL | const ASSOC_LT<'a>: [&'a (); 0] = const { [] }; + | ^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/tests/ui/const-generics/mgca/type_const-generic-param-in-type.nogate.stderr b/tests/ui/const-generics/mgca/type_const-generic-param-in-type.nogate.stderr new file mode 100644 index 000000000000..14ae276324ad --- /dev/null +++ b/tests/ui/const-generics/mgca/type_const-generic-param-in-type.nogate.stderr @@ -0,0 +1,57 @@ +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:9:45 + | +LL | const FOO: [T; 0] = const { [] }; + | ^ the type must not depend on the parameter `T` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:14:33 + | +LL | const BAR: [(); N] = const { [] }; + | ^ the type must not depend on the parameter `N` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:19:18 + | +LL | const BAZ<'a>: [&'a (); 0] = const { [] }; + | ^^ the type must not depend on the parameter `'a` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:25:51 + | +LL | const ASSOC: [T; 0]; + | ^ the type must not depend on the parameter `T` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:29:45 + | +LL | const ASSOC_CONST: [(); N]; + | ^ the type must not depend on the parameter `N` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:33:27 + | +LL | const ASSOC_LT<'a>: [&'a (); 0]; + | ^^ the type must not depend on the parameter `'a` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:39:51 + | +LL | const ASSOC: [T; 0] = const { [] }; + | ^ the type must not depend on the parameter `T` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:44:45 + | +LL | const ASSOC_CONST: [(); N] = const { [] }; + | ^ the type must not depend on the parameter `N` + +error[E0770]: the type of const parameters must not depend on other generic parameters + --> $DIR/type_const-generic-param-in-type.rs:49:27 + | +LL | const ASSOC_LT<'a>: [&'a (); 0] = const { [] }; + | ^^ the type must not depend on the parameter `'a` + +error: aborting due to 9 previous errors + +For more information about this error, try `rustc --explain E0770`. diff --git a/tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs b/tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs new file mode 100644 index 000000000000..f1a4aba9bcee --- /dev/null +++ b/tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs @@ -0,0 +1,54 @@ +//@ revisions: nogate gate +//@ [gate] check-fail +// FIXME(generic_const_parameter_types): this should pass +#![expect(incomplete_features)] +#![feature(adt_const_params, unsized_const_params, min_generic_const_args, generic_const_items)] +#![cfg_attr(gate, feature(generic_const_parameter_types))] + +#[type_const] +const FOO: [T; 0] = const { [] }; +//[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters +//[gate]~^^ ERROR anonymous constants referencing generics are not yet supported + +#[type_const] +const BAR: [(); N] = const { [] }; +//[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters +//[gate]~^^ ERROR anonymous constants referencing generics are not yet supported + +#[type_const] +const BAZ<'a>: [&'a (); 0] = const { [] }; +//[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters +//[gate]~^^ ERROR anonymous constants with lifetimes in their type are not yet supported + +trait Tr { + #[type_const] + const ASSOC: [T; 0]; + //[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters + + #[type_const] + const ASSOC_CONST: [(); N]; + //[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters + + #[type_const] + const ASSOC_LT<'a>: [&'a (); 0]; + //[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters +} + +impl Tr for () { + #[type_const] + const ASSOC: [T; 0] = const { [] }; + //[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters + //[gate]~^^ ERROR anonymous constants referencing generics are not yet supported + + #[type_const] + const ASSOC_CONST: [(); N] = const { [] }; + //[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters + //[gate]~^^ ERROR anonymous constants referencing generics are not yet supported + + #[type_const] + const ASSOC_LT<'a>: [&'a (); 0] = const { [] }; + //[nogate]~^ ERROR the type of const parameters must not depend on other generic parameters + //[gate]~^^ ERROR anonymous constants with lifetimes in their type are not yet supported +} + +fn main() {} diff --git a/tests/ui/const-generics/mgca/type_const-only-in-impl.rs b/tests/ui/const-generics/mgca/type_const-only-in-impl.rs index ae4a0004232b..1887f511bd62 100644 --- a/tests/ui/const-generics/mgca/type_const-only-in-impl.rs +++ b/tests/ui/const-generics/mgca/type_const-only-in-impl.rs @@ -1,5 +1,5 @@ #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] trait BadTr { const NUM: usize; diff --git a/tests/ui/const-generics/mgca/type_const-only-in-trait.rs b/tests/ui/const-generics/mgca/type_const-only-in-trait.rs index 8c8ff6259cae..2ff38648206a 100644 --- a/tests/ui/const-generics/mgca/type_const-only-in-trait.rs +++ b/tests/ui/const-generics/mgca/type_const-only-in-trait.rs @@ -1,5 +1,5 @@ #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] trait GoodTr { #[type_const] diff --git a/tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.stderr b/tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.stderr index 30509ddf9b46..00db630c27e9 100644 --- a/tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.stderr +++ b/tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.stderr @@ -1,58 +1,58 @@ error[E0658]: unbraced const blocks as const args are experimental - --> $DIR/unbraced_const_block_const_arg_gated.rs:7:33 + --> $DIR/unbraced_const_block_const_arg_gated.rs:7:27 | LL | const PARAM_TY: Inner, - | ^^^^^ + | ^^^^^^^^^^^ | = note: see issue #132980 for more information = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: unbraced const blocks as const args are experimental - --> $DIR/unbraced_const_block_const_arg_gated.rs:9:34 + --> $DIR/unbraced_const_block_const_arg_gated.rs:9:28 | LL | const DEFAULT: usize = const { 1 }, - | ^^^^^ + | ^^^^^^^^^^^ | = note: see issue #132980 for more information = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: unbraced const blocks as const args are experimental - --> $DIR/unbraced_const_block_const_arg_gated.rs:14:29 + --> $DIR/unbraced_const_block_const_arg_gated.rs:14:23 | LL | type NormalTy = Inner; - | ^^^^^ + | ^^^^^^^^^^^ | = note: see issue #132980 for more information = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: unbraced const blocks as const args are experimental - --> $DIR/unbraced_const_block_const_arg_gated.rs:22:24 + --> $DIR/unbraced_const_block_const_arg_gated.rs:22:18 | LL | let _: Inner; - | ^^^^^ + | ^^^^^^^^^^^ | = note: see issue #132980 for more information = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: unbraced const blocks as const args are experimental - --> $DIR/unbraced_const_block_const_arg_gated.rs:28:25 + --> $DIR/unbraced_const_block_const_arg_gated.rs:28:19 | LL | generic::(); - | ^^^^^ + | ^^^^^^^^^^^ | = note: see issue #132980 for more information = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: unbraced const blocks as const args are experimental - --> $DIR/unbraced_const_block_const_arg_gated.rs:37:33 + --> $DIR/unbraced_const_block_const_arg_gated.rs:37:27 | LL | const TYPE_CONST: usize = const { 1 }; - | ^^^^^ + | ^^^^^^^^^^^ | = note: see issue #132980 for more information = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable diff --git a/tests/ui/const-generics/mgca/using-fnptr-as-type_const.rs b/tests/ui/const-generics/mgca/using-fnptr-as-type_const.rs index d97b3a9f0929..5c494031d4fa 100644 --- a/tests/ui/const-generics/mgca/using-fnptr-as-type_const.rs +++ b/tests/ui/const-generics/mgca/using-fnptr-as-type_const.rs @@ -1,7 +1,7 @@ // Regression test for #119783 #![expect(incomplete_features)] -#![feature(associated_const_equality, min_generic_const_args)] +#![feature(min_generic_const_args)] trait Trait { #[type_const] diff --git a/tests/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs b/tests/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs index e1cf7b579aa5..b8739b263aee 100644 --- a/tests/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs +++ b/tests/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs @@ -9,7 +9,7 @@ trait BindsParam { type ArrayTy; } impl BindsParam for ::Assoc { - type ArrayTy = [u8; Self::MAX]; //~ ERROR generic `Self` types + type ArrayTy = [u8; Self::MAX]; //~ ERROR generic `Self` } fn main() {} diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr index d435af07db2a..9c956d79a7bb 100644 --- a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr +++ b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | impl Foo for Bar { | ^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0229]: associated item constraints are not allowed here diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr b/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr index f852c14b1784..4a4ff098dc4b 100644 --- a/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr +++ b/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr @@ -16,8 +16,8 @@ error[E0658]: associated const equality is incomplete LL | impl Foo for Bar { | ^^^^^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0229]: associated item constraints are not allowed here diff --git a/tests/ui/const-generics/type-relative-path-144547.min.stderr b/tests/ui/const-generics/type-relative-path-144547.min.stderr new file mode 100644 index 000000000000..1192a7434ec8 --- /dev/null +++ b/tests/ui/const-generics/type-relative-path-144547.min.stderr @@ -0,0 +1,8 @@ +error: generic parameters may not be used in const operations + --> $DIR/type-relative-path-144547.rs:39:35 + | +LL | type SupportedArray = [T; ::SUPPORTED_SLOTS]; + | ^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/const-generics/type-relative-path-144547.rs b/tests/ui/const-generics/type-relative-path-144547.rs new file mode 100644 index 000000000000..b268055e1f7d --- /dev/null +++ b/tests/ui/const-generics/type-relative-path-144547.rs @@ -0,0 +1,43 @@ +// Regression test for #144547. + +//@ revisions: min mgca +//@[mgca] check-pass + +#![cfg_attr(mgca, feature(min_generic_const_args))] +#![cfg_attr(mgca, expect(incomplete_features))] + +trait UnderlyingImpl { + type InfoType: LevelInfo; + type SupportedArray; +} + +// FIXME: cfg_attr(..., type_const) is broken (search for sym::type_const in compiler/) +trait LevelInfo { + #[cfg(mgca)] + #[type_const] + const SUPPORTED_SLOTS: usize; + + #[cfg(not(mgca))] + const SUPPORTED_SLOTS: usize; +} + +struct Info; + +impl LevelInfo for Info { + #[cfg(mgca)] + #[type_const] + const SUPPORTED_SLOTS: usize = 1; + + #[cfg(not(mgca))] + const SUPPORTED_SLOTS: usize = 1; +} + +struct SomeImpl; + +impl UnderlyingImpl for SomeImpl { + type InfoType = Info; + type SupportedArray = [T; ::SUPPORTED_SLOTS]; + //[min]~^ ERROR generic parameters +} + +fn main() {} diff --git a/tests/ui/consts/const-eval/heap/vec-not-made-global.rs b/tests/ui/consts/const-eval/heap/vec-not-made-global.rs new file mode 100644 index 000000000000..4f78e977e4d5 --- /dev/null +++ b/tests/ui/consts/const-eval/heap/vec-not-made-global.rs @@ -0,0 +1,5 @@ +#![feature(const_heap)] +const V: Vec = Vec::with_capacity(1); +//~^ ERROR: encountered `const_allocate` pointer in final value that was not made global + +fn main() {} diff --git a/tests/ui/consts/const-eval/heap/vec-not-made-global.stderr b/tests/ui/consts/const-eval/heap/vec-not-made-global.stderr new file mode 100644 index 000000000000..595cbeb8df26 --- /dev/null +++ b/tests/ui/consts/const-eval/heap/vec-not-made-global.stderr @@ -0,0 +1,10 @@ +error: encountered `const_allocate` pointer in final value that was not made global + --> $DIR/vec-not-made-global.rs:2:1 + | +LL | const V: Vec = Vec::with_capacity(1); + | ^^^^^^^^^^^^^^^^^ + | + = note: use `const_make_global` to turn allocated pointers into immutable globals before returning + +error: aborting due to 1 previous error + diff --git a/tests/ui/consts/const-static-ref-to-closure.rs b/tests/ui/consts/const-static-ref-to-closure.rs new file mode 100644 index 000000000000..06b5ca5a935c --- /dev/null +++ b/tests/ui/consts/const-static-ref-to-closure.rs @@ -0,0 +1,7 @@ +//! regression test for +//@ check-pass +#![allow(dead_code)] + +const X: &'static dyn Fn() = &|| println!("ICE here"); + +fn main() {} diff --git a/tests/ui/consts/rustc-impl-const-stability.stderr b/tests/ui/consts/rustc-impl-const-stability.stderr deleted file mode 100644 index 55c085396882..000000000000 --- a/tests/ui/consts/rustc-impl-const-stability.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: const `impl` for trait `Debug` which is not `const` - --> $DIR/rustc-impl-const-stability.rs:15:12 - | -LL | impl const std::fmt::Debug for Data { - | ^^^^^^^^^^^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error: aborting due to 1 previous error - diff --git a/tests/ui/crate-loading/missing-std-tier-3.rs b/tests/ui/crate-loading/missing-std-tier-3.rs new file mode 100644 index 000000000000..74c7db3db0ab --- /dev/null +++ b/tests/ui/crate-loading/missing-std-tier-3.rs @@ -0,0 +1,14 @@ +// Ensure that we do not recommend rustup installing tier 3 targets. + +//@ compile-flags: --target m68k-unknown-linux-gnu +//@ needs-llvm-components: m68k +//@ rustc-env:CARGO_CRATE_NAME=foo +//@ ignore-backends: gcc +#![feature(no_core)] +#![no_core] +extern crate core; +//~^ ERROR can't find crate for `core` +//~| NOTE can't find crate +//~| NOTE target may not be installed +//~| HELP consider building the standard library from source with `cargo build -Zbuild-std` +fn main() {} diff --git a/tests/ui/crate-loading/missing-std-tier-3.stderr b/tests/ui/crate-loading/missing-std-tier-3.stderr new file mode 100644 index 000000000000..197feeccd9c5 --- /dev/null +++ b/tests/ui/crate-loading/missing-std-tier-3.stderr @@ -0,0 +1,12 @@ +error[E0463]: can't find crate for `core` + --> $DIR/missing-std-tier-3.rs:9:1 + | +LL | extern crate core; + | ^^^^^^^^^^^^^^^^^^ can't find crate + | + = note: the `m68k-unknown-linux-gnu` target may not be installed + = help: consider building the standard library from source with `cargo build -Zbuild-std` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/tests/ui/issues/auxiliary/issue-12660-aux.rs b/tests/ui/cross-crate/auxiliary/aux-12660.rs similarity index 100% rename from tests/ui/issues/auxiliary/issue-12660-aux.rs rename to tests/ui/cross-crate/auxiliary/aux-12660.rs diff --git a/tests/ui/issues/issue-12660.rs b/tests/ui/cross-crate/cross-crate-unit-struct-reexport.rs similarity index 82% rename from tests/ui/issues/issue-12660.rs rename to tests/ui/cross-crate/cross-crate-unit-struct-reexport.rs index 3aa3426519af..2d4e0c654ef3 100644 --- a/tests/ui/issues/issue-12660.rs +++ b/tests/ui/cross-crate/cross-crate-unit-struct-reexport.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ aux-build:issue-12660-aux.rs +//@ aux-build:aux-12660.rs extern crate issue12660aux; diff --git a/tests/ui/delegation/recursive-delegation-ice-150152.rs b/tests/ui/delegation/recursive-delegation-ice-150152.rs new file mode 100644 index 000000000000..565563c9d03d --- /dev/null +++ b/tests/ui/delegation/recursive-delegation-ice-150152.rs @@ -0,0 +1,31 @@ +#![feature(fn_delegation)] +#![allow(incomplete_features)] + +mod first_example { + mod to_reuse { pub fn foo() {} } + struct S< S >; + //~^ ERROR type parameter `S` is never used + + impl Item for S { + //~^ ERROR cannot find trait `Item` in this scope + //~| ERROR missing generics for struct `S` + reuse to_reuse::foo; + } +} + +mod second_example { + trait Trait { + reuse to_reuse::foo; + //~^ ERROR function `foo` is private + } + mod to_reuse { + fn foo() {} + } + impl Trait for S { + //~^ ERROR cannot find type `S` in this scope + reuse foo; + //~^ ERROR cannot find function `foo` in this scope + } +} + +fn main() {} diff --git a/tests/ui/delegation/recursive-delegation-ice-150152.stderr b/tests/ui/delegation/recursive-delegation-ice-150152.stderr new file mode 100644 index 000000000000..c58f0ff09291 --- /dev/null +++ b/tests/ui/delegation/recursive-delegation-ice-150152.stderr @@ -0,0 +1,74 @@ +error[E0405]: cannot find trait `Item` in this scope + --> $DIR/recursive-delegation-ice-150152.rs:9:10 + | +LL | impl Item for S { + | ^^^^ not found in this scope + +error[E0425]: cannot find type `S` in this scope + --> $DIR/recursive-delegation-ice-150152.rs:24:20 + | +LL | impl Trait for S { + | ^ not found in this scope + | +note: struct `first_example::S` exists but is inaccessible + --> $DIR/recursive-delegation-ice-150152.rs:6:5 + | +LL | struct S< S >; + | ^^^^^^^^^^^^^^ not accessible + +error[E0425]: cannot find function `foo` in this scope + --> $DIR/recursive-delegation-ice-150152.rs:26:15 + | +LL | reuse foo; + | ^^^ not found in this scope + | +note: these functions exist but are inaccessible + --> $DIR/recursive-delegation-ice-150152.rs:5:20 + | +LL | mod to_reuse { pub fn foo() {} } + | ^^^^^^^^^^^^ `first_example::to_reuse::foo`: not accessible +... +LL | fn foo() {} + | ^^^^^^^^ `second_example::to_reuse::foo`: not accessible + +error[E0603]: function `foo` is private + --> $DIR/recursive-delegation-ice-150152.rs:18:25 + | +LL | reuse to_reuse::foo; + | ^^^ private function + | +note: the function `foo` is defined here + --> $DIR/recursive-delegation-ice-150152.rs:22:9 + | +LL | fn foo() {} + | ^^^^^^^^ + +error[E0392]: type parameter `S` is never used + --> $DIR/recursive-delegation-ice-150152.rs:6:15 + | +LL | struct S< S >; + | ^ unused type parameter + | + = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` + = help: if you intended `S` to be a const parameter, use `const S: /* Type */` instead + +error[E0107]: missing generics for struct `S` + --> $DIR/recursive-delegation-ice-150152.rs:9:21 + | +LL | impl Item for S { + | ^ expected 1 generic argument + | +note: struct defined here, with 1 generic parameter: `S` + --> $DIR/recursive-delegation-ice-150152.rs:6:12 + | +LL | struct S< S >; + | ^ - +help: add missing generic argument + | +LL | impl Item for S> { + | +++ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0107, E0392, E0405, E0425, E0603. +For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/delegation/recursive-delegation-pass.rs b/tests/ui/delegation/recursive-delegation-pass.rs index 93f8fa401b55..2a40986d352a 100644 --- a/tests/ui/delegation/recursive-delegation-pass.rs +++ b/tests/ui/delegation/recursive-delegation-pass.rs @@ -1,9 +1,10 @@ -//@ check-pass +//@ run-pass //@ edition:2018 //@ aux-crate:recursive_delegation_aux=recursive-delegation-aux.rs #![feature(fn_delegation)] #![allow(incomplete_features)] +#![allow(warnings)] mod first_mod { pub mod to_reuse { @@ -12,18 +13,35 @@ mod first_mod { } } - mod single_reuse { - reuse crate::first_mod::to_reuse::foo; - reuse foo as bar; - reuse foo as bar1; - reuse bar as goo; - reuse goo as koo; - reuse koo as too; + pub mod single_reuse { + reuse crate::first_mod::to_reuse::foo { self + 1 } + reuse foo as bar { self + 1 } + reuse foo as bar1 { self + 1 } + reuse bar as goo { self + 1 } + reuse goo as koo { self + 1 } + pub reuse koo as too { self + 1 } + + pub fn check() { + assert_eq!(foo(1), 3); + assert_eq!(bar(1), 4); + assert_eq!(bar1(1), 4); + assert_eq!(goo(1), 5); + assert_eq!(koo(1), 6); + assert_eq!(too(1), 7); + } } mod glob_reuse { reuse super::to_reuse::{foo as bar, foo as bar1} { self } reuse super::glob_reuse::{bar as goo, goo as koo, koo as too} { self } + + fn check() { + bar(1); + bar1(1); + goo(1); + koo(1); + too(1); + } } } @@ -44,6 +62,29 @@ mod second_mod { reuse TGlob::{foo1 as bar1, foo3 as bar3, bar1 as bar11, bar11 as bar111} { self.xd() } } + + fn check() { + struct X; + impl T for X { + fn foo(&self) {} + fn bar(&self) {} + fn goo(&self) {} + fn poo(&self) {} + } + + impl TGlob for X { + fn xd(&self) -> &Self { &self } + fn foo1(&self) {} + fn foo2(&self) {} + fn foo3(&self) {} + fn foo4(&self) {} + + fn bar1(&self) {} + fn bar3(&self) {} + fn bar11(&self) {} + fn bar111(&self) {} + } + } } mod third_mod { @@ -63,6 +104,45 @@ mod third_mod { mod fourth_mod { reuse recursive_delegation_aux::goo as bar; reuse bar as foo; + + fn check() { + bar(); + foo(); + } } -fn main() {} +mod fifth_mod { + mod m { + fn foo() { } + pub reuse foo as bar; + } + + trait T { + reuse m::bar as foo; + } + + struct X; + impl T for X {} + + trait T1 { + reuse ::foo as baz; + } + + impl T1 for X {} + + struct Y; + impl T1 for Y { + reuse ::foo as baz; + } + + fn check() { + m::bar(); + ::foo(); + ::baz(); + ::baz(); + } +} + +fn main() { + first_mod::single_reuse::check(); +} diff --git a/tests/ui/deref-patterns/gate.rs b/tests/ui/deref-patterns/gate.rs deleted file mode 100644 index 835fdf854d2c..000000000000 --- a/tests/ui/deref-patterns/gate.rs +++ /dev/null @@ -1,7 +0,0 @@ -// gate-test-string_deref_patterns -fn main() { - match String::new() { - "" | _ => {} - //~^ ERROR mismatched types - } -} diff --git a/tests/ui/deref-patterns/gate.stderr b/tests/ui/deref-patterns/gate.stderr deleted file mode 100644 index e3cbded339d7..000000000000 --- a/tests/ui/deref-patterns/gate.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/gate.rs:4:9 - | -LL | match String::new() { - | ------------- this expression has type `String` -LL | "" | _ => {} - | ^^ expected `String`, found `&str` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-29030.rs b/tests/ui/derives/derive-debug-generic-with-lifetime.rs similarity index 66% rename from tests/ui/issues/issue-29030.rs rename to tests/ui/derives/derive-debug-generic-with-lifetime.rs index c92853fb5dc2..430ade071795 100644 --- a/tests/ui/issues/issue-29030.rs +++ b/tests/ui/derives/derive-debug-generic-with-lifetime.rs @@ -1,3 +1,4 @@ +//! regression test for //@ check-pass #![allow(dead_code)] #[derive(Debug)] diff --git a/tests/ui/issues/issue-25394.rs b/tests/ui/derives/derive-debug-newtype-unsized-slice.rs similarity index 54% rename from tests/ui/issues/issue-25394.rs rename to tests/ui/derives/derive-debug-newtype-unsized-slice.rs index 689c9f33af02..c735d9f039d2 100644 --- a/tests/ui/issues/issue-25394.rs +++ b/tests/ui/derives/derive-debug-newtype-unsized-slice.rs @@ -1,3 +1,4 @@ +//! regression test for //@ check-pass #![allow(dead_code)] #[derive(Debug)] diff --git a/tests/ui/derives/derive-debug-uninhabited-enum.stderr b/tests/ui/derives/derive-debug-uninhabited-enum.stderr index 4911b6b6cded..90f4d34b1c5c 100644 --- a/tests/ui/derives/derive-debug-uninhabited-enum.stderr +++ b/tests/ui/derives/derive-debug-uninhabited-enum.stderr @@ -9,7 +9,7 @@ LL | Void(Void), | = note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis = note: `-W dead-code` implied by `-W unused` - = help: to override `-W unused` add `#[allow(dead_code)]` + = help: to override `-W unused` add `#[expect(dead_code)]` or `#[allow(dead_code)]` warning: 1 warning emitted diff --git a/tests/ui/duplicate/multiple-types-with-same-name-and-derive-default-133965.rs b/tests/ui/duplicate/multiple-types-with-same-name-and-derive-default-133965.rs new file mode 100644 index 000000000000..8e5cd4248f14 --- /dev/null +++ b/tests/ui/duplicate/multiple-types-with-same-name-and-derive-default-133965.rs @@ -0,0 +1,14 @@ +//@ needs-rustc-debug-assertions + +struct NonGeneric {} + +#[derive(Default)] +//~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied +//~^^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied +//~^^^ ERROR struct takes 0 generic arguments but 1 generic argument was supplied +//~^^^^ ERROR struct takes 0 generic arguments but 1 generic argument was supplied +struct NonGeneric<'a, const N: usize> {} +//~^ ERROR lifetime parameter `'a` is never used +//~^^ ERROR the name `NonGeneric` is defined multiple times + +pub fn main() {} diff --git a/tests/ui/duplicate/multiple-types-with-same-name-and-derive-default-133965.stderr b/tests/ui/duplicate/multiple-types-with-same-name-and-derive-default-133965.stderr new file mode 100644 index 000000000000..cf9c0d0ad3be --- /dev/null +++ b/tests/ui/duplicate/multiple-types-with-same-name-and-derive-default-133965.stderr @@ -0,0 +1,81 @@ +error[E0428]: the name `NonGeneric` is defined multiple times + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:10:1 + | +LL | struct NonGeneric {} + | ----------------- previous definition of the type `NonGeneric` here +... +LL | struct NonGeneric<'a, const N: usize> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonGeneric` redefined here + | + = note: `NonGeneric` must be defined only once in the type namespace of this module + +error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:5:10 + | +LL | #[derive(Default)] + | ^^^^^^^ expected 0 lifetime arguments +... +LL | struct NonGeneric<'a, const N: usize> {} + | -- help: remove the lifetime argument + | +note: struct defined here, with 0 lifetime parameters + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:3:8 + | +LL | struct NonGeneric {} + | ^^^^^^^^^^ + +error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:5:10 + | +LL | #[derive(Default)] + | ^^^^^^^ expected 0 generic arguments + | +note: struct defined here, with 0 generic parameters + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:3:8 + | +LL | struct NonGeneric {} + | ^^^^^^^^^^ + +error[E0392]: lifetime parameter `'a` is never used + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:10:19 + | +LL | struct NonGeneric<'a, const N: usize> {} + | ^^ unused lifetime parameter + | + = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:5:10 + | +LL | #[derive(Default)] + | ^^^^^^^ expected 0 lifetime arguments +... +LL | struct NonGeneric<'a, const N: usize> {} + | -- help: remove the lifetime argument + | +note: struct defined here, with 0 lifetime parameters + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:3:8 + | +LL | struct NonGeneric {} + | ^^^^^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:5:10 + | +LL | #[derive(Default)] + | ^^^^^^^ expected 0 generic arguments +... +LL | struct NonGeneric<'a, const N: usize> {} + | - help: remove the unnecessary generic argument + | +note: struct defined here, with 0 generic parameters + --> $DIR/multiple-types-with-same-name-and-derive-default-133965.rs:3:8 + | +LL | struct NonGeneric {} + | ^^^^^^^^^^ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0107, E0392, E0428. +For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/error-codes/E0778.rs b/tests/ui/error-codes/E0778.rs deleted file mode 100644 index 74653886d415..000000000000 --- a/tests/ui/error-codes/E0778.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[instruction_set()] //~ ERROR -fn no_isa_defined() {} - -fn main() {} diff --git a/tests/ui/error-codes/E0778.stderr b/tests/ui/error-codes/E0778.stderr deleted file mode 100644 index 7eb24c493bf5..000000000000 --- a/tests/ui/error-codes/E0778.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0778]: `#[instruction_set]` requires an argument - --> $DIR/E0778.rs:1:1 - | -LL | #[instruction_set()] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0778`. diff --git a/tests/ui/error-codes/E0779.rs b/tests/ui/error-codes/E0779.rs deleted file mode 100644 index c32dae12c9cb..000000000000 --- a/tests/ui/error-codes/E0779.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[instruction_set(arm::magic)] //~ ERROR -fn main() {} diff --git a/tests/ui/error-codes/E0779.stderr b/tests/ui/error-codes/E0779.stderr deleted file mode 100644 index a01aa98b914c..000000000000 --- a/tests/ui/error-codes/E0779.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0779]: invalid instruction set specified - --> $DIR/E0779.rs:1:1 - | -LL | #[instruction_set(arm::magic)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0779`. diff --git a/tests/ui/feature-gates/feature-gate-associated_const_equality.rs b/tests/ui/feature-gates/feature-gate-associated_const_equality.rs index 2534c527be46..6b643b629a29 100644 --- a/tests/ui/feature-gates/feature-gate-associated_const_equality.rs +++ b/tests/ui/feature-gates/feature-gate-associated_const_equality.rs @@ -8,7 +8,7 @@ impl TraitWAssocConst for Demo { } fn foo>() {} -//~^ ERROR associated const equality +//~^ ERROR associated const equality is incomplete fn main() { foo::(); diff --git a/tests/ui/feature-gates/feature-gate-associated_const_equality.stderr b/tests/ui/feature-gates/feature-gate-associated_const_equality.stderr index 5a0fb69b6ba7..096755701931 100644 --- a/tests/ui/feature-gates/feature-gate-associated_const_equality.stderr +++ b/tests/ui/feature-gates/feature-gate-associated_const_equality.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | fn foo>() {} | ^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-33687.rs b/tests/ui/fn_traits/call-unit-struct-impl-fn-once.rs similarity index 79% rename from tests/ui/issues/issue-33687.rs rename to tests/ui/fn_traits/call-unit-struct-impl-fn-once.rs index a5693b3aca8e..15554482931b 100644 --- a/tests/ui/issues/issue-33687.rs +++ b/tests/ui/fn_traits/call-unit-struct-impl-fn-once.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass #![feature(unboxed_closures)] #![feature(fn_traits)] diff --git a/tests/ui/issues/issue-20847.rs b/tests/ui/fn_traits/fn-trait-explicit-call.rs similarity index 65% rename from tests/ui/issues/issue-20847.rs rename to tests/ui/fn_traits/fn-trait-explicit-call.rs index 364b07bf6922..f37e0a558baa 100644 --- a/tests/ui/issues/issue-20847.rs +++ b/tests/ui/fn_traits/fn-trait-explicit-call.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass #![feature(fn_traits)] diff --git a/tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.rs b/tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.rs index a72aaedb980e..fb2506daf078 100644 --- a/tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.rs +++ b/tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.rs @@ -1,6 +1,6 @@ // ICE: assertion failed: !value.has_infer() // issue: rust-lang/rust#115806 -#![feature(associated_const_equality, min_generic_const_args, unsized_const_params)] +#![feature(min_generic_const_args, unsized_const_params)] #![allow(incomplete_features)] pub struct NoPin; diff --git a/tests/ui/generic-const-items/associated-const-equality.rs b/tests/ui/generic-const-items/associated-const-equality.rs index 37cf381e6824..d0301b920e27 100644 --- a/tests/ui/generic-const-items/associated-const-equality.rs +++ b/tests/ui/generic-const-items/associated-const-equality.rs @@ -1,7 +1,7 @@ //@ check-pass #![feature(generic_const_items, min_generic_const_args)] -#![feature(associated_const_equality, adt_const_params)] +#![feature(adt_const_params)] #![allow(incomplete_features)] trait Owner { diff --git a/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs b/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs index de632119ecba..0277da46f750 100644 --- a/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs +++ b/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs @@ -1,6 +1,6 @@ +//@ check-pass //@ aux-crate: glob_vs_expanded=glob-vs-expanded.rs fn main() { - glob_vs_expanded::mac!(); //~ ERROR `mac` is ambiguous - //~| WARN this was previously accepted + glob_vs_expanded::mac!(); // OK } diff --git a/tests/ui/imports/ambiguous-glob-vs-expanded-extern.stderr b/tests/ui/imports/ambiguous-glob-vs-expanded-extern.stderr deleted file mode 100644 index 4a9a6c99819b..000000000000 --- a/tests/ui/imports/ambiguous-glob-vs-expanded-extern.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error: `mac` is ambiguous - --> $DIR/ambiguous-glob-vs-expanded-extern.rs:4:23 - | -LL | glob_vs_expanded::mac!(); - | ^^^ ambiguous name - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #114095 - = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution -note: `mac` could refer to the macro defined here - --> $DIR/auxiliary/glob-vs-expanded.rs:9:13 - | -LL | () => { pub macro mac() {} } - | ^^^^^^^^^^^^^ -LL | } -LL | define_mac!(); - | ------------- in this macro invocation -note: `mac` could also refer to the macro defined here - --> $DIR/auxiliary/glob-vs-expanded.rs:5:9 - | -LL | pub use inner::*; - | ^^^^^ - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - = note: this error originates in the macro `define_mac` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 1 previous error - -Future incompatibility report: Future breakage diagnostic: -error: `mac` is ambiguous - --> $DIR/ambiguous-glob-vs-expanded-extern.rs:4:23 - | -LL | glob_vs_expanded::mac!(); - | ^^^ ambiguous name - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #114095 - = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution -note: `mac` could refer to the macro defined here - --> $DIR/auxiliary/glob-vs-expanded.rs:9:13 - | -LL | () => { pub macro mac() {} } - | ^^^^^^^^^^^^^ -LL | } -LL | define_mac!(); - | ------------- in this macro invocation -note: `mac` could also refer to the macro defined here - --> $DIR/auxiliary/glob-vs-expanded.rs:5:9 - | -LL | pub use inner::*; - | ^^^^^ - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - = note: this error originates in the macro `define_mac` (in Nightly builds, run with -Z macro-backtrace for more info) - diff --git a/tests/ui/imports/issue-114682-1.stderr b/tests/ui/imports/issue-114682-1.stderr index 85fb7f7919e4..fd2776f50ad7 100644 --- a/tests/ui/imports/issue-114682-1.stderr +++ b/tests/ui/imports/issue-114682-1.stderr @@ -4,7 +4,7 @@ error[E0659]: `A` is ambiguous LL | A!(); | ^ ambiguous name | - = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution + = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `A` could refer to the macro defined here --> $DIR/issue-114682-1.rs:7:9 | @@ -15,12 +15,13 @@ LL | | } ... LL | mac!(); | ------ in this macro invocation + = help: use `crate::A` to refer to this macro unambiguously note: `A` could also refer to the macro imported here --> $DIR/issue-114682-1.rs:19:9 | LL | pub use m::*; | ^^^^ - = help: consider adding an explicit import of `A` to disambiguate + = help: use `crate::A` to refer to this macro unambiguously = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 1 previous error diff --git a/tests/ui/imports/local-modularized-tricky-fail-1.stderr b/tests/ui/imports/local-modularized-tricky-fail-1.stderr index 52a01e8bcdfe..b5b3be5953f9 100644 --- a/tests/ui/imports/local-modularized-tricky-fail-1.stderr +++ b/tests/ui/imports/local-modularized-tricky-fail-1.stderr @@ -4,7 +4,7 @@ error[E0659]: `exported` is ambiguous LL | exported!(); | ^^^^^^^^ ambiguous name | - = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution + = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `exported` could refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:6:5 | @@ -15,12 +15,13 @@ LL | | } ... LL | define_exported!(); | ------------------ in this macro invocation + = help: use `crate::exported` to refer to this macro unambiguously note: `exported` could also refer to the macro imported here --> $DIR/local-modularized-tricky-fail-1.rs:23:5 | LL | use inner1::*; | ^^^^^^^^^ - = help: consider adding an explicit import of `exported` to disambiguate + = help: use `crate::exported` to refer to this macro unambiguously = note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `panic` is ambiguous diff --git a/tests/ui/imports/macro-paths.stderr b/tests/ui/imports/macro-paths.stderr index 5f113ce2bee5..56a40e908258 100644 --- a/tests/ui/imports/macro-paths.stderr +++ b/tests/ui/imports/macro-paths.stderr @@ -4,7 +4,7 @@ error[E0659]: `bar` is ambiguous LL | bar::m! { | ^^^ ambiguous name | - = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution + = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `bar` could refer to the module defined here --> $DIR/macro-paths.rs:14:9 | @@ -15,7 +15,6 @@ note: `bar` could also refer to the module imported here | LL | use foo::*; | ^^^^^^ - = help: consider adding an explicit import of `bar` to disambiguate error[E0659]: `baz` is ambiguous --> $DIR/macro-paths.rs:23:5 diff --git a/tests/ui/imports/macros.rs b/tests/ui/imports/macros.rs index cf67e08c87a3..121f1f7ae043 100644 --- a/tests/ui/imports/macros.rs +++ b/tests/ui/imports/macros.rs @@ -13,7 +13,7 @@ mod m1 { mod m2 { use two_macros::*; - m! { //~ ERROR ambiguous + m! { //~ ERROR `m` is ambiguous use crate::foo::m; } } diff --git a/tests/ui/imports/macros.stderr b/tests/ui/imports/macros.stderr index 25a678c6b375..9c081cc7af8b 100644 --- a/tests/ui/imports/macros.stderr +++ b/tests/ui/imports/macros.stderr @@ -4,18 +4,19 @@ error[E0659]: `m` is ambiguous LL | m! { | ^ ambiguous name | - = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution + = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `m` could refer to the macro imported here --> $DIR/macros.rs:17:13 | LL | use crate::foo::m; | ^^^^^^^^^^^^^ + = help: use `self::m` to refer to this macro unambiguously note: `m` could also refer to the macro imported here --> $DIR/macros.rs:15:9 | LL | use two_macros::*; | ^^^^^^^^^^^^^ - = help: consider adding an explicit import of `m` to disambiguate + = help: use `self::m` to refer to this macro unambiguously error[E0659]: `m` is ambiguous --> $DIR/macros.rs:29:9 diff --git a/tests/ui/imports/overwritten-glob-ambig.rs b/tests/ui/imports/overwritten-glob-ambig.rs new file mode 100644 index 000000000000..a5918568c62a --- /dev/null +++ b/tests/ui/imports/overwritten-glob-ambig.rs @@ -0,0 +1,26 @@ +// Test for a regression introduced by splitting module scope into two scopes +// (similar to issue #145575). + +//@ check-pass +//@ edition: 2018.. + +#[macro_use] +mod one { + // Macro that is in a different module, but still in scope due to `macro_use` + macro_rules! mac { () => {} } + pub(crate) use mac; +} + +mod other { + macro_rules! mac { () => {} } + pub(crate) use mac; +} + +// Single import of the same in the current module. +use one::mac; +// Glob import of a different macro in the current module (should be an ambiguity). +use other::*; + +fn main() { + mac!(); // OK for now, the ambiguity is not reported +} diff --git a/tests/ui/inline-const/in-pat-recovery.rs b/tests/ui/inline-const/in-pat-recovery.rs index a46e56e3be64..d519217fad3b 100644 --- a/tests/ui/inline-const/in-pat-recovery.rs +++ b/tests/ui/inline-const/in-pat-recovery.rs @@ -4,8 +4,63 @@ fn main() { match 1 { const { 1 + 7 } => {} - //~^ ERROR const blocks cannot be used as patterns + //~^ ERROR arbitrary expressions aren't allowed in patterns 2 => {} _ => {} } + + match 5 { + const { 1 } ..= 10 => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + 1 ..= const { 10 } => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + const { 1 } ..= const { 10 } => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + const { 1 } .. 10 => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + 1 .. const { 10 } => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + const { 1 + 2 } ..= 10 => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + 1 ..= const { 5 + 5 } => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + const { 3 } .. => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } + + match 5 { + ..= const { 7 } => {} + //~^ ERROR arbitrary expressions aren't allowed in patterns + _ => {} + } } diff --git a/tests/ui/inline-const/in-pat-recovery.stderr b/tests/ui/inline-const/in-pat-recovery.stderr index 0698cff1480d..376c43aaecca 100644 --- a/tests/ui/inline-const/in-pat-recovery.stderr +++ b/tests/ui/inline-const/in-pat-recovery.stderr @@ -1,10 +1,90 @@ -error: const blocks cannot be used as patterns - --> $DIR/in-pat-recovery.rs:6:15 +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:6:9 | LL | const { 1 + 7 } => {} - | ^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead -error: aborting due to 1 previous error +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:13:9 + | +LL | const { 1 } ..= 10 => {} + | ^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:19:15 + | +LL | 1 ..= const { 10 } => {} + | ^^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:25:9 + | +LL | const { 1 } ..= const { 10 } => {} + | ^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:25:25 + | +LL | const { 1 } ..= const { 10 } => {} + | ^^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:32:9 + | +LL | const { 1 } .. 10 => {} + | ^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:38:14 + | +LL | 1 .. const { 10 } => {} + | ^^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:44:9 + | +LL | const { 1 + 2 } ..= 10 => {} + | ^^^^^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:50:15 + | +LL | 1 ..= const { 5 + 5 } => {} + | ^^^^^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:56:9 + | +LL | const { 3 } .. => {} + | ^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/in-pat-recovery.rs:62:13 + | +LL | ..= const { 7 } => {} + | ^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error: aborting due to 11 previous errors diff --git a/tests/ui/internal/auxiliary/internal_unstable.rs b/tests/ui/internal/auxiliary/internal_unstable.rs index eb4d6cb380ef..bea153227a77 100644 --- a/tests/ui/internal/auxiliary/internal_unstable.rs +++ b/tests/ui/internal/auxiliary/internal_unstable.rs @@ -99,3 +99,10 @@ macro_rules! access_field_noallow { macro_rules! pass_through_noallow { ($e: expr) => { $e } } + +#[stable(feature = "stable", since = "1.0.0")] +#[allow_internal_unstable(asm_experimental_arch)] +#[macro_export] +macro_rules! asm_redirect { + ($($t:tt)*) => { core::arch::global_asm!($($t)*); } +} diff --git a/tests/ui/internal/internal-unstable-asm-experimental-arch.rs b/tests/ui/internal/internal-unstable-asm-experimental-arch.rs new file mode 100644 index 000000000000..6d97779ff911 --- /dev/null +++ b/tests/ui/internal/internal-unstable-asm-experimental-arch.rs @@ -0,0 +1,18 @@ +//@ only-wasm32-wasip1 +//@ compile-flags: --crate-type=lib +//@ build-pass +//@ aux-build:internal_unstable.rs + +#[macro_use] +extern crate internal_unstable; + +asm_redirect!( + "test:", + ".globl test", + ".functype test (i32) -> (i32)", + "local.get 0", + "i32.const 1", + "i32.add", + "end_function", + ".export_name test, test", +); diff --git a/tests/ui/issues/issue-11384.rs b/tests/ui/issues/issue-11384.rs deleted file mode 100644 index ad0affa4b0d2..000000000000 --- a/tests/ui/issues/issue-11384.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ check-pass - -trait Common { fn dummy(&self) { } } - -impl<'t, T> Common for (T, &'t T) {} - -impl<'t, T> Common for (&'t T, T) {} - -fn main() {} diff --git a/tests/ui/issues/issue-19601.rs b/tests/ui/issues/issue-19601.rs deleted file mode 100644 index e97819e4122d..000000000000 --- a/tests/ui/issues/issue-19601.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ check-pass - -trait A {} -struct B where B: A> { t: T } - -fn main() {} diff --git a/tests/ui/issues/issue-20676.rs b/tests/ui/issues/issue-20676.rs deleted file mode 100644 index 2059365c7d62..000000000000 --- a/tests/ui/issues/issue-20676.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ run-pass -// Regression test for #20676. Error was that we didn't support -// UFCS-style calls to a method in `Trait` where `Self` was bound to a -// trait object of type `Trait`. See also `ufcs-trait-object.rs`. - - -use std::fmt; - -fn main() { - let a: &dyn fmt::Debug = &1; - let _ = format!("{:?}", a); -} diff --git a/tests/ui/issues/issue-22426.rs b/tests/ui/issues/issue-22426.rs deleted file mode 100644 index 0857ac9dfb4d..000000000000 --- a/tests/ui/issues/issue-22426.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ run-pass - -fn main() { - match 42 { - x if x < 7 => (), - _ => () - } -} diff --git a/tests/ui/issues/issue-2428.rs b/tests/ui/issues/issue-2428.rs deleted file mode 100644 index 9cb02460f35b..000000000000 --- a/tests/ui/issues/issue-2428.rs +++ /dev/null @@ -1,14 +0,0 @@ -//@ run-pass -#![allow(non_upper_case_globals)] - - -pub fn main() { - let _foo = 100; - const quux: isize = 5; - - enum Stuff { - Bar = quux - } - - assert_eq!(Stuff::Bar as isize, quux); -} diff --git a/tests/ui/issues/issue-24389.rs b/tests/ui/issues/issue-24389.rs deleted file mode 100644 index 95bb2af9b25c..000000000000 --- a/tests/ui/issues/issue-24389.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ check-pass -#![allow(dead_code)] - -struct Foo; - -impl Foo { - fn new() -> Self { Foo } - fn bar() { Self::new(); } -} - -fn main() {} diff --git a/tests/ui/issues/issue-25180.rs b/tests/ui/issues/issue-25180.rs deleted file mode 100644 index 339aca037546..000000000000 --- a/tests/ui/issues/issue-25180.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ check-pass -#![allow(dead_code)] -#![allow(non_upper_case_globals)] - -const x: &'static dyn Fn() = &|| println!("ICE here"); - -fn main() {} diff --git a/tests/ui/issues/issue-27639.rs b/tests/ui/issues/issue-27639.rs deleted file mode 100644 index 95edcb8695e2..000000000000 --- a/tests/ui/issues/issue-27639.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ run-pass -#![allow(dead_code)] -#![allow(non_upper_case_globals)] - -fn main() { - const iter: i32 = 0; - - for i in 1..10 { - println!("{}", i); - } -} diff --git a/tests/ui/lint/dead-code/allow-trait-or-impl.rs b/tests/ui/lint/dead-code/allow-trait-or-impl.rs new file mode 100644 index 000000000000..92817549a91e --- /dev/null +++ b/tests/ui/lint/dead-code/allow-trait-or-impl.rs @@ -0,0 +1,38 @@ +#![deny(dead_code)] + +pub mod a { + pub trait Foo { } + impl Foo for u32 { } + + struct PrivateType; //~ ERROR struct `PrivateType` is never constructed + impl Foo for PrivateType { } // <-- warns as dead, even though Foo is public + + struct AnotherPrivateType; //~ ERROR struct `AnotherPrivateType` is never constructed + impl Foo for AnotherPrivateType { } // <-- warns as dead, even though Foo is public +} + +pub mod b { + #[allow(dead_code)] + pub trait Foo { } + impl Foo for u32 { } + + struct PrivateType; + impl Foo for PrivateType { } // <-- no warning, trait is "allowed" + + struct AnotherPrivateType; + impl Foo for AnotherPrivateType { } // <-- no warning, trait is "allowed" +} + +pub mod c { + pub trait Foo { } + impl Foo for u32 { } + + struct PrivateType; + #[allow(dead_code)] + impl Foo for PrivateType { } // <-- no warning, impl is allowed + + struct AnotherPrivateType; //~ ERROR struct `AnotherPrivateType` is never constructed + impl Foo for AnotherPrivateType { } // <-- warns as dead, even though Foo is public +} + +fn main() {} diff --git a/tests/ui/lint/dead-code/allow-trait-or-impl.stderr b/tests/ui/lint/dead-code/allow-trait-or-impl.stderr new file mode 100644 index 000000000000..130116b6c91d --- /dev/null +++ b/tests/ui/lint/dead-code/allow-trait-or-impl.stderr @@ -0,0 +1,26 @@ +error: struct `PrivateType` is never constructed + --> $DIR/allow-trait-or-impl.rs:7:12 + | +LL | struct PrivateType; + | ^^^^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/allow-trait-or-impl.rs:1:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: struct `AnotherPrivateType` is never constructed + --> $DIR/allow-trait-or-impl.rs:10:12 + | +LL | struct AnotherPrivateType; + | ^^^^^^^^^^^^^^^^^^ + +error: struct `AnotherPrivateType` is never constructed + --> $DIR/allow-trait-or-impl.rs:34:12 + | +LL | struct AnotherPrivateType; + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/tests/ui/lint/dead-code/allow-unused-trait.rs b/tests/ui/lint/dead-code/allow-unused-trait.rs new file mode 100644 index 000000000000..4eb63bd4d27a --- /dev/null +++ b/tests/ui/lint/dead-code/allow-unused-trait.rs @@ -0,0 +1,29 @@ +//@ check-pass + +#![deny(dead_code)] + +#[allow(dead_code)] +trait Foo { + const FOO: u32; + type Baz; + fn foobar(); +} + +const fn bar(x: u32) -> u32 { + x +} + +struct Qux; + +struct FooBar; + +impl Foo for u32 { + const FOO: u32 = bar(0); + type Baz = Qux; + + fn foobar() { + let _ = FooBar; + } +} + +fn main() {} diff --git a/tests/ui/lint/dead-code/unused-fn-with-check-pass.rs b/tests/ui/lint/dead-code/unused-fn-with-check-pass.rs new file mode 100644 index 000000000000..a4853e125a1a --- /dev/null +++ b/tests/ui/lint/dead-code/unused-fn-with-check-pass.rs @@ -0,0 +1,8 @@ +//@ check-pass +//@ compile-flags: -Wunused + +fn foo() -> &'static str { //~ WARN function `foo` is never used + "hello" +} + +fn main() {} diff --git a/tests/ui/lint/dead-code/unused-fn-with-check-pass.stderr b/tests/ui/lint/dead-code/unused-fn-with-check-pass.stderr new file mode 100644 index 000000000000..add938553563 --- /dev/null +++ b/tests/ui/lint/dead-code/unused-fn-with-check-pass.stderr @@ -0,0 +1,11 @@ +warning: function `foo` is never used + --> $DIR/unused-fn-with-check-pass.rs:4:4 + | +LL | fn foo() -> &'static str { + | ^^^ + | + = note: `-W dead-code` implied by `-W unused` + = help: to override `-W unused` add `#[expect(dead_code)]` or `#[allow(dead_code)]` + +warning: 1 warning emitted + diff --git a/tests/ui/lint/lint-gpu-kernel.amdgpu.stderr b/tests/ui/lint/lint-gpu-kernel.amdgpu.stderr new file mode 100644 index 000000000000..21eebe42f8b1 --- /dev/null +++ b/tests/ui/lint/lint-gpu-kernel.amdgpu.stderr @@ -0,0 +1,86 @@ +warning: `extern` fn uses type `()`, which is not FFI-safe + --> $DIR/lint-gpu-kernel.rs:36:35 + | +LL | extern "gpu-kernel" fn arg_zst(_: ()) { } + | ^^ not FFI-safe + | + = help: consider using a struct instead + = note: tuples have unspecified layout + = note: `#[warn(improper_ctypes_definitions)]` on by default + +warning: passing type `()` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:36:35 + | +LL | extern "gpu-kernel" fn arg_zst(_: ()) { } + | ^^ + | + = help: use primitive types and raw pointers to get reliable behavior + = note: `#[warn(improper_gpu_kernel_arg)]` on by default + +warning: passing type `&i32` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:41:35 + | +LL | extern "gpu-kernel" fn arg_ref(_: &i32) { } + | ^^^^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: passing type `&mut i32` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:44:39 + | +LL | extern "gpu-kernel" fn arg_ref_mut(_: &mut i32) { } + | ^^^^^^^^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: `extern` fn uses type `S`, which is not FFI-safe + --> $DIR/lint-gpu-kernel.rs:49:38 + | +LL | extern "gpu-kernel" fn arg_struct(_: S) { } + | ^ not FFI-safe + | + = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct + = note: this struct has unspecified layout +note: the type is defined here + --> $DIR/lint-gpu-kernel.rs:47:1 + | +LL | struct S { a: i32, b: i32 } + | ^^^^^^^^ + +warning: passing type `S` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:49:38 + | +LL | extern "gpu-kernel" fn arg_struct(_: S) { } + | ^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: `extern` fn uses type `(i32, i32)`, which is not FFI-safe + --> $DIR/lint-gpu-kernel.rs:54:35 + | +LL | extern "gpu-kernel" fn arg_tup(_: (i32, i32)) { } + | ^^^^^^^^^^ not FFI-safe + | + = help: consider using a struct instead + = note: tuples have unspecified layout + +warning: passing type `(i32, i32)` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:54:35 + | +LL | extern "gpu-kernel" fn arg_tup(_: (i32, i32)) { } + | ^^^^^^^^^^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: function with the "gpu-kernel" ABI has a mangled name + --> $DIR/lint-gpu-kernel.rs:61:1 + | +LL | pub extern "gpu-kernel" fn mangled_kernel() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: use `unsafe(no_mangle)` or `unsafe(export_name = "")` + = note: mangled names make it hard to find the kernel, this is usually not intended + = note: `#[warn(missing_gpu_kernel_export_name)]` on by default + +warning: 9 warnings emitted + diff --git a/tests/ui/lint/lint-gpu-kernel.nvptx.stderr b/tests/ui/lint/lint-gpu-kernel.nvptx.stderr new file mode 100644 index 000000000000..21eebe42f8b1 --- /dev/null +++ b/tests/ui/lint/lint-gpu-kernel.nvptx.stderr @@ -0,0 +1,86 @@ +warning: `extern` fn uses type `()`, which is not FFI-safe + --> $DIR/lint-gpu-kernel.rs:36:35 + | +LL | extern "gpu-kernel" fn arg_zst(_: ()) { } + | ^^ not FFI-safe + | + = help: consider using a struct instead + = note: tuples have unspecified layout + = note: `#[warn(improper_ctypes_definitions)]` on by default + +warning: passing type `()` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:36:35 + | +LL | extern "gpu-kernel" fn arg_zst(_: ()) { } + | ^^ + | + = help: use primitive types and raw pointers to get reliable behavior + = note: `#[warn(improper_gpu_kernel_arg)]` on by default + +warning: passing type `&i32` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:41:35 + | +LL | extern "gpu-kernel" fn arg_ref(_: &i32) { } + | ^^^^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: passing type `&mut i32` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:44:39 + | +LL | extern "gpu-kernel" fn arg_ref_mut(_: &mut i32) { } + | ^^^^^^^^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: `extern` fn uses type `S`, which is not FFI-safe + --> $DIR/lint-gpu-kernel.rs:49:38 + | +LL | extern "gpu-kernel" fn arg_struct(_: S) { } + | ^ not FFI-safe + | + = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct + = note: this struct has unspecified layout +note: the type is defined here + --> $DIR/lint-gpu-kernel.rs:47:1 + | +LL | struct S { a: i32, b: i32 } + | ^^^^^^^^ + +warning: passing type `S` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:49:38 + | +LL | extern "gpu-kernel" fn arg_struct(_: S) { } + | ^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: `extern` fn uses type `(i32, i32)`, which is not FFI-safe + --> $DIR/lint-gpu-kernel.rs:54:35 + | +LL | extern "gpu-kernel" fn arg_tup(_: (i32, i32)) { } + | ^^^^^^^^^^ not FFI-safe + | + = help: consider using a struct instead + = note: tuples have unspecified layout + +warning: passing type `(i32, i32)` to a function with "gpu-kernel" ABI may have unexpected behavior + --> $DIR/lint-gpu-kernel.rs:54:35 + | +LL | extern "gpu-kernel" fn arg_tup(_: (i32, i32)) { } + | ^^^^^^^^^^ + | + = help: use primitive types and raw pointers to get reliable behavior + +warning: function with the "gpu-kernel" ABI has a mangled name + --> $DIR/lint-gpu-kernel.rs:61:1 + | +LL | pub extern "gpu-kernel" fn mangled_kernel() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: use `unsafe(no_mangle)` or `unsafe(export_name = "")` + = note: mangled names make it hard to find the kernel, this is usually not intended + = note: `#[warn(missing_gpu_kernel_export_name)]` on by default + +warning: 9 warnings emitted + diff --git a/tests/ui/lint/lint-gpu-kernel.rs b/tests/ui/lint/lint-gpu-kernel.rs new file mode 100644 index 000000000000..9b3ed0d14d8a --- /dev/null +++ b/tests/ui/lint/lint-gpu-kernel.rs @@ -0,0 +1,62 @@ +// Test argument and return type restrictions of the gpu-kernel ABI and +// check for warnings on mangled gpu-kernels. + +//@ check-pass +//@ ignore-backends: gcc +//@ revisions: amdgpu nvptx +//@ add-minicore +//@ edition: 2024 +//@[amdgpu] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx900 +//@[amdgpu] needs-llvm-components: amdgpu +//@[nvptx] compile-flags: --target nvptx64-nvidia-cuda +//@[nvptx] needs-llvm-components: nvptx + +#![feature(no_core, abi_gpu_kernel)] +#![no_core] +#![crate_type = "lib"] + +extern crate minicore; +use minicore::*; + +// Return types can be () or ! +#[unsafe(no_mangle)] +extern "gpu-kernel" fn ret_empty() {} +#[unsafe(no_mangle)] +extern "gpu-kernel" fn ret_never() -> ! { loop {} } + +// Arguments can be scalars or pointers +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_i32(_: i32) { } +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_ptr(_: *const i32) { } +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_ptr_mut(_: *mut i32) { } + +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_zst(_: ()) { } +//~^ WARN passing type `()` to a function with "gpu-kernel" ABI may have unexpected behavior +//~^^ WARN `extern` fn uses type `()`, which is not FFI-safe + +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_ref(_: &i32) { } +//~^ WARN passing type `&i32` to a function with "gpu-kernel" ABI may have unexpected behavior +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_ref_mut(_: &mut i32) { } +//~^ WARN passing type `&mut i32` to a function with "gpu-kernel" ABI may have unexpected behavior + +struct S { a: i32, b: i32 } +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_struct(_: S) { } +//~^ WARN passing type `S` to a function with "gpu-kernel" ABI may have unexpected behavior +//~^^ WARN `extern` fn uses type `S`, which is not FFI-safe + +#[unsafe(no_mangle)] +extern "gpu-kernel" fn arg_tup(_: (i32, i32)) { } +//~^ WARN passing type `(i32, i32)` to a function with "gpu-kernel" ABI may have unexpected behavior +//~^^ WARN `extern` fn uses type `(i32, i32)`, which is not FFI-safe + +#[unsafe(export_name = "kernel")] +pub extern "gpu-kernel" fn allowed_kernel_name() {} + +pub extern "gpu-kernel" fn mangled_kernel() { } +//~^ WARN function with the "gpu-kernel" ABI has a mangled name diff --git a/tests/ui/lowering/no-name-for-DefPath-issue-133426.stderr b/tests/ui/lowering/no-name-for-DefPath-issue-133426.stderr index 555d8eec6bab..3d1233cdd019 100644 --- a/tests/ui/lowering/no-name-for-DefPath-issue-133426.stderr +++ b/tests/ui/lowering/no-name-for-DefPath-issue-133426.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | fn b(_: impl Iterator) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0614]: type `!` cannot be dereferenced diff --git a/tests/ui/macros/concat-nested-repetition.rs b/tests/ui/macros/concat-nested-repetition.rs new file mode 100644 index 000000000000..ac5394ef8dcc --- /dev/null +++ b/tests/ui/macros/concat-nested-repetition.rs @@ -0,0 +1,35 @@ +//@ check-pass +#![feature(macro_metavar_expr_concat)] + +struct A; +struct B; +const AA: A = A; +const BB: B = B; + +macro_rules! define_ioctl_data { + (struct $s:ident { + $($field:ident: $ty:ident $([$opt:ident])?,)* + }) => { + pub struct $s { + $($field: $ty,)* + } + + impl $s { + $($( + fn ${concat(get_, $field)}(&self) -> $ty { + let _ = $opt; + todo!() + } + )?)* + } + }; +} + +define_ioctl_data! { + struct Foo { + a: A [AA], + b: B [BB], + } +} + +fn main() {} diff --git a/tests/ui/macros/macro-metavar-expr-concat/in-repetition.rs b/tests/ui/macros/macro-metavar-expr-concat/in-repetition.rs index d2bd31b06d60..3ee11d373e05 100644 --- a/tests/ui/macros/macro-metavar-expr-concat/in-repetition.rs +++ b/tests/ui/macros/macro-metavar-expr-concat/in-repetition.rs @@ -11,7 +11,7 @@ macro_rules! InRepetition { ) => { $( $( - ${concat(_, $arg)} //~ ERROR nested repetitions with `${concat(...)}` metavariable expressions are not yet supported + ${concat(_, $arg)} //~ ERROR macro expansion ends with an incomplete expression: expected one of `!` or `::` )* )* }; diff --git a/tests/ui/macros/macro-metavar-expr-concat/in-repetition.stderr b/tests/ui/macros/macro-metavar-expr-concat/in-repetition.stderr index ec39ca799e19..b84d98874931 100644 --- a/tests/ui/macros/macro-metavar-expr-concat/in-repetition.stderr +++ b/tests/ui/macros/macro-metavar-expr-concat/in-repetition.stderr @@ -1,8 +1,8 @@ -error: nested repetitions with `${concat(...)}` metavariable expressions are not yet supported - --> $DIR/in-repetition.rs:14:30 +error: macro expansion ends with an incomplete expression: expected one of `!` or `::` + --> $DIR/in-repetition.rs:14:35 | LL | ${concat(_, $arg)} - | ^^^ + | ^ expected one of `!` or `::` error: aborting due to 1 previous error diff --git a/tests/ui/macros/metavar-expressions/concat-repetitions.rs b/tests/ui/macros/metavar-expressions/concat-repetitions.rs index 52a7d5cd8a7e..133a969b1248 100644 --- a/tests/ui/macros/metavar-expressions/concat-repetitions.rs +++ b/tests/ui/macros/metavar-expressions/concat-repetitions.rs @@ -11,8 +11,7 @@ macro_rules! one_rep { macro_rules! issue_128346 { ( $($a:ident)* ) => { A( - const ${concat($a, Z)}: i32 = 3; - //~^ ERROR invalid syntax + const ${concat($a, Z)}: i32 = 3; //~ ERROR `${concat(...)}` variable is still repeating at this depth )* }; } @@ -20,8 +19,8 @@ macro_rules! issue_128346 { macro_rules! issue_131393 { ($t:ident $($en:ident)?) => { read::<${concat($t, $en)}>() - //~^ ERROR invalid syntax - //~| ERROR invalid syntax + //~^ ERROR `${concat(...)}` variable is still repeating at this depth + //~| ERROR `${concat(...)}` variable is still repeating at this depth } } diff --git a/tests/ui/macros/metavar-expressions/concat-repetitions.stderr b/tests/ui/macros/metavar-expressions/concat-repetitions.stderr index 18b0a90c1c8a..0ef20c65a284 100644 --- a/tests/ui/macros/metavar-expressions/concat-repetitions.stderr +++ b/tests/ui/macros/metavar-expressions/concat-repetitions.stderr @@ -1,20 +1,20 @@ -error: invalid syntax - --> $DIR/concat-repetitions.rs:14:20 +error: `${concat(...)}` variable is still repeating at this depth + --> $DIR/concat-repetitions.rs:14:29 | LL | const ${concat($a, Z)}: i32 = 3; - | ^^^^^^^^^^^^^^^ + | ^ -error: invalid syntax - --> $DIR/concat-repetitions.rs:22:17 +error: `${concat(...)}` variable is still repeating at this depth + --> $DIR/concat-repetitions.rs:21:30 | LL | read::<${concat($t, $en)}>() - | ^^^^^^^^^^^^^^^^^ + | ^^ -error: invalid syntax - --> $DIR/concat-repetitions.rs:22:17 +error: `${concat(...)}` variable is still repeating at this depth + --> $DIR/concat-repetitions.rs:21:30 | LL | read::<${concat($t, $en)}>() - | ^^^^^^^^^^^^^^^^^ + | ^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/never_type/try-block-never-type-fallback.e2021.stderr b/tests/ui/never_type/try-block-never-type-fallback.e2021.stderr new file mode 100644 index 000000000000..7e23c86bcbcc --- /dev/null +++ b/tests/ui/never_type/try-block-never-type-fallback.e2021.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `!: From<()>` is not satisfied + --> $DIR/try-block-never-type-fallback.rs:20:9 + | +LL | bar(try { x? }); + | --- ^^^^^^^^^^ the trait `From<()>` is not implemented for `!` + | | + | required by a bound introduced by this call + | + = note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #148922 for more information) + = help: you might have intended to use the type `()` here instead + = note: required for `()` to implement `Into` +note: required by a bound in `bar` + --> $DIR/try-block-never-type-fallback.rs:15:23 + | +LL | fn bar(_: Result, u32>) { + | ^^^^^^^ required by this bound in `bar` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/never_type/try-block-never-type-fallback.rs b/tests/ui/never_type/try-block-never-type-fallback.rs new file mode 100644 index 000000000000..94107a0ff103 --- /dev/null +++ b/tests/ui/never_type/try-block-never-type-fallback.rs @@ -0,0 +1,25 @@ +//@ revisions: e2021 e2024 +//@[e2021] edition: 2021 +//@[e2024] edition: 2024 +//@[e2024] check-pass + +// Issue #125364: Bad interaction between never_type, try_blocks, and From/Into +// +// In edition 2021, the never type in try blocks falls back to (), +// causing a type error (since (): Into does not hold). +// In edition 2024, it falls back to !, allowing the code to compile correctly. + +#![feature(never_type)] +#![feature(try_blocks)] + +fn bar(_: Result, u32>) { + unimplemented!() +} + +fn foo(x: Result) { + bar(try { x? }); + //[e2021]~^ ERROR the trait bound `!: From<()>` is not satisfied +} + +fn main() { +} diff --git a/tests/ui/parser/diff-markers/enum-2.stderr b/tests/ui/parser/diff-markers/enum-2.stderr index b76cf5d5a01e..8f20e70922f9 100644 --- a/tests/ui/parser/diff-markers/enum-2.stderr +++ b/tests/ui/parser/diff-markers/enum-2.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/enum-2.rs:3:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `|||||||` is the code that we're merging into + | ^^^^^^^ between this marker and `|||||||` is the code that you are merging into LL | x: u8, LL | ||||||| | ------- between this marker and `=======` is the base code (what the two refs diverged from) @@ -15,12 +15,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/enum.stderr b/tests/ui/parser/diff-markers/enum.stderr index 0ce473bc7023..67f7561fd77b 100644 --- a/tests/ui/parser/diff-markers/enum.stderr +++ b/tests/ui/parser/diff-markers/enum.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/enum.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | Foo(u8), LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/fn-arg.stderr b/tests/ui/parser/diff-markers/fn-arg.stderr index 24521ffa6262..e63592ecf426 100644 --- a/tests/ui/parser/diff-markers/fn-arg.stderr +++ b/tests/ui/parser/diff-markers/fn-arg.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/fn-arg.rs:3:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | x: u8, LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/item-with-attr.stderr b/tests/ui/parser/diff-markers/item-with-attr.stderr index 432673cd5518..29dbfab16fda 100644 --- a/tests/ui/parser/diff-markers/item-with-attr.stderr +++ b/tests/ui/parser/diff-markers/item-with-attr.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/item-with-attr.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | fn foo() {} LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/item.stderr b/tests/ui/parser/diff-markers/item.stderr index 180c74e5d696..8de41123c9e9 100644 --- a/tests/ui/parser/diff-markers/item.stderr +++ b/tests/ui/parser/diff-markers/item.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/item.rs:1:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | fn foo() {} LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/statement.stderr b/tests/ui/parser/diff-markers/statement.stderr index 6dccce4a48ee..5b5da0ede615 100644 --- a/tests/ui/parser/diff-markers/statement.stderr +++ b/tests/ui/parser/diff-markers/statement.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/statement.rs:10:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | S::foo(); LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/struct-expr.stderr b/tests/ui/parser/diff-markers/struct-expr.stderr index 3733cdd34964..d094cbcc9e8c 100644 --- a/tests/ui/parser/diff-markers/struct-expr.stderr +++ b/tests/ui/parser/diff-markers/struct-expr.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/struct-expr.rs:6:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | x: 42, LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/struct.stderr b/tests/ui/parser/diff-markers/struct.stderr index 44f8346613e6..33999ff92b93 100644 --- a/tests/ui/parser/diff-markers/struct.stderr +++ b/tests/ui/parser/diff-markers/struct.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/struct.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | x: u8, LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/trait-item.stderr b/tests/ui/parser/diff-markers/trait-item.stderr index 4361542c7743..6b89b800790c 100644 --- a/tests/ui/parser/diff-markers/trait-item.stderr +++ b/tests/ui/parser/diff-markers/trait-item.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/trait-item.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | fn foo() {} LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/tuple-struct.stderr b/tests/ui/parser/diff-markers/tuple-struct.stderr index 7fda24ba4853..a0c8b7f3700a 100644 --- a/tests/ui/parser/diff-markers/tuple-struct.stderr +++ b/tests/ui/parser/diff-markers/tuple-struct.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/tuple-struct.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | u8, LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/diff-markers/use-statement.stderr b/tests/ui/parser/diff-markers/use-statement.stderr index 3eac7bebb5af..640f88f98057 100644 --- a/tests/ui/parser/diff-markers/use-statement.stderr +++ b/tests/ui/parser/diff-markers/use-statement.stderr @@ -2,7 +2,7 @@ error: encountered diff marker --> $DIR/use-statement.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ between this marker and `=======` is the code that we're merging into + | ^^^^^^^ between this marker and `=======` is the code that you are merging into LL | bar, LL | ======= | ------- between this marker and `>>>>>>>` is the incoming code @@ -12,12 +12,9 @@ LL | >>>>>>> branch | = note: conflict markers indicate that a merge was started but could not be completed due to merge conflicts to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers - = help: if you're having merge conflicts after pulling new code: - the top section is the code you already had and the bottom section is the remote code - if you're in the middle of a rebase: - the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased - = note: for an explanation on these markers from the `git` documentation: - visit + = help: if you are in a merge, the top section is the code you already had checked out and the bottom section is the new code + if you are in a rebase, the top section is the code being rebased onto and the bottom section is the code you had checked out which is being rebased + = note: for an explanation on these markers from the `git` documentation, visit error: aborting due to 1 previous error diff --git a/tests/ui/parser/recover/recover-assoc-const-constraint.stderr b/tests/ui/parser/recover/recover-assoc-const-constraint.stderr index 02b1c3fe68a9..766acd0398d2 100644 --- a/tests/ui/parser/recover/recover-assoc-const-constraint.stderr +++ b/tests/ui/parser/recover/recover-assoc-const-constraint.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | bar::(); | ^^^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: associated const equality is incomplete @@ -14,8 +14,8 @@ error[E0658]: associated const equality is incomplete LL | bar::(); | ^^^^^^^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 2 previous errors diff --git a/tests/ui/deref-patterns/basic.rs b/tests/ui/pattern/deref-patterns/basic.rs similarity index 83% rename from tests/ui/deref-patterns/basic.rs rename to tests/ui/pattern/deref-patterns/basic.rs index d76fb697f406..dee4521e1f95 100644 --- a/tests/ui/deref-patterns/basic.rs +++ b/tests/ui/pattern/deref-patterns/basic.rs @@ -1,6 +1,7 @@ //@ run-pass //@ check-run-results -#![feature(string_deref_patterns)] +#![feature(deref_patterns)] +#![expect(incomplete_features)] fn main() { test(Some(String::from("42"))); diff --git a/tests/ui/deref-patterns/basic.run.stdout b/tests/ui/pattern/deref-patterns/basic.run.stdout similarity index 100% rename from tests/ui/deref-patterns/basic.run.stdout rename to tests/ui/pattern/deref-patterns/basic.run.stdout diff --git a/tests/ui/deref-patterns/default-infer.rs b/tests/ui/pattern/deref-patterns/default-infer.rs similarity index 66% rename from tests/ui/deref-patterns/default-infer.rs rename to tests/ui/pattern/deref-patterns/default-infer.rs index 4f926175bd33..fb0b2add132a 100644 --- a/tests/ui/deref-patterns/default-infer.rs +++ b/tests/ui/pattern/deref-patterns/default-infer.rs @@ -1,5 +1,6 @@ //@ check-pass -#![feature(string_deref_patterns)] +#![feature(deref_patterns)] +#![expect(incomplete_features)] fn main() { match <_ as Default>::default() { diff --git a/tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.rs b/tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.rs new file mode 100644 index 000000000000..fac8684ef094 --- /dev/null +++ b/tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.rs @@ -0,0 +1,10 @@ +#![feature(deref_patterns)] +#![expect(incomplete_features)] + +fn main() { + let vec![const { vec![] }]: Vec = vec![]; + //~^ ERROR expected a pattern, found a function call + //~| ERROR usage of qualified paths in this context is experimental + //~| ERROR expected tuple struct or tuple variant + //~| ERROR arbitrary expressions aren't allowed in patterns +} diff --git a/tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.stderr b/tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.stderr new file mode 100644 index 000000000000..43b0ad18a79b --- /dev/null +++ b/tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.stderr @@ -0,0 +1,41 @@ +error[E0532]: expected a pattern, found a function call + --> $DIR/ice-adjust-mode-unimplemented-for-constblock.rs:5:9 + | +LL | let vec![const { vec![] }]: Vec = vec![]; + | ^^^^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant + | + = note: function calls are not allowed in patterns: + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0658]: usage of qualified paths in this context is experimental + --> $DIR/ice-adjust-mode-unimplemented-for-constblock.rs:5:9 + | +LL | let vec![const { vec![] }]: Vec = vec![]; + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #86935 for more information + = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: arbitrary expressions aren't allowed in patterns + --> $DIR/ice-adjust-mode-unimplemented-for-constblock.rs:5:14 + | +LL | let vec![const { vec![] }]: Vec = vec![]; + | ^^^^^^^^^^^^^^^^ + | + = help: use a named `const`-item or an `if`-guard (`x if x == const { ... }`) instead + +error[E0164]: expected tuple struct or tuple variant, found associated function `<[_]>::into_vec` + --> $DIR/ice-adjust-mode-unimplemented-for-constblock.rs:5:9 + | +LL | let vec![const { vec![] }]: Vec = vec![]; + | ^^^^^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns + | + = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html + = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0164, E0532, E0658. +For more information about an error, try `rustc --explain E0164`. diff --git a/tests/ui/deref-patterns/refs.rs b/tests/ui/pattern/deref-patterns/refs.rs similarity index 79% rename from tests/ui/deref-patterns/refs.rs rename to tests/ui/pattern/deref-patterns/refs.rs index c93e579bfd80..51826225856b 100644 --- a/tests/ui/deref-patterns/refs.rs +++ b/tests/ui/pattern/deref-patterns/refs.rs @@ -1,5 +1,6 @@ //@ check-pass -#![feature(string_deref_patterns)] +#![feature(deref_patterns)] +#![expect(incomplete_features)] fn foo(s: &String) -> i32 { match *s { diff --git a/tests/ui/print_type_sizes/async.stdout b/tests/ui/print_type_sizes/async.stdout index d3d6b6471c6e..d2adff80e3c9 100644 --- a/tests/ui/print_type_sizes/async.stdout +++ b/tests/ui/print_type_sizes/async.stdout @@ -12,6 +12,8 @@ print-type-size variant `Panicked`: 8192 bytes print-type-size upvar `.arg`: 8192 bytes print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size field `.value`: 8192 bytes +print-type-size type: `std::mem::MaybeDangling<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes +print-type-size field `.0`: 8192 bytes print-type-size type: `std::mem::MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 8192 bytes print-type-size field `.uninit`: 0 bytes @@ -47,6 +49,8 @@ print-type-size type: `std::ptr::NonNull`: 8 bytes, print-type-size field `.pointer`: 8 bytes print-type-size type: `std::mem::ManuallyDrop<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes print-type-size field `.value`: 1 bytes +print-type-size type: `std::mem::MaybeDangling<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes +print-type-size field `.0`: 1 bytes print-type-size type: `std::mem::MaybeUninit<{async fn body of wait()}>`: 1 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/print_type_sizes/coroutine_discr_placement.stdout b/tests/ui/print_type_sizes/coroutine_discr_placement.stdout index 4ce1ce46f6e8..b51beb514ba8 100644 --- a/tests/ui/print_type_sizes/coroutine_discr_placement.stdout +++ b/tests/ui/print_type_sizes/coroutine_discr_placement.stdout @@ -11,6 +11,8 @@ print-type-size variant `Returned`: 0 bytes print-type-size variant `Panicked`: 0 bytes print-type-size type: `std::mem::ManuallyDrop`: 4 bytes, alignment: 4 bytes print-type-size field `.value`: 4 bytes +print-type-size type: `std::mem::MaybeDangling`: 4 bytes, alignment: 4 bytes +print-type-size field `.0`: 4 bytes print-type-size type: `std::mem::MaybeUninit`: 4 bytes, alignment: 4 bytes print-type-size variant `MaybeUninit`: 4 bytes print-type-size field `.uninit`: 0 bytes diff --git a/tests/ui/proc-macro/auxiliary/api/ident.rs b/tests/ui/proc-macro/auxiliary/api/ident.rs new file mode 100644 index 000000000000..4451b896b65c --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/api/ident.rs @@ -0,0 +1,37 @@ +use proc_macro::{Ident, Span}; + +// FIXME: `Ident` does not yet implement `PartialEq` directly (#146553) +fn assert_eq(l: Ident, r: Ident) { + assert_eq!(l.to_string(), r.to_string()); +} + +fn assert_ne(l: Ident, r: Ident) { + assert_ne!(l.to_string(), r.to_string()); +} + +fn new(s: &str) -> Ident { + Ident::new(s, Span::call_site()) +} + +fn new_raw(s: &str) -> Ident { + Ident::new_raw(s, Span::call_site()) +} + +const LATIN_CAPITAL_LETTER_K: &str = "K"; +const KELVIN_SIGN: &str = "K"; + +const NORMAL_MIDDLE_DOT: &str = "L·L"; +const GREEK_ANO_TELEIA: &str = "L·L"; + +pub fn test() { + assert_eq(new("foo"), new("foo")); + assert_ne(new("foo"), new_raw("foo")); + + assert_ne!(LATIN_CAPITAL_LETTER_K, KELVIN_SIGN); + assert_eq(new(LATIN_CAPITAL_LETTER_K), new(KELVIN_SIGN)); + assert_eq(new_raw(LATIN_CAPITAL_LETTER_K), new_raw(KELVIN_SIGN)); + + assert_ne!(NORMAL_MIDDLE_DOT, GREEK_ANO_TELEIA); + assert_eq(new(NORMAL_MIDDLE_DOT), new(GREEK_ANO_TELEIA)); + assert_eq(new_raw(NORMAL_MIDDLE_DOT), new_raw(GREEK_ANO_TELEIA)); +} diff --git a/tests/ui/proc-macro/auxiliary/api/proc_macro_api_tests.rs b/tests/ui/proc-macro/auxiliary/api/proc_macro_api_tests.rs index abd667d8ce1d..4083604e1885 100644 --- a/tests/ui/proc-macro/auxiliary/api/proc_macro_api_tests.rs +++ b/tests/ui/proc-macro/auxiliary/api/proc_macro_api_tests.rs @@ -6,6 +6,7 @@ extern crate proc_macro; mod cmp; +mod ident; mod literal; use proc_macro::TokenStream; @@ -15,6 +16,7 @@ pub fn run(input: TokenStream) -> TokenStream { assert!(input.is_empty()); cmp::test(); + ident::test(); literal::test(); TokenStream::new() diff --git a/tests/ui/proc-macro/auxiliary/nested-empty-proc-macro.rs b/tests/ui/proc-macro/auxiliary/nested-empty-proc-macro.rs new file mode 100644 index 000000000000..a1cb4c1c7638 --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/nested-empty-proc-macro.rs @@ -0,0 +1,18 @@ +// Auxiliary proc-macro for issue #99173 +// Tests that nested proc-macro calls with empty output don't cause ICE + +extern crate proc_macro; + +use proc_macro::TokenStream; + +// This macro returns an empty TokenStream +#[proc_macro] +pub fn ignore(_input: TokenStream) -> TokenStream { + TokenStream::new() +} + +// This macro generates code that calls the `ignore` macro +#[proc_macro] +pub fn outer_macro(_input: TokenStream) -> TokenStream { + "nested_empty_proc_macro::ignore!(42)".parse().unwrap() +} diff --git a/tests/ui/proc-macro/nested-empty-proc-macro.rs b/tests/ui/proc-macro/nested-empty-proc-macro.rs new file mode 100644 index 000000000000..d1c2c8a01412 --- /dev/null +++ b/tests/ui/proc-macro/nested-empty-proc-macro.rs @@ -0,0 +1,12 @@ +//@ check-pass +//@ proc-macro: nested-empty-proc-macro.rs + +// Regression test for issue #99173 +// Tests that nested proc-macro calls where the inner macro returns +// an empty TokenStream don't cause an ICE. + +extern crate nested_empty_proc_macro; + +fn main() { + nested_empty_proc_macro::outer_macro!(1 * 2 * 3 * 7); +} diff --git a/tests/ui/issues/auxiliary/i8.rs b/tests/ui/resolve/auxiliary/i8.rs similarity index 100% rename from tests/ui/issues/auxiliary/i8.rs rename to tests/ui/resolve/auxiliary/i8.rs diff --git a/tests/ui/resolve/const-iter-no-conflict-for-loop.rs b/tests/ui/resolve/const-iter-no-conflict-for-loop.rs new file mode 100644 index 000000000000..ddbba64e5a31 --- /dev/null +++ b/tests/ui/resolve/const-iter-no-conflict-for-loop.rs @@ -0,0 +1,15 @@ +//! regression test for +//! Ensure that a constant named `iter` does not +//! interfere with the name resolution of the `iter` methods used internally +//! by `for` loops +//@ run-pass +#![allow(dead_code)] +#![allow(non_upper_case_globals)] + +fn main() { + const iter: i32 = 0; + + for i in 1..10 { + println!("{}", i); + } +} diff --git a/tests/ui/issues/issue-20427.rs b/tests/ui/resolve/shadow-primitives.rs similarity index 69% rename from tests/ui/issues/issue-20427.rs rename to tests/ui/resolve/shadow-primitives.rs index 4018043c371e..17da0cd0530c 100644 --- a/tests/ui/issues/issue-20427.rs +++ b/tests/ui/resolve/shadow-primitives.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] @@ -31,17 +32,10 @@ mod char { mod char_ {} mod str { - use super::i8 as i8; - use super::i32_ as i32; - use super::i64_ as i64; - use super::u8_ as u8; - use super::f_ as f64; - use super::u16_ as u16; - use super::u32_ as u32; - use super::u64_ as u64; - use super::bool_ as bool; - use super::{bool_ as str}; - use super::char_ as char; + use super::{ + bool_ as bool, bool_ as str, char_ as char, f_ as f64, i8, i32_ as i32, i64_ as i64, + u8_ as u8, u16_ as u16, u32_ as u32, u64_ as u64, + }; } } @@ -49,7 +43,9 @@ trait isize_ { type isize; } -fn usize<'usize>(usize: &'usize usize) -> &'usize usize { usize } +fn usize<'usize>(usize: &'usize usize) -> &'usize usize { + usize +} mod reuse { use std::mem::size_of; @@ -68,9 +64,10 @@ mod reuse { mod guard { pub fn check() { use std::u8; // bring module u8 in scope - fn f() -> u8 { // OK, resolves to primitive u8, not to std::u8 + fn f() -> u8 { + // OK, resolves to primitive u8, not to std::u8 u8::max_value() // OK, resolves to associated function ::max_value, - // not to non-existent std::u8::max_value + // not to non-existent std::u8::max_value } assert_eq!(f(), u8::MAX); // OK, resolves to std::u8::MAX } @@ -79,7 +76,13 @@ mod guard { fn main() { let bool = true; let _ = match bool { - str @ true => if str { i32 as i64 } else { i64 }, + str @ true => { + if str { + i32 as i64 + } else { + i64 + } + } false => i64, }; diff --git a/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs b/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs deleted file mode 100644 index c40590ad87f4..000000000000 --- a/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs +++ /dev/null @@ -1,15 +0,0 @@ -//@ run-pass -//@ aux-build:sigpipe-utils.rs -//@ compile-flags: -Zon-broken-pipe=kill -//@ only-unix because SIGPIPE is a unix thing - -#![feature(rustc_attrs)] - -#[rustc_main] -fn rustc_main() { - extern crate sigpipe_utils; - - // `-Zon-broken-pipe=kill` is active, so SIGPIPE handler shall be - // SIG_DFL. Note that we have a #[rustc_main], but it should still work. - sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Default); -} diff --git a/tests/ui/scalable-vectors/debuginfo-does-not-spill.rs b/tests/ui/scalable-vectors/debuginfo-does-not-spill.rs new file mode 100644 index 000000000000..f7cc455dc8ef --- /dev/null +++ b/tests/ui/scalable-vectors/debuginfo-does-not-spill.rs @@ -0,0 +1,39 @@ +// Compiletest for rust-lang/rust#150419: Do not spill operands to the stack when +// creating debuginfo for AArch64 SVE predicates `` where `N != 16` +//@ edition: 2021 +//@ only-aarch64 +//@ build-pass +//@ compile-flags: -C debuginfo=2 -C target-feature=+sve + +#![crate_type = "lib"] +#![allow(internal_features)] +#![feature(rustc_attrs, link_llvm_intrinsics)] + +#[rustc_scalable_vector(16)] +#[allow(non_camel_case_types)] +#[repr(transparent)] +pub struct svbool_t(bool); + +#[rustc_scalable_vector(4)] +#[allow(non_camel_case_types)] +#[repr(transparent)] +pub struct svbool4_t(bool); + +impl std::convert::Into for svbool4_t { + #[inline(always)] + fn into(self) -> svbool_t { + unsafe extern "C" { + #[link_name = "llvm.aarch64.sve.convert.to.svbool.nxv4i1"] + fn convert_to_svbool(b: svbool4_t) -> svbool_t; + } + unsafe { convert_to_svbool(self) } + } +} + +pub fn svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool_t { + unsafe extern "C" { + #[link_name = "llvm.aarch64.sve.whilelo.nxv4i1.u64"] + fn _svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool4_t; + } + unsafe { _svwhilelt_b32_u64(op1, op2) }.into() +} diff --git a/tests/ui/self/self-in-method-body-resolves.rs b/tests/ui/self/self-in-method-body-resolves.rs new file mode 100644 index 000000000000..636922cd87ce --- /dev/null +++ b/tests/ui/self/self-in-method-body-resolves.rs @@ -0,0 +1,16 @@ +//! regression test for +//@ check-pass +#![allow(dead_code)] + +struct Foo; + +impl Foo { + fn new() -> Self { + Foo + } + fn bar() { + Self::new(); + } +} + +fn main() {} diff --git a/tests/ui/specialization/const_trait_impl.stderr b/tests/ui/specialization/const_trait_impl.stderr deleted file mode 100644 index 93ed7234e563..000000000000 --- a/tests/ui/specialization/const_trait_impl.stderr +++ /dev/null @@ -1,59 +0,0 @@ -error: `[const]` can only be applied to `const` traits - --> $DIR/const_trait_impl.rs:33:9 - | -LL | impl const A for T { - | ^^^^^^^ can't be applied to `Debug` - | -note: `Debug` can't be used with `[const]` because it isn't `const` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - -error: `[const]` can only be applied to `const` traits - --> $DIR/const_trait_impl.rs:39:9 - | -LL | impl const A for T { - | ^^^^^^^ can't be applied to `Debug` - | -note: `Debug` can't be used with `[const]` because it isn't `const` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - -error: `[const]` can only be applied to `const` traits - --> $DIR/const_trait_impl.rs:45:9 - | -LL | impl const A for T { - | ^^^^^^^ can't be applied to `Debug` - | -note: `Debug` can't be used with `[const]` because it isn't `const` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - -error: `[const]` can only be applied to `const` traits - --> $DIR/const_trait_impl.rs:39:9 - | -LL | impl const A for T { - | ^^^^^^^ can't be applied to `Debug` - | -note: `Debug` can't be used with `[const]` because it isn't `const` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `[const]` can only be applied to `const` traits - --> $DIR/const_trait_impl.rs:33:9 - | -LL | impl const A for T { - | ^^^^^^^ can't be applied to `Debug` - | -note: `Debug` can't be used with `[const]` because it isn't `const` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: `[const]` can only be applied to `const` traits - --> $DIR/const_trait_impl.rs:45:9 - | -LL | impl const A for T { - | ^^^^^^^ can't be applied to `Debug` - | -note: `Debug` can't be used with `[const]` because it isn't `const` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: aborting due to 6 previous errors - diff --git a/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.rs b/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.rs index edea6f75444f..538b0c2b1d46 100644 --- a/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.rs +++ b/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.rs @@ -1,6 +1,6 @@ // Regression test for #140571. The compiler used to ICE -#![feature(associated_const_equality, min_generic_const_args, specialization)] +#![feature(min_generic_const_args, specialization)] //~^ WARN the feature `specialization` is incomplete //~| WARN the feature `min_generic_const_args` is incomplete diff --git a/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.stderr b/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.stderr index bf15d0fae4e5..6159c2ed331a 100644 --- a/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.stderr +++ b/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.stderr @@ -1,17 +1,17 @@ warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/overlap-due-to-unsatisfied-const-bound.rs:3:39 + --> $DIR/overlap-due-to-unsatisfied-const-bound.rs:3:12 | -LL | #![feature(associated_const_equality, min_generic_const_args, specialization)] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #![feature(min_generic_const_args, specialization)] + | ^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #132980 for more information = note: `#[warn(incomplete_features)]` on by default warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/overlap-due-to-unsatisfied-const-bound.rs:3:63 + --> $DIR/overlap-due-to-unsatisfied-const-bound.rs:3:36 | -LL | #![feature(associated_const_equality, min_generic_const_args, specialization)] - | ^^^^^^^^^^^^^^ +LL | #![feature(min_generic_const_args, specialization)] + | ^^^^^^^^^^^^^^ | = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete diff --git a/tests/ui/suggestions/suggest-variants.rs b/tests/ui/suggestions/suggest-variants.rs index dd05d0f04abe..d3bd3c2c8e87 100644 --- a/tests/ui/suggestions/suggest-variants.rs +++ b/tests/ui/suggestions/suggest-variants.rs @@ -16,3 +16,26 @@ fn main() { Shape::Circl; //~ ERROR no variant Shape::Rombus; //~ ERROR no variant } + +enum Color { + Red, + Green(()), + Blue, + Alpha{ a: u8 }, +} + +fn red() -> Result { + Ok(Color::Redd) //~ ERROR no variant +} + +fn green() -> Result { + Ok(Color::Greenn(())) //~ ERROR no variant +} + +fn blue() -> Result { + Ok(Color::Blu) //~ ERROR no variant +} + +fn alpha() -> Result { + Ok(Color::Alph{ a: 255 }) //~ ERROR no variant +} diff --git a/tests/ui/suggestions/suggest-variants.stderr b/tests/ui/suggestions/suggest-variants.stderr index 50286a968759..13518a9d5842 100644 --- a/tests/ui/suggestions/suggest-variants.stderr +++ b/tests/ui/suggestions/suggest-variants.stderr @@ -74,6 +74,64 @@ LL | enum Shape { LL | Shape::Rombus; | ^^^^^^ variant or associated item not found in `Shape` -error: aborting due to 6 previous errors +error[E0599]: no variant or associated item named `Redd` found for enum `Color` in the current scope + --> $DIR/suggest-variants.rs:28:13 + | +LL | enum Color { + | ---------- variant or associated item `Redd` not found for this enum +... +LL | Ok(Color::Redd) + | ^^^^ variant or associated item not found in `Color` + | +help: there is a variant with a similar name + | +LL - Ok(Color::Redd) +LL + Ok(Color::Red) + | + +error[E0599]: no variant or associated item named `Greenn` found for enum `Color` in the current scope + --> $DIR/suggest-variants.rs:32:13 + | +LL | enum Color { + | ---------- variant or associated item `Greenn` not found for this enum +... +LL | Ok(Color::Greenn(())) + | ^^^^^^ variant or associated item not found in `Color` + | +help: there is a variant with a similar name + | +LL - Ok(Color::Greenn(())) +LL + Ok(Color::Green(())) + | + +error[E0599]: no variant or associated item named `Blu` found for enum `Color` in the current scope + --> $DIR/suggest-variants.rs:36:13 + | +LL | enum Color { + | ---------- variant or associated item `Blu` not found for this enum +... +LL | Ok(Color::Blu) + | ^^^ variant or associated item not found in `Color` + | +help: there is a variant with a similar name + | +LL | Ok(Color::Blue) + | + + +error[E0599]: no variant named `Alph` found for enum `Color` + --> $DIR/suggest-variants.rs:40:13 + | +LL | enum Color { + | ---------- variant `Alph` not found here +... +LL | Ok(Color::Alph{ a: 255 }) + | ^^^^ + | +help: there is a variant with a similar name + | +LL | Ok(Color::Alpha{ a: 255 }) + | + + +error: aborting due to 10 previous errors For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/target-feature/gate.stderr b/tests/ui/target-feature/gate.stderr index 345dc2006d0b..67df09fd369e 100644 --- a/tests/ui/target-feature/gate.stderr +++ b/tests/ui/target-feature/gate.stderr @@ -4,7 +4,7 @@ error[E0658]: the target feature `x87` is currently unstable LL | #[target_feature(enable = "x87")] | ^^^^^^^^^^^^^^ | - = note: see issue #44839 for more information + = note: see issue #150261 for more information = help: add `#![feature(x87_target_feature)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/thir-print/offset_of.stdout b/tests/ui/thir-print/offset_of.stdout index 846817f47528..ab924091ba7a 100644 --- a/tests/ui/thir-print/offset_of.stdout +++ b/tests/ui/thir-print/offset_of.stdout @@ -68,7 +68,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::concrete).10)) - span: $DIR/offset_of.rs:37:5: 1433:57 (#0) + span: $DIR/offset_of.rs:37:5: 1437:57 (#0) } } Stmt { @@ -117,7 +117,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::concrete).20)) - span: $DIR/offset_of.rs:38:5: 1433:57 (#0) + span: $DIR/offset_of.rs:38:5: 1437:57 (#0) } } Stmt { @@ -166,7 +166,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::concrete).30)) - span: $DIR/offset_of.rs:39:5: 1433:57 (#0) + span: $DIR/offset_of.rs:39:5: 1437:57 (#0) } } Stmt { @@ -215,7 +215,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::concrete).40)) - span: $DIR/offset_of.rs:40:5: 1433:57 (#0) + span: $DIR/offset_of.rs:40:5: 1437:57 (#0) } } Stmt { @@ -264,7 +264,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::concrete).50)) - span: $DIR/offset_of.rs:41:5: 1433:57 (#0) + span: $DIR/offset_of.rs:41:5: 1437:57 (#0) } } ] @@ -864,7 +864,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::generic).12)) - span: $DIR/offset_of.rs:45:5: 1433:57 (#0) + span: $DIR/offset_of.rs:45:5: 1437:57 (#0) } } Stmt { @@ -913,7 +913,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::generic).24)) - span: $DIR/offset_of.rs:46:5: 1433:57 (#0) + span: $DIR/offset_of.rs:46:5: 1437:57 (#0) } } Stmt { @@ -962,7 +962,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::generic).36)) - span: $DIR/offset_of.rs:47:5: 1433:57 (#0) + span: $DIR/offset_of.rs:47:5: 1437:57 (#0) } } Stmt { @@ -1011,7 +1011,7 @@ body: ) else_block: None lint_level: Explicit(HirId(DefId(offset_of::generic).48)) - span: $DIR/offset_of.rs:48:5: 1433:57 (#0) + span: $DIR/offset_of.rs:48:5: 1437:57 (#0) } } ] diff --git a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs index d8fd1d44a985..37fa01692053 100644 --- a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs +++ b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs @@ -9,3 +9,11 @@ fn main() { //~| HELP try using a fully qualified path to specify the expected types //~| HELP consider removing this method call, as the receiver has type `Bar` and `Bar: From` trivially holds } + +// regression test for https://github.com/rust-lang/rust/issues/149487. +fn quux() { + let mut tx_heights: std::collections::BTreeMap<(), Option<()>> = <_>::default(); + tx_heights.get(&()).unwrap_or_default(); + //~^ ERROR the trait bound `&Option<()>: Default` is not satisfied + //~| HELP: the trait `Default` is implemented for `Option` +} diff --git a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr index 7d795581ea9d..f0c993125279 100644 --- a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr +++ b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr @@ -23,6 +23,18 @@ LL - qux(Bar.into()); LL + qux(Bar); | -error: aborting due to 1 previous error +error[E0277]: the trait bound `&Option<()>: Default` is not satisfied + --> $DIR/argument-with-unnecessary-method-call.rs:16:25 + | +LL | tx_heights.get(&()).unwrap_or_default(); + | ^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `&Option<()>` + | +help: the trait `Default` is implemented for `Option` + --> $SRC_DIR/core/src/option.rs:LL:COL +note: required by a bound in `Option::::unwrap_or_default` + --> $SRC_DIR/core/src/option.rs:LL:COL -For more information about this error, try `rustc --explain E0283`. +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0277, E0283. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/bound/recursive-trait-bound-on-type-param.rs b/tests/ui/traits/bound/recursive-trait-bound-on-type-param.rs new file mode 100644 index 000000000000..41ae91afad49 --- /dev/null +++ b/tests/ui/traits/bound/recursive-trait-bound-on-type-param.rs @@ -0,0 +1,12 @@ +//! regression test for +//@ check-pass + +trait A {} +struct B +where + B: A>, +{ + t: T, +} + +fn main() {} diff --git a/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.rs b/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.rs index 0bc25ce5f650..e61ae2760aab 100644 --- a/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.rs +++ b/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.rs @@ -1,15 +1,15 @@ -//@ known-bug: #110395 -#![feature(derive_const)] +#![feature(const_default, derive_const)] pub struct A; -impl std::fmt::Debug for A { - fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - panic!() +impl Default for A { + fn default() -> A { + A } } -#[derive_const(Debug)] +#[derive_const(Default)] pub struct S(A); +//~^ ERROR: cannot call non-const associated function fn main() {} diff --git a/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr b/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr index 93638801895d..558957985328 100644 --- a/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr +++ b/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr @@ -1,20 +1,13 @@ -error: const `impl` for trait `Debug` which is not `const` - --> $DIR/derive-const-non-const-type.rs:12:16 +error[E0015]: cannot call non-const associated function `::default` in constant functions + --> $DIR/derive-const-non-const-type.rs:12:14 | -LL | #[derive_const(Debug)] - | ^^^^^ this trait is not `const` - | - = note: marking a trait with `const` ensures all default method bodies are `const` - = note: adding a non-const method body in the future would be a breaking change - -error[E0015]: cannot call non-const method `Formatter::<'_>::debug_tuple_field1_finish` in constant functions - --> $DIR/derive-const-non-const-type.rs:12:16 - | -LL | #[derive_const(Debug)] - | ^^^^^ +LL | #[derive_const(Default)] + | ------- in this derive macro expansion +LL | pub struct S(A); + | ^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: aborting due to 2 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/rustc-impl-const-stability.rs b/tests/ui/traits/const-traits/rustc-impl-const-stability.rs similarity index 63% rename from tests/ui/consts/rustc-impl-const-stability.rs rename to tests/ui/traits/const-traits/rustc-impl-const-stability.rs index 93a5e8e4f458..7d30342d11ca 100644 --- a/tests/ui/consts/rustc-impl-const-stability.rs +++ b/tests/ui/traits/const-traits/rustc-impl-const-stability.rs @@ -1,5 +1,4 @@ -//@ compile-flags: -Znext-solver -//@ known-bug: #110395 +//@ check-pass #![crate_type = "lib"] #![feature(staged_api, const_trait_impl, const_default)] @@ -12,8 +11,8 @@ pub struct Data { #[stable(feature = "potato", since = "1.27.0")] #[rustc_const_unstable(feature = "data_foo", issue = "none")] -impl const std::fmt::Debug for Data { - fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - Ok(()) +impl const Default for Data { + fn default() -> Data { + Data { _data: 0xbeef } } } diff --git a/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.rs b/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.rs index 5125d2580238..f771107ec068 100644 --- a/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.rs +++ b/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.rs @@ -1,7 +1,5 @@ // Tests that trait bounds on specializing trait impls must be `[const]` if the // same bound is present on the default impl and is `[const]` there. -//@ known-bug: #110395 -// FIXME(const_trait_impl) ^ should error #![feature(const_trait_impl)] #![feature(rustc_attrs)] @@ -23,9 +21,9 @@ where default fn bar() {} } -impl Bar for T +impl Bar for T //~ ERROR conflicting implementations of trait `Bar` where - T: Foo, //FIXME ~ ERROR missing `[const]` qualifier + T: Foo, T: Specialize, { fn bar() {} @@ -42,7 +40,7 @@ where default fn baz() {} } -impl const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz` +impl const Baz for T //~ ERROR conflicting implementations of trait `Baz` where T: Foo, T: Specialize, diff --git a/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr b/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr index 85e9fda5c2a3..ff27559c8ec6 100644 --- a/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr +++ b/tests/ui/traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.stderr @@ -1,5 +1,5 @@ error[E0119]: conflicting implementations of trait `Bar` - --> $DIR/const-default-bound-non-const-specialized-bound.rs:26:1 + --> $DIR/const-default-bound-non-const-specialized-bound.rs:24:1 | LL | / impl const Bar for T LL | | where @@ -8,19 +8,19 @@ LL | | T: [const] Foo, ... LL | / impl Bar for T LL | | where -LL | | T: Foo, //FIXME ~ ERROR missing `[const]` qualifier +LL | | T: Foo, LL | | T: Specialize, | |__________________^ conflicting implementation error[E0119]: conflicting implementations of trait `Baz` - --> $DIR/const-default-bound-non-const-specialized-bound.rs:45:1 + --> $DIR/const-default-bound-non-const-specialized-bound.rs:43:1 | LL | / impl const Baz for T LL | | where LL | | T: [const] Foo, | |___________________- first implementation here ... -LL | / impl const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz` +LL | / impl const Baz for T LL | | where LL | | T: Foo, LL | | T: Specialize, diff --git a/tests/ui/specialization/const_trait_impl.rs b/tests/ui/traits/const-traits/specialization/pass.rs similarity index 70% rename from tests/ui/specialization/const_trait_impl.rs rename to tests/ui/traits/const-traits/specialization/pass.rs index adfef77a15ca..0ba4e40ee30a 100644 --- a/tests/ui/specialization/const_trait_impl.rs +++ b/tests/ui/traits/const-traits/specialization/pass.rs @@ -1,8 +1,6 @@ -//@ known-bug: #110395 - -#![feature(const_trait_impl, min_specialization, rustc_attrs)] - -use std::fmt::Debug; +//@ check-pass +#![feature(const_trait_impl, const_default, min_specialization, rustc_attrs)] +#![allow(internal_features)] #[rustc_specialization_trait] pub const unsafe trait Sup { @@ -30,19 +28,19 @@ pub const trait A { fn a() -> u32; } -impl const A for T { +impl const A for T { default fn a() -> u32 { 2 } } -impl const A for T { +impl const A for T { default fn a() -> u32 { 3 } } -impl const A for T { +impl const A for T { fn a() -> u32 { T::foo() } diff --git a/tests/ui/traits/const-traits/specializing-constness-2.rs b/tests/ui/traits/const-traits/specialization/specializing-constness-2.rs similarity index 81% rename from tests/ui/traits/const-traits/specializing-constness-2.rs rename to tests/ui/traits/const-traits/specialization/specializing-constness-2.rs index 455dd111603d..78cfbe361d91 100644 --- a/tests/ui/traits/const-traits/specializing-constness-2.rs +++ b/tests/ui/traits/const-traits/specialization/specializing-constness-2.rs @@ -1,5 +1,6 @@ #![feature(const_trait_impl, min_specialization, rustc_attrs)] -//@ known-bug: #110395 +#![allow(internal_features)] + #[rustc_specialization_trait] pub const trait Sup {} @@ -23,7 +24,7 @@ impl const A for T { const fn generic() { ::a(); - //FIXME ~^ ERROR: the trait bound `T: [const] Sup` is not satisfied + //~^ ERROR: the trait bound `T: [const] A` is not satisfied } fn main() {} diff --git a/tests/ui/traits/const-traits/specializing-constness-2.stderr b/tests/ui/traits/const-traits/specialization/specializing-constness-2.stderr similarity index 88% rename from tests/ui/traits/const-traits/specializing-constness-2.stderr rename to tests/ui/traits/const-traits/specialization/specializing-constness-2.stderr index bd6ffa544d0e..bb1c9ac78531 100644 --- a/tests/ui/traits/const-traits/specializing-constness-2.stderr +++ b/tests/ui/traits/const-traits/specialization/specializing-constness-2.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `T: [const] A` is not satisfied - --> $DIR/specializing-constness-2.rs:25:6 + --> $DIR/specializing-constness-2.rs:26:6 | LL | ::a(); | ^ diff --git a/tests/ui/traits/const-traits/specializing-constness.rs b/tests/ui/traits/const-traits/specialization/specializing-constness.rs similarity index 100% rename from tests/ui/traits/const-traits/specializing-constness.rs rename to tests/ui/traits/const-traits/specialization/specializing-constness.rs diff --git a/tests/ui/traits/const-traits/specializing-constness.stderr b/tests/ui/traits/const-traits/specialization/specializing-constness.stderr similarity index 100% rename from tests/ui/traits/const-traits/specializing-constness.stderr rename to tests/ui/traits/const-traits/specialization/specializing-constness.stderr diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs index 9b2e489c5425..82d0fa36d7ec 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs @@ -12,7 +12,7 @@ trait Tr1 { } #[rustc_must_implement_one_of(a)] -//~^ ERROR the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args +//~^ ERROR malformed trait Tr2 { fn a() {} } @@ -36,11 +36,11 @@ trait Tr5 { } #[rustc_must_implement_one_of(abc, xyz)] -//~^ ERROR attribute should be applied to a trait +//~^ ERROR `#[rustc_must_implement_one_of]` attribute cannot be used on functions fn function() {} #[rustc_must_implement_one_of(abc, xyz)] -//~^ ERROR attribute should be applied to a trait +//~^ ERROR `#[rustc_must_implement_one_of]` attribute cannot be used on structs struct Struct {} fn main() {} diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr index cf197d035b38..0d854b4594fa 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr @@ -1,26 +1,36 @@ -error: malformed `rustc_must_implement_one_of` attribute input +error[E0539]: malformed `rustc_must_implement_one_of` attribute input + --> $DIR/rustc_must_implement_one_of_misuse.rs:14:1 + | +LL | #[rustc_must_implement_one_of(a)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ + | | | + | | expected 2 or more items + | help: must be of the form: `#[rustc_must_implement_one_of(function1, function2, ...)]` + +error[E0539]: malformed `rustc_must_implement_one_of` attribute input --> $DIR/rustc_must_implement_one_of_misuse.rs:20:1 | LL | #[rustc_must_implement_one_of] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_must_implement_one_of(function1, function2, ...)]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected this to be a list + | help: must be of the form: `#[rustc_must_implement_one_of(function1, function2, ...)]` -error: attribute should be applied to a trait +error: `#[rustc_must_implement_one_of]` attribute cannot be used on functions --> $DIR/rustc_must_implement_one_of_misuse.rs:38:1 | LL | #[rustc_must_implement_one_of(abc, xyz)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | -LL | fn function() {} - | ---------------- not a trait + | + = help: `#[rustc_must_implement_one_of]` can only be applied to traits -error: attribute should be applied to a trait +error: `#[rustc_must_implement_one_of]` attribute cannot be used on structs --> $DIR/rustc_must_implement_one_of_misuse.rs:42:1 | LL | #[rustc_must_implement_one_of(abc, xyz)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | -LL | struct Struct {} - | ---------------- not a trait + | + = help: `#[rustc_must_implement_one_of]` can only be applied to traits error: function not found in this trait --> $DIR/rustc_must_implement_one_of_misuse.rs:3:31 @@ -40,12 +50,6 @@ error: function not found in this trait LL | #[rustc_must_implement_one_of(a, b)] | ^ -error: the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args - --> $DIR/rustc_must_implement_one_of_misuse.rs:14:1 - | -LL | #[rustc_must_implement_one_of(a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error: not a function --> $DIR/rustc_must_implement_one_of_misuse.rs:26:5 | @@ -98,3 +102,4 @@ LL | #[rustc_must_implement_one_of(a, b)] error: aborting due to 11 previous errors +For more information about this error, try `rustc --explain E0539`. diff --git a/tests/ui/traits/next-solver/dont-ice-on-assoc-projection.stderr b/tests/ui/traits/next-solver/dont-ice-on-assoc-projection.stderr index db7d2dd3e3a3..8334fdae9485 100644 --- a/tests/ui/traits/next-solver/dont-ice-on-assoc-projection.stderr +++ b/tests/ui/traits/next-solver/dont-ice-on-assoc-projection.stderr @@ -4,8 +4,8 @@ error[E0658]: associated const equality is incomplete LL | impl Foo for T where T: Bar {} | ^^^^^^^^^ | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable + = note: see issue #132980 for more information + = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0119]: conflicting implementations of trait `Foo` for type `()` diff --git a/tests/ui/transmutability/non_scalar_alignment_value.rs b/tests/ui/transmutability/non_scalar_alignment_value.rs new file mode 100644 index 000000000000..45c9e61fcfe2 --- /dev/null +++ b/tests/ui/transmutability/non_scalar_alignment_value.rs @@ -0,0 +1,30 @@ +#![feature(min_generic_const_args)] +//~^ WARN the feature `min_generic_const_args` is incomplete + +#![feature(transmutability)] + +mod assert { + use std::mem::{Assume, TransmuteFrom}; + struct Dst {} + fn is_maybe_transmutable() + where + Dst: TransmuteFrom< + (), + { + Assume { + alignment: Assume {}, + //~^ ERROR struct expression with missing field initialiser for `alignment` + //~| ERROR struct expression with missing field initialiser for `lifetimes` + //~| ERROR struct expression with missing field initialiser for `safety` + //~| ERROR struct expression with missing field initialiser for `validity` + lifetimes: const { true }, + safety: const { true }, + validity: const { true }, + } + }, + >, + { + } +} + +fn main() {} diff --git a/tests/ui/transmutability/non_scalar_alignment_value.stderr b/tests/ui/transmutability/non_scalar_alignment_value.stderr new file mode 100644 index 000000000000..d22c6d0b27e8 --- /dev/null +++ b/tests/ui/transmutability/non_scalar_alignment_value.stderr @@ -0,0 +1,35 @@ +warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/non_scalar_alignment_value.rs:1:12 + | +LL | #![feature(min_generic_const_args)] + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #132980 for more information + = note: `#[warn(incomplete_features)]` on by default + +error: struct expression with missing field initialiser for `alignment` + --> $DIR/non_scalar_alignment_value.rs:15:32 + | +LL | alignment: Assume {}, + | ^^^^^^^^^ + +error: struct expression with missing field initialiser for `lifetimes` + --> $DIR/non_scalar_alignment_value.rs:15:32 + | +LL | alignment: Assume {}, + | ^^^^^^^^^ + +error: struct expression with missing field initialiser for `safety` + --> $DIR/non_scalar_alignment_value.rs:15:32 + | +LL | alignment: Assume {}, + | ^^^^^^^^^ + +error: struct expression with missing field initialiser for `validity` + --> $DIR/non_scalar_alignment_value.rs:15:32 + | +LL | alignment: Assume {}, + | ^^^^^^^^^ + +error: aborting due to 4 previous errors; 1 warning emitted + diff --git a/tests/ui/try-trait/bad-question-mark-on-trait-object.rs b/tests/ui/try-trait/bad-question-mark-on-trait-object.rs index 2a0d14b17503..270ec2c532ac 100644 --- a/tests/ui/try-trait/bad-question-mark-on-trait-object.rs +++ b/tests/ui/try-trait/bad-question-mark-on-trait-object.rs @@ -1,6 +1,5 @@ struct E; //~^ NOTE `E` needs to implement `std::error::Error` -//~| NOTE alternatively, `E` needs to implement `Into` struct X; //~ NOTE `X` needs to implement `From` fn foo() -> Result<(), Box> { //~ NOTE required `E: std::error::Error` because of this diff --git a/tests/ui/try-trait/bad-question-mark-on-trait-object.stderr b/tests/ui/try-trait/bad-question-mark-on-trait-object.stderr index dd380850c9ec..7639489b891a 100644 --- a/tests/ui/try-trait/bad-question-mark-on-trait-object.stderr +++ b/tests/ui/try-trait/bad-question-mark-on-trait-object.stderr @@ -1,5 +1,5 @@ error[E0277]: `?` couldn't convert the error: `E: std::error::Error` is not satisfied - --> $DIR/bad-question-mark-on-trait-object.rs:7:13 + --> $DIR/bad-question-mark-on-trait-object.rs:6:13 | LL | fn foo() -> Result<(), Box> { | -------------------------------------- required `E: std::error::Error` because of this @@ -17,7 +17,7 @@ LL | struct E; = note: required for `Box` to implement `From` error[E0277]: `?` couldn't convert the error to `X` - --> $DIR/bad-question-mark-on-trait-object.rs:18:13 + --> $DIR/bad-question-mark-on-trait-object.rs:17:13 | LL | fn bat() -> Result<(), X> { | ------------- expected `X` because of this @@ -27,15 +27,10 @@ LL | Ok(bar()?) | this can't be annotated with `?` because it has type `Result<_, E>` | note: `X` needs to implement `From` - --> $DIR/bad-question-mark-on-trait-object.rs:4:1 + --> $DIR/bad-question-mark-on-trait-object.rs:3:1 | LL | struct X; | ^^^^^^^^ -note: alternatively, `E` needs to implement `Into` - --> $DIR/bad-question-mark-on-trait-object.rs:1:1 - | -LL | struct E; - | ^^^^^^^^ = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/tuple-ref-order-distinct-impls.rs b/tests/ui/typeck/tuple-ref-order-distinct-impls.rs new file mode 100644 index 000000000000..fdede8a1d9c4 --- /dev/null +++ b/tests/ui/typeck/tuple-ref-order-distinct-impls.rs @@ -0,0 +1,12 @@ +//! regression test for +//@ check-pass + +trait Common { + fn dummy(&self) {} +} + +impl<'t, T> Common for (T, &'t T) {} + +impl<'t, T> Common for (&'t T, T) {} + +fn main() {} diff --git a/tests/ui/ufcs/ufcs-trait-object-format.rs b/tests/ui/ufcs/ufcs-trait-object-format.rs new file mode 100644 index 000000000000..7d50a2444806 --- /dev/null +++ b/tests/ui/ufcs/ufcs-trait-object-format.rs @@ -0,0 +1,13 @@ +//@ run-pass +//! Regression test for . +//! Error was that we didn't support +//! UFCS-style calls to a method in `Trait` where `Self` was bound to a +//! trait object of type `Trait`. +//! See also . + +use std::fmt; + +fn main() { + let a: &dyn fmt::Debug = &1; + let _ = format!("{:?}", a); +} diff --git a/tests/ui/unpretty/struct-exprs-tuple-call-pretty-printing.rs b/tests/ui/unpretty/struct-exprs-tuple-call-pretty-printing.rs new file mode 100644 index 000000000000..5f2d6680efac --- /dev/null +++ b/tests/ui/unpretty/struct-exprs-tuple-call-pretty-printing.rs @@ -0,0 +1,33 @@ +//@ compile-flags: -Zunpretty=hir +//@ check-pass + +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] +#![allow(dead_code)] + +use std::marker::ConstParamTy; + +struct Point(u32, u32); + +struct Point3(); + +struct Point1 { + a: u32, + b: u32, +} + +struct Point2 {} + +fn with_point() {} +fn with_point1() {} +fn with_point2() {} +fn with_point3() {} + +fn test() { + with_point::<{ Point(N, N) }>(); + with_point1::<{ Point1 { a: N, b: N } }>(); + with_point2::<{ Point2 {} }>(); + with_point3::<{ Point3() }>(); +} + +fn main() {} diff --git a/tests/ui/unpretty/struct-exprs-tuple-call-pretty-printing.stdout b/tests/ui/unpretty/struct-exprs-tuple-call-pretty-printing.stdout new file mode 100644 index 000000000000..fc0fbe8ef237 --- /dev/null +++ b/tests/ui/unpretty/struct-exprs-tuple-call-pretty-printing.stdout @@ -0,0 +1,39 @@ +//@ compile-flags: -Zunpretty=hir +//@ check-pass + +#![feature(min_generic_const_args, adt_const_params)] +#![expect(incomplete_features)] +#![allow(dead_code)] +#[attr = MacroUse {arguments: UseAll}] +extern crate std; +#[prelude_import] +use ::std::prelude::rust_2015::*; + +use std::marker::ConstParamTy; + +struct Point(u32, u32); + +struct Point3(); + +struct Point1 { + a: u32, + b: u32, +} + +struct Point2 { +} + +fn with_point() { } +fn with_point1() { } +fn with_point2() { } +fn with_point3() { } + +fn test() { + with_point::(); + with_point1::(); + with_point2::(); + with_point3::(); +} + +fn main() { } diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs index 519e913480ec..f2b9f037ea5f 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs @@ -4,7 +4,6 @@ trait Foo> { //~^ WARN trait objects without an explicit `dyn` are deprecated //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //~| ERROR cycle detected when computing type of `Foo::N` - //~| ERROR cycle detected when computing type of `Foo::N` fn func() {} } diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr index 0ecb3e74eb57..4024f57af4ff 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.stderr @@ -13,7 +13,7 @@ LL | trait Foo> { | +++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:20 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:10:20 | LL | trait Bar> {} | ^^^^^^ @@ -32,7 +32,7 @@ LL | trait Foo> { | ^^^^^^^^^^^^^^^ | note: ...which requires computing type of `Bar::M`... - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:11 + --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:10:11 | LL | trait Bar> {} | ^^^^^^^^^^^^^^^ @@ -44,26 +44,6 @@ LL | trait Foo> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0391]: cycle detected when computing type of `Foo::N` - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:11 - | -LL | trait Foo> { - | ^^^^^^^^^^^^^^^ - | -note: ...which requires computing type of `Bar::M`... - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:11:11 - | -LL | trait Bar> {} - | ^^^^^^^^^^^^^^^ - = note: ...which again requires computing type of `Foo::N`, completing the cycle -note: cycle used when checking that `Foo` is well-formed - --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:3:1 - | -LL | trait Foo> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: aborting due to 2 previous errors; 2 warnings emitted +error: aborting due to 1 previous error; 2 warnings emitted For more information about this error, try `rustc --explain E0391`. diff --git a/triagebot.toml b/triagebot.toml index de9ac961dc8c..59c5e5f24330 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -240,7 +240,7 @@ trigger_files = [ "src/rustdoc-json-types", # Tests - "tests/rustdoc", + "tests/rustdoc-html", "tests/rustdoc-ui", "tests/rustdoc-gui", "tests/rustdoc-js/", @@ -315,7 +315,7 @@ trigger_labels = [ ] trigger_files = [ "src/librustdoc/html/", - "tests/rustdoc/", + "tests/rustdoc-html/", "tests/rustdoc-gui/", "tests/rustdoc-js/", "tests/rustdoc-js-std/", @@ -954,15 +954,15 @@ cc = ["@lcnr"] [mentions."compiler/rustc_middle/src/ty/relate.rs"] message = "changes to the core type system" -cc = ["@compiler-errors", "@lcnr"] +cc = ["@lcnr"] [mentions."compiler/rustc_infer/src/infer/relate"] message = "changes to the core type system" -cc = ["@compiler-errors", "@lcnr"] +cc = ["@lcnr"] [mentions."compiler/rustc_hir_typeck/src/fn_ctxt/inspect_obligations.rs"] message = "changes to `inspect_obligations.rs`" -cc = ["@compiler-errors", "@lcnr"] +cc = ["@lcnr"] [mentions."compiler/rustc_middle/src/mir/interpret"] message = "Some changes occurred to the CTFE / Miri interpreter" @@ -974,7 +974,7 @@ cc = ["@rust-lang/wg-mir-opt"] [mentions."compiler/rustc_trait_selection/src/traits/wf.rs"] message = "changes to the core type system" -cc = ["@compiler-errors", "@lcnr"] +cc = ["@lcnr"] [mentions."compiler/rustc_trait_selection/src/traits/const_evaluatable.rs"] message = "Some changes occurred in `const_evaluatable.rs`" @@ -997,7 +997,7 @@ message = """ Some changes occurred in engine.rs, potentially modifying the public API \ of `ObligationCtxt`. """ -cc = ["@lcnr", "@compiler-errors"] +cc = ["@lcnr"] [mentions."compiler/rustc_hir_analysis/src/hir_ty_lowering"] message = "HIR ty lowering was modified" @@ -1059,6 +1059,14 @@ gets adapted for the changes, if necessary. """ cc = ["@rust-lang/miri", "@RalfJung", "@oli-obk", "@lcnr"] +[mentions."library/core/src/num/{dec2flt,flt2dec}"] +message = "Some changes occurred in float parsing" +cc = ["@tgross35"] + +[mentions."library/core/src/fmt/num.rs"] +message = "Some changes occurred in integer formatting" +cc = ["@tgross35"] + [mentions."library/portable-simd"] message = """ Portable SIMD is developed in its own repository. If possible, consider \ @@ -1146,7 +1154,7 @@ cc = ["@oli-obk", "@RalfJung", "@JakobDegen", "@vakaras"] [mentions."compiler/rustc_error_messages"] message = "`rustc_error_messages` was changed" -cc = ["@davidtwco", "@compiler-errors", "@TaKO8Ki"] +cc = ["@davidtwco", "@TaKO8Ki"] [mentions."compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs"] message = "`rustc_errors::annotate_snippet_emitter_writer` was changed" @@ -1158,11 +1166,11 @@ cc = ["@Muscraft"] [mentions."compiler/rustc_errors/src/translation.rs"] message = "`rustc_errors::translation` was changed" -cc = ["@davidtwco", "@compiler-errors", "@TaKO8Ki"] +cc = ["@davidtwco", "@TaKO8Ki"] [mentions."compiler/rustc_macros/src/diagnostics"] message = "`rustc_macros::diagnostics` was changed" -cc = ["@davidtwco", "@compiler-errors", "@TaKO8Ki"] +cc = ["@davidtwco", "@TaKO8Ki"] [mentions."compiler/rustc_public"] message = "This PR changes rustc_public" @@ -1427,7 +1435,6 @@ compiler_leads = [ compiler = [ "@BoxyUwU", "@chenyukang", - "@compiler-errors", "@davidtwco", "@eholk", "@fee1-dead", @@ -1486,13 +1493,11 @@ incremental = [ "@wesleywiser", ] diagnostics = [ - "@compiler-errors", "@davidtwco", "@oli-obk", "@chenyukang", ] parser = [ - "@compiler-errors", "@davidtwco", "@nnethercote", "@petrochenkov", @@ -1518,7 +1523,6 @@ mir-opt = [ "@saethlin", ] types = [ - "@compiler-errors", "@jackh726", "@lcnr", "@oli-obk", @@ -1530,14 +1534,14 @@ borrowck = [ "@matthewjasper" ] ast_lowering = [ - "@compiler-errors", "@spastorino", ] debuginfo = [ "@davidtwco" ] fallback = [ - "@Mark-Simulacrum" + "@Mark-Simulacrum", + "@jieyouxu", ] style-team = [ "@calebcartwright", @@ -1545,7 +1549,6 @@ style-team = [ "@traviscross", ] project-const-traits = [ - "@compiler-errors", "@fee1-dead", "@fmease", "@oli-obk", @@ -1629,9 +1632,9 @@ dep-bumps = [ "/src/llvm-project" = ["@cuviper"] "/src/rustdoc-json-types" = ["rustdoc"] "/src/stage0" = ["bootstrap"] -"/tests/run-make" = ["@jieyouxu"] -"/tests/run-make-cargo" = ["@jieyouxu"] -"/tests/rustdoc" = ["rustdoc"] +"/tests/run-make" = ["compiler"] +"/tests/run-make-cargo" = ["compiler"] +"/tests/rustdoc-html" = ["rustdoc"] "/tests/rustdoc-gui" = ["rustdoc"] "/tests/rustdoc-js-std" = ["rustdoc"] "/tests/rustdoc-js/" = ["rustdoc"] @@ -1639,7 +1642,7 @@ dep-bumps = [ "/tests/rustdoc-ui" = ["rustdoc"] "/tests/ui" = ["compiler"] "/src/tools/cargo" = ["@ehuss"] -"/src/tools/compiletest" = ["bootstrap", "@wesleywiser", "@oli-obk", "@compiler-errors", "@jieyouxu"] +"/src/tools/compiletest" = ["bootstrap", "@wesleywiser", "@oli-obk", "@jieyouxu"] "/src/tools/linkchecker" = ["@ehuss"] "/src/tools/opt-dist" = ["@kobzol"] "/src/tools/run-make-support" = ["@jieyouxu"]